awtk/tools/idl_gen
2021-02-04 13:51:45 +08:00
..
node_modules add node_modules for idl 2020-12-27 11:28:46 +08:00
.gitignore init 2018-02-21 19:36:38 +08:00
code_gen.js refactor idl gen 2020-01-02 10:12:42 +08:00
idl_gen.js improve api comments and improve idle gen 2020-07-21 10:05:51 +08:00
index.js Windows build awtk to DLL 2020-04-28 09:34:09 +08:00
merge.js add merge.js and update docs 2019-05-08 16:23:46 +08:00
package-lock.json add node_modules for idl 2020-12-27 11:28:46 +08:00
package.json add node_modules for idl 2020-12-27 11:28:46 +08:00
README.md improve assets_manager and assets_manager 2020-12-14 11:59:02 +08:00
tkc.js add network interface 2021-02-04 13:51:45 +08:00

[ { "type": "class", "methods": [ { "params": [ { "type": "event_t*", "name": "event", "desc": "event对象。" } ], "annotation": { "cast": true, "scriptable": true }, "desc": "转换为event对象。\n\n> 供脚本语言使用", "name": "event_cast", "return": { "type": "event_t*", "desc": "event对象。" } }, { "params": [ { "type": "uint32_t", "name": "type", "desc": "事件类型。" } ], "annotation": { "constructor": true, "scriptable": true, "gc": true }, "desc": "创建event对象。\n\n主要给脚本语言使用。", "name": "event_create", "return": { "type": "event_t*", "desc": "返回事件对象。" } }, { "params": [ { "type": "event_t*", "name": "event", "desc": "event对象。" } ], "annotation": { "deconstructor": true, "scriptable": true, "gc": true }, "desc": "销毁事件对象。\n\n主要给脚本语言使用。", "name": "event_destroy", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "uint32_t", "name": "type", "desc": "事件类型。" }, { "type": "void*", "name": "target", "desc": "目标对象。" } ], "annotation": { "constructor": true }, "desc": "初始化事件。", "name": "event_init", "return": { "type": "event_t", "desc": "事件对象。" } } ], "events": [], "properties": [ { "name": "type", "desc": "类型。", "type": "int32_t", "annotation": { "readable": true, "scriptable": true } }, { "name": "size", "desc": "结构体的大小。", "type": "int32_t", "annotation": { "readable": true, "scriptable": true } }, { "name": "time", "desc": "事件发生的时间。", "type": "uint64_t", "annotation": { "readable": true, "scriptable": true } }, { "name": "target", "desc": "事件发生的目标对象。", "type": "void*", "annotation": { "readable": true, "scriptable": true } } ], "header": "tkc/event.h", "desc": "事件基类。", "name": "event_t", "order": -100, "annotation": { "scriptable": true }, "level": 1 }, { "type": "class", "methods": [ { "params": [], "annotation": { "constructor": true, "scriptable": true, "gc": true }, "desc": "创建emitter对象。", "name": "emitter_create", "return": { "type": "emitter_t*", "desc": "对象。" } }, { "params": [ { "type": "emitter_t*", "name": "emitter", "desc": "emitter对象。" } ], "annotation": { "constructor": true }, "desc": "初始化emitter对象。", "name": "emitter_init", "return": { "type": "emitter_t*", "desc": "对象。" } }, { "params": [ { "type": "emitter_t*", "name": "emitter", "desc": "emitter对象。" }, { "type": "event_t*", "name": "e", "desc": "事件对象。" } ], "annotation": { "scriptable": true }, "desc": "分发事件。如果当前分发的回调函数返回RET_REMOVE该回调函数将被移出。\n禁用状态下本函数不做任何事情。", "name": "emitter_dispatch", "return": { "type": "ret_t", "desc": "如果当前分发的回调函数返回RET_STOPdispatch中断分发并返回RET_STOP否则返回RET_OK。" } }, { "params": [ { "type": "emitter_t*", "name": "emitter", "desc": "emitter对象。" }, { "type": "event_type_t", "name": "type", "desc": "事件类型。" } ], "annotation": { "scriptable": true }, "desc": "分发事件。\n> 对emitter_dispatch的包装分发一个简单的事件。\n如果当前分发的回调函数返回RET_STOPdispatch中断分发并返回RET_STOP否则返回RET_OK。", "name": "emitter_dispatch_simple_event", "return": { "type": "ret_t", "desc": "" } }, { "params": [ { "type": "emitter_t*", "name": "emitter", "desc": "emitter对象。" }, { "type": "event_type_t", "name": "etype", "desc": "事件类型。" }, { "type": "event_func_t", "name": "handler", "desc": "事件处理函数。" }, { "type": "void*", "name": "ctx", "desc": "事件处理函数上下文。" } ], "annotation": { "scriptable": "custom" }, "desc": "注册指定事件的处理函数。", "name": "emitter_on", "return": { "type": "uint32_t", "desc": "返回id用于emitter_off。" } }, { "params": [ { "type": "emitter_t*", "name": "emitter", "desc": "emitter对象。" }, { "type": "event_type_t", "name": "type", "desc": "事件类型。" }, { "type": "event_func_t", "name": "on_event", "desc": "事件处理函数。" }, { "type": "void*", "name": "ctx", "desc": "事件处理函数上下文。" } ], "annotation": {}, "desc": "判断指定的事件和回调函数是否已经注册。", "name": "emitter_exist", "return": { "type": "bool_t", "desc": "返回TRUE表示已经注册否则表示没有注册。" } }, { "params": [ { "type": "emitter_t*", "name": "emitter", "desc": "emitter对象。" }, { "type": "event_type_t", "name": "type", "desc": "事件类型。" }, { "type": "event_func_t", "name": "on_event", "desc": "事件处理函数。" }, { "type": "void*", "name": "ctx", "desc": "事件处理函数上下文。" }, { "type": "uint32_t", "name": "tag", "desc": "tag。" } ], "annotation": {}, "desc": "注册指定事件的处理函数。", "name": "emitter_on_with_tag", "return": { "type": "uint32_t", "desc": "返回id用于emitter_off。" } }, { "params": [ { "type": "emitter_t*", "name": "emitter", "desc": "emitter对象。" }, { "type": "uint32_t", "name": "id", "desc": "emitter_on返回的ID。" } ], "annotation": { "scriptable": true }, "desc": "注销指定事件的处理函数。", "name": "emitter_off", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "emitter_t*", "name": "emitter", "desc": "emitter对象。" }, { "type": "event_type_t", "name": "type", "desc": "事件类型。" }, { "type": "event_func_t", "name": "on_event", "desc": "事件处理函数。" }, { "type": "void*", "name": "ctx", "desc": "事件处理函数上下文。" } ], "annotation": {}, "desc": "注销指定事件的处理函数。", "name": "emitter_off_by_func", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "emitter_t*", "name": "emitter", "desc": "emitter对象。" }, { "type": "void*", "name": "ctx", "desc": "事件处理函数上下文。" } ], "annotation": {}, "desc": "注销指定事件的处理函数。", "name": "emitter_off_by_ctx", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "emitter_t*", "name": "emitter", "desc": "emitter对象。" }, { "type": "uint32_t", "name": "tag", "desc": "tag。" } ], "annotation": {}, "desc": "注销指定事件的处理函数。", "name": "emitter_off_by_tag", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "emitter_t*", "name": "emitter", "desc": "emitter对象。" }, { "type": "uint32_t", "name": "id", "desc": "emitter_on返回的ID。" }, { "type": "tk_destroy_t", "name": "on_destroy", "desc": "回调函数。" }, { "type": "void*", "name": "on_destroy_ctx", "desc": "回调函数上下文。" } ], "annotation": {}, "desc": "设置一个回调函数在emitter被销毁时调用(方便脚本语言去释放回调函数)。", "name": "emitter_set_on_destroy", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "emitter_t*", "name": "emitter", "desc": "emitter对象。" }, { "type": "uint32_t", "name": "id", "desc": "emitter_on返回的ID。" } ], "annotation": {}, "desc": "通过ID查找emitter_item_t主要用于辅助测试。", "name": "emitter_find", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "emitter_t*", "name": "emitter", "desc": "emitter对象。" } ], "annotation": { "scriptable": true }, "desc": "启用。", "name": "emitter_enable", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "emitter_t*", "name": "emitter", "desc": "emitter对象。" } ], "annotation": { "scriptable": true }, "desc": "禁用。\n\n禁用后emitter_dispatch无效但可以注册和注销。", "name": "emitter_disable", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "emitter_t*", "name": "emitter", "desc": "emitter对象。" } ], "annotation": { "scriptable": true }, "desc": "获取注册的回调函数个数,主要用于辅助测试。", "name": "emitter_size", "return": { "type": "uint32_t", "desc": "回调函数个数。" } }, { "params": [ { "type": "emitter_t*", "name": "emitter", "desc": "emitter对象。" } ], "annotation": { "deconstructor": true }, "desc": "析构。", "name": "emitter_deinit", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "emitter_t*", "name": "emitter", "desc": "emitter对象。" } ], "annotation": { "deconstructor": true, "scriptable": true, "gc": true }, "desc": "销毁。", "name": "emitter_destroy", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "emitter_t*", "name": "emitter", "desc": "emitter对象。" } ], "annotation": { "cast": true, "scriptable": true }, "desc": "转换为emitter对象(供脚本语言使用)。\n\n主要给脚本语言使用。", "name": "emitter_cast", "return": { "type": "emitter_t*", "desc": "对象。" } }, { "params": [ { "type": "void*", "name": "ctx", "desc": "emitter对象。" }, { "type": "event_t*", "name": "e", "desc": "分发的事件。" } ], "annotation": {}, "desc": "分发事件", "name": "emitter_forward", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } } ], "events": [], "properties": [ { "name": "items", "desc": "注册的回调函数集合。", "type": "emitter_item_t*", "annotation": { "private": true } }, { "name": "next_id", "desc": "下一次emitter_on返回的IDemitter_on成功后会自动增加next_id。", "type": "uint32_t", "annotation": { "private": true } }, { "name": "enable", "desc": "禁用标志。禁用时dispatch无效。", "type": "bool_t", "annotation": { "readable": true } }, { "name": "remove_curr_iter", "desc": "如果在回调函数中emitter_off当前正在dispatch的回调函数\n我们只是设置remove_curr_iter为TRUE在分发完成后才执行。\nXXX: 如果要注销当前正在dispatch的回调函数直接返回RET_REMOVE是最好的选择。", "type": "bool_t", "annotation": { "private": true } }, { "name": "curr_iter", "desc": "当前正在dispatch的项。", "type": "emitter_item_t*", "annotation": { "private": true } } ], "header": "tkc/emitter.h", "desc": "事件分发器, 用于实现观察者模式。", "name": "emitter_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": [], "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": [ { "params": [], "annotation": { "constructor": true, "scriptable": true, "gc": true }, "desc": "创建图片对象(一般供脚本语言中使用)。", "name": "bitmap_create", "return": { "type": "bitmap_t*", "desc": "返回bitmap对象。" } }, { "params": [ { "type": "uint32_t", "name": "w", "desc": "宽度。" }, { "type": "uint32_t", "name": "h", "desc": "高度。" }, { "type": "uint32_t", "name": "line_length", "desc": "line_length。" }, { "type": "bitmap_format_t", "name": "format", "desc": "格式。" } ], "annotation": { "constructor": true, "scriptable": true, "gc": true }, "desc": "创建图片对象。", "name": "bitmap_create_ex", "return": { "type": "bitmap_t*", "desc": "返回bitmap对象。" } }, { "params": [ { "type": "bitmap_t*", "name": "bitmap", "desc": "bitmap对象。" } ], "annotation": { "scriptable": true }, "desc": "获取图片一个像素占用的字节数。", "name": "bitmap_get_bpp", "return": { "type": "uint32_t", "desc": "返回一个像素占用的字节数。" } }, { "params": [ { "type": "bitmap_t*", "name": "bitmap", "desc": "bitmap对象。" } ], "annotation": {}, "desc": "为读取数据而锁定bitmap的图片缓冲区。", "name": "bitmap_lock_buffer_for_read", "return": { "type": "uint8_t*", "desc": "返回缓存区的首地址。" } }, { "params": [ { "type": "bitmap_t*", "name": "bitmap", "desc": "bitmap对象。" } ], "annotation": {}, "desc": "为修改数据而锁定bitmap的图片缓冲区。", "name": "bitmap_lock_buffer_for_write", "return": { "type": "uint8_t*", "desc": "返回缓存区的首地址。" } }, { "params": [ { "type": "bitmap_t*", "name": "bitmap", "desc": "bitmap对象。" } ], "annotation": {}, "desc": "解锁图像缓冲区。", "name": "bitmap_unlock_buffer", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "bitmap_t*", "name": "bitmap", "desc": "bitmap对象。" }, { "type": "uint32_t", "name": "x", "desc": "x坐标。" }, { "type": "uint32_t", "name": "y", "desc": "y坐标。" }, { "type": "rgba_t*", "name": "rgba", "desc": "返回颜色值。" } ], "annotation": {}, "desc": "获取图片指定像素的rgba颜色值(主要用于测试程序)。", "name": "bitmap_get_pixel", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "bitmap_t*", "name": "bitmap", "desc": "bitmap对象。" }, { "type": "uint32_t", "name": "line_length", "desc": "line_length。" } ], "annotation": {}, "desc": "设置line_length。", "name": "bitmap_set_line_length", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "bitmap_t*", "name": "bitmap", "desc": "bitmap对象。" } ], "annotation": {}, "desc": "获取每一行占用内存的字节数。", "name": "bitmap_get_line_length", "return": { "type": "ret_t", "desc": "返回每一行占用内存的字节数。" } }, { "params": [ { "type": "bitmap_t*", "name": "bitmap", "desc": "bitmap对象。" }, { "type": "uint32_t", "name": "w", "desc": "宽度。" }, { "type": "uint32_t", "name": "h", "desc": "高度。" }, { "type": "bitmap_format_t", "name": "format", "desc": "格式。" }, { "type": "const uint8_t*", "name": "", "desc": "a" }, { "type": "uint32_t", "name": "comp", "desc": "颜色通道数(目前支持3(rgb)和4(rgba))。" } ], "annotation": {}, "desc": "初始化图片。\n数据。3通道时为RGB888格式4通道时为RGBA888格式(内部拷贝该数据,不会引用,调用者自行释放)。", "name": "bitmap_init_from_rgba", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "bitmap_t*", "name": "bitmap", "desc": "bitmap对象。" }, { "type": "uint32_t", "name": "w", "desc": "宽度。" }, { "type": "uint32_t", "name": "h", "desc": "高度。" }, { "type": "bitmap_format_t", "name": "format", "desc": "格式。" }, { "type": "const uint8_t*", "name": "data", "desc": "数据,直接引用,但不负责释放。如果为空,由内部自动分配和释放。" } ], "annotation": {}, "desc": "初始化图片。", "name": "bitmap_init", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "bitmap_t*", "name": "bitmap", "desc": "bitmap对象。" }, { "type": "const char*", "name": "filename", "desc": "文件名。" } ], "annotation": {}, "desc": "把bitmap保存为png。", "name": "bitmap_save_png", "return": { "type": "bool_t", "desc": "返回TRUE表示成功FALSE表示失败。" } }, { "params": [ { "type": "const uint8_t*", "name": "buff", "desc": "数据。" }, { "type": "uint32_t", "name": "w", "desc": "宽度。" }, { "type": "uint32_t", "name": "h", "desc": "高度。" } ], "annotation": { "static": true }, "desc": "dump mono bitmap。", "name": "bitmap_mono_dump", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "bitmap_t*", "name": "bitmap", "desc": "bitmap对象。" } ], "annotation": { "deconstructor": true, "scriptable": true, "gc": true }, "desc": "销毁图片(for script only)。", "name": "bitmap_destroy_with_self", "alias": "bitmap_destroy", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "bitmap_t*", "name": "bitmap", "desc": "bitmap对象。" } ], "annotation": { "deconstructor": true }, "desc": "销毁图片。", "name": "bitmap_destroy", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "bitmap_format_t", "name": "format", "desc": "位图格式。" } ], "annotation": { "scriptable": true, "static": true }, "desc": "获取位图格式对应的颜色位数。", "name": "bitmap_get_bpp_of_format", "return": { "type": "uint32_t", "desc": "成功返回颜色位数失败返回0。" } } ], "events": [], "properties": [ { "name": "w", "desc": "宽度。", "type": "wh_t", "annotation": { "readable": true, "scriptable": true } }, { "name": "h", "desc": "高度。", "type": "wh_t", "annotation": { "readable": true, "scriptable": true } }, { "name": "line_length", "desc": "每一行实际占用的内存(也称为stride或pitch)一般情况下为wbpp。", "type": "uint32_t", "annotation": { "readable": true, "scriptable": true } }, { "name": "flags", "desc": "标志。请参考{bitmap_flag_t}。", "type": "uint16_t", "annotation": { "readable": true, "scriptable": true } }, { "name": "format", "desc": "格式。请参考{bitmap_format_t}。", "type": "uint16_t", "annotation": { "readable": true, "scriptable": true } }, { "name": "name", "desc": "名称。", "type": "const char", "annotation": { "readable": true, "scriptable": true } }, { "name": "buffer", "desc": "图片数据。", "type": "graphic_buffer_t*", "annotation": { "readable": true } } ], "header": "base/bitmap.h", "desc": "位图。", "name": "bitmap_t", "order": -9, "annotation": { "scriptable": true }, "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各级之间用.分隔。" } ], "annotation": { "scriptable": true }, "desc": "检查是否存在指定的属性。", "name": "object_has_prop_by_path", "return": { "type": "bool_t", "desc": "返回TRUE表示存在否则表示不存在。" } }, { "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": "获取指定属性的浮点数类型的值。\n\ne", "name": "object_get_prop_float_by_path", "return": { "type": "float_t", "desc": "返回指定属性的浮点数类型的值。" } }, { "params": [ { "type": "object_t*", "name": "obj", "desc": "object对象。" }, { "type": "const char*", "name": "path", "desc": "属性的path。" }, { "type": "value_t*", "name": "value", "desc": "属性的值。" } ], "annotation": { "scriptable": true }, "desc": "设置指定属性的值。", "name": "object_set_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。" }, { "type": "const char*", "name": "value", "desc": "属性的值。" } ], "annotation": { "scriptable": true }, "desc": "设置指定属性的字符串类型的值。", "name": "object_set_prop_str_by_path", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "object_t*", "name": "obj", "desc": "object对象。" }, { "type": "const char*", "name": "path", "desc": "属性的path。" }, { "type": "void*", "name": "value", "desc": "属性的值。" } ], "annotation": {}, "desc": "设置指定属性的指针类型的值。", "name": "object_set_prop_pointer_by_path", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "object_t*", "name": "obj", "desc": "object对象。" }, { "type": "const char*", "name": "path", "desc": "属性的path。" }, { "type": "object_t*", "name": "value", "desc": "属性的值。" } ], "annotation": { "scriptable": true }, "desc": "设置指定属性的object类型的值。", "name": "object_set_prop_object_by_path", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "object_t*", "name": "obj", "desc": "object对象。" }, { "type": "const char*", "name": "path", "desc": "属性的path。" }, { "type": "int32_t", "name": "value", "desc": "属性的值。" } ], "annotation": { "scriptable": true }, "desc": "设置指定属性的整数类型的值。", "name": "object_set_prop_int_by_path", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "object_t*", "name": "obj", "desc": "object对象。" }, { "type": "const char*", "name": "path", "desc": "属性的path。" }, { "type": "bool_t", "name": "value", "desc": "属性的值。" } ], "annotation": { "scriptable": true }, "desc": "设置指定属性的bool类型的值。", "name": "object_set_prop_bool_by_path", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "object_t*", "name": "obj", "desc": "object对象。" }, { "type": "const char*", "name": "path", "desc": "属性的path。" }, { "type": "float_t", "name": "value", "desc": "属性的值。" } ], "annotation": { "scriptable": true }, "desc": "设置指定属性的浮点数类型的值。", "name": "object_set_prop_float_by_path", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "object_t*", "name": "obj", "desc": "object对象。" }, { "type": "const char*", "name": "path", "desc": "命令的path。" }, { "type": "const char*", "name": "args", "desc": "命令的参数。" } ], "annotation": { "scriptable": true }, "desc": "检查是否可以执行指定的命令。", "name": "object_can_exec_by_path", "return": { "type": "bool_t", "desc": "返回TRUE表示可以执行否则表示不可以执行。" } }, { "params": [ { "type": "object_t*", "name": "obj", "desc": "object对象。" }, { "type": "const char*", "name": "path", "desc": "命令的path。" }, { "type": "const char*", "name": "args", "desc": "命令的参数。" } ], "annotation": { "scriptable": true }, "desc": "执行指定的命令。", "name": "object_exec_by_path", "alias": "execute_by_path", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } } ], "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": [ { "params": [ { "type": "value_t*", "name": "v", "desc": "value对象。" }, { "type": "bool_t", "name": "value", "desc": "待设置的值。" } ], "annotation": { "scriptable": true }, "desc": "设置类型为bool的值。", "name": "value_set_bool", "return": { "type": "value_t*", "desc": "value对象本身。" } }, { "params": [ { "type": "value_t*", "name": "v", "desc": "value对象。" } ], "annotation": { "scriptable": true }, "desc": "获取类型为bool的值。", "name": "value_bool", "return": { "type": "bool_t", "desc": "值。" } }, { "params": [ { "type": "value_t*", "name": "v", "desc": "value对象。" }, { "type": "int8_t", "name": "value", "desc": "待设置的值。" } ], "annotation": { "scriptable": true }, "desc": "设置类型为int8的值。", "name": "value_set_int8", "return": { "type": "value_t*", "desc": "value对象本身。" } }, { "params": [ { "type": "value_t*", "name": "v", "desc": "value对象。" } ], "annotation": { "scriptable": true }, "desc": "获取类型为int8的值。", "name": "value_int8", "return": { "type": "int8_t", "desc": "值。" } }, { "params": [ { "type": "value_t*", "name": "v", "desc": "value对象。" }, { "type": "uint8_t", "name": "value", "desc": "待设置的值。" } ], "annotation": { "scriptable": true }, "desc": "设置类型为uint8的值。", "name": "value_set_uint8", "return": { "type": "value_t*", "desc": "value对象本身。" } }, { "params": [ { "type": "value_t*", "name": "v", "desc": "value对象。" } ], "annotation": { "scriptable": true }, "desc": "获取类型为uint8的值。", "name": "value_uint8", "return": { "type": "int8_t", "desc": "值。" } }, { "params": [ { "type": "value_t*", "name": "v", "desc": "value对象。" }, { "type": "int16_t", "name": "value", "desc": "待设置的值。" } ], "annotation": { "scriptable": true }, "desc": "设置类型为int16的值。", "name": "value_set_int16", "return": { "type": "value_t*", "desc": "value对象本身。" } }, { "params": [ { "type": "value_t*", "name": "v", "desc": "value对象。" } ], "annotation": { "scriptable": true }, "desc": "获取类型为int16的值。", "name": "value_int16", "return": { "type": "int16_t", "desc": "值。" } }, { "params": [ { "type": "value_t*", "name": "v", "desc": "value对象。" }, { "type": "uint16_t", "name": "value", "desc": "待设置的值。" } ], "annotation": { "scriptable": true }, "desc": "设置类型为uint16的值。", "name": "value_set_uint16", "return": { "type": "value_t*", "desc": "value对象本身。" } }, { "params": [ { "type": "value_t*", "name": "v", "desc": "value对象。" } ], "annotation": { "scriptable": true }, "desc": "获取类型为uint16的值。", "name": "value_uint16", "return": { "type": "uint16_t", "desc": "值。" } }, { "params": [ { "type": "value_t*", "name": "v", "desc": "value对象。" }, { "type": "int32_t", "name": "value", "desc": "待设置的值。" } ], "annotation": { "scriptable": true }, "desc": "设置类型为int32的值。", "name": "value_set_int32", "return": { "type": "value_t*", "desc": "value对象本身。" } }, { "params": [ { "type": "value_t*", "name": "v", "desc": "value对象。" } ], "annotation": { "scriptable": true }, "desc": "获取类型为int32的值。", "name": "value_int32", "return": { "type": "int32_t", "desc": "值。" } }, { "params": [ { "type": "value_t*", "name": "v", "desc": "value对象。" }, { "type": "uint32_t", "name": "value", "desc": "待设置的值。" } ], "annotation": { "scriptable": true }, "desc": "设置类型为uint32的值。", "name": "value_set_uint32", "return": { "type": "value_t*", "desc": "value对象本身。" } }, { "params": [ { "type": "value_t*", "name": "v", "desc": "value对象。" } ], "annotation": {}, "desc": "获取类型为uint32的值。", "name": "value_uint32", "return": { "type": "uint32_t", "desc": "值。" } }, { "params": [ { "type": "value_t*", "name": "v", "desc": "value对象。" }, { "type": "int64_t", "name": "value", "desc": "待设置的值。" } ], "annotation": { "scriptable": true }, "desc": "设置类型为int64的值。", "name": "value_set_int64", "return": { "type": "value_t*", "desc": "value对象本身。" } }, { "params": [ { "type": "value_t*", "name": "v", "desc": "value对象。" } ], "annotation": { "scriptable": true }, "desc": "获取类型为int64的值。", "name": "value_int64", "return": { "type": "int64_t", "desc": "值。" } }, { "params": [ { "type": "value_t*", "name": "v", "desc": "value对象。" }, { "type": "uint64_t", "name": "value", "desc": "待设置的值。" } ], "annotation": { "scriptable": true }, "desc": "设置类型为uint64的值。", "name": "value_set_uint64", "return": { "type": "value_t*", "desc": "value对象本身。" } }, { "params": [ { "type": "value_t*", "name": "v", "desc": "value对象。" } ], "annotation": { "scriptable": true }, "desc": "获取类型为uint64的值。", "name": "value_uint64", "return": { "type": "uint64_t", "desc": "值。" } }, { "params": [ { "type": "value_t*", "name": "v", "desc": "value对象。" }, { "type": "void*", "name": "value", "desc": "待设置的值。" } ], "annotation": {}, "desc": "设置类型为pointer的值。", "name": "value_set_pointer", "return": { "type": "value_t*", "desc": "value对象本身。" } }, { "params": [ { "type": "value_t*", "name": "v", "desc": "value对象。" } ], "annotation": {}, "desc": "获取类型为pointer的值。", "name": "value_pointer", "return": { "type": "void*", "desc": "值。" } }, { "params": [ { "type": "value_t*", "name": "v", "desc": "value对象。" }, { "type": "float_t", "name": "value", "desc": "待设置的值。" } ], "annotation": { "scriptable": true }, "desc": "设置类型为float\t的值。", "name": "value_set_float", "return": { "type": "value_t*", "desc": "value对象本身。" } }, { "params": [ { "type": "value_t*", "name": "v", "desc": "value对象。" } ], "annotation": {}, "desc": "获取类型为float\t的值。", "name": "value_float", "return": { "type": "float_t", "desc": "值。" } }, { "params": [ { "type": "value_t*", "name": "v", "desc": "value对象。" }, { "type": "float", "name": "value", "desc": "待设置的值。" } ], "annotation": {}, "desc": "设置类型为float的值。", "name": "value_set_float32", "return": { "type": "value_t*", "desc": "value对象本身。" } }, { "params": [ { "type": "value_t*", "name": "v", "desc": "value对象。" } ], "annotation": { "scriptable": true }, "desc": "获取类型为float的值。", "name": "value_float32", "return": { "type": "float", "desc": "值。" } }, { "params": [ { "type": "value_t*", "name": "v", "desc": "value对象。" }, { "type": "double", "name": "value", "desc": "待设置的值。" } ], "annotation": { "scriptable": true }, "desc": "设置类型为double的值。", "name": "value_set_double", "alias": "value_set_float64", "return": { "type": "value_t*", "desc": "value对象本身。" } }, { "params": [ { "type": "value_t*", "name": "v", "desc": "value对象。" } ], "annotation": { "scriptable": true }, "desc": "获取类型为double的值。", "name": "value_double", "alias": "value_float64", "return": { "type": "double", "desc": "值。" } }, { "params": [ { "type": "value_t*", "name": "v", "desc": "value对象。" }, { "type": "const char*", "name": "value", "desc": "待设置的值。" } ], "annotation": {}, "desc": "设置类型为字符串的值。", "name": "value_set_str", "return": { "type": "value_t*", "desc": "value对象本身。" } }, { "params": [ { "type": "value_t*", "name": "v", "desc": "value对象。" }, { "type": "const char*", "name": "value", "desc": "待设置的值。" } ], "annotation": { "scriptable": true }, "desc": "设置类型为字符串的值(并拷贝字符串)。", "name": "value_dup_str", "alias": "value_set_str", "return": { "type": "value_t*", "desc": "value对象本身。" } }, { "params": [ { "type": "value_t*", "name": "v", "desc": "value对象。" }, { "type": "const char*", "name": "value", "desc": "待设置的值。" }, { "type": "uint32_t", "name": "len", "desc": "长度。" } ], "annotation": {}, "desc": "设置类型为字符串的值(并拷贝字符串)。", "name": "value_dup_str_with_len", "return": { "type": "value_t*", "desc": "value对象本身。" } }, { "params": [ { "type": "value_t*", "name": "v", "desc": "value对象。" }, { "type": "const wchar_t*", "name": "value", "desc": "待设置的值。" } ], "annotation": {}, "desc": "设置类型为宽字符串的值。", "name": "value_set_wstr", "return": { "type": "value_t*", "desc": "value对象本身。" } }, { "params": [ { "type": "value_t*", "name": "v", "desc": "value对象。" } ], "annotation": { "scriptable": true }, "desc": "获取类型为字符串的值。", "name": "value_str", "return": { "type": "const char*", "desc": "值。" } }, { "params": [ { "type": "value_t*", "name": "v", "desc": "value对象。" }, { "type": "char*", "name": "buff", "desc": "用于格式转换的缓冲区。" }, { "type": "uint32_t", "name": "size", "desc": "缓冲区大小。" } ], "annotation": { "scriptable": true }, "desc": "获取类型为字符串的值。", "name": "value_str_ex", "return": { "type": "const char*", "desc": "值。" } }, { "params": [ { "type": "value_t*", "name": "v", "desc": "value对象。" } ], "annotation": {}, "desc": "获取类型为宽字符串的值。", "name": "value_wstr", "return": { "type": "const wchar_t*", "desc": "值。" } }, { "params": [ { "type": "value_t*", "name": "value", "desc": "value对象。" } ], "annotation": { "scriptable": true }, "desc": "判断value是否为空值。", "name": "value_is_null", "return": { "type": "bool_t", "desc": "为空值返回TRUE否则返回FALSE。" } }, { "params": [ { "type": "value_t*", "name": "value", "desc": "value对象。" }, { "type": "value_t*", "name": "other", "desc": "value对象。" } ], "annotation": {}, "desc": "判断两个value是否相同。", "name": "value_equal", "return": { "type": "bool_t", "desc": "为空值返回TRUE否则返回FALSE。" } }, { "params": [ { "type": "value_t*", "name": "v", "desc": "value对象。" } ], "annotation": {}, "desc": "转换为int的值。", "name": "value_int", "return": { "type": "int", "desc": "值。" } }, { "params": [ { "type": "value_t*", "name": "v", "desc": "value对象。" }, { "type": "int32_t", "name": "value", "desc": "待设置的值。" } ], "annotation": { "scriptable": true }, "desc": "设置类型为int的值。", "name": "value_set_int", "return": { "type": "value_t*", "desc": "value对象本身。" } }, { "params": [ { "type": "value_t*", "name": "v", "desc": "value对象。" }, { "type": "object_t*", "name": "value", "desc": "待设置的值。" } ], "annotation": { "scriptable": true }, "desc": "设置类型为object的值。", "name": "value_set_object", "return": { "type": "value_t*", "desc": "value对象本身。" } }, { "params": [ { "type": "value_t*", "name": "v", "desc": "value对象。" } ], "annotation": { "scriptable": true }, "desc": "转换为object的值。", "name": "value_object", "return": { "type": "object_t*", "desc": "值。" } }, { "params": [ { "type": "value_t*", "name": "v", "desc": "value对象。" }, { "type": "uint32_t", "name": "value", "desc": "待设置的值。" } ], "annotation": { "scriptable": true }, "desc": "设置类型为token的值。", "name": "value_set_token", "return": { "type": "value_t*", "desc": "value对象本身。" } }, { "params": [ { "type": "value_t*", "name": "v", "desc": "value对象。" } ], "annotation": { "scriptable": true }, "desc": "获取token的值。", "name": "value_token", "return": { "type": "uint32_t", "desc": "值。" } }, { "params": [ { "type": "value_t*", "name": "v", "desc": "value对象。" }, { "type": "char*", "name": "str", "desc": "待设置的值。" }, { "type": "uint32_t", "name": "size", "desc": "长度。" } ], "annotation": {}, "desc": "设置类型为带长度的字符串的值。", "name": "value_set_sized_str", "return": { "type": "value_t*", "desc": "value对象本身。" } }, { "params": [ { "type": "value_t*", "name": "v", "desc": "value对象。" } ], "annotation": {}, "desc": "获取为sized_str的值。", "name": "value_sized_str", "return": { "type": "sized_str_t*", "desc": "值。" } }, { "params": [ { "type": "value_t*", "name": "v", "desc": "value对象。" }, { "type": "void*", "name": "value", "desc": "待设置的值。" }, { "type": "uint32_t", "name": "size", "desc": "长度。" } ], "annotation": {}, "desc": "设置类型为binary_data的值。", "name": "value_set_binary_data", "return": { "type": "value_t*", "desc": "value对象本身。" } }, { "params": [ { "type": "value_t*", "name": "v", "desc": "value对象。" }, { "type": "const void*", "name": "value", "desc": "待设置的值。" }, { "type": "uint32_t", "name": "size", "desc": "长度。" } ], "annotation": {}, "desc": "设置类型为binary_data的值(复制数据)。", "name": "value_dup_binary_data", "return": { "type": "value_t*", "desc": "value对象本身。" } }, { "params": [ { "type": "value_t*", "name": "v", "desc": "value对象。" } ], "annotation": {}, "desc": "获取为binary_data的值。", "name": "value_binary_data", "return": { "type": "binary_data_t*", "desc": "值。" } }, { "params": [ { "type": "value_t*", "name": "v", "desc": "value对象。" }, { "type": "void*", "name": "value", "desc": "待设置的值。" }, { "type": "uint32_t", "name": "size", "desc": "长度。" } ], "annotation": {}, "desc": "设置类型为ubjson的值。", "name": "value_set_ubjson", "return": { "type": "value_t*", "desc": "value对象本身。" } }, { "params": [ { "type": "value_t*", "name": "v", "desc": "value对象。" } ], "annotation": {}, "desc": "获取为ubjson的值。", "name": "value_ubjson", "return": { "type": "binary_data_t*", "desc": "值。" } }, { "params": [ { "type": "value_t*", "name": "dst", "desc": "目的value对象。" }, { "type": "value_t*", "name": "src", "desc": "源value对象。" } ], "annotation": {}, "desc": "拷贝value的值。", "name": "value_copy", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "value_t*", "name": "dst", "desc": "目的value对象。" }, { "type": "value_t*", "name": "src", "desc": "源value对象。" } ], "annotation": {}, "desc": "深拷贝value的值。", "name": "value_deep_copy", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [], "annotation": { "constructor": true, "scriptable": true, "gc": true }, "desc": "创建value对象。", "name": "value_create", "return": { "type": "value_t*", "desc": "对象。" } }, { "params": [ { "type": "value_t*", "name": "v", "desc": "value对象。" } ], "annotation": { "deconstructor": true, "scriptable": true, "gc": true }, "desc": "销毁value对象。", "name": "value_destroy", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "value_t*", "name": "v", "desc": "value对象。" } ], "annotation": { "deconstructor": true, "scriptable": true }, "desc": "重置value对象。", "name": "value_reset", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "value_t*", "name": "value", "desc": "value对象。" } ], "annotation": { "cast": true, "scriptable": true }, "desc": "转换为value对象。\n\n> 供脚本语言使用", "name": "value_cast", "return": { "type": "value_t*", "desc": "对象。" } } ], "events": [], "properties": [], "header": "tkc/value.h", "desc": "一个通用数据类型,用来存放整数、浮点数、字符串和其它对象。\n\n在C/C++中,一般不需动态创建对象,直接声明并初始化即可。如:\n\nc\nvalue_t v;\nvalue_set_int(&v, 100);\n\n\n> 在脚本语言中,需要动态创建对象。", "name": "value_t", "order": -9, "annotation": { "scriptable": true }, "level": 1 }, { "type": "class", "methods": [ { "params": [ { "type": "wh_t", "name": "w", "desc": "LCD宽度。" }, { "type": "wh_t", "name": "h", "desc": "LCD高度。" }, { "type": "app_type_t", "name": "app_type", "desc": "应用程序的类型。" }, { "type": "const char*", "name": "app_name", "desc": "应用程序的名称(必须为常量字符串)。" }, { "type": "const char*", "name": "app_root", "desc": "应用程序的根目录,用于定位资源文件(必须为常量字符串)。" } ], "annotation": { "static": true, "scriptable": true }, "desc": "初始化TK。", "name": "tk_init", "alias": "init", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [], "annotation": { "static": true, "scriptable": true }, "desc": "进入TK事件主循环。", "name": "tk_run", "alias": "run", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [], "annotation": { "static": true, "scriptable": true }, "desc": "退出TK事件主循环。", "name": "tk_quit", "alias": "global_quit", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [], "annotation": { "static": true, "scriptable": true }, "desc": "获取全局指针的X坐标。", "name": "tk_get_pointer_x", "alias": "global_get_pointer_x", "return": { "type": "int32_t", "desc": "返回全局指针的X坐标。" } }, { "params": [], "annotation": { "static": true, "scriptable": true }, "desc": "获取全局指针的Y坐标。", "name": "tk_get_pointer_y", "alias": "global_get_pointer_y", "return": { "type": "int32_t", "desc": "返回全局指针的X坐标。" } }, { "params": [], "annotation": { "static": true, "scriptable": true }, "desc": "获取全局指针是否按下。", "name": "tk_is_pointer_pressed", "alias": "global_is_pointer_pressed", "return": { "type": "bool_t", "desc": "返回全局指针是否按下。" } }, { "params": [ { "type": "int", "name": "orientation", "desc": "旋转方向。" } ], "annotation": {}, "desc": "设置屏幕的旋转方向(XXX:目前仅支持0度和90度)。", "name": "tk_set_lcd_orientation", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [], "annotation": {}, "desc": "初始化资源。", "name": "tk_init_assets", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [], "annotation": {}, "desc": "init。\n> public for test program", "name": "tk_init_internal", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [], "annotation": {}, "desc": "deinit。\n> public for test program", "name": "tk_deinit_internal", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [], "annotation": {}, "desc": "public for web", "name": "tk_exit", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [], "annotation": {}, "desc": "判断当前线程是否是UI线程。", "name": "tk_is_ui_thread", "return": { "type": "bool_t", "desc": "返回TRUE表示是否则表示否。" } }, { "params": [ { "type": "tk_callback_t", "name": "func", "desc": "函数。" }, { "type": "void*", "name": "ctx", "desc": "回调函数的上下文。" }, { "type": "bool_t", "name": "wait_until_done", "desc": "是否等待完成。" } ], "annotation": {}, "desc": "后台线程在UI线程执行指定的函数。", "name": "tk_run_in_ui_thread", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [], "annotation": {}, "desc": "创建缺省的资源加载器。", "name": "asset_loader_default_create", "return": { "type": "asset_loader_t*", "desc": "返回loader对象。" } }, { "params": [ { "type": "const char*", "name": "zipfile", "desc": "zip文件名。" } ], "annotation": {}, "desc": "创建zip资源加载器。", "name": "asset_loader_zip_create", "return": { "type": "asset_loader_t*", "desc": "返回loader对象。" } }, { "params": [ { "type": "data_reader_t*", "name": "reader", "desc": "reader对象。" }, { "type": "bool_t", "name": "own_the_reader", "desc": "如果希望销毁loader时销毁reader请设置为TRUE。" } ], "annotation": {}, "desc": "创建zip资源加载器。", "name": "asset_loader_zip_create_with_reader", "return": { "type": "asset_loader_t*", "desc": "返回loader对象。" } } ], "events": [], "properties": [], "header": "src/awtk_global.h", "desc": "TK全局对象。", "name": "global_t", "annotation": { "scriptable": true, "fake": true }, "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": "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 格式可以为 rgbabgarbgr565和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": [ { "params": [], "annotation": { "constructor": true }, "desc": "获取缺省的子控件布局算法工厂对象。", "name": "children_layouter_factory", "return": { "type": "children_layouter_factory_t*", "desc": "返回子控件布局算法工厂对象。" } }, { "params": [ { "type": "children_layouter_factory_t*", "name": "factory", "desc": "子控件布局算法工厂对象。" } ], "annotation": {}, "desc": "设置缺省的子控件布局算法工厂对象。", "name": "children_layouter_factory_set", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [], "annotation": { "constructor": true }, "desc": "创建子控件布局算法工厂对象。", "name": "children_layouter_factory_create", "return": { "type": "children_layouter_factory_t*", "desc": "返回子控件布局算法工厂对象。" } }, { "params": [ { "type": "children_layouter_factory_t*", "name": "factory", "desc": "layouter工厂对象。" }, { "type": "const char*", "name": "type", "desc": "子控件布局算法类型。" }, { "type": "children_layouter_create_t", "name": "create", "desc": "子控件布局算法创建函数。" } ], "annotation": {}, "desc": "注册子控件布局算法创建函数。", "name": "children_layouter_factory_register", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "children_layouter_factory_t*", "name": "factory", "desc": "子控件布局算法工厂对象。" }, { "type": "const char*", "name": "type", "desc": "类型。" } ], "annotation": { "constructor": true }, "desc": "创建指定类型的子控件布局算法对象。", "name": "children_layouter_factory_create_layouter", "return": { "type": "children_layouter_t*", "desc": "返回子控件布局算法对象。" } }, { "params": [ { "type": "children_layouter_factory_t*", "name": "factory", "desc": "子控件布局算法工厂对象。" } ], "annotation": {}, "desc": "析构并释放子控件布局算法工厂对象。", "name": "children_layouter_factory_destroy", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } } ], "events": [], "properties": [], "header": "base/children_layouter_factory.h", "desc": "子控件布局算法工厂。", "name": "children_layouter_factory_t", "level": 1 }, { "type": "class", "methods": [ { "params": [ { "type": "children_layouter_t*", "name": "layouter", "desc": "layouter对象。" } ], "annotation": {}, "desc": "获取全部参数。", "name": "children_layouter_to_string", "return": { "type": "ret_t", "desc": "返回字符串格式的参数。" } }, { "params": [ { "type": "children_layouter_t*", "name": "layouter", "desc": "layouter对象。" }, { "type": "widget_t*", "name": "widget", "desc": "控件。" } ], "annotation": {}, "desc": "对控件的子控件进行布局。", "name": "children_layouter_layout", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "children_layouter_t*", "name": "layouter", "desc": "layouter对象。" }, { "type": "const char*", "name": "name", "desc": "参数名。" }, { "type": "value_t*", "name": "v", "desc": "返回参数的值。" } ], "annotation": {}, "desc": "获取指定的参数。", "name": "children_layouter_get_param", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "children_layouter_t*", "name": "layouter", "desc": "layouter对象。" }, { "type": "const char*", "name": "name", "desc": "参数名。" }, { "type": "const value_t*", "name": "v", "desc": "参数的值。" } ], "annotation": {}, "desc": "获取指定的参数。", "name": "children_layouter_set_param", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "children_layouter_t*", "name": "layouter", "desc": "layouter对象。" }, { "type": "const char*", "name": "name", "desc": "参数名。" }, { "type": "const char*", "name": "value", "desc": "参数值。" } ], "annotation": {}, "desc": "设置字符串格式的参数。", "name": "children_layouter_set_param_str", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "children_layouter_t*", "name": "layouter", "desc": "layouter对象。" }, { "type": "const char*", "name": "name", "desc": "参数名。" }, { "type": "float_t", "name": "defval", "desc": "缺省值。" } ], "annotation": {}, "desc": "获取指定的浮点格式的参数。", "name": "children_layouter_get_param_float", "return": { "type": "ret_t", "desc": "成功返回参数的值,失败返回缺省值。" } }, { "params": [ { "type": "children_layouter_t*", "name": "layouter", "desc": "layouter对象。" }, { "type": "const char*", "name": "name", "desc": "参数名。" }, { "type": "int32_t", "name": "defval", "desc": "缺省值。" } ], "annotation": {}, "desc": "获取指定的整数格式的参数。", "name": "children_layouter_get_param_int", "return": { "type": "ret_t", "desc": "成功返回参数的值,失败返回缺省值。" } }, { "params": [ { "type": "children_layouter_t*", "name": "layouter", "desc": "layouter对象。" } ], "annotation": {}, "desc": "判断layouter对象是否有效。", "name": "children_layouter_is_valid", "return": { "type": "bool_t", "desc": "返回TRUE表示有效否则表示无效。" } }, { "params": [ { "type": "children_layouter_t*", "name": "layouter", "desc": "layouter对象。" } ], "annotation": {}, "desc": "销毁layouter对象。", "name": "children_layouter_destroy", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "const char*", "name": "params", "desc": "参数。" } ], "annotation": {}, "desc": "创建layouter对象。", "name": "children_layouter_create", "return": { "type": "children_layouter_t*", "desc": "返回layouter对象。" } }, { "params": [ { "type": "children_layouter_t*", "name": "layouter", "desc": "被克隆的对象。" } ], "annotation": {}, "desc": "克隆layouter对象。", "name": "children_layouter_clone", "return": { "type": "children_layouter_t*", "desc": "返回layouter对象。" } } ], "events": [], "properties": [], "header": "base/children_layouter.h", "desc": "子控件排版布局器的接口。\n\n按特定算法对子控件进行排版布局子类需要实现vtable中的函数。", "name": "children_layouter_t", "level": 1 }, { "type": "enum", "desc": "剪切板数据类型定义。", "consts": [ { "desc": "无数据。", "name": "CLIP_BOARD_DATA_TYPE_NONE" }, { "desc": "UTF8文本。", "name": "CLIP_BOARD_DATA_TYPE_TEXT" } ], "header": "base/clip_board.h", "name": "clip_board_data_type_t", "prefix": "CLIP_BOARD_DATA_TYPE_", "annotation": { "scriptable": true }, "level": 1 }, { "type": "class", "methods": [ { "params": [], "annotation": { "constructor": true }, "desc": "获取缺省的剪切板对象。", "name": "clip_board", "alias": "clip_board_instance", "return": { "type": "ret_t", "desc": "返回缺省剪切板对象。" } }, { "params": [ { "type": "clip_board_t*", "name": "cl", "desc": "剪切板对象。" } ], "annotation": {}, "desc": "设置缺省的剪切板对象。", "name": "clip_board_set", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "clip_board_t*", "name": "cl", "desc": "剪切板对象。" } ], "annotation": {}, "desc": "清空剪切板中的数据。", "name": "clip_board_clear", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "clip_board_t*", "name": "cl", "desc": "剪切板对象。" }, { "type": "clip_board_data_type_t", "name": "type", "desc": "数据类型。" }, { "type": "const void* data", "name": "data", "desc": "数据。" }, { "type": "uint32_t", "name": "size", "desc": "数据长度" } ], "annotation": {}, "desc": "设置数据到剪切板中。", "name": "clip_board_set_data", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "clip_board_t*", "name": "cl", "desc": "剪切板对象。" }, { "type": "clip_board_data_type_t*", "name": "type", "desc": "返回数据类型(可为NULL)。" }, { "type": "void** data", "name": "data", "desc": "返回数据(可为NULL)。" }, { "type": "uint32_t*", "name": "size", "desc": "返回数据长度(可为NULL)。" } ], "annotation": {}, "desc": "从剪切板中获取数据。", "name": "clip_board_get_data", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "clip_board_t*", "name": "cl", "desc": "剪切板对象。" } ], "annotation": {}, "desc": "销毁剪切板对象。", "name": "clip_board_destroy", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "const char*", "name": "text", "desc": "文本。" } ], "annotation": { "static": true, "scriptable": true }, "desc": "设置文本(UTF8)数据到剪切板。", "name": "clip_board_set_text", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [], "annotation": { "static": true, "scriptable": true }, "desc": "从剪切板中获取文本(UTF8)数据。", "name": "clip_board_get_text", "return": { "type": "const char*", "desc": "返回文本数据。" } }, { "params": [ { "type": "const char*", "name": "assetname", "desc": "资源的名称。" } ], "annotation": {}, "desc": "创建基于asset的data reader。", "name": "data_reader_asset_create", "return": { "type": "data_reader_t*", "desc": "返回data reader对象。" } } ], "events": [], "properties": [], "header": "base/clip_board.h", "desc": "剪切板接口。", "name": "clip_board_t", "annotation": { "scriptable": true }, "level": 1 }, { "type": "class", "methods": [ { "params": [], "annotation": { "constructor": true }, "desc": "获取缺省的对话框高亮策略工厂对象。", "name": "dialog_highlighter_factory", "return": { "type": "dialog_highlighter_factory_t*", "desc": "返回对话框高亮策略工厂对象。" } }, { "params": [ { "type": "dialog_highlighter_factory_t*", "name": "factory", "desc": "对话框高亮策略工厂对象。" } ], "annotation": {}, "desc": "设置缺省的对话框高亮策略工厂对象。", "name": "dialog_highlighter_factory_set", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [], "annotation": { "constructor": true }, "desc": "创建对话框高亮策略工厂对象。", "name": "dialog_highlighter_factory_create", "return": { "type": "dialog_highlighter_factory_t*", "desc": "返回对话框高亮策略工厂对象。" } }, { "params": [ { "type": "dialog_highlighter_factory_t*", "name": "factory", "desc": "highlighter工厂对象。" }, { "type": "const char*", "name": "type", "desc": "对话框高亮策略类型。" }, { "type": "dialog_highlighter_create_t", "name": "create", "desc": "对话框高亮策略创建函数。" } ], "annotation": {}, "desc": "注册对话框高亮策略创建函数。", "name": "dialog_highlighter_factory_register", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "dialog_highlighter_factory_t*", "name": "factory", "desc": "对话框高亮策略工厂对象。" }, { "type": "const char*", "name": "args", "desc": "参数。如default(alpha=90)" }, { "type": "widget_t*", "name": "dialog", "desc": "对话框对象。" } ], "annotation": { "constructor": true }, "desc": "创建指定类型的对话框高亮策略对象。", "name": "dialog_highlighter_factory_create_highlighter", "return": { "type": "dialog_highlighter_t*", "desc": "返回窗口动画对象。" } }, { "params": [ { "type": "dialog_highlighter_factory_t*", "name": "factory", "desc": "对话框高亮策略工厂对象。" } ], "annotation": {}, "desc": "析构并释放对话框高亮策略工厂对象。", "name": "dialog_highlighter_factory_destroy", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } } ], "events": [], "properties": [], "header": "base/dialog_highlighter_factory.h", "desc": "对话框高亮策略工厂。", "name": "dialog_highlighter_factory_t", "level": 1 }, { "type": "enum", "desc": "@type string\n内置的对话框高亮策略。", "consts": [ { "desc": "缺省的对话框高亮策略。", "name": "DIALOG_HIGHLIGHTER_DEFAULT" } ], "header": "base/dialog_highlighter.h", "name": "dialog_highlighter_type_t", "prefix": "DIALOG_HIGHLIGHTER_", "level": 1 }, { "type": "class", "methods": [ { "params": [ { "type": "const dialog_highlighter_vtable_t*", "name": "vt", "desc": "虚表对象。" } ], "annotation": {}, "desc": "创建对话框高亮策略对象。\n\n>供子类构造函数用。", "name": "dialog_highlighter_create", "return": { "type": "dialog_highlighter_t*", "desc": "返回对话框高亮策略对象" } }, { "params": [ { "type": "dialog_highlighter_t*", "name": "h", "desc": "对话框高亮策略对象。" }, { "type": "bitmap_t*", "name": "img", "desc": "背景截图。" } ], "annotation": {}, "desc": "设置背景图片。", "name": "dialog_highlighter_set_bg", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "dialog_highlighter_t*", "name": "h", "desc": "对话框高亮策略对象。" }, { "type": "rect_t*", "name": "clip_rect", "desc": "背景显示裁减区。" } ], "annotation": {}, "desc": "设置背景图片的显示裁减区。", "name": "dialog_highlighter_set_bg_clip_rect", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "dialog_highlighter_t*", "name": "h", "desc": "对话框高亮策略对象。" }, { "type": "canvas_t*", "name": "c", "desc": "画布。" } ], "annotation": {}, "desc": "初始化。在绘制完背景,在截图前调用。", "name": "dialog_highlighter_prepare", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "dialog_highlighter_t*", "name": "h", "desc": "对话框高亮策略对象。" }, { "type": "canvas_t*", "name": "c", "desc": "画布。" }, { "type": "canvas_t*", "name": "canvas_offline", "desc": "离线画布。" } ], "annotation": {}, "desc": "初始化。在绘制完背景,在截图前调用。", "name": "dialog_highlighter_prepare_ex", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "dialog_highlighter_t*", "name": "h", "desc": "对话框高亮策略对象。" }, { "type": "uint8_t", "name": "alpha", "desc": "设置 sytem_bar 的高亮透明值。" } ], "annotation": {}, "desc": "设置 sytem_bar 的高亮透明值。", "name": "dialog_highlighter_set_system_bar_alpha", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "dialog_highlighter_t*", "name": "h", "desc": "对话框高亮策略对象。" }, { "type": "float_t", "name": "percent", "desc": "高亮的百分比。" } ], "annotation": {}, "desc": "获取高亮的透明度。", "name": "dialog_highlighter_get_alpha", "return": { "type": "uint8_t", "desc": "返回透明度。" } }, { "params": [ { "type": "dialog_highlighter_t*", "name": "h", "desc": "对话框高亮策略对象。" }, { "type": "float_t", "name": "percent", "desc": "动画进度(0-1)1表示打开已经完成。" } ], "annotation": {}, "desc": "绘制背景。", "name": "dialog_highlighter_draw", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "dialog_highlighter_t*", "name": "h", "desc": "对话框高亮策略对象。" }, { "type": "canvas_t*", "name": "c", "desc": "画布。" }, { "type": "float_t", "name": "percent", "desc": "高亮的百分比。" } ], "annotation": {}, "desc": "绘制背景高亮部分。", "name": "dialog_highlighter_draw_mask", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "dialog_highlighter_t*", "name": "h", "desc": "对话框高亮策略对象。" } ], "annotation": {}, "desc": "是否是动态绘制(方便外层优化)。", "name": "dialog_highlighter_is_dynamic", "return": { "type": "bool_t", "desc": "返回TRUE表示动态绘制否则表示不是动态绘制。" } }, { "params": [ { "type": "dialog_highlighter_t*", "name": "h", "desc": "对话框高亮策略对象。" } ], "annotation": {}, "desc": "销毁对话框高亮策略对象。", "name": "dialog_highlighter_destroy", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } } ], "events": [], "properties": [ { "name": "img", "desc": "底层窗口的截图。", "type": "bitmap_t" }, { "name": "canvas", "desc": "画布。", "type": "canvas_t*" }, { "name": "dialog", "desc": "对应的对话框。", "type": "widget_t*" }, { "name": "clip_rect", "desc": "截图的显示裁减区", "type": "rect_t*" } ], "header": "base/dialog_highlighter.h", "desc": "对话框高亮策略。\n\n> 高亮策略的基本思路是对背景进行处理,比如将背景变暗或变模糊。", "name": "dialog_highlighter_t", "level": 1 }, { "type": "enum", "desc": "对话框退出码。\n\n> 一般用作dialog_quit函数的参数。", "consts": [ { "desc": "对话框被强行关闭或不关心关闭原因。", "name": "DIALOG_QUIT_NONE" }, { "desc": "点击“OK”按钮关闭。", "name": "DIALOG_QUIT_OK" }, { "desc": "点击“YES”按钮关闭。", "name": "DIALOG_QUIT_YES" }, { "desc": "点击“CANCEL”按钮关闭。", "name": "DIALOG_QUIT_CANCEL" }, { "desc": "点击“NO”按钮关闭。", "name": "DIALOG_QUIT_NO" }, { "desc": "点击其它按钮关闭。", "name": "DIALOG_QUIT_OTHER" } ], "header": "base/dialog.h", "name": "dialog_quit_code_t", "prefix": "DIALOG_QUIT_", "annotation": { "scriptable": true }, "level": 1 }, { "type": "class", "methods": [ { "params": [ { "type": "uint32_t", "name": "value", "desc": "资源的类型。" } ], "annotation": {}, "desc": "获取资源类型枚值和名称的对应关系。", "name": "asset_type_find_by_value", "return": { "type": "const key_type_value_t*", "desc": "返回资源类型枚值和名称的对应关系。" } }, { "params": [ { "type": "const key_type_value_t*", "name": "items", "desc": "特定枚举值对应列表。" }, { "type": "uint32_t", "name": "nr", "desc": "列表长度。" }, { "type": "const char*", "name": "name", "desc": "名称。" } ], "annotation": {}, "desc": "获取特定枚值和名称的对应关系。", "name": "find_item", "return": { "type": "const key_type_value_t*", "desc": "返回资源类型枚值和名称的对应关系。" } }, { "params": [ { "type": "const key_type_value_t*", "name": "items", "desc": "特定枚举值对应列表。" }, { "type": "uint32_t", "name": "nr", "desc": "列表长度。" }, { "type": "uint32_t", "name": "value", "desc": "资源的类型。" } ], "annotation": {}, "desc": "获取特定枚值和名称的对应关系。", "name": "find_item_by_value", "return": { "type": "const key_type_value_t*", "desc": "返回资源类型枚值和名称的对应关系。" } }, { "params": [ { "type": "const char*", "name": "name", "desc": "按键名。" } ], "annotation": {}, "desc": "获取按键值和名称的对应关系。", "name": "keys_type_find", "return": { "type": "const key_type_value_t*", "desc": "返回按键值和名称的对应关系。" } }, { "params": [ { "type": "uint32_t", "name": "value", "desc": "按键值。" } ], "annotation": {}, "desc": "获取按键值和名称的对应关系。", "name": "keys_type_find_by_value", "return": { "type": "const key_type_value_t*", "desc": "返回按键值和名称的对应关系。" } } ], "events": [], "properties": [], "header": "base/enums.h", "desc": "", "name": "enum_helper", "annotation": { "fake": true }, "level": 1 }, { "type": "class", "methods": [ { "params": [ { "type": "const char*", "name": "filename", "desc": "用于保存事件的文件名。" } ], "annotation": { "static": true }, "desc": "开始事件记录。", "name": "event_recorder_player_start_record", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "const char*", "name": "filename", "desc": "存放事件的文件名。" }, { "type": "uint32_t", "name": "times", "desc": "循环播放的次数。" } ], "annotation": { "static": true }, "desc": "开始事件重放。", "name": "event_recorder_player_start_play", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [], "annotation": { "static": true }, "desc": "停止事件记录。", "name": "event_recorder_player_stop_record", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [], "annotation": { "static": true }, "desc": "停止事件重放。", "name": "event_recorder_player_stop_play", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } } ], "events": [], "properties": [], "header": "base/event_recorder_player.h", "desc": "事件录制与重放,用于辅助自动测试和压力测试。", "name": "event_recorder_player_t", "annotation": { "fake": true }, "level": 1 }, { "type": "enum", "desc": "类型常量定义。", "consts": [ { "desc": "指针按下事件名(pointer_event_t)。", "name": "EVT_POINTER_DOWN" }, { "desc": "指针按下事件名,在子控件处理之前触发(pointer_event_t)。", "name": "EVT_POINTER_DOWN_BEFORE_CHILDREN" }, { "desc": "指针移动事件名(pointer_event_t)。", "name": "EVT_POINTER_MOVE" }, { "desc": "指针移动事件名,在子控件处理之前触发(pointer_event_t)。", "name": "EVT_POINTER_MOVE_BEFORE_CHILDREN" }, { "desc": "指针抬起事件名(pointer_event_t)。", "name": "EVT_POINTER_UP" }, { "desc": "指针抬起事件名,在子控件处理之前触发(pointer_event_t)。", "name": "EVT_POINTER_UP_BEFORE_CHILDREN" }, { "desc": "滚轮事件名(wheel_event_t)。", "name": "EVT_WHEEL" }, { "desc": "鼠标滚轮事件名,在子控件处理之前触发(wheel_event_t)。", "name": "EVT_WHEEL_BEFORE_CHILDREN" }, { "desc": "取消前一个指针按下事件名(pointer_event_t)。", "name": "EVT_POINTER_DOWN_ABORT" }, { "desc": "右键/长按弹出上下文菜单的事件名(pointer_event_t)。", "name": "EVT_CONTEXT_MENU" }, { "desc": "指针进入事件名(pointer_event_t)。", "name": "EVT_POINTER_ENTER" }, { "desc": "指针离开事件名(pointer_event_t)。", "name": "EVT_POINTER_LEAVE" }, { "desc": "长按事件名(pointer_event_t)。", "name": "EVT_LONG_PRESS" }, { "desc": "点击事件名(pointer_event_t)。", "name": "EVT_CLICK" }, { "desc": "得到焦点事件名(event_t)。", "name": "EVT_FOCUS" }, { "desc": "失去焦点事件名(event_t)。", "name": "EVT_BLUR" }, { "desc": "键按下事件名(key_event_t)。", "name": "EVT_KEY_DOWN" }, { "desc": "键长按事件名(key_event_t)。", "name": "EVT_KEY_LONG_PRESS" }, { "desc": "键按下事件名,在子控件处理之前触发(key_event_t)。", "name": "EVT_KEY_DOWN_BEFORE_CHILDREN" }, { "desc": "按键repeat事件名(key_event_t)。", "name": "EVT_KEY_REPEAT" }, { "desc": "键抬起事件名(key_event_t)。", "name": "EVT_KEY_UP" }, { "desc": "键抬起事件名,在子控件处理之前触发(key_event_t)。", "name": "EVT_KEY_UP_BEFORE_CHILDREN" }, { "desc": "即将移动Widget的事件名(event_t)。", "name": "EVT_WILL_MOVE" }, { "desc": "移动Widget的事件名(event_t)。", "name": "EVT_MOVE" }, { "desc": "即将调整Widget大小的事件名(event_t)。", "name": "EVT_WILL_RESIZE" }, { "desc": "调整Widget大小的事件名(event_t)。", "name": "EVT_RESIZE" }, { "desc": "即将调整Widget大小/位置的事件名(event_t)。", "name": "EVT_WILL_MOVE_RESIZE" }, { "desc": "调整Widget大小/位置的事件名(event_t)。", "name": "EVT_MOVE_RESIZE" }, { "desc": "控件的值即将改变的事件名(value_change_event_t)。", "name": "EVT_VALUE_WILL_CHANGE" }, { "desc": "控件的值改变的事件名(value_change_event_t)。", "name": "EVT_VALUE_CHANGED" }, { "desc": "控件的值持续改变(如编辑器正在编辑)的事件名(value_change_event_t)。", "name": "EVT_VALUE_CHANGING" }, { "desc": "绘制的事件名(paint_event_t)。", "name": "EVT_PAINT" }, { "desc": "即将绘制的事件名(paint_event_t)。", "name": "EVT_BEFORE_PAINT" }, { "desc": "绘制完成的事件名(paint_event_t)。", "name": "EVT_AFTER_PAINT" }, { "desc": "绘制完成(canvas状态已经恢复)的事件名(paint_event_t)。", "name": "EVT_PAINT_DONE" }, { "desc": "locale改变的事件(event_t)。", "name": "EVT_LOCALE_CHANGED" }, { "desc": "控件动画开始事件(event_t)。", "name": "EVT_ANIM_START" }, { "desc": "控件动画被主动停止的事件(event_t)。", "name": "EVT_ANIM_STOP" }, { "desc": "控件动画被暂停的事件(event_t)。", "name": "EVT_ANIM_PAUSE" }, { "desc": "控件动画yoyo/repeat时完成一次的事件(event_t)。", "name": "EVT_ANIM_ONCE" }, { "desc": "控件动画完成事件(event_t)。", "name": "EVT_ANIM_END" }, { "desc": "窗口加载完成事件(event_t)。", "name": "EVT_WINDOW_LOAD" }, { "desc": "控件加载完成事件(event_t)。", "name": "EVT_WIDGET_LOAD" }, { "desc": "窗口即将打开事件(event_t)。\n如果有窗口动画在窗口动画开始前触发。如果没有窗口动画在窗口被加载后的下一次循环中触发。", "name": "EVT_WINDOW_WILL_OPEN" }, { "desc": "窗口打开事件(event_t)。\n如果有窗口动画在窗口动画完成时触发。如果没有窗口动画在窗口被加载后的下一次循环中触发。", "name": "EVT_WINDOW_OPEN" }, { "desc": "窗口被切换到后台事件(event_t)。\n打开新窗口时当前窗口被切换到后台时对当前窗口触发本事件。", "name": "EVT_WINDOW_TO_BACKGROUND" }, { "desc": "窗口被切换到前台事件(event_t)。\n关闭当前窗口时前一个窗口被切换到前台时对前一个窗口触发本事件。", "name": "EVT_WINDOW_TO_FOREGROUND" }, { "desc": "窗口关闭事件。", "name": "EVT_WINDOW_CLOSE" }, { "desc": "请求关闭窗口的事件(event_t)。", "name": "EVT_REQUEST_CLOSE_WINDOW" }, { "desc": "顶层窗口改变的事件(window_event_t)。", "name": "EVT_TOP_WINDOW_CHANGED" }, { "desc": "输入法启动(event_t)。", "name": "EVT_IM_START" }, { "desc": "输入法停止(event_t)。", "name": "EVT_IM_STOP" }, { "desc": "输入法提交输入的文本事件(im_commit_event_t)。", "name": "EVT_IM_COMMIT" }, { "desc": "清除编辑器内容(event_t)。", "name": "EVT_IM_CLEAR" }, { "desc": "取消编辑,恢复之前的内容(event_t)。", "name": "EVT_IM_CANCEL" }, { "desc": "进入预编辑状态(event_t)。", "name": "EVT_IM_PREEDIT" }, { "desc": "确认预编辑内容,退出预编辑状态(event_t)。", "name": "EVT_IM_PREEDIT_CONFIRM" }, { "desc": "删除预编辑内容退出预编辑状态event_t)。", "name": "EVT_IM_PREEDIT_ABORT" }, { "desc": "输入法请求显示候选字事件(im_candidates_event_t)。", "name": "EVT_IM_SHOW_CANDIDATES" }, { "desc": "输入法请求显示预候选字事件(im_candidates_event_t)。", "name": "EVT_IM_SHOW_PRE_CANDIDATES" }, { "desc": "输入法语言改变事件(event_t)。", "name": "EVT_IM_LANG_CHANGED" }, { "desc": "软键盘Action点击事件(event_t)。", "name": "EVT_IM_ACTION" }, { "desc": "请求更新软键盘上的Action按钮的信息(im_action_button_info_event_t)。", "name": "EVT_IM_ACTION_INFO" }, { "desc": "开始拖动(event_t)。", "name": "EVT_DRAG_START" }, { "desc": "拖动(event_t)。", "name": "EVT_DRAG" }, { "desc": "结束拖动(event_t)。", "name": "EVT_DRAG_END" }, { "desc": "Reset(event_t)。", "name": "EVT_RESET" }, { "desc": "在指定的时间内(WITH_SCREEN_SAVER_TIME),没有用户输入事件,由窗口管理器触发。", "name": "EVT_SCREEN_SAVER" }, { "desc": "内存不足(event_t)。", "name": "EVT_LOW_MEMORY" }, { "desc": "内存耗尽(event_t)。", "name": "EVT_OUT_OF_MEMORY" }, { "desc": "屏幕即将旋转(event_t)。", "name": "EVT_ORIENTATION_WILL_CHANGED" }, { "desc": "屏幕旋转(event_t)。", "name": "EVT_ORIENTATION_CHANGED" }, { "desc": "控件创建事件(event_t)。", "name": "EVT_WIDGET_CREATED" }, { "desc": "请求退出应用程序事件。\n点击原生窗口关闭按钮时通过窗口管理器触发注册该事件并返回RET_STOP可以阻止窗口关闭。", "name": "EVT_REQUEST_QUIT_APP" }, { "desc": "主题变化(event_t)。", "name": "EVT_THEME_CHANGED" }, { "desc": "控件加载新的子控件(event_t)。", "name": "EVT_WIDGET_ADD_CHILD" }, { "desc": "控件移除子控件(event_t)。", "name": "EVT_WIDGET_REMOVE_CHILD" }, { "desc": "scroll view开始滚动(event_t)。", "name": "EVT_SCROLL_START" }, { "desc": "scroll view滚动(event_t)。", "name": "EVT_SCROLL" }, { "desc": "scroll view结束滚动(event_t)。", "name": "EVT_SCROLL_END" }, { "desc": "多点触摸手势(multi_gesture_event_t)。", "name": "EVT_MULTI_GESTURE" }, { "desc": "页面改变了(event_t)。", "name": "EVT_PAGE_CHANGED" }, { "desc": "资源管理加载某个资源(assets_event_t)。", "name": "EVT_ASSET_MANAGER_LOAD_ASSET" }, { "desc": "资源管理卸载某个资源(assets_event_t)。", "name": "EVT_ASSET_MANAGER_UNLOAD_ASSET" }, { "desc": "资源管理移除同种资源缓存(assets_event_t)。", "name": "EVT_ASSET_MANAGER_CLEAR_CACHE" }, { "desc": "event queue其它请求编号起始值。", "name": "EVT_REQ_START" }, { "desc": "用户定义事件起始值。", "name": "EVT_USER_START" }, { "desc": "无效事件名称。", "name": "EVT_NONE" }, { "desc": "对象的属性即将改变的事件名(prop_change_event_t)。", "name": "EVT_PROP_WILL_CHANGE" }, { "desc": "对象的属性改变的事件名(prop_change_event_t)。", "name": "EVT_PROP_CHANGED" }, { "desc": "对象即将执行命令(cmd_exec_event_t)。", "name": "EVT_CMD_WILL_EXEC" }, { "desc": "对象完成执行命令(cmd_exec_event_t)。", "name": "EVT_CMD_EXECED" }, { "desc": "对象命令是否能执行指定的命令(cmd_exec_event_t)。", "name": "EVT_CMD_CAN_EXEC" }, { "desc": "即将增加和删除集合中的项目(event_t)。", "name": "EVT_ITEMS_WILL_CHANGE" }, { "desc": "完成增加和删除集合中的项目(event_t)。", "name": "EVT_ITEMS_CHANGED" }, { "desc": "对象的属性改变的事件名(props_event_t)。", "name": "EVT_PROPS_CHANGED" }, { "desc": "进度状态(progress_event_t)。", "name": "EVT_PROGRESS" }, { "desc": "完成(done_event_t)。", "name": "EVT_DONE" }, { "desc": "错误(error_event_t)。", "name": "EVT_ERROR" }, { "desc": "对象销毁事件名(event_t)。", "name": "EVT_DESTROY" } ], "header": "base/events.h", "name": "event_type_t", "prefix": "EVT_", "annotation": { "scriptable": true }, "level": 1 }, { "type": "class", "methods": [ { "params": [ { "type": "font_loader_t*", "name": "loader", "desc": "loader对象。" }, { "type": "const char*", "name": "name", "desc": "字体名字。" }, { "type": "uint8_t*", "name": "buff", "desc": "字体数据。" }, { "type": "uint32_t", "name": "size", "desc": "字体数据长度。" } ], "annotation": {}, "desc": "加载字体。", "name": "font_loader_load", "return": { "type": "font_t*", "desc": "成功返回font失败返回NULL。" } } ], "events": [], "properties": [], "header": "base/font_loader.h", "desc": "字体加载接口。", "name": "font_loader_t", "level": 1 }, { "type": "class", "methods": [ { "params": [], "annotation": { "constructor": true }, "desc": "获取缺省的字体管理器。", "name": "font_manager", "return": { "type": "font_manager_t*", "desc": "返回字体管理器对象。" } }, { "params": [ { "type": "font_manager_t*", "name": "fm", "desc": "字体管理器对象。" } ], "annotation": {}, "desc": "设置缺省的字体管理器。", "name": "font_manager_set", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "font_loader_t*", "name": "loader", "desc": "字体加载器。" } ], "annotation": { "constructor": true }, "desc": "创建字体管理器。", "name": "font_manager_create", "return": { "type": "font_manager_t*", "desc": "返回字体管理器对象。" } }, { "params": [ { "type": "font_manager_t*", "name": "fm", "desc": "字体管理器对象。" }, { "type": "font_loader_t*", "name": "loader", "desc": "字体加载器。" } ], "annotation": { "constructor": true }, "desc": "初始化字体管理器。", "name": "font_manager_init", "return": { "type": "font_manager_t*", "desc": "返回字体管理器对象。" } }, { "params": [ { "type": "font_manager_t*", "name": "imm", "desc": "字体管理器对象。" }, { "type": "assets_manager_t*", "name": "assets_manager", "desc": "资源管理器。" } ], "annotation": {}, "desc": "设置资源管理器对象\n\n之所以需要设置资源管理器对象而不是使用缺省的资源管理器对象是因为在designer中有两个字体管理器\n\n* 一个用于designer本身加载字体。\n\n* 一个用于被设计的窗口加载字体。\n\n这两个字体管理器需要从不同的路径加载资源。", "name": "font_manager_set_assets_manager", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "font_manager_t*", "name": "fm", "desc": "字体管理器对象。" }, { "type": "char*", "name": "name", "desc": "字体名。" }, { "type": "font_t*", "name": "font", "desc": "字体。" } ], "annotation": {}, "desc": "向缓存中加入字体。", "name": "font_manager_add_font", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "font_manager_t*", "name": "fm", "desc": "字体管理器对象。" }, { "type": "char*", "name": "name", "desc": "字体名为NULL时使用缺省字体。" }, { "type": "font_size_t", "name": "size", "desc": "字体的大小。" } ], "annotation": {}, "desc": "从缓存中查找字体,如果没找到,再加载字体,并缓存。", "name": "font_manager_get_font", "return": { "type": "font_t*", "desc": "返回字体对象。" } }, { "params": [ { "type": "font_manager_t*", "name": "fm", "desc": "字体管理器对象。" }, { "type": "char*", "name": "name", "desc": "字体名为NULL时使用缺省字体。" }, { "type": "font_size_t", "name": "size", "desc": "字体的大小(矢量字体指定为0即可)。" } ], "annotation": { "scriptable": true }, "desc": "卸载指定的字体。", "name": "font_manager_unload_font", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "font_manager_t*", "name": "fm", "desc": "字体管理器对象。" }, { "type": "uint32_t", "name": "cache_size", "desc": "每种字体保留缓存字模的个数。" } ], "annotation": { "scriptable": true }, "desc": "清除最久没有被使用的缓冲字模。", "name": "font_manager_shrink_cache", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "font_manager_t*", "name": "fm", "desc": "字体管理器对象。" } ], "annotation": { "scriptable": true }, "desc": "卸载全部字体。", "name": "font_manager_unload_all", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "font_manager_t*", "name": "fm", "desc": "字体管理器对象。" } ], "annotation": {}, "desc": "析构字体管理器。", "name": "font_manager_deinit", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "font_manager_t*", "name": "fm", "desc": "字体管理器对象。" } ], "annotation": {}, "desc": "析构并释放字体管理器。", "name": "font_manager_destroy", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } } ], "events": [], "properties": [ { "name": "loader", "desc": "字体加载器。", "type": "font_loader_t*", "annotation": { "private": true } }, { "name": "assets_manager", "desc": "资源管理器。", "type": "assets_manager_t*", "annotation": { "private": true } } ], "header": "base/font_manager.h", "desc": "字体管理器,负责字体的加载和缓存管理。\n(如果使用nanovg字体由nanovg内部管理)", "name": "font_manager_t", "annotation": { "scriptable": true }, "level": 1 }, { "type": "enum", "desc": "字模格式常量定义。", "consts": [ { "desc": "每个像素占用1个字节(缺省)。", "name": "GLYPH_FMT_ALPHA" }, { "desc": "每个像素占用1个比特。", "name": "GLYPH_FMT_MONO" }, { "desc": "每个像素占用4个字节。", "name": "GLYPH_FMT_RGBA" } ], "header": "base/font.h", "name": "glyph_format_t", "prefix": "GLYPH_FMT_", "annotation": { "scriptable": true }, "level": 1 }, { "type": "class", "methods": [ { "params": [], "annotation": { "constructor": true }, "desc": "创建glyph对象。", "name": "glyph_create", "return": { "type": "glyph_t*", "desc": "glyph对象。" } }, { "params": [], "annotation": { "constructor": true }, "desc": "克隆glyph对象。", "name": "glyph_clone", "return": { "type": "glyph_t*", "desc": "glyph对象。" } }, { "params": [ { "type": "glyph_t*", "name": "glyph", "desc": "glyph对象。" } ], "annotation": { "deconstructor": true }, "desc": "销毁glyph对象。", "name": "glyph_destroy", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } } ], "events": [], "properties": [ { "name": "x", "desc": "x坐标。", "type": "int16_t", "annotation": { "readable": true } }, { "name": "y", "desc": "y坐标。", "type": "int16_t", "annotation": { "readable": true } }, { "name": "w", "desc": "宽度。", "type": "uint16_t", "annotation": { "readable": true } }, { "name": "h", "desc": "高度。", "type": "uint16_t", "annotation": { "readable": true } }, { "name": "advance", "desc": "占位宽度。", "type": "uint16_t", "annotation": { "readable": true } }, { "name": "format", "desc": "格式。", "type": "uint8_t", "annotation": { "readable": true } }, { "name": "pitch", "desc": "pitch。", "type": "uint8_t", "annotation": { "readable": true } }, { "name": "data", "desc": "数据。", "type": "const uint8_t*", "annotation": { "readable": true } } ], "header": "base/font.h", "desc": "代表一个字符的字模。", "name": "glyph_t", "level": 1 }, { "type": "class", "methods": [ { "params": [ { "type": "font_t*", "name": "font", "desc": "font对象。" }, { "type": "font_size_t", "name": "font_size", "desc": "字体大小。" } ], "annotation": {}, "desc": "获取字体的高度信息。", "name": "font_get_vmetrics", "return": { "type": "font_vmetrics_t", "desc": "返回字体的高度信息。" } }, { "params": [ { "type": "font_t*", "name": "font", "desc": "font对象。" }, { "type": "const char*", "name": "font_name", "desc": "字体名称。" }, { "type": "font_size_t", "name": "font_size", "desc": "字体大小。" } ], "annotation": {}, "desc": "检查当前字体是否与指定名称和大小相匹配。", "name": "font_match", "return": { "type": "int32_t", "desc": "返回TRUE表示成功FALSE表示失败。" } }, { "params": [ { "type": "font_t*", "name": "font", "desc": "font对象。" }, { "type": "wchar_t", "name": "chr", "desc": "字符。" }, { "type": "font_size_t", "name": "font_size", "desc": "字体大小。" }, { "type": "glyph_t*", "name": "glyph", "desc": "返回字模数据。" } ], "annotation": {}, "desc": "获取指定字符和大小的字模。", "name": "font_get_glyph", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "font_t*", "name": "font", "desc": "font对象。" }, { "type": "uint32_t", "name": "cache_size", "desc": "保留缓存字模的个数。" } ], "annotation": {}, "desc": "清除最近没使用的字模。", "name": "font_shrink_cache", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "font_t*", "name": "font", "desc": "font对象。" } ], "annotation": { "deconstructor": true }, "desc": "销毁font对象。", "name": "font_destroy", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } } ], "events": [], "properties": [], "header": "base/font.h", "desc": "代表一种字体。", "name": "font_t", "level": 1 }, { "type": "class", "methods": [ { "params": [ { "type": "bitmap_t*", "name": "fb", "desc": "framebuffer对象。" }, { "type": "const rect_t*", "name": "dst", "desc": "要填充的目标区域。" }, { "type": "color_t", "name": "c", "desc": "颜色。" } ], "annotation": {}, "desc": "用颜色填充指定的区域。", "name": "g2d_fill_rect", "export": "none", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败返回失败则上层用软件实现。" } }, { "params": [ { "type": "bitmap_t*", "name": "fb", "desc": "framebuffer对象。" }, { "type": "bitmap_t*", "name": "img", "desc": "图片对象。" }, { "type": "const rect_t*", "name": "src", "desc": "要拷贝的区域。" }, { "type": "xy_t", "name": "dx", "desc": "目标位置的x坐标。" }, { "type": "xy_t", "name": "dy", "desc": "目标位置的y坐标。" } ], "annotation": {}, "desc": "把图片指定的区域拷贝到framebuffer中。", "name": "g2d_copy_image", "export": "none", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败返回失败则上层用软件实现。" } }, { "params": [ { "type": "bitmap_t*", "name": "fb", "desc": "framebuffer对象。" }, { "type": "bitmap_t*", "name": "img", "desc": "图片对象。" }, { "type": "const rect_t*", "name": "src", "desc": "要旋转并拷贝的区域。" }, { "type": "lcd_orientation_t", "name": "o", "desc": "旋转角度(一般支持90度即可)。" } ], "annotation": {}, "desc": "把图片指定的区域进行旋转并拷贝到framebuffer相应的区域本函数主要用于辅助实现横屏和竖屏的切换一般支持90度旋转即可。", "name": "g2d_rotate_image", "export": "none", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败返回失败则上层用软件实现。" } }, { "params": [ { "type": "bitmap_t*", "name": "fb", "desc": "framebuffer对象。" }, { "type": "bitmap_t*", "name": "img", "desc": "图片对象。" }, { "type": "const rect_t*", "name": "dst", "desc": "目的区域。" }, { "type": "const rect_t*", "name": "src", "desc": "源区域。" }, { "type": "uint8_t", "name": "global_alpha", "desc": "全局alpha。" } ], "annotation": {}, "desc": "把图片指定的区域渲染到framebuffer指定的区域src的大小和dst的大小不一致则进行缩放。\n1.硬件不支持缩放则返回NOT_IMPL。\n2.硬件不支持全局alphaglobal_alpha!=0xff时返回NOT_IMPL。", "name": "g2d_blend_image", "export": "none", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败返回失败则上层用软件实现。" } } ], "events": [], "properties": [], "header": "base/g2d.h", "desc": "2D加速接口。", "name": "g2d_t", "level": 1 }, { "type": "class", "methods": [ { "params": [ { "type": "glyph_cache_t*", "name": "cache", "desc": "cache对象。" }, { "type": "uint32_t", "name": "capacity", "desc": "最大容量。" }, { "type": "tk_destroy_t", "name": "destroy_glyph", "desc": "销毁函数。" } ], "annotation": {}, "desc": "初始化glyph_cache对象。", "name": "glyph_cache_init", "return": { "type": "glyph_cache_t*", "desc": "返回cache对象。" } }, { "params": [ { "type": "glyph_cache_t*", "name": "cache", "desc": "cache对象。" }, { "type": "wchar_t", "name": "code", "desc": "字符。" }, { "type": "font_size_t", "name": "size", "desc": "字体大小。" }, { "type": "glyph_t", "name": "g", "desc": "glyph对象。" } ], "annotation": {}, "desc": "增加一个glyph对象到cache。", "name": "glyph_cache_add", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "glyph_cache_t*", "name": "cache", "desc": "cache对象。" }, { "type": "wchar_t", "name": "code", "desc": "字符。" }, { "type": "font_size_t", "name": "size", "desc": "字体大小。" }, { "type": "glyph_t", "name": "g", "desc": "glyph对象(用于返回glyph)。" } ], "annotation": {}, "desc": "查找glyph对象。", "name": "glyph_cache_lookup", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "glyph_cache_t*", "name": "cache", "desc": "cache对象。" }, { "type": "uint32_t", "name": "cache_size", "desc": "保留cache个数。" } ], "annotation": {}, "desc": "释放部分glyph。", "name": "glyph_cache_shrink", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "glyph_cache_t*", "name": "cache", "desc": "cache对象。" } ], "annotation": {}, "desc": "释放全部cache。", "name": "glyph_cache_deinit", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } } ], "events": [], "properties": [], "header": "base/glyph_cache.h", "desc": "glyph cache", "name": "glyph_cache_t", "level": 1 }, { "type": "class", "methods": [ { "params": [ { "type": "bitmap_t*", "name": "bitmap", "desc": "位图对象。" } ], "annotation": {}, "desc": "为位图创建缓冲区。", "name": "graphic_buffer_create_for_bitmap", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "const uint8_t*", "name": "data", "desc": "数据。" }, { "type": "uint32_t", "name": "w", "desc": "宽度。" }, { "type": "uint32_t", "name": "h", "desc": "宽度。" }, { "type": "bitmap_format_t", "name": "format", "desc": "格式。" } ], "annotation": {}, "desc": "创建缓冲区。\n\n> 为了兼容raw图像。", "name": "graphic_buffer_create_with_data", "return": { "type": "graphic_buffer_t*", "desc": "返回缓存区。" } }, { "params": [ { "type": "graphic_buffer_t*", "name": "buffer", "desc": "图像缓冲区对象。" } ], "annotation": {}, "desc": "为读取数据而锁定缓冲区。", "name": "graphic_buffer_lock_for_read", "return": { "type": "uint8_t*", "desc": "返回缓存区的首地址。" } }, { "params": [ { "type": "graphic_buffer_t*", "name": "buffer", "desc": "图像缓冲区对象。" } ], "annotation": {}, "desc": "为修改数据而锁定缓冲区。", "name": "graphic_buffer_lock_for_write", "return": { "type": "uint8_t*", "desc": "返回缓存区的首地址。" } }, { "params": [ { "type": "graphic_buffer_t*", "name": "buffer", "desc": "图像缓冲区对象。" } ], "annotation": {}, "desc": "解锁缓冲区。", "name": "graphic_buffer_unlock", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "graphic_buffer_t*", "name": "buffer", "desc": "图像缓冲区对象。" }, { "type": "void*", "name": "data", "desc": "内存数据。" }, { "type": "uint32_t", "name": "w", "desc": "宽度。" }, { "type": "uint32_t", "name": "h", "desc": "宽度。" } ], "annotation": {}, "desc": "附件到指定的内存。", "name": "graphic_buffer_attach", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "graphic_buffer_t*", "name": "buffer", "desc": "图像缓冲区对象。" }, { "type": "bitmap_t*", "name": "bitmap", "desc": "位图对象。" } ], "annotation": {}, "desc": "用于检查graphic buffer的有效性。", "name": "graphic_buffer_is_valid_for", "return": { "type": "bool_t", "desc": "返回TRUE表示有效否则表示无效。" } }, { "params": [ { "type": "graphic_buffer_t*", "name": "buffer", "desc": "图像缓冲区对象。" } ], "annotation": {}, "desc": "销毁缓冲区。", "name": "graphic_buffer_destroy", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } } ], "events": [], "properties": [], "header": "base/graphic_buffer.h", "desc": "graphic_buffer。", "name": "graphic_buffer_t", "level": 1 }, { "type": "class", "methods": [], "events": [], "properties": [], "header": "base/hscrollable.h", "desc": "帮助实现控件左右滚动的效果。", "name": "hscrollable_t", "level": 1 }, { "type": "class", "methods": [ { "params": [ { "type": "idle_func_t", "name": "on_idle", "desc": "idle回调函数回调函数返回RET_REPEAT则下次继续执行否则自动移出。" }, { "type": "void*", "name": "ctx", "desc": "idle回调函数的上下文。" } ], "annotation": { "scriptable": "custom", "static": true }, "desc": "增加一个idle。", "name": "idle_add", "return": { "type": "uint32_t", "desc": "返回idle的ID0表示失败。" } }, { "params": [ { "type": "idle_func_t", "name": "on_idle", "desc": "idle回调函数。" }, { "type": "void*", "name": "ctx", "desc": "idle回调函数的上下文。" } ], "annotation": { "static": true }, "desc": "用于非GUI线程增加一个idle本函数向主循环的事件队列中发送一个增加idle的请求。", "name": "idle_queue", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "uint32_t", "name": "idle_id", "desc": "idleID。" } ], "annotation": { "scriptable": true, "static": true }, "desc": "删除指定的idle。", "name": "idle_remove", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "uint32_t", "name": "idle_id", "desc": "idleID。" }, { "type": "tk_destroy_t", "name": "on_destroy", "desc": "回调函数。" }, { "type": "void*", "name": "on_destroy_ctx", "desc": "回调函数上下文。" } ], "annotation": {}, "desc": "设置一个回调函数在idle被销毁时调用(方便脚本语言去释放回调函数)。", "name": "idle_set_on_destroy", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [], "annotation": {}, "desc": "调用全部idle的函数。", "name": "idle_dispatch", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [], "annotation": { "static": true }, "desc": "返回idle的个数。", "name": "idle_count", "return": { "type": "uint32_t", "desc": "返回idle的个数。" } } ], "events": [], "properties": [], "header": "base/idle.h", "desc": "idle可以看作是duration为0的定时器。\n\n> idle可以用来实现一些异步处理。\n\n示例\n\nc\nstatic ret_t something_on_idle(const idle_info_t* info) {\nwidget_t* widget = WIDGET(info->ctx);\nedit_t* edit = EDIT(widget);\n...\nreturn RET_REMOVE;\n}\n\n...\n\nidle_add(something_on_idle, edit);\n\n\n\n> 在非GUI线程请用idle\queue。", "name": "idle_t", "annotation": { "scriptable": true, "fake": true }, "level": 1 }, { "type": "class", "methods": [ { "params": [ { "type": "image_loader_t*", "name": "loader", "desc": "loader对象。" }, { "type": "const asset_info_t*", "name": "asset", "desc": "资源。" }, { "type": "bitmap_t*", "name": "bitmap", "desc": "用于返回位图对象。" } ], "annotation": {}, "desc": "加载图片。", "name": "image_loader_load", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "image_loader_t*", "name": "loader", "desc": "loader对象。" } ], "annotation": { "static": true }, "desc": "注册图片加载器。", "name": "image_loader_register", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "image_loader_t*", "name": "loader", "desc": "loader对象。" } ], "annotation": { "static": true }, "desc": "注销图片加载器。", "name": "image_loader_unregister", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "const asset_info_t*", "name": "asset", "desc": "资源。" }, { "type": "bitmap_t*", "name": "bitmap", "desc": "用于返回位图对象。" } ], "annotation": { "static": true }, "desc": "查找满足条件加载器并加载图片。", "name": "image_loader_load_image", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } } ], "events": [], "properties": [], "header": "base/image_loader.h", "desc": "图片加载接口。", "name": "image_loader_t", "level": 1 }, { "type": "class", "methods": [ { "params": [], "annotation": { "constructor": true, "scriptable": true }, "desc": "获取缺省的图片管理器。", "name": "image_manager", "alias": "image_manager_instance", "return": { "type": "image_manager_t*", "desc": "返回图片管理器对象。" } }, { "params": [ { "type": "image_manager_t*", "name": "imm", "desc": "图片管理器对象。" } ], "annotation": {}, "desc": "设置缺省的图片管理器。", "name": "image_manager_set", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [], "annotation": { "constructor": true }, "desc": "创建图片管理器。", "name": "image_manager_create", "return": { "type": "image_manager_t*", "desc": "返回图片管理器对象。" } }, { "params": [ { "type": "image_manager_t*", "name": "imm", "desc": "图片管理器对象。" } ], "annotation": { "constructor": true }, "desc": "初始化图片管理器。", "name": "image_manager_init", "return": { "type": "image_manager_t*", "desc": "返回图片管理器对象。" } }, { "params": [ { "type": "image_manager_t*", "name": "imm", "desc": "图片管理器对象。" }, { "type": "char*", "name": "name", "desc": "图片名称。" }, { "type": "bitmap_t*", "name": "image", "desc": "用于返回图片。" } ], "annotation": { "scriptable": true }, "desc": "获取指定的图片。\n先从缓存查找如果没找到再加载并缓存。", "name": "image_manager_get_bitmap", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "image_manager_t*", "name": "imm", "desc": "图片管理器对象。" }, { "type": "char*", "name": "name", "desc": "图片名称。" } ], "annotation": { "scriptable": true }, "desc": "预加载指定的图片。", "name": "image_manager_preload", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "image_manager_t*", "name": "imm", "desc": "图片管理器对象。" }, { "type": "uint32_t", "name": "time_delta_s", "desc": "时间范围,单位为秒。" } ], "annotation": {}, "desc": "从图片管理器中卸载指定时间内没有使用的图片。", "name": "image_manager_unload_unused", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "image_manager_t*", "name": "imm", "desc": "图片管理器对象。" } ], "annotation": {}, "desc": "从图片管理器中卸载全部图片。", "name": "image_manager_unload_all", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "image_manager_t*", "name": "imm", "desc": "图片管理器对象。" }, { "type": "bitmap_t*", "name": "image", "desc": "图片。" } ], "annotation": {}, "desc": "从图片管理器中卸载指定的图片。", "name": "image_manager_unload_bitmap", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "image_manager_t*", "name": "imm", "desc": "图片管理器对象。" }, { "type": "bitmap_t*", "name": "image", "desc": "返回图片信息。" } ], "annotation": {}, "desc": "更新缓存中图片的specific信息。", "name": "image_manager_update_specific", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "image_manager_t*", "name": "imm", "desc": "图片管理器对象。" }, { "type": "assets_manager_t*", "name": "assets_manager", "desc": "资源管理器。" } ], "annotation": {}, "desc": "设置资源管理器对象。\n\n之所以需要设置资源管理器对象而不是使用缺省的资源管理器对象是因为在designer中有两个图片管理器\n\n* 一个用于designer本身加载图片。\n\n* 一个用于被设计的窗口加载图片。\n\n这两个图片管理器需要从不同的路径加载资源。", "name": "image_manager_set_assets_manager", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "image_manager_t*", "name": "imm", "desc": "图片管理器对象。" } ], "annotation": {}, "desc": "析构图片管理器。", "name": "image_manager_deinit", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "image_manager_t*", "name": "imm", "desc": "图片管理器对象。" } ], "annotation": {}, "desc": "析构并释放图片管理器。", "name": "image_manager_destroy", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } } ], "events": [], "properties": [ { "name": "images", "desc": "缓存的图片。", "type": "darray_t", "annotation": { "private": true } }, { "name": "assets_manager", "desc": "资源管理器。", "type": "assets_manager_t*", "annotation": { "private": true } } ], "header": "base/image_manager.h", "desc": "图片管理器。负责加载,解码和缓存图片。", "name": "image_manager_t", "annotation": { "scriptable": true }, "level": 1 }, { "type": "class", "methods": [ { "params": [ { "type": "input_device_status_t*", "name": "ids", "desc": "输入设备状态管理器对象。" } ], "annotation": { "constructor": true }, "desc": "初始化输入设备状态管理器。", "name": "input_device_status_init", "return": { "type": "input_device_status_t*", "desc": "返回输入设备状态管理器对象。" } }, { "params": [ { "type": "input_device_status_t*", "name": "ids", "desc": "输入设备状态管理器对象。" }, { "type": "widget_t*", "name": "widget", "desc": "窗口管理器对象。" }, { "type": "event_t*", "name": "e", "desc": "事件对象。" } ], "annotation": {}, "desc": "对输入事件进行处理然后分发给widget。", "name": "input_device_status_on_input_event", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "input_device_status_t*", "name": "ids", "desc": "输入设备状态管理器对象。" } ], "annotation": {}, "desc": "取消全部已经按下的键。\n\n窗口切换时旧窗口按下的键一直不松开会持续触发PRESS可能会干扰新窗口的用户功能。\n所在窗口切换时abort全部已经按下的键直到按键松开。", "name": "input_device_status_abort_all_pressed_keys", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } } ], "events": [], "properties": [], "header": "base/input_device_status.h", "desc": "输入设备状态管理器。本类仅供窗口管理器内部使用。", "name": "input_device_status_t", "level": 1 }, { "type": "class", "methods": [ { "params": [ { "type": "input_method_t*", "name": "im", "desc": "输入法对象。" } ], "annotation": { "constructor": true }, "desc": "创建输入法引擎对象。", "name": "input_engine_create", "return": { "type": "input_engine_t*", "desc": "返回输入法引擎对象。" } }, { "params": [ { "type": "input_engine_t*", "name": "engine", "desc": "输入法引擎对象。" } ], "annotation": { "deconstructor": true }, "desc": "销毁输入法引擎对象。", "name": "input_engine_destroy", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "input_engine_t*", "name": "engine", "desc": "输入法引擎对象。" } ], "annotation": {}, "desc": "清除所有输入的按键组合和候选字。", "name": "input_engine_reset_input", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "input_engine_t*", "name": "engine", "desc": "输入法引擎对象。" }, { "type": "int", "name": "key", "desc": "键值。" } ], "annotation": {}, "desc": "输入新的按键,并更新候选字。", "name": "input_engine_input", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "input_engine_t*", "name": "engine", "desc": "输入法引擎对象。" }, { "type": "const char*", "name": "keys", "desc": "按键组合。" } ], "annotation": {}, "desc": "根据按键组合更新候选字并通过输入法对象提交候选字和pre候选字。", "name": "input_engine_search", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } } ], "events": [], "properties": [ { "name": "keys", "desc": "当前的按键组合。", "type": "str_t", "annotation": { "private": true } }, { "name": "candidates", "desc": "当前按键组合对应的候选字列表。", "type": "char*", "annotation": { "private": true } }, { "name": "candidates_nr", "desc": "当前按键组合对应的候选字/词个数。", "type": "uint32_t", "annotation": { "private": true } } ], "header": "base/input_engine.h", "desc": "输入法引擎接口。\n\n常见的实现方式有以下几种\n\n* 空实现。用于不需要输入法的嵌入式平台。\n\n* 拼音输入法实现。用于需要输入法的嵌入式平台。\n\ngraphviz\n[default_style]\n\ninput_engine_pinyin_t -> input_engine_t[arrowhead=empty style=dashed]\ninput_engine_null_t -> input_engine_t[arrowhead=empty style=dashed]\n\n", "name": "input_engine_t", "level": 1 }, { "type": "enum", "desc": "输入类型常量定义。", "consts": [ { "desc": "文本。字符串属性值text", "name": "INPUT_TEXT" }, { "desc": "整数。字符串属性值int", "name": "INPUT_INT" }, { "desc": "非负整数。字符串属性值uint", "name": "INPUT_UINT" }, { "desc": "16进制整数。字符串属性值hex", "name": "INPUT_HEX" }, { "desc": "浮点数。字符串属性值float", "name": "INPUT_FLOAT" }, { "desc": "非负浮点数。字符串属性值ufloat", "name": "INPUT_UFLOAT" }, { "desc": "邮件地址。字符串属性值email", "name": "INPUT_EMAIL" }, { "desc": "密码。字符串属性值password", "name": "INPUT_PASSWORD" }, { "desc": "电话号码。字符串属性值phone", "name": "INPUT_PHONE" }, { "desc": "IP Addr V4(如192.168.1.1)。字符串属性值ipv4", "name": "INPUT_IPV4" }, { "desc": "日期(如2020/02/20)。字符串属性值date", "name": "INPUT_DATE" }, { "desc": "时间(时分12:00)。字符串属性值time", "name": "INPUT_TIME" }, { "desc": "时间(时分秒12:00:00)。字符串属性值time_full", "name": "INPUT_TIME_FULL" }, { "desc": "使用自定义的软键盘(如计算器等应用不希望弹出系统软键盘)。字符串属性值custom", "name": "INPUT_CUSTOM" }, { "desc": "使用自定义的密码软键盘。字符串属性值custom_password", "name": "INPUT_CUSTOM_PASSWORD" } ], "header": "base/input_method.h", "name": "input_type_t", "prefix": "INPUT", "annotation": { "scriptable": true }, "level": 1 }, { "type": "class", "methods": [ { "params": [ { "type": "input_method_t*", "name": "im", "desc": "控件对象。" }, { "type": "event_t*", "name": "e", "desc": "事件。" } ], "annotation": {}, "desc": "分发一个事件。", "name": "input_method_dispatch", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "input_method_t*", "name": "im", "desc": "控件对象。" }, { "type": "event_t*", "name": "e", "desc": "事件。" } ], "annotation": {}, "desc": "分发一个事件当前焦点控件。", "name": "input_method_dispatch_to_widget", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "input_method_t*", "name": "im", "desc": "输入法对象。" }, { "type": "event_type_t", "name": "type", "desc": "事件类型。" }, { "type": "event_func_t", "name": "on_event", "desc": "事件处理函数。" }, { "type": "void*", "name": "ctx", "desc": "事件处理函数上下文。" } ], "annotation": {}, "desc": "注册指定事件的处理函数。", "name": "input_method_on", "return": { "type": "uint32_t", "desc": "返回id用于input_method_off。" } }, { "params": [ { "type": "input_method_t*", "name": "im", "desc": "输入法对象。" }, { "type": "uint32_t", "name": "id", "desc": "input_method_on返回的ID。" } ], "annotation": {}, "desc": "注销指定事件的处理函数。", "name": "input_method_off", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "input_method_t*", "name": "im", "desc": "输入法对象。" }, { "type": "widget_t*", "name": "widget", "desc": "焦点控件为NULL时关闭输入法非NULL时打开输入法。" } ], "annotation": {}, "desc": "打开或关闭输入法。", "name": "input_method_request", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "input_method_t*", "name": "im", "desc": "输入法对象。" }, { "type": "char*", "name": "text", "desc": "按钮的文本。" }, { "type": "bool_t", "name": "enable", "desc": "按钮的是否可用。" } ], "annotation": {}, "desc": "设置软键盘上的action按钮的信息。", "name": "input_method_update_action_button_info", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "input_method_t*", "name": "im", "desc": "输入法对象。" } ], "annotation": {}, "desc": "软键盘上的action按钮被点击时调用本函数分发EVT_IM_ACTION事件。", "name": "input_method_dispatch_action", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "input_method_t*", "name": "im", "desc": "输入法对象。" }, { "type": "const char*", "name": "text", "desc": "文本。" } ], "annotation": { "scriptable": true }, "desc": "提交输入文本。", "name": "input_method_commit_text", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "input_method_t*", "name": "im", "desc": "输入法对象。" }, { "type": "const char*", "name": "lang", "desc": "语言。格式为语言+国家/地区码。如zh_cn和en_us等。" } ], "annotation": { "scriptable": true }, "desc": "设置语言。\n\n> 有时在同一种语言环境下,也需要输入多种文字,典型的情况是同时输入中文和英文。\n> 比如T9输入法可以同时支持中文和英文输入配合软键盘随时切换输入的语言。\n> 数字、小写字母、大写字母和符合也可以视为输入的语言。\n> 主要用于提示输入法引擎选择适当的输入方法。", "name": "input_method_set_lang", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "input_method_t*", "name": "im", "desc": "输入法对象。" } ], "annotation": { "scriptable": true }, "desc": "获取语言。", "name": "input_method_get_lang", "return": { "type": "const char*", "desc": "返回语言。" } }, { "params": [ { "type": "input_method_t*", "name": "im", "desc": "输入法对象。" }, { "type": "bool_t", "name": "replace", "desc": "是否替换原来的文本。" }, { "type": "const char*", "name": "text", "desc": "文本。" } ], "annotation": {}, "desc": "提交输入文本。", "name": "input_method_commit_text_ex", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "input_method_t*", "name": "im", "desc": "输入法对象。" }, { "type": "uint32_t", "name": "key", "desc": "键值。" } ], "annotation": { "scriptable": true }, "desc": "提交按键。", "name": "input_method_dispatch_key", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "input_method_t*", "name": "im", "desc": "输入法对象。" }, { "type": "const char*", "name": "key", "desc": "键值。" } ], "annotation": { "scriptable": true }, "desc": "提交按键。", "name": "input_method_dispatch_keys", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "input_method_t*", "name": "im", "desc": "输入法对象。" } ], "annotation": { "scriptable": true }, "desc": "分发进入预编辑状态的事件。", "name": "input_method_dispatch_preedit", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "input_method_t*", "name": "im", "desc": "输入法对象。" } ], "annotation": { "scriptable": true }, "desc": "分发确认预编辑状态的事件(提交预编辑内容,退出预编辑状态)。", "name": "input_method_dispatch_preedit_confirm", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "input_method_t*", "name": "im", "desc": "输入法对象。" } ], "annotation": { "scriptable": true }, "desc": "分发取消预编辑状态的事件(提交预编辑内容,退出预编辑状态)。", "name": "input_method_dispatch_preedit_abort", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "input_method_t*", "name": "im", "desc": "输入法对象。" }, { "type": "char*", "name": "strs", "desc": "候选字列表。" }, { "type": "uint32_t", "name": "nr", "desc": "候选字个数。" }, { "type": "int32_t", "name": "selected", "desc": "缺省选中候选字的序数。" } ], "annotation": {}, "desc": "请求显示候选字。", "name": "input_method_dispatch_candidates", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "input_method_t*", "name": "im", "desc": "输入法对象。" }, { "type": "char*", "name": "strs", "desc": "候选字列表。" }, { "type": "uint32_t", "name": "nr", "desc": "候选字个数。" }, { "type": "int32_t", "name": "selected", "desc": "缺省选中候选字的序数。" } ], "annotation": {}, "desc": "请求显示预候选字。\n\n> 预候选字: 在有的输入法中比如T9硬键盘输入时按下12两个键时预候选字会显示可用的拼音列表。\n> 从预候选字列表中选择拼音,再查询拼音对应的候选字列表。", "name": "input_method_dispatch_pre_candidates", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [], "annotation": {}, "desc": "创建输入法对象。在具体实现中实现。", "name": "input_method_create", "return": { "type": "input_method_t*", "desc": "成功返回输入法对象失败返回NULL。" } }, { "params": [ { "type": "input_method_t*", "name": "im", "desc": "输入法对象。" } ], "annotation": {}, "desc": "销毁输入法对象。在具体实现中实现。", "name": "input_method_destroy", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [], "annotation": { "constructor": true, "scriptable": true }, "desc": "获取全局输入法对象。", "name": "input_method", "alias": "input_method_instance", "return": { "type": "input_method_t*", "desc": "成功返回输入法对象失败返回NULL。" } }, { "params": [ { "type": "input_method_t*", "name": "im", "desc": "输入法对象。" } ], "annotation": {}, "desc": "设置全局输入法对象。", "name": "input_method_set", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } } ], "events": [], "properties": [ { "name": "widget", "desc": "当前的焦点控件。", "type": "widget_t*", "annotation": { "private": true } }, { "name": "keyboard", "desc": "当前的软件键盘。", "type": "widget_t*", "annotation": { "private": true } }, { "name": "win", "desc": "当前的窗口。", "type": "widget_t*", "annotation": { "private": true } }, { "name": "win_delta_y", "desc": "由于软键盘的弹出可能会将窗口向上推移win_delta_y为推移的距离。", "type": "int32_t", "annotation": { "private": true } }, { "name": "win_old_y", "desc": "窗口原来的位置。", "type": "int32_t", "annotation": { "private": true } }, { "name": "action_button_enable", "desc": "软键盘的上的action按钮是否可用。", "type": "bool_t", "annotation": { "readable": true } }, { "name": "action_button_enable", "desc": "软键盘的上的action按钮文本。", "type": "bool_t", "annotation": { "readable": true } }, { "name": "emitter", "desc": "emitter。用于实现dispatch/on/off等功能。", "type": "emitter_t", "annotation": { "private": true } }, { "name": "keyboard_name", "desc": "软键盘资源名称。", "type": "char*", "annotation": { "readable": true } } ], "header": "base/input_method.h", "desc": "输入法接口。\n\n常见的实现方式有以下几种\n\n* 空实现。用于不需要输入法的嵌入式平台。\n\n* 缺省实现。用于需要输入法的嵌入式平台。\n\n* 基于SDL实现的平台原生输入法。用于桌面系统和手机系统。\n\ngraphviz\n[default_style]\n\ninput_method_default_t -> input_method_t [arrowhead=empty style=dashed]\ninput_method_sdl_t -> input_method_t [arrowhead=empty style=dashed]\ninput_method_null_t -> input_method_t [arrowhead=empty style=dashed]\n\n\n\n> 输入类型请参考:input\_type", "name": "input_method_t", "annotation": { "scriptable": true }, "level": 1 }, { "type": "enum", "desc": "key code。", "consts": [ { "desc": "TK_KEY_RETURN", "name": "TK_KEY_RETURN" }, { "desc": "TK_KEY_ESCAPE", "name": "TK_KEY_ESCAPE" }, { "desc": "TK_KEY_BACKSPACE", "name": "TK_KEY_BACKSPACE" }, { "desc": "TK_KEY_TAB", "name": "TK_KEY_TAB" }, { "desc": "TK_KEY_SPACE", "name": "TK_KEY_SPACE" }, { "desc": "TK_KEY_EXCLAIM", "name": "TK_KEY_EXCLAIM" }, { "desc": "TK_KEY_QUOTEDBL", "name": "TK_KEY_QUOTEDBL" }, { "desc": "TK_KEY_HASH", "name": "TK_KEY_HASH" }, { "desc": "TK_KEY_PERCENT", "name": "TK_KEY_PERCENT" }, { "desc": "TK_KEY_DOLLAR", "name": "TK_KEY_DOLLAR" }, { "desc": "TK_KEY_AMPERSAND", "name": "TK_KEY_AMPERSAND" }, { "desc": "TK_KEY_QUOTE", "name": "TK_KEY_QUOTE" }, { "desc": "TK_KEY_LEFTPAREN", "name": "TK_KEY_LEFTPAREN" }, { "desc": "TK_KEY_RIGHTPAREN", "name": "TK_KEY_RIGHTPAREN" }, { "desc": "TK_KEY_ASTERISK", "name": "TK_KEY_ASTERISK" }, { "desc": "TK_KEY_PLUS", "name": "TK_KEY_PLUS" }, { "desc": "TK_KEY_COMMA", "name": "TK_KEY_COMMA" }, { "desc": "TK_KEY_MINUS", "name": "TK_KEY_MINUS" }, { "desc": "TK_KEY_PERIOD", "name": "TK_KEY_PERIOD" }, { "desc": "TK_KEY_SLASH", "name": "TK_KEY_SLASH" }, { "desc": "TK_KEY_0", "name": "TK_KEY_0" }, { "desc": "TK_KEY_1", "name": "TK_KEY_1" }, { "desc": "TK_KEY_2", "name": "TK_KEY_2" }, { "desc": "TK_KEY_3", "name": "TK_KEY_3" }, { "desc": "TK_KEY_4", "name": "TK_KEY_4" }, { "desc": "TK_KEY_5", "name": "TK_KEY_5" }, { "desc": "TK_KEY_6", "name": "TK_KEY_6" }, { "desc": "TK_KEY_7", "name": "TK_KEY_7" }, { "desc": "TK_KEY_8", "name": "TK_KEY_8" }, { "desc": "TK_KEY_9", "name": "TK_KEY_9" }, { "desc": "TK_KEY_COLON", "name": "TK_KEY_COLON" }, { "desc": "TK_KEY_SEMICOLON", "name": "TK_KEY_SEMICOLON" }, { "desc": "TK_KEY_LESS", "name": "TK_KEY_LESS" }, { "desc": "TK_KEY_EQUAL", "name": "TK_KEY_EQUAL" }, { "desc": "TK_KEY_GREATER", "name": "TK_KEY_GREATER" }, { "desc": "TK_KEY_QUESTION", "name": "TK_KEY_QUESTION" }, { "desc": "TK_KEY_AT", "name": "TK_KEY_AT" }, { "desc": "TK_KEY_LEFTBRACKET", "name": "TK_KEY_LEFTBRACKET" }, { "desc": "TK_KEY_BACKSLASH", "name": "TK_KEY_BACKSLASH" }, { "desc": "TK_KEY_RIGHTBRACKET", "name": "TK_KEY_RIGHTBRACKET" }, { "desc": "TK_KEY_CARET", "name": "TK_KEY_CARET" }, { "desc": "TK_KEY_UNDERSCORE", "name": "TK_KEY_UNDERSCORE" }, { "desc": "TK_KEY_BACKQUOTE", "name": "TK_KEY_BACKQUOTE" }, { "desc": "TK_KEY_a", "name": "TK_KEY_a" }, { "desc": "TK_KEY_b", "name": "TK_KEY_b" }, { "desc": "TK_KEY_c", "name": "TK_KEY_c" }, { "desc": "TK_KEY_d", "name": "TK_KEY_d" }, { "desc": "TK_KEY_e", "name": "TK_KEY_e" }, { "desc": "TK_KEY_f", "name": "TK_KEY_f" }, { "desc": "TK_KEY_g", "name": "TK_KEY_g" }, { "desc": "TK_KEY_h", "name": "TK_KEY_h" }, { "desc": "TK_KEY_i", "name": "TK_KEY_i" }, { "desc": "TK_KEY_j", "name": "TK_KEY_j" }, { "desc": "TK_KEY_k", "name": "TK_KEY_k" }, { "desc": "TK_KEY_l", "name": "TK_KEY_l" }, { "desc": "TK_KEY_m", "name": "TK_KEY_m" }, { "desc": "TK_KEY_n", "name": "TK_KEY_n" }, { "desc": "TK_KEY_o", "name": "TK_KEY_o" }, { "desc": "TK_KEY_p", "name": "TK_KEY_p" }, { "desc": "TK_KEY_q", "name": "TK_KEY_q" }, { "desc": "TK_KEY_r", "name": "TK_KEY_r" }, { "desc": "TK_KEY_s", "name": "TK_KEY_s" }, { "desc": "TK_KEY_t", "name": "TK_KEY_t" }, { "desc": "TK_KEY_u", "name": "TK_KEY_u" }, { "desc": "TK_KEY_v", "name": "TK_KEY_v" }, { "desc": "TK_KEY_w", "name": "TK_KEY_w" }, { "desc": "TK_KEY_x", "name": "TK_KEY_x" }, { "desc": "TK_KEY_y", "name": "TK_KEY_y" }, { "desc": "TK_KEY_z", "name": "TK_KEY_z" }, { "desc": "TK_KEY_A", "name": "TK_KEY_A" }, { "desc": "TK_KEY_B", "name": "TK_KEY_B" }, { "desc": "TK_KEY_C", "name": "TK_KEY_C" }, { "desc": "TK_KEY_D", "name": "TK_KEY_D" }, { "desc": "TK_KEY_E", "name": "TK_KEY_E" }, { "desc": "TK_KEY_F", "name": "TK_KEY_F" }, { "desc": "TK_KEY_G", "name": "TK_KEY_G" }, { "desc": "TK_KEY_H", "name": "TK_KEY_H" }, { "desc": "TK_KEY_I", "name": "TK_KEY_I" }, { "desc": "TK_KEY_J", "name": "TK_KEY_J" }, { "desc": "TK_KEY_K", "name": "TK_KEY_K" }, { "desc": "TK_KEY_L", "name": "TK_KEY_L" }, { "desc": "TK_KEY_M", "name": "TK_KEY_M" }, { "desc": "TK_KEY_N", "name": "TK_KEY_N" }, { "desc": "TK_KEY_O", "name": "TK_KEY_O" }, { "desc": "TK_KEY_P", "name": "TK_KEY_P" }, { "desc": "TK_KEY_Q", "name": "TK_KEY_Q" }, { "desc": "TK_KEY_R", "name": "TK_KEY_R" }, { "desc": "TK_KEY_S", "name": "TK_KEY_S" }, { "desc": "TK_KEY_T", "name": "TK_KEY_T" }, { "desc": "TK_KEY_U", "name": "TK_KEY_U" }, { "desc": "TK_KEY_V", "name": "TK_KEY_V" }, { "desc": "TK_KEY_W", "name": "TK_KEY_W" }, { "desc": "TK_KEY_X", "name": "TK_KEY_X" }, { "desc": "TK_KEY_Y", "name": "TK_KEY_Y" }, { "desc": "TK_KEY_Z", "name": "TK_KEY_Z" }, { "desc": "TK_KEY_DOT", "name": "TK_KEY_DOT" }, { "desc": "TK_KEY_DELETE", "name": "TK_KEY_DELETE" }, { "desc": "TK_KEY_LEFTBRACE", "name": "TK_KEY_LEFTBRACE" }, { "desc": "TK_KEY_RIGHTBRACE", "name": "TK_KEY_RIGHTBRACE" }, { "desc": "TK_KEY_LSHIFT", "name": "TK_KEY_LSHIFT" }, { "desc": "TK_KEY_RSHIFT", "name": "TK_KEY_RSHIFT" }, { "desc": "TK_KEY_LCTRL", "name": "TK_KEY_LCTRL" }, { "desc": "TK_KEY_RCTRL", "name": "TK_KEY_RCTRL" }, { "desc": "TK_KEY_LALT", "name": "TK_KEY_LALT" }, { "desc": "TK_KEY_RALT", "name": "TK_KEY_RALT" }, { "desc": "TK_KEY_CAPSLOCK", "name": "TK_KEY_CAPSLOCK" }, { "desc": "TK_KEY_HOME", "name": "TK_KEY_HOME" }, { "desc": "TK_KEY_END", "name": "TK_KEY_END" }, { "desc": "TK_KEY_INSERT", "name": "TK_KEY_INSERT" }, { "desc": "TK_KEY_UP", "name": "TK_KEY_UP" }, { "desc": "TK_KEY_DOWN", "name": "TK_KEY_DOWN" }, { "desc": "TK_KEY_LEFT", "name": "TK_KEY_LEFT" }, { "desc": "TK_KEY_RIGHT", "name": "TK_KEY_RIGHT" }, { "desc": "TK_KEY_PAGEUP", "name": "TK_KEY_PAGEUP" }, { "desc": "TK_KEY_PAGEDOWN", "name": "TK_KEY_PAGEDOWN" }, { "desc": "TK_KEY_F1", "name": "TK_KEY_F1" }, { "desc": "TK_KEY_F2", "name": "TK_KEY_F2" }, { "desc": "TK_KEY_F3", "name": "TK_KEY_F3" }, { "desc": "TK_KEY_F4", "name": "TK_KEY_F4" }, { "desc": "TK_KEY_F5", "name": "TK_KEY_F5" }, { "desc": "TK_KEY_F6", "name": "TK_KEY_F6" }, { "desc": "TK_KEY_F7", "name": "TK_KEY_F7" }, { "desc": "TK_KEY_F8", "name": "TK_KEY_F8" }, { "desc": "TK_KEY_F9", "name": "TK_KEY_F9" }, { "desc": "TK_KEY_F10", "name": "TK_KEY_F10" }, { "desc": "TK_KEY_F11", "name": "TK_KEY_F11" }, { "desc": "TK_KEY_F12", "name": "TK_KEY_F12" }, { "desc": "TK_KEY_MENU", "name": "TK_KEY_MENU" }, { "desc": "TK_KEY_COMMAND", "name": "TK_KEY_COMMAND" }, { "desc": "TK_KEY_BACK", "name": "TK_KEY_BACK" }, { "desc": "TK_KEY_CANCEL", "name": "TK_KEY_CANCEL" } ], "header": "base/keys.h", "name": "key_code_t", "prefix": "TK_", "annotation": { "scriptable": true }, "level": 1 }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件。" } ], "annotation": { "global": true }, "desc": "调用widget的selflayout。", "name": "widget_layout_self", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" }, "type": "method", "header": "base/layout.h", "level": 1 }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件。" } ], "annotation": { "global": true }, "desc": "调用widget默认的childrenlayout。", "name": "widget_layout_children_default", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" }, "type": "method", "header": "base/layout.h", "level": 1 }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件。" } ], "annotation": { "global": true }, "desc": "对floating属性的子控件进行layout。", "name": "widget_layout_floating_children", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" }, "type": "method", "header": "base/layout.h", "level": 1 }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件。" }, { "type": "darray_t*", "name": "result", "desc": "返回队列。" }, { "type": "bool_t", "name": "keep_disable", "desc": "是否保留非enable状态的控件。" }, { "type": "bool_t", "name": "keep_invisible", "desc": "是否保留非visible状态的控件。" } ], "annotation": { "global": true }, "desc": "获取受childrenlayout控件的子控件队列。", "name": "widget_get_children_for_layout", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" }, "type": "method", "header": "base/layout.h", "level": 1 }, { "type": "enum", "desc": "LCD绘制模式常量定义。", "consts": [ { "desc": "正常绘制。", "name": "LCD_DRAW_NORMAL" }, { "desc": "绘制窗口动画,两个窗口无重叠。\n在该模式下可以直接绘制到显存不用绘制到framebuffer中。", "name": "LCD_DRAW_ANIMATION" }, { "desc": "绘制窗口动画,两个窗口有重叠。\n(目前无特殊用途)。", "name": "LCD_DRAW_ANIMATION_OVERLAP" }, { "desc": "如果lcd支持swap操作在特殊情况下可以使用该模式提速。", "name": "LCD_DRAW_SWAP" }, { "desc": "离线模式绘制(仅适用于framebuffer)。\n在该模式下绘制的内容不会显示出来但可以用take_snapshot取出来主要用于窗口动画。", "name": "LCD_DRAW_OFFLINE" } ], "header": "base/lcd.h", "name": "lcd_draw_mode_t", "prefix": "LCD_DRAW_", "level": 1 }, { "type": "enum", "desc": "LCD类型常量定义。", "consts": [ { "desc": "基于FrameBuffer的LCD。", "name": "LCD_FRAMEBUFFER" }, { "desc": "基于寄存器的LCD。", "name": "LCD_REGISTER" }, { "desc": "基于VGCANVS的LCD。仅在支持OpenGL时用nanovg实现。", "name": "LCD_VGCANVAS" }, { "desc": "单色LCD。", "name": "LCD_MONO" } ], "header": "base/lcd.h", "name": "lcd_type_t", "prefix": "LCD_", "level": 1 }, { "type": "class", "methods": [ { "params": [ { "type": "lcd_t*", "name": "lcd", "desc": "lcd对象。" }, { "type": "const rect_t*", "name": "dirty_rect", "desc": "需要绘制的区域。" }, { "type": "lcd_draw_mode_t", "name": "anim_mode", "desc": "动画模式如果可能直接画到显存而不是离线的framebuffer。" } ], "annotation": {}, "desc": "准备绘制。", "name": "lcd_begin_frame", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "lcd_t*", "name": "lcd", "desc": "lcd对象。" }, { "type": "const rect_t*", "name": "rect", "desc": "裁剪区域。" } ], "annotation": {}, "desc": "设置裁剪区域。", "name": "lcd_set_clip_rect", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "lcd_t*", "name": "lcd", "desc": "lcd对象。" }, { "type": "rect_t*", "name": "rect", "desc": "裁剪区域。" } ], "annotation": {}, "desc": "获取裁剪区域。", "name": "lcd_get_clip_rect", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "lcd_t*", "name": "lcd", "desc": "lcd对象。" }, { "type": "wh_t", "name": "w", "desc": "新的宽度。" }, { "type": "wh_t", "name": "h", "desc": "新的高度。" }, { "type": "uint32_t", "name": "line_length", "desc": "line_length。" } ], "annotation": {}, "desc": "基于SDL的PC软件在SDL窗口resize时需要调用本函数resize lcd。\n屏幕旋转时会调用本函数调整LCD的大小。", "name": "lcd_resize", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "lcd_t*", "name": "lcd", "desc": "lcd对象。" }, { "type": "uint8_t", "name": "alpha", "desc": "全局alpha。" } ], "annotation": {}, "desc": "设置全局alpha。", "name": "lcd_set_global_alpha", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "lcd_t*", "name": "lcd", "desc": "lcd对象。" }, { "type": "color_t", "name": "color", "desc": "颜色。" } ], "annotation": {}, "desc": "设置文本颜色。", "name": "lcd_set_text_color", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "lcd_t*", "name": "lcd", "desc": "lcd对象。" }, { "type": "color_t", "name": "color", "desc": "颜色。" } ], "annotation": {}, "desc": "设置线条颜色。", "name": "lcd_set_stroke_color", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "lcd_t*", "name": "lcd", "desc": "lcd对象。" }, { "type": "color_t", "name": "color", "desc": "颜色。" } ], "annotation": {}, "desc": "设置填充颜色。", "name": "lcd_set_fill_color", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "lcd_t*", "name": "lcd", "desc": "lcd对象。" }, { "type": "const char*", "name": "name", "desc": "字体名称。" } ], "annotation": {}, "desc": "设置字体名称。", "name": "lcd_set_font_name", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "lcd_t*", "name": "lcd", "desc": "lcd对象。" }, { "type": "uint32_t", "name": "font_size", "desc": "字体大小。" } ], "annotation": {}, "desc": "设置字体大小。", "name": "lcd_set_font_size", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "lcd_t*", "name": "lcd", "desc": "lcd对象。" }, { "type": "xy_t", "name": "x", "desc": "x坐标。" }, { "type": "xy_t", "name": "y", "desc": "y坐标。" }, { "type": "xy_t", "name": "h", "desc": "直线高度。" } ], "annotation": {}, "desc": "绘制一条垂直线。", "name": "lcd_draw_vline", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "lcd_t*", "name": "lcd", "desc": "lcd对象。" }, { "type": "xy_t", "name": "x", "desc": "x坐标。" }, { "type": "xy_t", "name": "y", "desc": "y坐标。" }, { "type": "xy_t", "name": "w", "desc": "直线宽度。" } ], "annotation": {}, "desc": "绘制一条水平线。", "name": "lcd_draw_hline", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "lcd_t*", "name": "lcd", "desc": "lcd对象。" }, { "type": "point_t*", "name": "points", "desc": "要绘制的点集合。" }, { "type": "uint32_t", "name": "nr", "desc": "点的个数。" } ], "annotation": {}, "desc": "绘制一组点。", "name": "lcd_draw_points", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "lcd_t*", "name": "lcd", "desc": "lcd对象。" }, { "type": "xy_t", "name": "x", "desc": "x坐标。" }, { "type": "xy_t", "name": "y", "desc": "y坐标。" } ], "annotation": {}, "desc": "获取指定点的颜色对于基于非FrameBuffer的LCD返回当前的fill_color。", "name": "lcd_get_point_color", "return": { "type": "color_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "lcd_t*", "name": "lcd", "desc": "lcd对象。" }, { "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": "绘制实心矩形。", "name": "lcd_fill_rect", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "lcd_t*", "name": "lcd", "desc": "lcd对象。" }, { "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": "填充实心矩形。", "name": "lcd_clear_rect", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "lcd_t*", "name": "lcd", "desc": "lcd对象。" }, { "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": "绘制矩形边框。", "name": "lcd_stroke_rect", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "lcd_t*", "name": "lcd", "desc": "lcd对象。" }, { "type": "glyph_t*", "name": "glyph", "desc": "字模" }, { "type": "const rect_t*", "name": "src", "desc": "只绘制指定区域的部分。" }, { "type": "xy_t", "name": "x", "desc": "x坐标。" }, { "type": "xy_t", "name": "y", "desc": "y坐标。" } ], "annotation": {}, "desc": "绘制字符。如果实现了measure_text/draw_text则不需要实现本函数。", "name": "lcd_draw_glyph", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "lcd_t*", "name": "lcd", "desc": "lcd对象。" }, { "type": "const wchar_t*", "name": "str", "desc": "字符串。" }, { "type": "uint32_t", "name": "nr", "desc": "字符数。" } ], "annotation": {}, "desc": "测量字符串占用的宽度。", "name": "lcd_measure_text", "return": { "type": "float_t", "desc": "返回字符串占用的宽度。" } }, { "params": [ { "type": "lcd_t*", "name": "lcd", "desc": "lcd对象。" }, { "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": "lcd_draw_text", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "lcd_t*", "name": "lcd", "desc": "lcd对象。" }, { "type": "bitmap_t*", "name": "img", "desc": "图片。" }, { "type": "const rect_t*", "name": "src", "desc": "只绘制指定区域的部分。" }, { "type": "const rect_t*", "name": "dst", "desc": "绘制到目标区域。" } ], "annotation": {}, "desc": "绘制图片。", "name": "lcd_draw_image", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "lcd_t*", "name": "lcd", "desc": "lcd对象。" }, { "type": "draw_image_info_t*", "name": "info", "desc": "绘制参数。" } ], "annotation": {}, "desc": "绘制图片。", "name": "lcd_draw_image_matrix", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "lcd_t*", "name": "lcd", "desc": "lcd对象。" } ], "annotation": {}, "desc": "获取矢量图canvas。", "name": "lcd_get_vgcanvas", "return": { "type": "vgcanvas_t*", "desc": "返回矢量图canvas。" } }, { "params": [ { "type": "lcd_t*", "name": "lcd", "desc": "lcd对象。" }, { "type": "bitmap_t*", "name": "img", "desc": "返回快照图片。" }, { "type": "bool_t", "name": "auto_rotate", "desc": "是否根据LCD实际方向自动旋转。" } ], "annotation": {}, "desc": "拍摄快照一般用于窗口动画只有framebuffer模式才支持。", "name": "lcd_take_snapshot", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "lcd_t*", "name": "lcd", "desc": "lcd对象。" } ], "annotation": {}, "desc": "获取期望的位图格式。绘制期望的位图格式可以提高绘制性能。", "name": "lcd_get_desired_bitmap_format", "return": { "type": "bitmap_format_t", "desc": "返回期望的位图格式。" } }, { "params": [ { "type": "lcd_t*", "name": "lcd", "desc": "lcd对象。" } ], "annotation": {}, "desc": "获取宽度。", "name": "lcd_get_width", "return": { "type": "wh_t", "desc": "返回宽度。" } }, { "params": [ { "type": "lcd_t*", "name": "lcd", "desc": "lcd对象。" } ], "annotation": {}, "desc": "获取高度。", "name": "lcd_get_height", "return": { "type": "wh_t", "desc": "返回高度。" } }, { "params": [ { "type": "lcd_t*", "name": "lcd", "desc": "lcd对象。" } ], "annotation": {}, "desc": "判读lcd是否支持swap。", "name": "lcd_is_swappable", "return": { "type": "bool_t", "desc": "返回是否支持swap。" } }, { "params": [ { "type": "lcd_t*", "name": "lcd", "desc": "lcd对象。" } ], "annotation": {}, "desc": "完成绘制,同步到显示设备。", "name": "lcd_end_frame", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "lcd_t*", "name": "lcd", "desc": "lcd对象。" }, { "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": "lcd_get_text_metrics", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "lcd_t*", "name": "lcd", "desc": "lcd对象。" } ], "annotation": {}, "desc": "销毁lcd对象。", "name": "lcd_destroy", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } } ], "events": [], "properties": [ { "name": "w", "desc": "屏幕的宽度", "type": "wh_t", "annotation": { "readable": true } }, { "name": "height", "desc": "屏幕的高度", "type": "wh_t", "annotation": { "readable": true } }, { "name": "global_alpha", "desc": "全局alpha", "type": "uint8_t", "annotation": { "readable": true } }, { "name": "text_color", "desc": "文本颜色", "type": "color_t", "annotation": { "readable": true } }, { "name": "fill_color", "desc": "填充颜色", "type": "color_t", "annotation": { "readable": true } }, { "name": "stroke_color", "desc": "线条颜色", "type": "color_t", "annotation": { "readable": true } }, { "name": "font_name", "desc": "字体名称。", "type": "char*", "annotation": { "readable": true } }, { "name": "font_size", "desc": "字体大小。", "type": "uint32_t", "annotation": { "readable": true } }, { "name": "draw_mode", "desc": "绘制模式。", "type": "lcd_draw_mode_t", "annotation": { "readable": true } }, { "name": "type", "desc": "LCD的类型。", "type": "lcd_type_t", "annotation": { "readable": true } }, { "name": "ratio", "desc": "屏幕密度。", "type": "float_t", "annotation": { "readable": true } }, { "name": "support_dirty_rect", "desc": "是否支持脏矩形。", "type": "bool_t", "annotation": { "readable": true } }, { "name": "last_update_time", "desc": "last update time", "type": "uint64_t", "annotation": { "readable": true } } ], "header": "base/lcd.h", "desc": "显示设备抽象基类。", "name": "lcd_t", "level": 1 }, { "type": "enum", "desc": "换行类型。", "consts": [ { "desc": "必须换行。", "name": "LINE_BREAK_MUST" }, { "desc": "可以换行。", "name": "LINE_BREAK_ALLOW" }, { "desc": "不可以换行。", "name": "LINE_BREAK_NO" } ], "header": "base/line_break.h", "name": "line_break_type_t", "prefix": "LINE_BREAK_", "level": 1 }, { "type": "class", "methods": [ { "params": [ { "type": "wchar_t", "name": "c1", "desc": "前面的字符。" }, { "type": "wchar_t", "name": "c2", "desc": "后面的字符。" } ], "annotation": {}, "desc": "检查两个字符之间是否允许换行。", "name": "line_break_check", "return": { "type": "line_break_type_t", "desc": "返回类型。" } }, { "params": [ { "type": "wchar_t", "name": "c1", "desc": "前面的字符。" }, { "type": "wchar_t", "name": "c2", "desc": "后面的字符。" } ], "annotation": {}, "desc": "检查两个字符之间是否允许单词分割。", "name": "word_break_check", "return": { "type": "line_break_type_t", "desc": "返回类型。" } }, { "params": [ { "type": "const wchar_t*", "name": "str", "desc": "字符串。" } ], "annotation": {}, "desc": "统计行数。", "name": "line_break_count", "return": { "type": "uint32_t", "desc": "返回行数。" } }, { "params": [ { "type": "const wchar_t*", "name": "str", "desc": "字符串。" }, { "type": "line_break_on_line_t", "name": "on_line", "desc": "回调函数。" }, { "type": "void*", "name": "ctx", "desc": "回调函数的上下文。" } ], "annotation": {}, "desc": "解析字符串对于每一行调用on_line函数。", "name": "line_break", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } } ], "events": [], "properties": [], "header": "base/line_break.h", "desc": "换行相关函数。", "name": "line_break_check", "annotation": { "fake": true }, "level": 1 }, { "type": "class", "methods": [ { "params": [], "annotation": { "constructor": true, "scriptable": true }, "desc": "获取缺省locale_info。", "name": "locale_info", "alias": "locale_info_instance", "return": { "type": "locale_info_t*", "desc": "返回locale_info对象。" } }, { "params": [ { "type": "locale_info_t*", "name": "locale_info", "desc": "locale_info对象。" } ], "annotation": {}, "desc": "设置缺省locale_info。", "name": "locale_info_set", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "char*", "name": "language", "desc": "语言。" }, { "type": "char*", "name": "country", "desc": "国家或地区。" } ], "annotation": { "constructor": true }, "desc": "创建locale_info。", "name": "locale_info_create", "return": { "type": "locale_info_t*", "desc": "返回locale_info对象。" } }, { "params": [ { "type": "locale_info_t*", "name": "locale_info", "desc": "locale_info对象。" }, { "type": "const char*", "name": "text", "desc": "待翻译的文本。" } ], "annotation": { "scriptable": true }, "desc": "翻译字符串。", "name": "locale_info_tr", "return": { "type": "const char*", "desc": "返回翻译之后的字符串。" } }, { "params": [ { "type": "locale_info_t*", "name": "locale_info", "desc": "locale_info对象。" }, { "type": "char*", "name": "language", "desc": "语言。" }, { "type": "char*", "name": "country", "desc": "国家或地区。" } ], "annotation": { "scriptable": true }, "desc": "设置当前的国家和语言。", "name": "locale_info_change", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "locale_info_t*", "name": "locale_info", "desc": "locale_info对象。" }, { "type": "event_type_t", "name": "type", "desc": "事件类型目前固定为EVT_LOCALE_CHANGED。" }, { "type": "event_func_t", "name": "on_event", "desc": "事件处理函数。" }, { "type": "void*", "name": "ctx", "desc": "事件处理函数上下文。" } ], "annotation": {}, "desc": "注册指定事件的处理函数。", "name": "locale_info_on", "return": { "type": "uint32_t", "desc": "返回id用于locale_info_off。" } }, { "params": [ { "type": "locale_info_t*", "name": "locale_info", "desc": "locale_info对象。" }, { "type": "uint32_t", "name": "id", "desc": "locale_info_on返回的ID。" } ], "annotation": { "scriptable": true }, "desc": "注销指定事件的处理函数。", "name": "locale_info_off", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "locale_info_t*", "name": "locale_info", "desc": "locale_info对象。" }, { "type": "assets_manager_t*", "name": "assets_manager", "desc": "资源管理器。" } ], "annotation": {}, "desc": "设置资源管理器对象。", "name": "locale_info_set_assets_manager", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "locale_info_t*", "name": "locale_info", "desc": "locale_info对象。" } ], "annotation": {}, "desc": "重新加载字符串资源。", "name": "locale_info_reload", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "locale_info_t*", "name": "locale_info", "desc": "locale_info对象。" } ], "annotation": {}, "desc": "释放全部资源并销毁locale_info对象。", "name": "locale_info_destroy", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } } ], "events": [], "properties": [ { "name": "country;", "desc": "国家或地区。如CN", "type": "char*", "annotation": { "readable": true } }, { "name": "language", "desc": "语言。如zh", "type": "char*", "annotation": { "readable": true } }, { "name": "assets_manager", "desc": "资源管理器。", "type": "assets_manager_t*", "annotation": { "private": true } } ], "header": "base/locale_info.h", "desc": "本地化信息。提供字符串翻译数据管理,当前语言改变的事件通知等等。", "name": "locale_info_t", "annotation": { "scriptable": true }, "level": 1 }, { "type": "class", "methods": [ { "params": [], "annotation": { "static": true }, "desc": "获取当前main_loop对象", "name": "main_loop", "return": { "type": "main_loop_t*", "desc": "返回main_loop对象。" } }, { "params": [ { "type": "main_loop_t*", "name": "l", "desc": "main_loop对象。" }, { "type": "event_source_t*", "name": "source", "desc": "event_source对象。" } ], "annotation": {}, "desc": "添加event_source。", "name": "main_loop_add_event_source", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "main_loop_t*", "name": "l", "desc": "main_loop对象。" }, { "type": "event_source_t*", "name": "source", "desc": "event_source对象。" } ], "annotation": {}, "desc": "删除event_source。", "name": "main_loop_remove_event_source", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "main_loop_t*", "name": "l", "desc": "main_loop对象。" }, { "type": "void*", "name": "tag", "desc": "tag。" } ], "annotation": {}, "desc": "删除event_source。", "name": "main_loop_remove_event_source_by_tag", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } } ], "events": [], "properties": [], "header": "base/main_loop.h", "desc": "主循环接口。", "name": "main_loop_t", "level": 1 }, { "type": "class", "methods": [ { "params": [], "annotation": { "constructor": true }, "desc": "获取缺省的控件自身布局算法工厂对象。", "name": "self_layouter_factory", "return": { "type": "self_layouter_factory_t*", "desc": "返回控件自身布局算法工厂对象。" } }, { "params": [ { "type": "self_layouter_factory_t*", "name": "factory", "desc": "控件自身布局算法工厂对象。" } ], "annotation": {}, "desc": "设置缺省的控件自身布局算法工厂对象。", "name": "self_layouter_factory_set", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [], "annotation": { "constructor": true }, "desc": "创建控件自身布局算法工厂对象。", "name": "self_layouter_factory_create", "return": { "type": "self_layouter_factory_t*", "desc": "返回控件自身布局算法工厂对象。" } }, { "params": [ { "type": "self_layouter_factory_t*", "name": "factory", "desc": "layouter工厂对象。" }, { "type": "const char*", "name": "type", "desc": "控件自身布局算法类型。" }, { "type": "self_layouter_create_t", "name": "create", "desc": "控件自身布局算法创建函数。" } ], "annotation": {}, "desc": "注册控件自身布局算法创建函数。", "name": "self_layouter_factory_register", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "self_layouter_factory_t*", "name": "factory", "desc": "控件自身布局算法工厂对象。" }, { "type": "const char*", "name": "type", "desc": "类型。" } ], "annotation": { "constructor": true }, "desc": "创建指定类型的控件自身布局算法对象。", "name": "self_layouter_factory_create_layouter", "return": { "type": "self_layouter_t*", "desc": "返回控件自身布局算法对象。" } }, { "params": [ { "type": "self_layouter_factory_t*", "name": "factory", "desc": "控件自身布局算法工厂对象。" } ], "annotation": {}, "desc": "析构并释放控件自身布局算法工厂对象。", "name": "self_layouter_factory_destroy", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } } ], "events": [], "properties": [], "header": "base/self_layouter_factory.h", "desc": "控件自身布局算法工厂。", "name": "self_layouter_factory_t", "level": 1 }, { "type": "class", "methods": [ { "params": [ { "type": "self_layouter_t*", "name": "layouter", "desc": "layouter对象。" } ], "annotation": {}, "desc": "获取全部参数。", "name": "self_layouter_to_string", "return": { "type": "ret_t", "desc": "返回字符串格式的参数。" } }, { "params": [ { "type": "self_layouter_t*", "name": "layouter", "desc": "layouter对象。" }, { "type": "widget_t*", "name": "widget", "desc": "控件。" }, { "type": "rect_t*", "name": "area", "desc": "可以使用的区域。" } ], "annotation": {}, "desc": "对控件自身进行布局。", "name": "self_layouter_layout", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "self_layouter_t*", "name": "layouter", "desc": "layouter对象。" }, { "type": "const char*", "name": "name", "desc": "参数名。" }, { "type": "value_t*", "name": "v", "desc": "返回参数的值。" } ], "annotation": {}, "desc": "获取指定的参数。", "name": "self_layouter_get_param", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "self_layouter_t*", "name": "layouter", "desc": "layouter对象。" }, { "type": "const char*", "name": "name", "desc": "参数名。" }, { "type": "const value_t*", "name": "v", "desc": "参数的值。" } ], "annotation": {}, "desc": "获取指定的参数。", "name": "self_layouter_set_param", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "self_layouter_t*", "name": "layouter", "desc": "layouter对象。" }, { "type": "const char*", "name": "name", "desc": "参数名。" }, { "type": "const char*", "name": "value", "desc": "参数值。" } ], "annotation": {}, "desc": "设置字符串格式的参数。", "name": "self_layouter_set_param_str", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "self_layouter_t*", "name": "layouter", "desc": "layouter对象。" }, { "type": "const char*", "name": "name", "desc": "参数名。" }, { "type": "float_t", "name": "defval", "desc": "缺省值。" } ], "annotation": {}, "desc": "获取指定的浮点格式的参数。", "name": "self_layouter_get_param_float", "return": { "type": "ret_t", "desc": "成功返回参数的值,失败返回缺省值。" } }, { "params": [ { "type": "self_layouter_t*", "name": "layouter", "desc": "layouter对象。" }, { "type": "const char*", "name": "name", "desc": "参数名。" }, { "type": "int32_t", "name": "defval", "desc": "缺省值。" } ], "annotation": {}, "desc": "获取指定的整数格式的参数。", "name": "self_layouter_get_param_int", "return": { "type": "ret_t", "desc": "成功返回参数的值,失败返回缺省值。" } }, { "params": [ { "type": "self_layouter_t*", "name": "layouter", "desc": "layouter对象。" } ], "annotation": {}, "desc": "销毁layouter对象。", "name": "self_layouter_destroy", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "const char*", "name": "params", "desc": "参数。" } ], "annotation": {}, "desc": "创建layouter对象。", "name": "self_layouter_create", "return": { "type": "self_layouter_t*", "desc": "返回layouter对象。" } }, { "params": [ { "type": "const char*", "name": "layouter", "desc": "被克隆的对象。" } ], "annotation": {}, "desc": "克隆layouter对象。", "name": "self_layouter_clone", "return": { "type": "self_layouter_t*", "desc": "返回layouter对象。" } } ], "events": [], "properties": [], "header": "base/self_layouter.h", "desc": "控件自身排版布局器的接口。\n\n按特定算法对控件进行排版布局子类需要实现vtable中的函数。", "name": "self_layouter_t", "level": 1 }, { "type": "class", "methods": [ { "params": [], "annotation": { "constructor": true }, "desc": "初始化快捷键对象。", "name": "shortcut_init", "return": { "type": "shortcut_t*", "desc": "返回快捷键对象。" } }, { "params": [ { "type": "shortcut_t*", "name": "shortcut", "desc": "快捷键对象。" } ], "annotation": { "constructor": true }, "desc": "初始化快捷键对象。", "name": "shortcut_init_with_str", "return": { "type": "shortcut_t*", "desc": "返回快捷键对象。" } }, { "params": [ { "type": "shortcut_t*", "name": "shortcut1", "desc": "快捷键对象1。" }, { "type": "shortcut_t*", "name": "shortcut2", "desc": "快捷键对象2。" } ], "annotation": {}, "desc": "比较两个快捷键对象。", "name": "shortcut_equal", "return": { "type": "bool_t", "desc": "返回TRUE表示相同否则表示不同。" } }, { "params": [ { "type": "shortcut_t*", "name": "filter", "desc": "过滤器快捷键对象。" }, { "type": "shortcut_t*", "name": "event", "desc": "事件快捷键对象。" } ], "annotation": {}, "desc": "检查事件与快捷键是否匹配。", "name": "shortcut_match", "return": { "type": "bool_t", "desc": "返回TRUE表示匹配否则表示不匹配。" } } ], "events": [], "properties": [ { "name": "is_valid", "desc": "是否有效。", "type": "bool_t", "annotation": { "readable": true } }, { "name": "key", "desc": "键值。", "type": "uint32_t", "annotation": { "readable": true } }, { "name": "alt", "desc": "alt键是否按下。", "type": "bool_t", "annotation": { "readable": true } }, { "name": "lalt", "desc": "left alt键是否按下。", "type": "bool_t", "annotation": { "readable": true } }, { "name": "ralt", "desc": "right alt键是否按下。", "type": "bool_t", "annotation": { "readable": true } }, { "name": "ctrl", "desc": "ctrl键是否按下。", "type": "bool_t", "annotation": { "readable": true } }, { "name": "lctrl", "desc": "left ctrl键是否按下。", "type": "bool_t", "annotation": { "readable": true } }, { "name": "rctrl", "desc": "right ctrl键是否按下。", "type": "bool_t", "annotation": { "readable": true } }, { "name": "shift", "desc": "shift键是否按下。", "type": "bool_t", "annotation": { "readable": true } }, { "name": "lshift", "desc": "left shift键是否按下。", "type": "bool_t", "annotation": { "readable": true } }, { "name": "rshift", "desc": "right shift键是否按下。", "type": "bool_t", "annotation": { "readable": true } }, { "name": "cmd", "desc": "cmd/win键是否按下。", "type": "bool_t", "annotation": { "readable": true } }, { "name": "menu", "desc": "menu键是否按下。", "type": "bool_t", "annotation": { "readable": true } } ], "header": "base/shortcut.h", "desc": "快捷键。", "name": "shortcut_t", "level": 1 }, { "type": "class", "methods": [ { "params": [ { "type": "style_factory_t*", "name": "factory", "desc": "factory对象。" }, { "type": "widget_t*", "name": "widget", "desc": "控件对象。" } ], "annotation": {}, "desc": "创建style。", "name": "style_factory_create_style", "return": { "type": "style_t*", "desc": "返回style对象。" } }, { "params": [], "annotation": { "constructor": true }, "desc": "获取缺省的style factory。", "name": "style_factory", "alias": "style_factory_instance", "return": { "type": "style_factory_t*", "desc": "返回style factory对象。" } }, { "params": [ { "type": "style_factory_t*", "name": "factory", "desc": "factory对象。" } ], "annotation": {}, "desc": "设置缺省的style factory(需要自定义的style factory才设置)。", "name": "style_factory_set", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } } ], "events": [], "properties": [], "header": "base/style_factory.h", "desc": "style工厂接口主要用于创建style。\n\n> 在特殊情况下可以实现自己的style工厂比如支持CSS和可实时修改的style。", "name": "style_factory_t", "level": 1 }, { "type": "enum", "desc": "style常量定义。", "consts": [ { "desc": "背景颜色。", "name": "STYLE_ID_BG_COLOR" }, { "desc": "前景颜色。", "name": "STYLE_ID_FG_COLOR" }, { "desc": "蒙版颜色。", "name": "STYLE_ID_MASK_COLOR" }, { "desc": "字体名称。", "name": "STYLE_ID_FONT_NAME" }, { "desc": "字体大小。", "name": "STYLE_ID_FONT_SIZE" }, { "desc": "字体风格(粗体、斜体等)。", "name": "STYLE_ID_FONT_STYLE" }, { "desc": "文本颜色。", "name": "STYLE_ID_TEXT_COLOR" }, { "desc": "高亮文本的字体名称。", "name": "STYLE_ID_HIGHLIGHT_FONT_NAME" }, { "desc": "高亮文本的字体大小。", "name": "STYLE_ID_HIGHLIGHT_FONT_SIZE" }, { "desc": "高亮文本的文本颜色。", "name": "STYLE_ID_HIGHLIGHT_TEXT_COLOR" }, { "desc": "提示文本颜色。", "name": "STYLE_ID_TIPS_TEXT_COLOR" }, { "desc": "文本水平对齐的方式。", "name": "STYLE_ID_TEXT_ALIGN_H" }, { "desc": "文本垂直对齐的方式。", "name": "STYLE_ID_TEXT_ALIGN_V" }, { "desc": "边框颜色。", "name": "STYLE_ID_BORDER_COLOR" }, { "desc": "边框线宽。", "name": "STYLE_ID_BORDER_WIDTH" }, { "desc": "边框类型。", "name": "STYLE_ID_BORDER" }, { "desc": "图片的名称。", "name": "STYLE_ID_BG_IMAGE" }, { "desc": "图片的显示方式。", "name": "STYLE_ID_BG_IMAGE_DRAW_TYPE" }, { "desc": "图标的名称。", "name": "STYLE_ID_ICON" }, { "desc": "图片的名称。", "name": "STYLE_ID_FG_IMAGE" }, { "desc": "图片的显示方式。", "name": "STYLE_ID_FG_IMAGE_DRAW_TYPE" }, { "desc": "间距。", "name": "STYLE_ID_SPACER" }, { "desc": "边距。", "name": "STYLE_ID_MARGIN" }, { "desc": "左边距。", "name": "STYLE_ID_MARGIN_LEFT" }, { "desc": "右边距。", "name": "STYLE_ID_MARGIN_RIGHT" }, { "desc": "顶边距。", "name": "STYLE_ID_MARGIN_TOP" }, { "desc": "底边距。", "name": "STYLE_ID_MARGIN_BOTTOM" }, { "desc": "图标的位置。", "name": "STYLE_ID_ICON_AT" }, { "desc": "Active图标的名称。", "name": "STYLE_ID_ACTIVE_ICON" }, { "desc": "X方向的偏移方便实现按下的效果。", "name": "STYLE_ID_X_OFFSET" }, { "desc": "Y方向的偏移方便实现按下的效果。", "name": "STYLE_ID_Y_OFFSET" }, { "desc": "编辑器中选中区域的背景颜色。", "name": "STYLE_ID_SELECTED_BG_COLOR" }, { "desc": "编辑器中选中区域的前景颜色。", "name": "STYLE_ID_SELECTED_FG_COLOR" }, { "desc": "编辑器中选中区域的文本颜色。", "name": "STYLE_ID_SELECTED_TEXT_COLOR" }, { "desc": "圆角半径(仅在WITH_VGCANVAS定义时生效)。", "name": "STYLE_ID_ROUND_RADIUS" }, { "desc": "左上角圆角半径(仅在WITH_VGCANVAS定义时生效)。", "name": "STYLE_ID_ROUND_RADIUS_TOP_LETF" }, { "desc": "右上角圆角半径(仅在WITH_VGCANVAS定义时生效)。", "name": "STYLE_ID_ROUND_RADIUS_TOP_RIGHT" }, { "desc": "左下角圆角半径(仅在WITH_VGCANVAS定义时生效)。", "name": "STYLE_ID_ROUND_RADIUS_BOTTOM_LETF" }, { "desc": "右下角圆角半径(仅在WITH_VGCANVAS定义时生效)。", "name": "STYLE_ID_ROUND_RADIUS_BOTTOM_RIGHT" }, { "desc": "子控件布局参数。", "name": "STYLE_ID_CHILDREN_LAYOUT" }, { "desc": "控件布局参数。", "name": "STYLE_ID_SELF_LAYOUT" } ], "header": "base/style.h", "name": "style_id_t", "prefix": "STYLE_ID_", "annotation": { "scriptable": true, "string": true }, "level": 1 }, { "type": "class", "methods": [ { "params": [ { "type": "style_t*", "name": "s", "desc": "style对象。" }, { "type": "widget_t*", "name": "widget", "desc": "控件对象。" } ], "annotation": { "scriptable": true }, "desc": "widget状态改变时通知style更新数据。", "name": "style_notify_widget_state_changed", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "style_t*", "name": "s", "desc": "style对象。" } ], "annotation": { "scriptable": true }, "desc": "检查style对象是否有效", "name": "style_is_valid", "return": { "type": "bool_t", "desc": "返回是否有效。" } }, { "params": [ { "type": "style_t*", "name": "s", "desc": "style对象。" }, { "type": "const char*", "name": "name", "desc": "属性名。" }, { "type": "int32_t", "name": "defval", "desc": "缺省值。" } ], "annotation": { "scriptable": true }, "desc": "获取指定name的整数格式的值。", "name": "style_get_int", "return": { "type": "int32_t", "desc": "返回整数格式的值。" } }, { "params": [ { "type": "style_t*", "name": "s", "desc": "style对象。" }, { "type": "const char*", "name": "name", "desc": "属性名。" }, { "type": "color_t", "name": "defval", "desc": "缺省值。" } ], "annotation": {}, "desc": "获取指定name的颜色值。", "name": "style_get_color", "return": { "type": "color_t", "desc": "返回颜色值。" } }, { "params": [ { "type": "style_t*", "name": "s", "desc": "style对象。" }, { "type": "const char*", "name": "name", "desc": "属性名。" }, { "type": "const char*", "name": "defval", "desc": "缺省值。" } ], "annotation": { "scriptable": true }, "desc": "获取指定name的字符串格式的值。", "name": "style_get_str", "return": { "type": "const char*", "desc": "返回字符串格式的值。" } }, { "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": "value", "desc": "值。" } ], "annotation": { "scriptable": true }, "desc": "设置指定状态的指定属性的值(仅仅对mutable的style有效)。", "name": "style_set", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "style_t*", "name": "s", "desc": "style对象。" } ], "annotation": { "scriptable": true }, "desc": "检查style是否是mutable的。", "name": "style_is_mutable", "return": { "type": "bool_t", "desc": "返回TRUE表示是否则表示不是。" } }, { "params": [ { "type": "style_t*", "name": "s", "desc": "style对象。" } ], "annotation": {}, "desc": "销毁style对象", "name": "style_destroy", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "const char*", "name": "name", "desc": "名称。" }, { "type": "const char*", "name": "value", "desc": "值。" }, { "type": "value_t*", "name": "out", "desc": "返回的值。" } ], "annotation": {}, "desc": "对值进行正规化。", "name": "style_normalize_value", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } } ], "events": [], "properties": [], "header": "base/style.h", "desc": "控件风格。\n\nwidget从style对象中获取诸如字体、颜色和图片相关的参数根据这些参数来绘制界面。\n\nc\nstyle_t* style = widget->astyle;\nint32_t margin = style_get_int(style, STYLE_ID_MARGIN, 2);\nint32_t icon_at = style_get_int(style, STYLE_ID_ICON_AT, ICON_AT_AUTO);\nuint16_t font_size = style_get_int(style, STYLE_ID_FONT_SIZE, TK_DEFAULT_FONT_SIZE);\n\n\n属性名称的请参考style\_id", "name": "style_t", "annotation": { "scriptable": true }, "level": 1 }, { "type": "class", "methods": [ { "params": [ { "type": "asset_info_t*", "name": "res", "desc": "数据资源。" } ], "annotation": { "constructor": true }, "desc": "创建联想字对象。", "name": "suggest_words_create", "return": { "type": "suggest_words_t*", "desc": "返回联想字对象。" } }, { "params": [ { "type": "suggest_words_t*", "name": "suggest_words", "desc": "联想字对象。" }, { "type": "wchar_t", "name": "c", "desc": "字符。" } ], "annotation": {}, "desc": "查找prefix对应的联想字列表成功后会更新words/words_nr。", "name": "suggest_words_find", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "suggest_words_t*", "name": "suggest_words", "desc": "联想字对象。" } ], "annotation": {}, "desc": "@deconstructor\n销毁联想字对象。", "name": "suggest_words_destroy", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } } ], "events": [], "properties": [ { "name": "words", "desc": "联想字列表。find函数执行成功后会更新。", "type": "char*", "annotation": { "private": true } }, { "name": "words_nr", "desc": "联想字/词个数。find函数执行成功后会更新。", "type": "uint32_t", "annotation": { "private": true } } ], "header": "base/suggest_words.h", "desc": "输入法联想字词。", "name": "suggest_words_t", "level": 1 }, { "type": "class", "methods": [], "events": [], "properties": [], "header": "base/text_edit.h", "desc": "", "name": "text_edit_state_t", "level": 1 }, { "type": "class", "methods": [ { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件" }, { "type": "boo_t", "name": "single_line", "desc": "是否是单行编辑器。" } ], "annotation": {}, "desc": "创建text_edit对象", "name": "text_edit_create", "return": { "type": "widget_t*", "desc": "对象。" } }, { "params": [ { "type": "text_edit_t*", "name": "text_edit", "desc": "text_edit对象。" }, { "type": "canvas_t*", "name": "c", "desc": "canvas对象。" } ], "annotation": {}, "desc": "设置canvas对象。", "name": "text_edit_set_canvas", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "text_edit_t*", "name": "text_edit", "desc": "text_edit对象。" }, { "type": "xy_t", "name": "x", "desc": "x坐标。" }, { "type": "xy_t", "name": "y", "desc": "y坐标。" } ], "annotation": {}, "desc": "处理点击事件。", "name": "text_edit_click", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "text_edit_t*", "name": "text_edit", "desc": "text_edit对象。" }, { "type": "xy_t", "name": "x", "desc": "x坐标。" }, { "type": "xy_t", "name": "y", "desc": "y坐标。" } ], "annotation": {}, "desc": "处理拖动事件。", "name": "text_edit_drag", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "text_edit_t*", "name": "text_edit", "desc": "text_edit对象。" }, { "type": "const wchar_t*", "name": "str", "desc": "文本。" }, { "type": "uint32_t", "name": "size", "desc": "文本长度。" } ], "annotation": {}, "desc": "粘贴文本。", "name": "text_edit_paste", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "text_edit_t*", "name": "text_edit", "desc": "text_edit对象。" } ], "annotation": {}, "desc": "剪切文本。", "name": "text_edit_cut", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "text_edit_t*", "name": "text_edit", "desc": "text_edit对象。" } ], "annotation": {}, "desc": "拷贝文本。", "name": "text_edit_copy", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "text_edit_t*", "name": "text_edit", "desc": "text_edit对象。" }, { "type": "key_event_t*", "name": "evt", "desc": "event" } ], "annotation": {}, "desc": "处理按键事件。", "name": "text_edit_key_down", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "text_edit_t*", "name": "text_edit", "desc": "text_edit对象。" }, { "type": "key_event_t*", "name": "evt", "desc": "event" } ], "annotation": {}, "desc": "处理按键事件。", "name": "text_edit_key_up", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "text_edit_t*", "name": "text_edit", "desc": "text_edit对象。" }, { "type": "uint32_t", "name": "start", "desc": "起始偏移。" }, { "type": "uint32_t", "name": "end", "desc": "结束偏移。" } ], "annotation": {}, "desc": "选择指定范围的文本。", "name": "text_edit_set_select", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "text_edit_t*", "name": "text_edit", "desc": "text_edit对象。" } ], "annotation": {}, "desc": "全选。", "name": "text_edit_select_all", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "text_edit_t*", "name": "text_edit", "desc": "text_edit对象。" } ], "annotation": {}, "desc": "取消选择。", "name": "text_edit_unselect", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "text_edit_t*", "name": "text_edit", "desc": "text_edit对象。" }, { "type": "uint32_t", "name": "cursor", "desc": "光标偏移。" } ], "annotation": {}, "desc": "设置光标位置。", "name": "text_edit_set_cursor", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "text_edit_t*", "name": "text_edit", "desc": "text_edit对象。" } ], "annotation": {}, "desc": "获取光标位置。", "name": "text_edit_get_cursor", "return": { "type": "uin32_t", "desc": "返回光标的位置。" } }, { "params": [ { "type": "text_edit_t*", "name": "text_edit", "desc": "text_edit对象。" }, { "type": "text_edit_state_t*", "name": "state", "desc": "状态。" } ], "annotation": {}, "desc": "获取编辑器的状态。", "name": "text_edit_get_state", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "text_edit_t*", "name": "text_edit", "desc": "text_edit对象。" }, { "type": "bool_t", "name": "wrap_word", "desc": "是否自动折行。" } ], "annotation": {}, "desc": "设置是否自动折行。", "name": "text_edit_set_wrap_word", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "text_edit_t*", "name": "text_edit", "desc": "text_edit对象。" } ], "annotation": {}, "desc": "如果caret可见将其设置为不可见。 如果caret不可见将其设置为可见。", "name": "text_edit_invert_caret_visible", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "text_edit_t*", "name": "text_edit", "desc": "text_edit对象。" }, { "type": "bool_t", "name": "caret_visible", "desc": "是否可见。" } ], "annotation": {}, "desc": "设置光标的看见性。", "name": "text_edit_set_caret_visible", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "text_edit_t*", "name": "text_edit", "desc": "text_edit对象。" }, { "type": "uint32_t", "name": "max_rows", "desc": "最大行数。" } ], "annotation": {}, "desc": "设置最大行数。", "name": "text_edit_set_max_rows", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "text_edit_t*", "name": "text_edit", "desc": "text_edit对象。" }, { "type": "bool_t", "name": "mask", "desc": "是否马赛克字符。" } ], "annotation": {}, "desc": "设置是否马赛克字符(用于密码)。", "name": "text_edit_set_mask", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "text_edit_t*", "name": "text_edit", "desc": "text_edit对象。" }, { "type": "const char*", "name": "tips", "desc": "提示信息。" } ], "annotation": {}, "desc": "设置提示信息。", "name": "text_edit_set_tips", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "text_edit_t*", "name": "text_edit", "desc": "text_edit对象。" }, { "type": "wchar_t", "name": "mask_char", "desc": "马赛克字符。" } ], "annotation": {}, "desc": "设置马赛克字符。", "name": "text_edit_set_mask_char", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "text_edit_t*", "name": "text_edit", "desc": "text_edit对象。" }, { "type": "canvas_t*", "name": "c", "desc": "canvas对象。" } ], "annotation": {}, "desc": "绘制文本。", "name": "text_edit_paint", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "text_edit_t*", "name": "text_edit", "desc": "text_edit对象。" } ], "annotation": {}, "desc": "重新排版。", "name": "text_edit_layout", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "text_edit_t*", "name": "text_edit", "desc": "text_edit对象。" }, { "type": "int32_t", "name": "ox", "desc": "x偏移量。" }, { "type": "int32_t", "name": "oy", "desc": "y偏移量。" } ], "annotation": {}, "desc": "设置滚动偏移。", "name": "text_edit_set_offset", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "text_edit_t*", "name": "text_edit", "desc": "text_edit对象。" }, { "type": "text_edit_on_state_changed_t", "name": "on_state_changed", "desc": "回调函数。" }, { "type": "void*", "name": "ctx", "desc": "回调函数上下文。" } ], "annotation": {}, "desc": "设置状态改变回调函数。", "name": "text_edit_set_on_state_changed", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "text_edit_t*", "name": "text_edit", "desc": "text_edit对象。" } ], "annotation": {}, "desc": "销毁text_edit对象。", "name": "text_edit_destroy", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "text_edit_t*", "name": "text_edit", "desc": "text_edit对象。" } ], "annotation": {}, "desc": "清除预编辑文本。", "name": "text_edit_preedit_clear", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "text_edit_t*", "name": "text_edit", "desc": "text_edit对象。" } ], "annotation": {}, "desc": "进入预编辑状态。", "name": "text_edit_preedit", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "text_edit_t*", "name": "text_edit", "desc": "text_edit对象。" } ], "annotation": {}, "desc": "提交预编辑的文本,并退出预编辑状态。", "name": "text_edit_preedit_confirm", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "text_edit_t*", "name": "text_edit", "desc": "text_edit对象。" } ], "annotation": {}, "desc": "取消预编辑的文本,并退出预编辑状态。", "name": "text_edit_preedit_abort", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } } ], "events": [], "properties": [], "header": "base/text_edit.h", "desc": "", "name": "text_edit_t", "level": 1 }, { "type": "class", "methods": [ { "params": [], "annotation": { "constructor": true, "scriptable": true }, "desc": "获取缺省的主题对象。", "name": "theme", "alias": "theme_instance", "return": { "type": "theme_t*", "desc": "返回主题对象。" } }, { "params": [ { "type": "theme_t*", "name": "theme", "desc": "主题对象。" } ], "annotation": {}, "desc": "设置缺省的主题对象。", "name": "theme_set", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "const uint8_t*", "name": "data", "desc": "主题数据。" } ], "annotation": { "constructor": true }, "desc": "创建主题对象。", "name": "theme_create", "return": { "type": "theme_t*", "desc": "返回主题对象。" } }, { "params": [ { "type": "theme_t*", "name": "theme", "desc": "主题对象。" }, { "type": "const uint8_t*", "name": "data", "desc": "主题数据。" } ], "annotation": { "constructor": true }, "desc": "初始化主题对象。", "name": "theme_init", "return": { "type": "theme_t*", "desc": "返回主题对象。" } }, { "params": [ { "type": "theme_t*", "name": "data", "desc": "主题对象。" }, { "type": "const char*", "name": "widget_type", "desc": "控件的类型名。" }, { "type": "const char*", "name": "name", "desc": "style的名称。" }, { "type": "const char*", "name": "widget_state", "desc": "控件的状态。" } ], "annotation": {}, "desc": "查找满足条件的style。", "name": "theme_find_style", "return": { "type": "theme_t*", "desc": "返回主题对象。" } }, { "params": [ { "type": "theme_t*", "name": "theme", "desc": "主题对象。" } ], "annotation": {}, "desc": "析构主题对象。", "name": "theme_deinit", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "theme_t*", "name": "theme", "desc": "主题对象。" } ], "annotation": {}, "desc": "析构并释放主题对象。", "name": "theme_destroy", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } } ], "events": [], "properties": [], "header": "base/theme.h", "desc": "主题。\n\n负责管理缺省的主题数据方便实现style\const。", "name": "theme_t", "annotation": { "scriptable": true }, "level": 1 }, { "type": "class", "methods": [ { "params": [ { "type": "timer_func_t", "name": "on_timer", "desc": "timer回调函数。" }, { "type": "void*", "name": "ctx", "desc": "timer回调函数的上下文。" }, { "type": "uint32_t", "name": "duration", "desc": "时间。" } ], "annotation": { "scriptable": "custom", "static": true }, "desc": "增加一个timer。", "name": "timer_add", "return": { "type": "uint32_t", "desc": "返回timer的IDTK_INVALID_ID表示失败。" } }, { "params": [ { "type": "timer_func_t", "name": "", "desc": "r" }, { "type": "void*", "name": "ctx", "desc": "timer回调函数的上下文。" }, { "type": "uint32_t", "name": "duration", "desc": "时间。" } ], "annotation": { "static": true }, "desc": "用于非GUI线程增加一个timer本函数向主循环的事件队列中发送一个增加timer的请求。\ntimer回调函数回调函数返回RET_REPEAT则下次继续执行否则自动移出。", "name": "timer_queue", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "uint32_t", "name": "timer_id", "desc": "timerID。" } ], "annotation": { "scriptable": true, "static": true }, "desc": "删除指定的timer。", "name": "timer_remove", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "uint32_t", "name": "timer_id", "desc": "timerID。" } ], "annotation": { "scriptable": true, "static": true }, "desc": "重置指定的timer重置之后定时器重新开始计时。", "name": "timer_reset", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "uint32_t", "name": "timer_id", "desc": "timerID。" } ], "annotation": { "scriptable": true, "static": true }, "desc": "挂起指定的timer一般用于不断循环触发的计时器。", "name": "timer_suspend", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "uint32_t", "name": "timer_id", "desc": "timerID。" } ], "annotation": { "scriptable": true, "static": true }, "desc": "唤醒挂起指定的timer并且重置定时器重新开始计时", "name": "timer_resume", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "uint32_t", "name": "timer_id", "desc": "timerID。" }, { "type": "uint32_t", "name": "duration", "desc": "新的时间。" } ], "annotation": { "scriptable": true, "static": true }, "desc": "修改指定的timer的duration修改之后定时器重新开始计时。", "name": "timer_modify", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "uint32_t", "name": "timer_id", "desc": "timerID。" }, { "type": "tk_destroy_t", "name": "on_destroy", "desc": "回调函数。" }, { "type": "void*", "name": "on_destroy_ctx", "desc": "回调函数上下文。" } ], "annotation": {}, "desc": "设置一个回调函数在timer被销毁时调用(方便脚本语言去释放回调函数)。", "name": "timer_set_on_destroy", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [], "annotation": { "static": true }, "desc": "返回timer的个数。", "name": "timer_count", "return": { "type": "uint32_t", "desc": "返回timer的个数。" } }, { "params": [], "annotation": { "static": true }, "desc": "返回最近的timer到期时间。", "name": "timer_next_time", "return": { "type": "uint32_t", "desc": "返回最近的timer到期时间。" } } ], "events": [], "properties": [], "header": "base/timer.h", "desc": "定时器系统。\n\n> 本定时器精度较低最高精度为1000/FPS如果需要高精度的定时器请用OS提供的定时器。\n\n示例\n\nc\nstatic ret_t my_on_timer(const timer_info_t* info) {\nwidget_t* widget = WIDGET(info->ctx);\n...\nreturn RET_REPEAT;\n}\n\n...\n\ntimer_add(my_on_timer, widget, 1000);\n\n> 在非GUI线程请用timer\queue。", "name": "timer_t", "annotation": { "scriptable": true, "fake": true }, "level": 1 }, { "type": "enum", "desc": "LCD旋转角度。", "consts": [ { "desc": "LCD没有旋转。", "name": "LCD_ORIENTATION_0" }, { "desc": "LCD旋转90度。", "name": "LCD_ORIENTATION_90" }, { "desc": "LCD旋转180度。", "name": "LCD_ORIENTATION_180" }, { "desc": "LCD旋转270度。", "name": "LCD_ORIENTATION_270" } ], "header": "base/types_def.h", "name": "lcd_orientation_t", "prefix": "LCD_ORIENTATION", "level": 1 }, { "type": "enum", "desc": "垂直对齐的常量定义。", "consts": [ { "desc": "无效对齐方式。", "name": "ALIGN_V_NONE" }, { "desc": "居中对齐。", "name": "ALIGN_V_MIDDLE" }, { "desc": "顶部对齐。", "name": "ALIGN_V_TOP" }, { "desc": "底部对齐。", "name": "ALIGN_V_BOTTOM" } ], "header": "base/types_def.h", "name": "align_v_t", "prefix": "ALIGN_V", "annotation": { "scriptable": true }, "level": 1 }, { "type": "enum", "desc": "水平对齐的常量定义。", "consts": [ { "desc": "无效对齐方式。", "name": "ALIGN_H_NONE" }, { "desc": "居中对齐。", "name": "ALIGN_H_CENTER" }, { "desc": "左边对齐。", "name": "ALIGN_H_LEFT" }, { "desc": "右边对齐。", "name": "ALIGN_H_RIGHT" } ], "header": "base/types_def.h", "name": "align_h_t", "prefix": "ALIGN_H_", "annotation": { "scriptable": true }, "level": 1 }, { "type": "enum", "desc": "控件边框类型。", "consts": [ { "desc": "无边框。", "name": "BORDER_NONE" }, { "desc": "左边框线。", "name": "BORDER_LEFT" }, { "desc": "右边框线。", "name": "BORDER_RIGHT" }, { "desc": "上边框线。", "name": "BORDER_TOP" }, { "desc": "下边框线。", "name": "BORDER_BOTTOM" }, { "desc": "全边框线。", "name": "BORDER_ALL" } ], "header": "base/types_def.h", "name": "border_type_t", "prefix": "BORDER_TYPE_", "level": 1 }, { "type": "enum", "desc": "图标所在的位置。", "consts": [ { "desc": "自动选择位置。", "name": "ICON_AT_AUTO" }, { "desc": "水平左边,垂直居中。", "name": "ICON_AT_LEFT" }, { "desc": "水平右边,垂直居中(not used now)。", "name": "ICON_AT_RIGHT" }, { "desc": "水平居中,垂直顶部(not used now)。", "name": "ICON_AT_TOP" }, { "desc": "水平居中,垂直低部(not used now)。", "name": "ICON_AT_BOTTOM" }, { "desc": "水平居中,垂直居中。", "name": "ICON_AT_CENTRE" }, { "desc": "水平居中,垂直居中。", "name": "ICON_AT_CENTER" } ], "header": "base/types_def.h", "name": "icon_at_type_t", "prefix": "ICON_AT", "level": 1 }, { "type": "enum", "desc": "应用程序类型。", "consts": [ { "desc": "嵌入式或移动APP", "name": "APP_MOBILE" }, { "desc": "模拟器。", "name": "APP_SIMULATOR" }, { "desc": "桌面应用程序。", "name": "APP_DESKTOP" } ], "header": "base/types_def.h", "name": "app_type_t", "prefix": "APP_", "annotation": { "scriptable": true }, "level": 1 }, { "type": "enum", "desc": "位图格式常量定义。", "consts": [ { "desc": "无效格式。", "name": "BITMAP_FMT_NONE" }, { "desc": "一个像素占用4个字节RGBA占一个字节按内存地址递增。", "name": "BITMAP_FMT_RGBA8888" }, { "desc": "一个像素占用4个字节ABGR占一个字节按内存地址递增。", "name": "BITMAP_FMT_ABGR8888" }, { "desc": "一个像素占用4个字节BGRA占一个字节按内存地址递增。", "name": "BITMAP_FMT_BGRA8888" }, { "desc": "一个像素占用4个字节ARGB占一个字节按内存地址递增。", "name": "BITMAP_FMT_ARGB8888" }, { "desc": "一个像素占用2个字节RGB分别占用5,6,5位, 按内存地址递增。", "name": "BITMAP_FMT_RGB565" }, { "desc": "一个像素占用2个字节BGR分别占用5,6,5位, 按内存地址递增。", "name": "BITMAP_FMT_BGR565" }, { "desc": "一个像素占用3个字节RGB占一个字节按内存地址递增。", "name": "BITMAP_FMT_RGB888" }, { "desc": "一个像素占用3个字节RGB占一个字节按内存地址递增。", "name": "BITMAP_FMT_BGR888" }, { "desc": "一个像素占用1个字节。", "name": "BITMAP_FMT_GRAY" }, { "desc": "一个像素占用1比特。", "name": "BITMAP_FMT_MONO" } ], "header": "base/types_def.h", "name": "bitmap_format_t", "prefix": "BITMAP_FMT_", "annotation": { "scriptable": true }, "level": 1 }, { "type": "enum", "desc": "位图标志常量定义。", "consts": [ { "desc": "无特殊标志。", "name": "BITMAP_FLAG_NONE" }, { "desc": "不透明图片。", "name": "BITMAP_FLAG_OPAQUE" }, { "desc": "图片内容不会变化。", "name": "BITMAP_FLAG_IMMUTABLE" }, { "desc": "OpenGL Texture, bitmap的id是有效的texture id。", "name": "BITMAP_FLAG_TEXTURE" }, { "desc": "如果是MUTABLE的图片更新时需要设置此标志底层可能会做特殊处理比如更新图片到GPU。", "name": "BITMAP_FLAG_CHANGED" }, { "desc": "预乘alpha。", "name": "BITMAP_FLAG_PREMULTI_ALPHA" } ], "header": "base/types_def.h", "name": "bitmap_flag_t", "prefix": "BITMAP_FLAG_", "annotation": { "scriptable": true }, "level": 1 }, { "type": "class", "methods": [ { "params": [ { "type": "ui_builder_t*", "name": "builder", "desc": "builder对象。" }, { "type": "const widget_desc_t*", "name": "desc", "desc": "widget描述信息。" } ], "annotation": {}, "desc": "ui\_loader在解析到widget时调用本函数进一步处理。", "name": "ui_builder_on_widget_start", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "ui_builder_t*", "name": "builder", "desc": "builder对象。" }, { "type": "const char*", "name": "name", "desc": "属性名。" }, { "type": "const char*", "name": "value", "desc": "属性值。" } ], "annotation": {}, "desc": "ui\_loader在解析到widget的属性时调用本函数进一步处理。", "name": "ui_builder_on_widget_prop", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "ui_builder_t*", "name": "builder", "desc": "builder对象。" } ], "annotation": {}, "desc": "ui\_loader在解析到widget全部属性结束时调用本函数进一步处理。", "name": "ui_builder_on_widget_prop_end", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "ui_builder_t*", "name": "builder", "desc": "builder对象。" } ], "annotation": {}, "desc": "ui\_loader在解析到widget结束时调用本函数进一步处理。", "name": "ui_builder_on_widget_end", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "ui_builder_t*", "name": "builder", "desc": "builder对象。" } ], "annotation": {}, "desc": "ui\_loader在解析开始时调用本函数做些准备工作。", "name": "ui_builder_on_start", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "ui_builder_t*", "name": "builder", "desc": "builder对象。" } ], "annotation": {}, "desc": "ui\_loader在解析结束时调用本函数做些收尾工作。", "name": "ui_builder_on_end", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } } ], "events": [], "properties": [], "header": "base/ui_builder.h", "desc": "界面构造器接口。\n\n负责把ui\_loader解析的数据进一步处理至于具体做什么由具体实现决定。常见的实现有\n\n* 构建widget对象树。\n\n* 生成二进制的UI描述数据。\n\n* 生成XML格式的UI描述数据。\n\ngraphviz\n[default_style]\n\nui_builder_defualt_t -> ui_builder_t[arrowhead = \"empty\"]\nui_xml_writer_t -> ui_builder_t[arrowhead = \"empty\"]\nui_binary_writer_t -> ui_builder_t[arrowhead = \"empty\"]\n", "name": "ui_builder_t", "level": 1 }, { "type": "class", "methods": [ { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "event_t*", "name": "evt", "desc": "event对象。" } ], "annotation": { "static": true }, "desc": "请求反馈。", "name": "ui_feedback_request", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "ui_on_feedback_t", "name": "on_feedback", "desc": "实际的处理函数。" }, { "type": "void*", "name": "ctx", "desc": "回调函数的上下文。" } ], "annotation": { "static": true }, "desc": "初始化。\n设置实际的处理函数。", "name": "ui_feedback_init", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } } ], "events": [], "properties": [], "header": "base/ui_feedback.h", "desc": "提供按键音、触屏音和震动等反馈。", "name": "ui_feedback_t", "annotation": { "fake": true }, "level": 1 }, { "type": "class", "methods": [ { "params": [ { "type": "ui_loader_t*", "name": "loader", "desc": "loader对象。" }, { "type": "const uint8_t*", "name": "data", "desc": "数据。" }, { "type": "uint32_t", "name": "size", "desc": "数据长度。" }, { "type": "ui_builder_t*", "name": "builder", "desc": "负责进一步处理比如构建UI界面。" } ], "annotation": {}, "desc": "加载界面描述数据然后分发给ui\builder由ui\builder进一步处理。", "name": "ui_loader_load", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "const char*", "name": "name", "desc": "资源名。" } ], "annotation": {}, "desc": "从指定的资源加载widget对象通常用于加载非窗口的widget。\n\n>需要自己将widget加入窗口后再调用widget\layout。", "name": "ui_loader_load_widget", "return": { "type": "widget_t*", "desc": "返回widget对象。" } } ], "events": [], "properties": [], "header": "base/ui_loader.h", "desc": "UI加载器。\n\n负责从资源加载界面描述数据然后分发给ui\builder由ui\builder进一步处理。\n\n常见的实现有两种\n\n* XML格式的加载器。\n\n* 二进制格式的加载器。\n\ngraphviz\n[default_style]\n\nui_loader_defualt_t -> ui_loader_t[arrowhead = \"empty\"]\nui_loader_xml_t -> ui_loader_t[arrowhead = \"empty\"]\n\n", "name": "ui_loader_t", "level": 1 }, { "type": "class", "methods": [ { "params": [ { "type": "velocity_t*", "name": "v", "desc": "velocity对象。" } ], "annotation": {}, "desc": "重置状态。", "name": "velocity_reset", "return": { "type": "velocity_t*", "desc": "返回velocity对象。" } }, { "params": [ { "type": "velocity_t*", "name": "v", "desc": "velocity对象。" }, { "type": "uint32_t", "name": "time", "desc": "时间。" }, { "type": "xy_t", "name": "x", "desc": "x坐标。" }, { "type": "xy_t", "name": "y", "desc": "y坐标。" } ], "annotation": {}, "desc": "更新位置。", "name": "velocity_update", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } } ], "events": [], "properties": [], "header": "base/velocity.h", "desc": "velocity。", "name": "velocity_t", "level": 1 }, { "type": "class", "methods": [ { "params": [ { "type": "uint32_t", "name": "w", "desc": "宽度" }, { "type": "uint32_t", "name": "h", "desc": "高度" }, { "type": "uint32_t", "name": "stride", "desc": "一行占用的字节数。" }, { "type": "bitmap_format_t", "name": "format", "desc": "如果data是framebufferformat指定data的格式。" }, { "type": "void*", "name": "data", "desc": "framebuffer或其它ctx。" } ], "annotation": { "constructor": true }, "desc": "创建vgcanvas。", "name": "vgcanvas_create", "return": { "type": "vgcanvas_t*", "desc": "返回vgcanvas对象。" } }, { "params": [ { "type": "vgcanvas_t*", "name": "vg", "desc": "vgcanvas对象。" } ], "annotation": { "cast": true, "scriptable": true }, "desc": "转换为vgcanvas对象(供脚本语言使用)。", "name": "vgcanvas_cast", "return": { "type": "vgcanvas_t*", "desc": "vgcanvas对象。" } }, { "params": [ { "type": "vgcanvas_t*", "name": "vg", "desc": "vgcanvas对象。" }, { "type": "uint32_t", "name": "w", "desc": "宽度" }, { "type": "uint32_t", "name": "h", "desc": "高度" }, { "type": "uint32_t", "name": "stride", "desc": "一行占用的字节数。" }, { "type": "bitmap_format_t", "name": "format", "desc": "如果data是framebufferformat指定data的格式。" }, { "type": "void*", "name": "data", "desc": "framebuffer或其它ctx。" } ], "annotation": {}, "desc": "重新初始化,系统内部调用。", "name": "vgcanvas_reinit", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "vgcanvas_t*", "name": "vg", "desc": "vgcanvas对象。" } ], "annotation": {}, "desc": "重置所有状态。", "name": "vgcanvas_reset", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "vgcanvas_t*", "name": "vg", "desc": "vgcanvas对象。" } ], "annotation": {}, "desc": "重置当前状态。", "name": "vgcanvas_reset_curr_state", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "vgcanvas_t*", "name": "vg", "desc": "vgcanvas对象。" } ], "annotation": { "scriptable": true }, "desc": "flush", "name": "vgcanvas_flush", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "vgcanvas_t*", "name": "vg", "desc": "vgcanvas对象。" }, { "type": "const rect_t*", "name": "dirty_rect", "desc": "需要绘制的区域。" } ], "annotation": {}, "desc": "开始绘制,系统内部调用。", "name": "vgcanvas_begin_frame", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "vgcanvas_t*", "name": "vg", "desc": "vgcanvas对象。" }, { "type": "float_t", "name": "x", "desc": "x坐标。" }, { "type": "float_t", "name": "y", "desc": "y坐标。" }, { "type": "float_t", "name": "w", "desc": "宽度。" }, { "type": "float_t", "name": "h", "desc": "高度。" }, { "type": "color_t", "name": "c", "desc": "颜色。" } ], "annotation": {}, "desc": "用颜色清除指定矩形区域。", "name": "vgcanvas_clear_rect", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "vgcanvas_t*", "name": "vg", "desc": "vgcanvas对象。" } ], "annotation": { "scriptable": true }, "desc": "清除之前的路径,并重新开始一条路径。", "name": "vgcanvas_begin_path", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "vgcanvas_t*", "name": "vg", "desc": "vgcanvas对象。" }, { "type": "float_t", "name": "x", "desc": "x坐标。" }, { "type": "float_t", "name": "y", "desc": "y坐标。" } ], "annotation": { "scriptable": true }, "desc": "移动当前点到指定点。", "name": "vgcanvas_move_to", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "vgcanvas_t*", "name": "vg", "desc": "vgcanvas对象。" }, { "type": "float_t", "name": "x", "desc": "x坐标。" }, { "type": "float_t", "name": "y", "desc": "y坐标。" } ], "annotation": { "scriptable": true }, "desc": "生成一条线段(从当前点到目标点)。", "name": "vgcanvas_line_to", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "vgcanvas_t*", "name": "vg", "desc": "vgcanvas对象。" }, { "type": "float_t", "name": "cpx", "desc": "控制点x坐标。" }, { "type": "float_t", "name": "cpy", "desc": "控制点y坐标。" }, { "type": "float_t", "name": "x", "desc": "x坐标。" }, { "type": "float_t", "name": "y", "desc": "y坐标。" } ], "annotation": { "scriptable": true }, "desc": "生成一条二次贝塞尔曲线。", "name": "vgcanvas_quad_to", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "vgcanvas_t*", "name": "vg", "desc": "vgcanvas对象。" }, { "type": "float_t", "name": "cp1x", "desc": "控制点1x坐标。" }, { "type": "float_t", "name": "cp1y", "desc": "控制点1y坐标。" }, { "type": "float_t", "name": "cp2x", "desc": "控制点2x坐标。" }, { "type": "float_t", "name": "cp2y", "desc": "控制点3y坐标。" }, { "type": "float_t", "name": "x", "desc": "x坐标。" }, { "type": "float_t", "name": "y", "desc": "y坐标。" } ], "annotation": { "scriptable": true }, "desc": "生成一条三次贝塞尔曲线。", "name": "vgcanvas_bezier_to", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "vgcanvas_t*", "name": "vg", "desc": "vgcanvas对象。" }, { "type": "float_t", "name": "x1", "desc": "起始点x坐标。" }, { "type": "float_t", "name": "y1", "desc": "起始点y坐标。" }, { "type": "float_t", "name": "x2", "desc": "结束点x坐标。" }, { "type": "float_t", "name": "y2", "desc": "结束点y坐标。" }, { "type": "float_t", "name": "r", "desc": "半径。" } ], "annotation": { "scriptable": true }, "desc": "生成一条圆弧路径到指定点。", "name": "vgcanvas_arc_to", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "vgcanvas_t*", "name": "vg", "desc": "vgcanvas对象。" }, { "type": "float_t", "name": "x", "desc": "原点x坐标。" }, { "type": "float_t", "name": "y", "desc": "原点y坐标。" }, { "type": "float_t", "name": "r", "desc": "半径。" }, { "type": "float_t", "name": "start_angle", "desc": "起始角度。" }, { "type": "float_t", "name": "end_angle", "desc": "结束角度。" }, { "type": "bool_t", "name": "ccw", "desc": "是否逆时针。" } ], "annotation": { "scriptable": true }, "desc": "生成一条圆弧。", "name": "vgcanvas_arc", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "vgcanvas_t*", "name": "vg", "desc": "vgcanvas对象。" }, { "type": "float_t", "name": "x", "desc": "x坐标。" }, { "type": "float_t", "name": "y", "desc": "y坐标。" } ], "annotation": { "scriptable": true }, "desc": "检查点是否在当前路径中。", "name": "vgcanvas_is_point_in_path", "return": { "type": "bool_t", "desc": "返回TRUE表示在否则表示不在。" } }, { "params": [ { "type": "vgcanvas_t*", "name": "vg", "desc": "vgcanvas对象。" }, { "type": "float_t", "name": "x", "desc": "x坐标。" }, { "type": "float_t", "name": "y", "desc": "y坐标。" }, { "type": "float_t", "name": "w", "desc": "宽度。" }, { "type": "float_t", "name": "h", "desc": "高度。" } ], "annotation": { "scriptable": true }, "desc": "生成一个矩形路径。", "name": "vgcanvas_rect", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "vgcanvas_t*", "name": "vg", "desc": "vgcanvas对象。" }, { "type": "float_t", "name": "x", "desc": "x坐标。" }, { "type": "float_t", "name": "y", "desc": "y坐标。" }, { "type": "float_t", "name": "w", "desc": "宽度。" }, { "type": "float_t", "name": "h", "desc": "高度。" }, { "type": "float_t", "name": "r", "desc": "圆角半径。" } ], "annotation": { "scriptable": true }, "desc": "生成一个圆角矩形路径。", "name": "vgcanvas_rounded_rect", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "vgcanvas_t*", "name": "vg", "desc": "vgcanvas对象。" }, { "type": "float_t", "name": "x", "desc": "x坐标。" }, { "type": "float_t", "name": "y", "desc": "y坐标。" }, { "type": "float_t", "name": "rx", "desc": "圆角半径。" }, { "type": "float_t", "name": "ry", "desc": "圆角半径。" } ], "annotation": { "scriptable": true }, "desc": "生成一个椭圆路径。", "name": "vgcanvas_ellipse", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "vgcanvas_t*", "name": "vg", "desc": "vgcanvas对象。" } ], "annotation": { "scriptable": true }, "desc": "闭合路径。\n\n>闭合路径是指把起点和终点连接起来,形成一个封闭的多边形。", "name": "vgcanvas_close_path", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "vgcanvas_t*", "name": "vg", "desc": "vgcanvas对象。" }, { "type": "bool_t", "name": "dir", "desc": "填充方法。" } ], "annotation": { "scriptable": true }, "desc": "设置路径填充实心与否。\n\n>CCW(1)为实心CW(2)为镂空,设置其他则默认根据非零环绕规则判断(nonzero)。", "name": "vgcanvas_path_winding", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "vgcanvas_t*", "name": "vg", "desc": "vgcanvas对象。" }, { "type": "float_t", "name": "rad", "desc": "角度" } ], "annotation": { "scriptable": true }, "desc": "旋转。", "name": "vgcanvas_rotate", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "vgcanvas_t*", "name": "vg", "desc": "vgcanvas对象。" }, { "type": "float_t", "name": "x", "desc": "x方向缩放比例。" }, { "type": "float_t", "name": "y", "desc": "y方向缩放比例。" } ], "annotation": { "scriptable": true }, "desc": "缩放。", "name": "vgcanvas_scale", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "vgcanvas_t*", "name": "vg", "desc": "vgcanvas对象。" }, { "type": "float_t", "name": "x", "desc": "x方向偏移。" }, { "type": "float_t", "name": "y", "desc": "y方向偏移。" } ], "annotation": { "scriptable": true }, "desc": "平移。", "name": "vgcanvas_translate", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "vgcanvas_t*", "name": "vg", "desc": "vgcanvas对象。" }, { "type": "float_t", "name": "a", "desc": "a" }, { "type": "float_t", "name": "b", "desc": "b" }, { "type": "float_t", "name": "c", "desc": "c" }, { "type": "float_t", "name": "d", "desc": "d" }, { "type": "float_t", "name": "e", "desc": "e" }, { "type": "float_t", "name": "f", "desc": "f" } ], "annotation": { "scriptable": true }, "desc": "变换矩阵。", "name": "vgcanvas_transform", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "vgcanvas_t*", "name": "vg", "desc": "vgcanvas对象。" }, { "type": "float_t", "name": "a", "desc": "a" }, { "type": "float_t", "name": "b", "desc": "b" }, { "type": "float_t", "name": "c", "desc": "c" }, { "type": "float_t", "name": "d", "desc": "d" }, { "type": "float_t", "name": "e", "desc": "e" }, { "type": "float_t", "name": "f", "desc": "f" } ], "annotation": { "scriptable": true }, "desc": "设置变换矩阵。", "name": "vgcanvas_set_transform", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "vgcanvas_t*", "name": "vg", "desc": "vgcanvas对象。" }, { "type": "float_t", "name": "x", "desc": "x坐标。" }, { "type": "float_t", "name": "y", "desc": "y坐标。" }, { "type": "float_t", "name": "w", "desc": "宽度。" }, { "type": "float_t", "name": "h", "desc": "高度。" } ], "annotation": { "scriptable": true }, "desc": "矩形裁剪。", "name": "vgcanvas_clip_rect", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "vgcanvas_t*", "name": "vg", "desc": "vgcanvas对象。" }, { "type": "float_t", "name": "x", "desc": "x坐标。" }, { "type": "float_t", "name": "y", "desc": "y坐标。" }, { "type": "float_t", "name": "w", "desc": "宽度。" }, { "type": "float_t", "name": "h", "desc": "高度。" } ], "annotation": { "scriptable": true }, "desc": "设置一个与前一个裁剪区做交集的矩形裁剪区。\n如果下面这种情况则不能直接调用 rect_intersect 函数来做矩形交集和 vgcanvas_clip_rect 函数设置裁剪区,而采用本函数做交集。\n由于缩放和旋转以及平移会导致 vg 的坐标系和上一个裁剪区的坐标系不同,\n导致直接使用做交集的话裁剪区会出错。\n\n\nvgcanvas_clip_rect(vg, old_r.x, old_r.y, old_r.w, old_r.h);\nvgcanvas_save(vg);\nvgcanvas_scale(vg, scale_x, scale_y);\nvgcanvas_rotate(vg, TK_D2R(15));\nvgcanvas_intersect_clip_rect(vg, r.x, r.y, r.w, r.h);\n..................\nvgcanvas_restore(vg);\n", "name": "vgcanvas_intersect_clip_rect", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "vgcanvas_t*", "name": "vg", "desc": "vgcanvas对象。" } ], "annotation": { "scriptable": true }, "desc": "填充多边形。", "name": "vgcanvas_fill", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "vgcanvas_t*", "name": "vg", "desc": "vgcanvas对象。" } ], "annotation": { "scriptable": true }, "desc": "画线。", "name": "vgcanvas_stroke", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "vgcanvas_t*", "name": "vg", "desc": "vgcanvas对象。" }, { "type": "bool_t", "name": "stroke", "desc": "TRUE表示画线FALSE表示填充。" }, { "type": "bitmap_t*", "name": "img", "desc": "图片。" } ], "annotation": { "scriptable": true }, "desc": "用图片填充/画多边形(可能存在可移植性问题,除非必要请勿使用)。\n多边形的顶点必须在图片范围内可以通过矩阵变化画到不同的位置。", "name": "vgcanvas_paint", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "vgcanvas_t*", "name": "vg", "desc": "vgcanvas对象。" }, { "type": "char*", "name": "font", "desc": "字体名称。" } ], "annotation": { "scriptable": true }, "desc": "设置字体的名称。", "name": "vgcanvas_set_font", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "vgcanvas_t*", "name": "vg", "desc": "vgcanvas对象。" }, { "type": "float_t", "name": "font", "desc": "字体大小。" } ], "annotation": { "scriptable": true }, "desc": "设置字体的大小。", "name": "vgcanvas_set_font_size", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "vgcanvas_t*", "name": "vg", "desc": "vgcanvas对象。" }, { "type": "char*", "name": "value", "desc": "取值left|center|right必须为常量字符串。" } ], "annotation": { "scriptable": true }, "desc": "设置文本水平对齐的方式。", "name": "vgcanvas_set_text_align", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "vgcanvas_t*", "name": "vg", "desc": "vgcanvas对象。" }, { "type": "char*", "name": "value", "desc": "取值top|middle|bottom必须为常量字符串。" } ], "annotation": { "scriptable": true }, "desc": "设置文本垂直对齐的方式。", "name": "vgcanvas_set_text_baseline", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "vgcanvas_t*", "name": "vg", "desc": "vgcanvas对象。" }, { "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": "vgcanvas_get_text_metrics", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "vgcanvas_t*", "name": "vg", "desc": "vgcanvas对象。" }, { "type": "char*", "name": "text", "desc": "text" }, { "type": "float_t", "name": "x", "desc": "x坐标。" }, { "type": "float_t", "name": "y", "desc": "y坐标。" }, { "type": "float_t", "name": "max_width", "desc": "最大宽度。" } ], "annotation": { "scriptable": true }, "desc": "绘制文本。", "name": "vgcanvas_fill_text", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "vgcanvas_t*", "name": "vg", "desc": "vgcanvas对象。" }, { "type": "char*", "name": "text", "desc": "text" } ], "annotation": { "scriptable": true }, "desc": "测量文本的宽度。", "name": "vgcanvas_measure_text", "return": { "type": "float_t", "desc": "返回text的宽度。" } }, { "params": [ { "type": "vgcanvas_t*", "name": "vg", "desc": "vgcanvas对象。" }, { "type": "bitmap_t*", "name": "img", "desc": "图片。" }, { "type": "float_t", "name": "sx", "desc": "sx" }, { "type": "float_t", "name": "sy", "desc": "sy" }, { "type": "float_t", "name": "sw", "desc": "sw" }, { "type": "float_t", "name": "sh", "desc": "sh" }, { "type": "float_t", "name": "dx", "desc": "dx" }, { "type": "float_t", "name": "dy", "desc": "dy" }, { "type": "float_t", "name": "dw", "desc": "dw" }, { "type": "float_t", "name": "dh", "desc": "dh" } ], "annotation": { "scriptable": true }, "desc": "绘制图片。", "name": "vgcanvas_draw_image", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "vgcanvas_t*", "name": "vg", "desc": "vgcanvas对象。" }, { "type": "bitmap_t*", "name": "img", "desc": "图片。" }, { "type": "float_t", "name": "sx", "desc": "sx" }, { "type": "float_t", "name": "sy", "desc": "sy" }, { "type": "float_t", "name": "sw", "desc": "sw" }, { "type": "float_t", "name": "sh", "desc": "sh" }, { "type": "float_t", "name": "dx", "desc": "dx" }, { "type": "float_t", "name": "dy", "desc": "dy" }, { "type": "float_t", "name": "dw", "desc": "dw" }, { "type": "float_t", "name": "dh", "desc": "dh" } ], "annotation": { "scriptable": true }, "desc": "绘制图标。\n\n绘制图标时会根据屏幕密度进行自动缩放而绘制普通图片时不会。", "name": "vgcanvas_draw_icon", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "vgcanvas_t*", "name": "vg", "desc": "vgcanvas对象。" }, { "type": "bool_t", "name": "value", "desc": "是否启用反走样。" } ], "annotation": { "scriptable": true }, "desc": "设置是否启用反走样。", "name": "vgcanvas_set_antialias", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "vgcanvas_t*", "name": "vg", "desc": "vgcanvas对象。" }, { "type": "float_t", "name": "alpha", "desc": "global alpha。" } ], "annotation": { "scriptable": true }, "desc": "设置全局透明度。", "name": "vgcanvas_set_global_alpha", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "vgcanvas_t*", "name": "vg", "desc": "vgcanvas对象。" }, { "type": "float_t", "name": "value", "desc": "线宽。" } ], "annotation": { "scriptable": true }, "desc": "设置线条的宽度。", "name": "vgcanvas_set_line_width", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "vgcanvas_t*", "name": "vg", "desc": "vgcanvas对象。" }, { "type": "color_t", "name": "color", "desc": "颜色。" } ], "annotation": {}, "desc": "设置填充颜色。", "name": "vgcanvas_set_fill_color", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "vgcanvas_t*", "name": "vg", "desc": "vgcanvas对象。" }, { "type": "const char*", "name": "color", "desc": "颜色。" } ], "annotation": { "scriptable": true }, "desc": "设置填充颜色。", "name": "vgcanvas_set_fill_color_str", "alias": "vgcanvas_set_fill_color", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "vgcanvas_t*", "name": "vg", "desc": "vgcanvas对象。" }, { "type": "float_t", "name": "sx", "desc": "start x" }, { "type": "float_t", "name": "sy", "desc": "start y" }, { "type": "float_t", "name": "ex", "desc": "end x" }, { "type": "float_t", "name": "ey", "desc": "end y" }, { "type": "color_t", "name": "icolor", "desc": "开始颜色。" }, { "type": "color_t", "name": "ocolor", "desc": "结束颜色。" } ], "annotation": {}, "desc": "设置填充颜色为线性渐变色。", "name": "vgcanvas_set_fill_linear_gradient", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "vgcanvas_t*", "name": "vg", "desc": "vgcanvas对象。" }, { "type": "float_t", "name": "cx", "desc": "center x" }, { "type": "float_t", "name": "cy", "desc": "center y" }, { "type": "float_t", "name": "inr", "desc": "内环半径" }, { "type": "float_t", "name": "outr", "desc": "外环半径。" }, { "type": "color_t", "name": "icolor", "desc": "开始颜色。" }, { "type": "color_t", "name": "ocolor", "desc": "结束颜色。" } ], "annotation": {}, "desc": "设置填充颜色为径向渐变色。", "name": "vgcanvas_set_fill_radial_gradient", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "vgcanvas_t*", "name": "vg", "desc": "vgcanvas对象。" }, { "type": "color_t", "name": "color", "desc": "颜色。" } ], "annotation": {}, "desc": "设置线条颜色。", "name": "vgcanvas_set_stroke_color", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "vgcanvas_t*", "name": "vg", "desc": "vgcanvas对象。" }, { "type": "const char*", "name": "color", "desc": "颜色。" } ], "annotation": { "scriptable": true }, "desc": "设置线条颜色。", "name": "vgcanvas_set_stroke_color_str", "alias": "vgcanvas_set_stroke_color", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "vgcanvas_t*", "name": "vg", "desc": "vgcanvas对象。" }, { "type": "float_t", "name": "sx", "desc": "start x" }, { "type": "float_t", "name": "sy", "desc": "start y" }, { "type": "float_t", "name": "ex", "desc": "end x" }, { "type": "float_t", "name": "ey", "desc": "end y" }, { "type": "color_t", "name": "icolor", "desc": "开始颜色。" }, { "type": "color_t", "name": "ocolor", "desc": "结束颜色。" } ], "annotation": {}, "desc": "设置线条颜色为线性渐变色。", "name": "vgcanvas_set_stroke_linear_gradient", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "vgcanvas_t*", "name": "vg", "desc": "vgcanvas对象。" }, { "type": "float_t", "name": "cx", "desc": "center x" }, { "type": "float_t", "name": "cy", "desc": "center y" }, { "type": "float_t", "name": "inr", "desc": "内环半径" }, { "type": "float_t", "name": "outr", "desc": "外环半径。" }, { "type": "color_t", "name": "icolor", "desc": "开始颜色。" }, { "type": "color_t", "name": "ocolor", "desc": "结束颜色。" } ], "annotation": {}, "desc": "设置线条颜色为径向渐变色。", "name": "vgcanvas_set_stroke_radial_gradient", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "vgcanvas_t*", "name": "vg", "desc": "vgcanvas对象。" }, { "type": "char*", "name": "value", "desc": "取值butt|round|square必须为常量字符串。" } ], "annotation": { "scriptable": true }, "desc": "设置line cap。", "name": "vgcanvas_set_line_cap", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "vgcanvas_t*", "name": "vg", "desc": "vgcanvas对象。" }, { "type": "char*", "name": "value", "desc": "取值bevel|round|miter必须为常量字符串。" } ], "annotation": { "scriptable": true }, "desc": "设置line join。", "name": "vgcanvas_set_line_join", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "vgcanvas_t*", "name": "vg", "desc": "vgcanvas对象。" }, { "type": "float_t", "name": "value", "desc": "miter limit" } ], "annotation": { "scriptable": true }, "desc": "设置miter limit。", "name": "vgcanvas_set_miter_limit", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "vgcanvas_t*", "name": "vg", "desc": "vgcanvas对象。" } ], "annotation": { "scriptable": true }, "desc": "保存当前的状态。如颜色和矩阵等信息。\n\n> save/restore必须配套使用否则可能导致状态混乱。", "name": "vgcanvas_save", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "vgcanvas_t*", "name": "vg", "desc": "vgcanvas对象。" } ], "annotation": { "scriptable": true }, "desc": "恢复上次save的状态。\n\n> save/restore必须配套使用否则可能导致状态混乱。", "name": "vgcanvas_restore", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "vgcanvas_t*", "name": "vg", "desc": "vgcanvas对象。" } ], "annotation": {}, "desc": "结束绘制。系统内部调用。", "name": "vgcanvas_end_frame", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "vgcanvas_t*", "name": "vgcanvas", "desc": "vgcanvas对象。" } ], "annotation": {}, "desc": "获取宽度。", "name": "vgcanvas_get_width", "return": { "type": "wh_t", "desc": "返回宽度。" } }, { "params": [ { "type": "vgcanvas_t*", "name": "vgcanvas", "desc": "vgcanvas对象。" } ], "annotation": {}, "desc": "获取高度。", "name": "vgcanvas_get_height", "return": { "type": "wh_t", "desc": "返回高度。" } }, { "params": [ { "type": "vgcanvas_t*", "name": "vg", "desc": "vgcanvas对象。" } ], "annotation": {}, "desc": "释放vgcanvas对象的缓冲数据。", "name": "vgcanvas_clear_cache", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "vgcanvas_t*", "name": "vg", "desc": "vgcanvas对象。" } ], "annotation": {}, "desc": "销毁vgcanvas对象。", "name": "vgcanvas_destroy", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } } ], "events": [], "properties": [ { "name": "w", "desc": "canvas的宽度", "type": "wh_t", "annotation": { "readable": true, "scriptable": true } }, { "name": "h", "desc": "canvas的高度", "type": "wh_t", "annotation": { "readable": true, "scriptable": true } }, { "name": "stride", "desc": "一行占的字节", "type": "uint32_t", "annotation": { "readable": true, "scriptable": true } }, { "name": "ratio", "desc": "显示比例。", "type": "float_t", "annotation": { "readable": true, "scriptable": true } }, { "name": "anti_alias", "desc": "是否启用反走样功能。", "type": "bool_t", "annotation": { "readable": true, "scriptable": true } }, { "name": "line_width", "desc": "线宽。", "type": "float_t", "annotation": { "readable": true, "scriptable": true } }, { "name": "global_alpha", "desc": "全局alpha。", "type": "float_t", "annotation": { "readable": true, "scriptable": true } }, { "name": "miter_limit", "desc": "miter\limit。\n@see http://www.w3school.com.cn/tags/canvas_miterlimit.asp", "type": "float_t", "annotation": { "readable": true, "scriptable": true } }, { "name": "line_cap", "desc": "line\cap。\n@see http://www.w3school.com.cn/tags/canvas_linecap.asp", "type": "const char*", "annotation": { "readable": true, "scriptable": true } }, { "name": "line_join", "desc": "line\join。\n@see http://www.w3school.com.cn/tags/canvas_linejoin.asp", "type": "const char*", "annotation": { "readable": true, "scriptable": true } }, { "name": "font", "desc": "字体。", "type": "char*", "annotation": { "readable": true, "scriptable": true } }, { "name": "font_size", "desc": "字体大小。", "type": "float_t", "annotation": { "readable": true, "scriptable": true } }, { "name": "text_align", "desc": "文本对齐方式。\n\n@see http://www.w3school.com.cn/tags/canvas_textalign.asp", "type": "const char*", "annotation": { "readable": true, "scriptable": true } }, { "name": "text_baseline", "desc": "文本基线。\n\n@see http://www.w3school.com.cn/tags/canvas_textbaseline.asp", "type": "const char*", "annotation": { "readable": true, "scriptable": true } }, { "name": "fill_color", "desc": "填充颜色", "type": "color_t", "annotation": { "readable": true } }, { "name": "stroke_color", "desc": "线条颜色", "type": "color_t", "annotation": { "readable": true } }, { "name": "buff;", "desc": "frame buffer", "type": "uint32_t*", "annotation": { "private": true } }, { "name": "format;", "desc": "frame buffer format", "type": "bitmap_format_t", "annotation": { "private": true } } ], "header": "base/vgcanvas.h", "desc": "矢量图画布抽象基类。\n\n具体实现时可以使用aggnanovg, cairo和skia等方式。\n\ncairo和skia体积太大不适合嵌入式平台但在PC平台也是一种选择。\n\n目前我们只提供了基于nanovg的实现支持软件渲染和硬件渲染。\n\n我们对nanovg进行了一些改进:\n\n* 可以用agg/agge实现软件渲染(暂时不支持文本绘制)。\n\n* 可以用bgfx使用DirectX(Windows平台)和Metal(iOS)平台硬件加速。\n\ngraphviz\n[default_style]\n\nvgcanvas_cairo_t -> vgcanvas_t[arrowhead = \"empty\"]\nvgcanvas_nanovg_t -> vgcanvas_t[arrowhead = \"empty\"]\nopengl -> vgcanvas_nanovg_t[arrowhead = \"none\"]\nbgfx -> vgcanvas_nanovg_t[arrowhead = \"none\"]\nagg -> vgcanvas_nanovg_t[arrowhead = \"none\"]\nagge -> vgcanvas_nanovg_t[arrowhead = \"none\"]\nvgcanvas_skia_t -> vgcanvas_t[arrowhead = \"empty\"]\nvgcanvas_agge_t -> vgcanvas_t[arrowhead = \"empty\"]\n\n\n示例\n\nc\nvgcanvas_t* vg = canvas_get_vgcanvas(c);\nvgcanvas_save(vg);\nvgcanvas_translate(vg, 0, 100);\n\nvgcanvas_set_line_width(vg, 1);\nvgcanvas_set_fill_color(vg, color_init(0xff, 0, 0, 0xff));\nvgcanvas_rect(vg, 5, 5, 100, 100);\nvgcanvas_fill(vg);\nvgcanvas_restore(vg);\n\n\n>请参考:https://www.w3schools.com/tags/ref_canvas.asp", "name": "vgcanvas_t", "annotation": { "scriptable": true }, "level": 1 }, { "type": "enum", "desc": "线帽类型。", "consts": [ { "desc": "圆头。", "name": "VGCANVAS_LINE_CAP_ROUND" }, { "desc": "方头。", "name": "VGCANVAS_LINE_CAP_SQUARE" } ], "header": "base/vgcanvas.h", "name": "vgcanvas_line_cap_t", "prefix": "VGCANVAS_LINE_CAP", "annotation": { "scriptable": true, "string": true }, "level": 1 }, { "type": "enum", "desc": "线条连接类型。", "consts": [ { "desc": "round。", "name": "VGCANVAS_LINE_JOIN_ROUND" }, { "desc": "bevel。", "name": "VGCANVAS_LINE_JOIN_BEVEL" }, { "desc": "mitter。", "name": "VGCANVAS_LINE_JOIN_MITTER" } ], "header": "base/vgcanvas.h", "name": "vgcanvas_line_join_t", "prefix": "VGCANVAS_LINE_JOIN", "annotation": { "scriptable": true, "string": true }, "level": 1 }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "动画应用的控件。" }, { "type": "const char*", "name": "params", "desc": "参数。" } ], "annotation": { "global": true }, "desc": "创建animator对象。", "name": "widget_animator_create", "return": { "type": "widget_animator_t*", "desc": "动画对象。" }, "type": "method", "header": "base/widget_animator_factory.h", "level": 1 }, { "type": "class", "methods": [ { "params": [], "annotation": { "constructor": true }, "desc": "获取缺省的控件动画管理器。", "name": "widget_animator_manager", "alias": "widget_animator_manager_instance", "return": { "type": "widget_animator_manager_t*", "desc": "返回控件动画管理器。" } }, { "params": [ { "type": "widget_animator_manager_t*", "name": "am", "desc": "控件动画管理器。" } ], "annotation": {}, "desc": "设置缺省的控件动画管理器。", "name": "widget_animator_manager_set", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [], "annotation": { "constructor": true }, "desc": "创建控件动画管理器。", "name": "widget_animator_manager_create", "return": { "type": "widget_animator_manager_t*", "desc": "返回控件动画管理器。" } }, { "params": [ { "type": "widget_animator_manager_t*", "name": "am", "desc": "控件动画管理器。" } ], "annotation": { "constructor": true }, "desc": "初始化控件动画管理器。", "name": "widget_animator_manager_init", "return": { "type": "widget_animator_manager_t*", "desc": "返回控件动画管理器。" } }, { "params": [ { "type": "widget_animator_manager_t*", "name": "am", "desc": "控件动画管理器。" } ], "annotation": {}, "desc": "析构控件动画管理器。", "name": "widget_animator_manager_deinit", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_animator_manager_t*", "name": "am", "desc": "控件动画管理器。" } ], "annotation": {}, "desc": "析构并释放控件动画管理器。", "name": "widget_animator_manager_destroy", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_animator_manager_t*", "name": "am", "desc": "控件动画管理器。" }, { "type": "widget_animator_t*", "name": "animator", "desc": "动画对象。" } ], "annotation": {}, "desc": "添加指定的动画,动画在创建时调用本函数。", "name": "widget_animator_manager_add", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_animator_manager_t*", "name": "am", "desc": "控件动画管理器。" }, { "type": "widget_animator_t*", "name": "animator", "desc": "动画对象。" } ], "annotation": {}, "desc": "移出指定的动画,动画在销毁时调用本函数。。", "name": "widget_animator_manager_remove", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_animator_manager_t*", "name": "am", "desc": "控件动画管理器。" } ], "annotation": {}, "desc": "获取动画个数。", "name": "widget_animator_manager_count", "return": { "type": "ret_t", "desc": "返回动画个数。" } }, { "params": [ { "type": "widget_animator_manager_t*", "name": "am", "desc": "控件动画管理器。" }, { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "const char*", "name": "name", "desc": "动画名称。" } ], "annotation": {}, "desc": "播放满足条件的动画。\n1.widget为NULL时播放所有名称为name的动画。\n2.name为NULL时播放所有widget相关的动画。\n3.widget和name均为NULL播放所有动画。", "name": "widget_animator_manager_start", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_animator_manager_t*", "name": "am", "desc": "控件动画管理器。" }, { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "const char*", "name": "name", "desc": "动画名称。" } ], "annotation": {}, "desc": "停止满足条件的动画。\n1.widget为NULL时停止所有名称为name的动画。\n2.name为NULL时停止所有widget相关的动画。\n3.widget和name均为NULL停止所有动画。", "name": "widget_animator_manager_stop", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_animator_manager_t*", "name": "am", "desc": "控件动画管理器。" }, { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "const char*", "name": "name", "desc": "动画名称。" } ], "annotation": {}, "desc": "暂停满足条件的动画。\n1.widget为NULL时暂停所有名称为name的动画。\n2.name为NULL时暂停所有widget相关的动画。\n3.widget和name均为NULL暂停所有动画。", "name": "widget_animator_manager_pause", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_animator_manager_t*", "name": "am", "desc": "控件动画管理器。" }, { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "const char*", "name": "name", "desc": "动画名称。" } ], "annotation": {}, "desc": "查找满足条件的动画。", "name": "widget_animator_manager_find", "return": { "type": "widget_animator_t*", "desc": "成功返回动画对象失败返回NULL。" } }, { "params": [ { "type": "widget_animator_manager_t*", "name": "am", "desc": "控件动画管理器。" }, { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "const char*", "name": "name", "desc": "动画名称。" } ], "annotation": {}, "desc": "销毁满足条件的动画。", "name": "widget_animator_manager_remove_all", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_animator_manager_t*", "name": "am", "desc": "控件动画管理器。" }, { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "const char*", "name": "name", "desc": "动画名称。" }, { "type": "float_t", "name": "time_scale", "desc": "时间倍率。" } ], "annotation": {}, "desc": "设置时间倍率。\n设置动画的时间倍率<0: 时间倒退,<1: 时间变慢,>1 时间变快。", "name": "widget_animator_manager_set_time_scale", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_animator_manager_t*", "name": "am", "desc": "控件动画管理器。" }, { "type": "uint32_t", "name": "delta_time", "desc": "流失的时间(毫秒)。" } ], "annotation": {}, "desc": "时间流失,调用本函数更新动画(public for test)。", "name": "widget_animator_manager_time_elapse", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } } ], "events": [], "properties": [ { "name": "time_scale", "desc": "时间倍率,可以让时间变快或变慢。", "type": "float_t" } ], "header": "base/widget_animator_manager.h", "desc": "控件动画管理器。", "name": "widget_animator_manager_t", "level": 1 }, { "type": "class", "methods": [ { "params": [ { "type": "widget_animator_t*", "name": "animator", "desc": "动画对象。" }, { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "uint32_t", "name": "duration", "desc": "动画持续时间。" }, { "type": "uint32_t", "name": "delay", "desc": "动画执行时间。" }, { "type": "easing_func_t", "name": "", "desc": "。" } ], "annotation": {}, "desc": "初始化。仅供子类内部使用。", "name": "widget_animator_init", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_animator_t*", "name": "animator", "desc": "动画对象。" }, { "type": "const char*", "name": "name", "desc": "名称。" } ], "annotation": {}, "desc": "设置名称。", "name": "widget_animator_set_name", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_animator_t*", "name": "animator", "desc": "动画对象。" }, { "type": "uint32_t", "name": "yoyo_times", "desc": "yoyo的次数往返视为两次。" } ], "annotation": {}, "desc": "设置为yoyo模式。", "name": "widget_animator_set_yoyo", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_animator_t*", "name": "animator", "desc": "动画对象。" }, { "type": "uint32_t", "name": "repeat_times", "desc": "重复的次数。" } ], "annotation": {}, "desc": "设置为重复模式。", "name": "widget_animator_set_repeat", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_animator_t*", "name": "animator", "desc": "动画对象。" }, { "type": "bool_t", "name": "value", "desc": "是否为逆向模式。" } ], "annotation": {}, "desc": "设置为逆向模式。", "name": "widget_animator_set_reversed", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_animator_t*", "name": "animator", "desc": "动画对象。" }, { "type": "float_t", "name": "time_scale", "desc": "时间倍率。" } ], "annotation": {}, "desc": "设置时间倍率,用于实现时间加速减速和停滞的功能。", "name": "widget_animator_set_time_scale", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_animator_t*", "name": "animator", "desc": "动画对象。" }, { "type": "event_type_t", "name": "", "desc": "e" }, { "type": "event_func_t", "name": "on_event", "desc": "事件处理函数。" }, { "type": "void*", "name": "ctx", "desc": "事件处理函数上下文。" } ], "annotation": { "scriptable": "custom" }, "desc": "注册指定事件的处理函数。\n事件类型。目前支持EVT_ANIM_START,EVT_ANIM_STOP,EVT_ANIM_PAUSE,EVT_ANIM_ONCE和EVT_ANIM_END。", "name": "widget_animator_on", "return": { "type": "uint32_t", "desc": "返回id用于widget_animator_off。" } }, { "params": [ { "type": "widget_animator_t*", "name": "animator", "desc": "动画对象。" }, { "type": "uint32_t", "name": "id", "desc": "widget_animator_on返回的ID。" } ], "annotation": { "scriptable": "custom" }, "desc": "注销指定事件的处理函数。", "name": "widget_animator_off", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_animator_t*", "name": "animator", "desc": "动画对象。" } ], "annotation": {}, "desc": "启动动画。", "name": "widget_animator_start", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_animator_t*", "name": "animator", "desc": "动画对象。" } ], "annotation": {}, "desc": "停止动画。", "name": "widget_animator_stop", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_animator_t*", "name": "animator", "desc": "动画对象。" } ], "annotation": {}, "desc": "暂停动画。", "name": "widget_animator_pause", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_animator_t*", "name": "animator", "desc": "动画对象。" }, { "type": "bool_t", "name": "destroy_when_done", "desc": "完成时是否自动销毁动画对象。" } ], "annotation": {}, "desc": "设置完成时是否自动销毁动画对象(缺省销毁)。", "name": "widget_animator_set_destroy_when_done", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_animator_t*", "name": "animator", "desc": "动画对象。" } ], "annotation": {}, "desc": "销毁animator对象。", "name": "widget_animator_destroy", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } } ], "events": [], "properties": [ { "name": "name", "desc": "名称。", "type": "char*" }, { "name": "widget", "desc": "控件对象。", "type": "widget_t*", "annotation": { "private": true } }, { "name": "reversed", "desc": "逆向运行在yoyo模式下自动设置。", "type": "bool_t", "annotation": { "private": true } }, { "name": "yoyo_times", "desc": "yoyo剩余次数。", "type": "uint32_t", "annotation": { "private": true } }, { "name": "repeat_times", "desc": "重复剩余次数。", "type": "uint32_t", "annotation": { "private": true } }, { "name": "now", "desc": "当前时间(毫秒)。", "type": "uint32_t", "annotation": { "private": true } }, { "name": "time_scale", "desc": "时间倍率。", "type": "float_t", "annotation": { "private": true } }, { "name": "start_time", "desc": "起始时间(毫秒)。", "type": "uint32_t", "annotation": { "private": true } }, { "name": "delay", "desc": "延迟执行时间(毫秒)。", "type": "uint32_t", "annotation": { "private": true } }, { "name": "duration", "desc": "单次动画执行时间(毫秒)。", "type": "uint32_t", "annotation": { "private": true } }, { "name": "state", "desc": "动画的状态。", "type": "animator_state_t", "annotation": { "private": true } }, { "name": "emitter", "desc": "emitter", "type": "uint32_t", "annotation": { "private": true } }, { "name": "destroy_when_done;", "desc": "播放完成时是否自动销毁(缺省销毁)。", "type": "bool_t", "annotation": { "private": true } }, { "name": "forever", "desc": "是否永远播放(yoyo_times/repeat_times为0时自动设置此标志)。", "type": "bool_t", "annotation": { "private": true } }, { "name": "widget_destroy_id", "desc": "widget_destroy_id。", "type": "uint32_t", "annotation": { "private": true } }, { "name": "easing", "desc": "插值函数。", "type": "easing_func_t", "annotation": { "private": true } }, { "name": "update", "desc": "update函数子类需要实现。", "type": "widget_animator_update_t", "annotation": { "private": true } }, { "name": "destroy", "desc": "destroy函数子类需要实现。", "type": "widget_animator_destroy_t", "annotation": { "private": true } } ], "header": "base/widget_animator.h", "desc": "控件动画接口。", "name": "widget_animator_t", "level": 1 }, { "type": "enum", "desc": "控件的属性。", "consts": [ { "desc": "用于执行某些特殊的命令比如控制动画的启停主要是方便MVVM通过属性来控制动画。", "name": "WIDGET_PROP_EXEC" }, { "desc": "X坐标。", "name": "WIDGET_PROP_X" }, { "desc": "Y坐标。", "name": "WIDGET_PROP_Y" }, { "desc": "宽度。", "name": "WIDGET_PROP_W" }, { "desc": "高度。", "name": "WIDGET_PROP_H" }, { "desc": "inputing。", "name": "WIDGET_PROP_INPUTING" }, { "desc": "always on top。", "name": "WIDGET_PROP_ALWAYS_ON_TOP" }, { "desc": "caret x。", "name": "WIDGET_PROP_CARET_X" }, { "desc": "caret y。", "name": "WIDGET_PROP_CARET_Y" }, { "desc": "脏矩形超出控件本身大小的最大范围。", "name": "WIDGET_PROP_DIRTY_RECT_TOLERANCE" }, { "desc": "bidi type(rtl,ltr,auto,wrtl,wltr,lro,rlo)。", "name": "WIDGET_PROP_BIDI" }, { "desc": "Canvas。", "name": "WIDGET_PROP_CANVAS" }, { "desc": "Canvas。", "name": "WIDGET_PROP_LOCALIZE_OPTIONS" }, { "desc": "Native Window。", "name": "WIDGET_PROP_NATIVE_WINDOW" }, { "desc": "dialog highlight。", "name": "WIDGET_PROP_HIGHLIGHT" }, { "desc": "slider中的bar的的宽度或高度。", "name": "WIDGET_PROP_BAR_SIZE" }, { "desc": "不透明度。", "name": "WIDGET_PROP_OPACITY" }, { "desc": "最小宽度。", "name": "WIDGET_PROP_MIN_W" }, { "desc": "最大宽度。", "name": "WIDGET_PROP_MAX_W" }, { "desc": "根据子控件和文本自动调整大小。", "name": "WIDGET_PROP_AUTO_ADJUST_SIZE" }, { "desc": "窗口是否保持单例。", "name": "WIDGET_PROP_SINGLE_INSTANCE" }, { "desc": "子控件布局参数。", "name": "WIDGET_PROP_CHILDREN_LAYOUT" }, { "desc": "子控件布局参数(过时)。", "name": "WIDGET_PROP_LAYOUT" }, { "desc": "控件布局参数。", "name": "WIDGET_PROP_SELF_LAYOUT" }, { "desc": "layout宽度。", "name": "WIDGET_PROP_LAYOUT_W" }, { "desc": "layout高度。", "name": "WIDGET_PROP_LAYOUT_H" }, { "desc": "虚拟宽度。", "name": "WIDGET_PROP_VIRTUAL_W" }, { "desc": "虚拟高度。", "name": "WIDGET_PROP_VIRTUAL_H" }, { "desc": "名称。", "name": "WIDGET_PROP_NAME" }, { "desc": "类型。", "name": "WIDGET_PROP_TYPE" }, { "desc": "是否可以关闭。", "name": "WIDGET_PROP_CLOSABLE" }, { "desc": "鼠标指针。", "name": "WIDGET_PROP_POINTER_CURSOR" }, { "desc": "值。", "name": "WIDGET_PROP_VALUE" }, { "desc": "进度条反向显示。", "name": "WIDGET_PROP_REVERSE" }, { "desc": "长度。", "name": "WIDGET_PROP_LENGTH" }, { "desc": "自动换行。", "name": "WIDGET_PROP_LINE_WRAP" }, { "desc": "是否允许单词中换行。", "name": "WIDGET_PROP_WORD_WRAP" }, { "desc": "文本。", "name": "WIDGET_PROP_TEXT" }, { "desc": "待翻译文本。", "name": "WIDGET_PROP_TR_TEXT" }, { "desc": "style。", "name": "WIDGET_PROP_STYLE" }, { "desc": "是否启用。", "name": "WIDGET_PROP_ENABLE" }, { "desc": "是否启用按键音等反馈。", "name": "WIDGET_PROP_FEEDBACK" }, { "desc": "是否启用floating布局。", "name": "WIDGET_PROP_FLOATING" }, { "desc": "边距。", "name": "WIDGET_PROP_MARGIN" }, { "desc": "间距。", "name": "WIDGET_PROP_SPACING" }, { "desc": "左边距。", "name": "WIDGET_PROP_LEFT_MARGIN" }, { "desc": "右边距。", "name": "WIDGET_PROP_RIGHT_MARGIN" }, { "desc": "顶边距。", "name": "WIDGET_PROP_TOP_MARGIN" }, { "desc": "底边距。", "name": "WIDGET_PROP_BOTTOM_MARGIN" }, { "desc": "步长。", "name": "WIDGET_PROP_STEP" }, { "desc": "是否可见。", "name": "WIDGET_PROP_VISIBLE" }, { "desc": "是否接受用户事件。", "name": "WIDGET_PROP_SENSITIVE" }, { "desc": "控件动画。", "name": "WIDGET_PROP_ANIMATION" }, { "desc": "窗口动画。", "name": "WIDGET_PROP_ANIM_HINT" }, { "desc": "窗口设置为全部大小。", "name": "WIDGET_PROP_FULLSCREEN" }, { "desc": "禁用窗口动画。", "name": "WIDGET_PROP_DISABLE_ANIM" }, { "desc": "打开窗口时的动画。", "name": "WIDGET_PROP_OPEN_ANIM_HINT" }, { "desc": "关闭窗口时的动画。", "name": "WIDGET_PROP_CLOSE_ANIM_HINT" }, { "desc": "最小值。", "name": "WIDGET_PROP_MIN" }, { "desc": "软键盘上action按钮的文本。", "name": "WIDGET_PROP_ACTION_TEXT" }, { "desc": "提示信息。", "name": "WIDGET_PROP_TIPS" }, { "desc": "需要翻译的提示信息。", "name": "WIDGET_PROP_TR_TIPS" }, { "desc": "输入类型。", "name": "WIDGET_PROP_INPUT_TYPE" }, { "desc": "自定义软键盘资源名称。", "name": "WIDGET_PROP_KEYBOARD" }, { "desc": "缺省获得焦点的子控件(可用控件名或类型)。", "name": "WIDGET_PROP_DEFAULT_FOCUSED_CHILD" }, { "desc": "只读模式。", "name": "WIDGET_PROP_READONLY" }, { "desc": "是否可取消。", "name": "WIDGET_PROP_CANCELABLE" }, { "desc": "密码是否可见。", "name": "WIDGET_PROP_PASSWORD_VISIBLE" }, { "desc": "是否处于active状态。", "name": "WIDGET_PROP_ACTIVE" }, { "desc": "当前页。", "name": "WIDGET_PROP_CURR_PAGE" }, { "desc": "页面最大个数。", "name": "WIDGET_PROP_PAGE_MAX_NUMBER" }, { "desc": "是否为垂直模式。", "name": "WIDGET_PROP_VERTICAL" }, { "desc": "是否显示文本。", "name": "WIDGET_PROP_SHOW_TEXT" }, { "desc": "X方向的偏移。", "name": "WIDGET_PROP_XOFFSET" }, { "desc": "Y方向的偏移。", "name": "WIDGET_PROP_YOFFSET" }, { "desc": "垂直对齐模式。", "name": "WIDGET_PROP_ALIGN_V" }, { "desc": "水平对齐模式。", "name": "WIDGET_PROP_ALIGN_H" }, { "desc": "是否自动播放或指定播放的时间。", "name": "WIDGET_PROP_AUTO_PLAY" }, { "desc": "是否循环播放或循环播放的次数。", "name": "WIDGET_PROP_LOOP" }, { "desc": "是否启用自动更正功能。", "name": "WIDGET_PROP_AUTO_FIX" }, { "desc": "编辑器在获得焦点时是否不选中文本。", "name": "WIDGET_PROP_SELECT_NONE_WHEN_FOCUSED" }, { "desc": "编辑器在获得焦点时是否打开输入法。", "name": "WIDGET_PROP_OPEN_IM_WHEN_FOCUSED" }, { "desc": "编辑器在失去焦点时是否关闭输入法。", "name": "WIDGET_PROP_CLOSE_IM_WHEN_BLURED" }, { "desc": "X最小值。", "name": "WIDGET_PROP_X_MIN" }, { "desc": "X最大值。", "name": "WIDGET_PROP_X_MAX" }, { "desc": "Y最小值。", "name": "WIDGET_PROP_Y_MIN" }, { "desc": "Y最大值。", "name": "WIDGET_PROP_Y_MAX" }, { "desc": "最大值。", "name": "WIDGET_PROP_MAX" }, { "desc": "让窗口管理器直接把按键发给自己。", "name": "WIDGET_PROP_GRAB_KEYS" }, { "desc": "行数或每行的高度。", "name": "WIDGET_PROP_ROW" }, { "desc": "控件状态。", "name": "WIDGET_PROP_STATE_FOR_STYLE" }, { "desc": "窗口主题名称。", "name": "WIDGET_PROP_THEME" }, { "desc": "window stage", "name": "WIDGET_PROP_STAGE" }, { "desc": "图片管理器。", "name": "WIDGET_PROP_IMAGE_MANAGER" }, { "desc": "资源管理器。", "name": "WIDGET_PROP_ASSETS_MANAGER" }, { "desc": "locale_info。", "name": "WIDGET_PROP_LOCALE_INFO" }, { "desc": "字体管理器。", "name": "WIDGET_PROP_FONT_MANAGER" }, { "desc": "窗口的主题对象。", "name": "WIDGET_PROP_THEME_OBJ" }, { "desc": "缺省的主题对象。", "name": "WIDGET_PROP_DEFAULT_THEME_OBJ" }, { "desc": "项的宽度。", "name": "WIDGET_PROP_ITEM_WIDTH" }, { "desc": "项的高度。", "name": "WIDGET_PROP_ITEM_HEIGHT" }, { "desc": "项的缺省高度。", "name": "WIDGET_PROP_DEFAULT_ITEM_HEIGHT" }, { "desc": "X方向是否可拖动。", "name": "WIDGET_PROP_XSLIDABLE" }, { "desc": "Y方向是否可拖动。", "name": "WIDGET_PROP_YSLIDABLE" }, { "desc": "重复次数。", "name": "WIDGET_PROP_REPEAT" }, { "desc": "触发长按事件的时间(ms)。", "name": "WIDGET_PROP_LONG_PRESS_TIME" }, { "desc": "是否启用长按。", "name": "WIDGET_PROP_ENABLE_LONG_PRESS" }, { "desc": "是否启用点击穿透。", "name": "WIDGET_PROP_CLICK_THROUGH" }, { "desc": "是否启用动画。", "name": "WIDGET_PROP_ANIMATABLE" }, { "desc": "是否自动隐藏滚动条。", "name": "WIDGET_PROP_AUTO_HIDE_SCROLL_BAR" }, { "desc": "图片名称。", "name": "WIDGET_PROP_IMAGE" }, { "desc": "显示格式。", "name": "WIDGET_PROP_FORMAT" }, { "desc": "图片绘制类型。", "name": "WIDGET_PROP_DRAW_TYPE" }, { "desc": "是否可选择。", "name": "WIDGET_PROP_SELECTABLE" }, { "desc": "是否可点击。", "name": "WIDGET_PROP_CLICKABLE" }, { "desc": "X方向缩放比例。", "name": "WIDGET_PROP_SCALE_X" }, { "desc": "Y方向缩放比例。", "name": "WIDGET_PROP_SCALE_Y" }, { "desc": "x锚点。", "name": "WIDGET_PROP_ANCHOR_X" }, { "desc": "y锚点。", "name": "WIDGET_PROP_ANCHOR_Y" }, { "desc": "选中角度(幅度)", "name": "WIDGET_PROP_ROTATION" }, { "desc": "紧凑模式。", "name": "WIDGET_PROP_COMPACT" }, { "desc": "是否支持滚动。", "name": "WIDGET_PROP_SCROLLABLE" }, { "desc": "图标名称。", "name": "WIDGET_PROP_ICON" }, { "desc": "选项集合。", "name": "WIDGET_PROP_OPTIONS" }, { "desc": "是否被选中。", "name": "WIDGET_PROP_SELECTED" }, { "desc": "是否被勾选。", "name": "WIDGET_PROP_CHECKED" }, { "desc": "active状态下的图标。", "name": "WIDGET_PROP_ACTIVE_ICON" }, { "desc": "动态加载UI名字。", "name": "WIDGET_PROP_LOAD_UI" }, { "desc": "要打开窗口的名称。", "name": "WIDGET_PROP_OPEN_WINDOW" }, { "desc": "被选中项的索引。", "name": "WIDGET_PROP_SELECTED_INDEX" }, { "desc": "点击窗口时关闭窗口。", "name": "WIDGET_PROP_CLOSE_WHEN_CLICK" }, { "desc": "点击窗口外部时关闭窗口。", "name": "WIDGET_PROP_CLOSE_WHEN_CLICK_OUTSIDE" }, { "desc": "超时后关闭窗口。", "name": "WIDGET_PROP_CLOSE_WHEN_TIMEOUT" }, { "desc": "行间距。", "name": "WIDGET_PROP_LINE_GAP" }, { "desc": "背景颜色(仅仅使用于color tile)。", "name": "WIDGET_PROP_BG_COLOR" }, { "desc": "边框颜色(仅仅使用于color tile)。", "name": "WIDGET_PROP_BORDER_COLOR" }, { "desc": "延迟时间(毫秒)", "name": "WIDGET_PROP_DELAY" }, { "desc": "是否为键盘。", "name": "WIDGET_PROP_IS_KEYBOARD" }, { "desc": "是否为焦点控件。", "name": "WIDGET_PROP_FOCUSED" }, { "desc": "(过时请用focused)。", "name": "WIDGET_PROP_FOCUS" }, { "desc": "是否支持焦点停留。", "name": "WIDGET_PROP_FOCUSABLE" }, { "desc": "是否支持焦点状态(如果希望style支持焦点状态但有不希望焦点停留可用本属性)。", "name": "WIDGET_PROP_WITH_FOCUS_STATE" }, { "desc": "将焦点移到前一个的键值。", "name": "WIDGET_PROP_MOVE_FOCUS_PREV_KEY" }, { "desc": "将焦点移到后一个的键值。", "name": "WIDGET_PROP_MOVE_FOCUS_NEXT_KEY" }, { "desc": "将焦点向上移动的键值。", "name": "WIDGET_PROP_MOVE_FOCUS_UP_KEY" }, { "desc": "将焦点向下移动的键值。", "name": "WIDGET_PROP_MOVE_FOCUS_DOWN_KEY" }, { "desc": "将焦点向左移动的键值。", "name": "WIDGET_PROP_MOVE_FOCUS_LEFT_KEY" }, { "desc": "将焦点向右移动的键值。", "name": "WIDGET_PROP_MOVE_FOCUS_RIGHT_KEY" } ], "header": "base/widget_consts.h", "name": "widget_prop_t", "prefix": "WIDGET_PROP", "annotation": { "scriptable": true, "string": true }, "level": 1 }, { "type": "enum", "desc": "控件的类型。", "consts": [ { "desc": "无特殊类型。", "name": "WIDGET_TYPE_NONE" }, { "desc": "窗口管理器。", "name": "WIDGET_TYPE_WINDOW_MANAGER" }, { "desc": "普通窗口。", "name": "WIDGET_TYPE_NORMAL_WINDOW" }, { "desc": "overlay窗口。", "name": "WIDGET_TYPE_OVERLAY" }, { "desc": "工具条。", "name": "WIDGET_TYPE_TOOL_BAR" }, { "desc": "对话框。", "name": "WIDGET_TYPE_DIALOG" }, { "desc": "弹出窗口。", "name": "WIDGET_TYPE_POPUP" }, { "desc": "system bar window", "name": "WIDGET_TYPE_SYSTEM_BAR" }, { "desc": "system bar window ato bottom", "name": "WIDGET_TYPE_SYSTEM_BAR_BOTTOM" }, { "desc": "精灵窗口。", "name": "WIDGET_TYPE_SPRITE" }, { "desc": "键盘窗口。", "name": "WIDGET_TYPE_KEYBOARD" }, { "desc": "拖放状态窗口。", "name": "WIDGET_TYPE_DND" }, { "desc": "文本控件。", "name": "WIDGET_TYPE_LABEL" }, { "desc": "按钮控件。", "name": "WIDGET_TYPE_BUTTON" }, { "desc": "图片控件。", "name": "WIDGET_TYPE_IMAGE" }, { "desc": "文本编辑控件。", "name": "WIDGET_TYPE_EDIT" }, { "desc": "进度条控件。", "name": "WIDGET_TYPE_PROGRESS_BAR" }, { "desc": "分组控件。", "name": "WIDGET_TYPE_GROUP_BOX" }, { "desc": "多选按钮控件。", "name": "WIDGET_TYPE_CHECK_BUTTON" }, { "desc": "单选按钮控件。", "name": "WIDGET_TYPE_RADIO_BUTTON" }, { "desc": "对话框标题。", "name": "WIDGET_TYPE_DIALOG_TITLE" }, { "desc": "对话框客户区域。", "name": "WIDGET_TYPE_DIALOG_CLIENT" }, { "desc": "滑块控件。", "name": "WIDGET_TYPE_SLIDER" }, { "desc": "视图控件。", "name": "WIDGET_TYPE_VIEW" }, { "desc": "下拉选择框控件。", "name": "WIDGET_TYPE_COMBO_BOX" }, { "desc": "下拉选择框的列表项控件。", "name": "WIDGET_TYPE_COMBO_BOX_ITEM" }, { "desc": "滑动视图控件。", "name": "WIDGET_TYPE_SLIDE_VIEW" }, { "desc": "滑动视图的指示器控件。", "name": "WIDGET_TYPE_SLIDE_INDICATOR" }, { "desc": "滑动视图的指示器控件(圆弧显示)。", "name": "WIDGET_TYPE_SLIDE_INDICATOR_ARC" }, { "desc": "多页控件。", "name": "WIDGET_TYPE_PAGES" }, { "desc": "标签按钮控件。", "name": "WIDGET_TYPE_TAB_BUTTON" }, { "desc": "标签控件。", "name": "WIDGET_TYPE_TAB_CONTROL" }, { "desc": "标签按钮分组控件。", "name": "WIDGET_TYPE_TAB_BUTTON_GROUP" }, { "desc": "按钮分组控件。", "name": "WIDGET_TYPE_BUTTON_GROUP" }, { "desc": "候选字控件。", "name": "WIDGET_TYPE_CANDIDATES" }, { "desc": "数值编辑控件。", "name": "WIDGET_TYPE_SPIN_BOX" }, { "desc": "拖动块控件。", "name": "WIDGET_TYPE_DRAGGER" }, { "desc": "滚动条控件。", "name": "WIDGET_TYPE_SCROLL_BAR" }, { "desc": "桌面版滚动条控件。", "name": "WIDGET_TYPE_SCROLL_BAR_DESKTOP" }, { "desc": "移动版滚动条控件。", "name": "WIDGET_TYPE_SCROLL_BAR_MOBILE" }, { "desc": "滚动视图控件。", "name": "WIDGET_TYPE_SCROLL_VIEW" }, { "desc": "列表视图控件。", "name": "WIDGET_TYPE_LIST_VIEW" }, { "desc": "水平列表视图控件。", "name": "WIDGET_TYPE_LIST_VIEW_H" }, { "desc": "列表项控件。", "name": "WIDGET_TYPE_LIST_ITEM" }, { "desc": "颜色选择器控件。", "name": "WIDGET_TYPE_COLOR_PICKER" }, { "desc": "颜色选择器组件控件。", "name": "WIDGET_TYPE_COLOR_COMPONENT" }, { "desc": "颜色块控件。", "name": "WIDGET_TYPE_COLOR_TILE" }, { "desc": "裁剪控件。", "name": "WIDGET_TYPE_CLIP_VIEW" }, { "desc": "富文本控件。", "name": "WIDGET_TYPE_RICH_TEXT" }, { "desc": "AppBar控件。", "name": "WIDGET_TYPE_APP_BAR" }, { "desc": "网格控件。", "name": "WIDGET_TYPE_GRID" }, { "desc": "网格项目控件。", "name": "WIDGET_TYPE_GRID_ITEM" }, { "desc": "行控件。", "name": "WIDGET_TYPE_ROW" }, { "desc": "列控件。", "name": "WIDGET_TYPE_COLUMN" }, { "desc": "电阻屏校准窗口。", "name": "WIDGET_TYPE_CALIBRATION_WIN" } ], "header": "base/widget_consts.h", "name": "widget_type_t", "prefix": "WIDGET_TYPE", "annotation": { "scriptable": true, "string": true }, "level": 1 }, { "type": "enum", "desc": "窗口的生命周期常量定义。", "consts": [ { "desc": "初始状态。", "name": "WINDOW_STAGE_NONE" }, { "desc": "创建完成。", "name": "WINDOW_STAGE_CREATED" }, { "desc": "窗口已经打开(窗口打开动画完成后)", "name": "WINDOW_STAGE_OPENED" }, { "desc": "窗口已关闭。", "name": "WINDOW_STAGE_CLOSED" }, { "desc": "窗口挂起状态。", "name": "WINDOW_STAGE_SUSPEND" } ], "header": "base/widget_consts.h", "name": "window_stage_t", "prefix": "WINDOW_STAGE", "annotation": { "scriptable": true }, "level": 1 }, { "type": "enum", "desc": "窗口的closable常量定义。", "consts": [ { "desc": "窗口可关闭。", "name": "WINDOW_CLOSABLE_YES" }, { "desc": "窗口不可关闭。", "name": "WINDOW_CLOSABLE_NO" }, { "desc": "窗口需要确认后才能关闭。", "name": "WINDOW_CLOSABLE_CONFIRM" } ], "header": "base/widget_consts.h", "name": "window_closable_t", "prefix": "WINDOW_CLOSABLE", "annotation": { "scriptable": true }, "level": 1 }, { "type": "enum", "desc": "控件状态常量定义。\n\n这里指定常用的状态值扩展控件可以在自己的头文件中定义私有的状态。", "consts": [ { "desc": "无效状态。", "name": "WIDGET_STATE_NONE" }, { "desc": "正常状态。", "name": "WIDGET_STATE_NORMAL" }, { "desc": "内容被修改的状态。", "name": "WIDGET_STATE_CHANGED" }, { "desc": "指针按下状态。", "name": "WIDGET_STATE_PRESSED" }, { "desc": "指针悬浮状态。", "name": "WIDGET_STATE_OVER" }, { "desc": "禁用状态。", "name": "WIDGET_STATE_DISABLE" }, { "desc": "聚焦状态。", "name": "WIDGET_STATE_FOCUSED" }, { "desc": "勾选状态。", "name": "WIDGET_STATE_CHECKED" }, { "desc": "没勾选状态。", "name": "WIDGET_STATE_UNCHECKED" }, { "desc": "编辑器无内容状态。", "name": "WIDGET_STATE_EMPTY" }, { "desc": "编辑器无内容同时聚焦的状态。", "name": "WIDGET_STATE_EMPTY_FOCUS" }, { "desc": "输入错误状态。", "name": "WIDGET_STATE_ERROR" }, { "desc": "选中状态。", "name": "WIDGET_STATE_SELECTED" }, { "desc": "正常状态(选中项)。", "name": "WIDGET_STATE_NORMAL_OF_CHECKED" }, { "desc": "指针按下状态(选中项)。", "name": "WIDGET_STATE_PRESSED_OF_CHECKED" }, { "desc": "指针悬浮状态(选中项)。", "name": "WIDGET_STATE_OVER_OF_CHECKED" }, { "desc": "禁用状态(选中项)。", "name": "WIDGET_STATE_DISABLE_OF_CHECKED" }, { "desc": "焦点状态(选中项)。", "name": "WIDGET_STATE_FOCUSED_OF_CHECKED" }, { "desc": "正常状态(当前项)。", "name": "WIDGET_STATE_NORMAL_OF_ACTIVE" }, { "desc": "指针按下状态(当前项)。", "name": "WIDGET_STATE_PRESSED_OF_ACTIVE" }, { "desc": "指针悬浮状态(当前项)。", "name": "WIDGET_STATE_OVER_OF_ACTIVE" }, { "desc": "禁用状态(当前项)。", "name": "WIDGET_STATE_DISABLE_OF_ACTIVE" }, { "desc": "焦点状态(当前项)。", "name": "WIDGET_STATE_FOCUSED_OF_ACTIVE" } ], "header": "base/widget_consts.h", "name": "widget_state_t", "prefix": "WIDGET_STATE", "annotation": { "scriptable": true, "string": true }, "level": 1 }, { "type": "enum", "desc": "控件鼠标光标常量定义。", "consts": [ { "desc": "默认光标。", "name": "WIDGET_CURSOR_DEFAULT" }, { "desc": "文本选择光标。", "name": "WIDGET_CURSOR_EDIT" }, { "desc": "手指光标。", "name": "WIDGET_CURSOR_HAND" }, { "desc": "等待光标。", "name": "WIDGET_CURSOR_WAIT" }, { "desc": "叉光标。", "name": "WIDGET_CURSOR_CROSS" }, { "desc": "Slashed circle or crossbones。", "name": "WIDGET_CURSOR_NO" }, { "desc": "Double arrow pointing northwest and southeast。", "name": "WIDGET_CURSOR_SIZENWSE" }, { "desc": "Double arrow pointing northeast and southwest。", "name": "WIDGET_CURSOR_SIZENESW" }, { "desc": "Double arrow pointing west and east。", "name": "WIDGET_CURSOR_SIZEWE" }, { "desc": "Double arrow pointing north and south。", "name": "WIDGET_CURSOR_SIZENS" }, { "desc": "Four pointed arrow pointing north, south, east, and west。", "name": "WIDGET_CURSOR_SIZEALL" } ], "header": "base/widget_consts.h", "name": "widget_cursor_t", "prefix": "WIDGET", "annotation": { "scriptable": true, "string": true }, "level": 1 }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件。" }, { "type": "const rect_t*", "name": "rect", "desc": "无效化区域。" } ], "annotation": { "global": true }, "desc": "awtk默认的invalidate接口。", "name": "widget_invalidate_default", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" }, "type": "method", "header": "base/widget_vtable.h", "level": 1 }, { "params": [], "annotation": { "global": true }, "desc": "", "name": "widget_on_event_default", "type": "method", "header": "base/widget_vtable.h", "level": 1 }, { "params": [], "annotation": { "global": true }, "desc": "", "name": "widget_on_paint_self_default", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" }, "type": "method", "header": "base/widget_vtable.h", "level": 1 }, { "params": [], "annotation": { "global": true }, "desc": "", "name": "widget_on_paint_children_default", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" }, "type": "method", "header": "base/widget_vtable.h", "level": 1 }, { "params": [], "annotation": { "global": true }, "desc": "", "name": "widget_on_keydown_default", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" }, "type": "method", "header": "base/widget_vtable.h", "level": 1 }, { "params": [], "annotation": { "global": true }, "desc": "", "name": "widget_on_keyup_default", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" }, "type": "method", "header": "base/widget_vtable.h", "level": 1 }, { "params": [], "annotation": { "global": true }, "desc": "", "name": "widget_on_pointer_down_default", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" }, "type": "method", "header": "base/widget_vtable.h", "level": 1 }, { "params": [], "annotation": { "global": true }, "desc": "", "name": "widget_on_pointer_move_default", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" }, "type": "method", "header": "base/widget_vtable.h", "level": 1 }, { "params": [], "annotation": { "global": true }, "desc": "", "name": "widget_on_pointer_up_default", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" }, "type": "method", "header": "base/widget_vtable.h", "level": 1 }, { "params": [], "annotation": { "global": true }, "desc": "", "name": "widget_on_copy_default", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" }, "type": "method", "header": "base/widget_vtable.h", "level": 1 }, { "params": [], "annotation": { "global": true }, "desc": "", "name": "widget_get_prop_default", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" }, "type": "method", "header": "base/widget_vtable.h", "level": 1 }, { "params": [], "annotation": { "global": true }, "desc": "", "name": "widget_set_prop_default", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" }, "type": "method", "header": "base/widget_vtable.h", "level": 1 }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件。" }, { "type": "xy_t", "name": "x", "desc": "坐标。" }, { "type": "xy_t", "name": "y", "desc": "坐标。" } ], "annotation": { "global": true }, "desc": "awtk默认的find_target接口。", "name": "widget_find_target_default", "return": { "type": "widget_t*", "desc": "返回响应的控件。" }, "type": "method", "header": "base/widget_vtable.h", "level": 1 }, { "params": [], "annotation": { "global": true }, "desc": "", "name": "widget_on_paint_null", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" }, "type": "method", "header": "base/widget_vtable.h", "level": 1 }, { "type": "class", "methods": [ { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" } ], "annotation": { "scriptable": true }, "desc": "获取子控件的个数。", "name": "widget_count_children", "return": { "type": "int32_t", "desc": "子控件的个数。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "int32_t", "name": "index", "desc": "索引。" } ], "annotation": { "scriptable": true }, "desc": "获取指定索引的子控件。", "name": "widget_get_child", "return": { "type": "widget_t*", "desc": "子控件。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" } ], "annotation": { "scriptable": true }, "desc": "获取原生窗口对象。", "name": "widget_get_native_window", "return": { "type": "native_window_t*", "desc": "原生窗口对象。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" } ], "annotation": { "scriptable": true }, "desc": "获取控件在父控件中的索引编号。", "name": "widget_index_of", "return": { "type": "int32_t", "desc": "在父控件中的索引编号。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "widget对象。" } ], "annotation": { "deconstructor": true, "scriptable": true }, "desc": "关闭控件所在的窗口。", "name": "widget_close_window", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "xy_t", "name": "x", "desc": "x坐标" }, { "type": "xy_t", "name": "y", "desc": "y坐标" } ], "annotation": { "scriptable": true }, "desc": "移动控件。", "name": "widget_move", "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": "widget_resize", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "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": { "scriptable": true }, "desc": "移动控件并调整控件的大小。", "name": "widget_move_resize", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "int32_t", "name": "value", "desc": "值。" } ], "annotation": { "scriptable": true }, "desc": "设置控件的值。\n只是对widget\_set\_prop的包装值的意义由子类控件决定。", "name": "widget_set_value", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "int32_t", "name": "value", "desc": "值。" }, { "type": "uint32_t", "name": "duration", "desc": "动画持续时间(毫秒)。" } ], "annotation": { "scriptable": true }, "desc": "设置控件的值(以动画形式变化到指定的值)。\n只是对widget\_set\_prop的包装值的意义由子类控件决定。", "name": "widget_animate_value_to", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "int32_t", "name": "delta", "desc": "增量。" } ], "annotation": { "scriptable": true }, "desc": "增加控件的值。\n只是对widget\_set\_prop的包装值的意义由子类控件决定。", "name": "widget_add_value", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "const wchar_t*", "name": "text", "desc": "文本。" } ], "annotation": {}, "desc": "设置控件的文本。\n只是对widget\_set\_prop的包装文本的意义由子类控件决定。", "name": "widget_set_text", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "const char*", "name": "style", "desc": "style的名称。" } ], "annotation": { "scriptable": true }, "desc": "启用指定的style。", "name": "widget_use_style", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "const char*", "name": "text", "desc": "文本。" } ], "annotation": { "scriptable": true }, "desc": "设置控件的文本。\n只是对widget\_set\_prop的包装文本的意义由子类控件决定。", "name": "widget_set_text_utf8", "alias": "set_text", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "char*", "name": "text", "desc": "用于返回文本。" }, { "type": "uint32_t", "name": "size", "desc": "text内存长度。" } ], "annotation": {}, "desc": "获取控件的文本。\n只是对widget\_get\_prop的包装文本的意义由子类控件决定。", "name": "widget_get_text_utf8", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "const char*", "name": "name", "desc": "子控件的名称。" }, { "type": "const char*", "name": "text", "desc": "文本。" } ], "annotation": { "scriptable": true }, "desc": "设置子控件的文本。\n只是对widget\_set\_prop的包装文本的意义由子类控件决定。", "name": "widget_set_child_text_utf8", "alias": "set_child_text", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "const char*", "name": "name", "desc": "子控件的名称。" }, { "type": "const char*", "name": "format", "desc": "格式字符串(如:"%2.2lf")。" }, { "type": "double", "name": "value", "desc": "浮点数值。" } ], "annotation": { "scriptable": true }, "desc": "用一个浮点数去设置子控件的文本。\n只是对widget\_set\_prop的包装文本的意义由子类控件决定。", "name": "widget_set_child_text_with_double", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "const char*", "name": "name", "desc": "子控件的名称。" }, { "type": "const char*", "name": "format", "desc": "格式字符串(如:"%d")。" }, { "type": "int", "name": "value", "desc": "值。" } ], "annotation": { "scriptable": true }, "desc": "用一个整数去设置子控件的文本。\n只是对widget\_set\_prop的包装文本的意义由子类控件决定。", "name": "widget_set_child_text_with_int", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "const char*", "name": "text", "desc": "文本。" } ], "annotation": { "scriptable": true }, "desc": "获取翻译之后的文本然后调用widget_set_text。", "name": "widget_set_tr_text", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" } ], "annotation": { "scriptable": true }, "desc": "获取控件的值。只是对widget\_get\_prop的包装值的意义由子类控件决定。", "name": "widget_get_value", "return": { "type": "int32_t", "desc": "返回值。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" } ], "annotation": { "scriptable": true }, "desc": "获取控件的文本。\n只是对widget\_get\prop的包装文本的意义由子类控件决定。\n\n如果希望获取UTF8格式的文本可以参考下面的代码\n\nc\nstr_t str;\nstr_init(&str, 0);\nstr_from_wstr(&str, widget_get_text(target));\nlog_debug(\"%s: %s\\n\", target->name, str.str);\nstr_reset(&str);\n", "name": "widget_get_text", "return": { "type": "const wchar_t*", "desc": "返回文本。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "point_t*", "name": "p", "desc": "坐标点。" } ], "annotation": {}, "desc": "将屏幕坐标转换成控件内的本地坐标,即相对于控件左上角的坐标。", "name": "widget_to_local", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "point_t*", "name": "p", "desc": "坐标点。" } ], "annotation": {}, "desc": "将控件内的本地坐标转换成全局坐标。", "name": "widget_to_global", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "point_t*", "name": "p", "desc": "坐标点。" } ], "annotation": {}, "desc": "将控件内的本地坐标转换成屏幕上的坐标。", "name": "widget_to_screen", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "const char*", "name": "name", "desc": "名称。" } ], "annotation": { "scriptable": true }, "desc": "设置控件的名称。", "name": "widget_set_name", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "const char*", "name": "name", "desc": "主题的名称。" } ], "annotation": { "scriptable": true }, "desc": "设置theme的名称用于动态切换主题。名称与当前主题名称相同则重新加载全部资源。\n\n> 目前只支持带有文件系统的平台。", "name": "widget_set_theme", "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": "widget_set_pointer_cursor", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "const char*", "name": "animation", "desc": "动画参数。" } ], "annotation": { "scriptable": true }, "desc": "设置控件的动画参数(仅用于在UI文件使用)。\n请参考[控件动画](https://github.com/zlgopen/awtk/blob/master/docs/widget_animator.md)", "name": "widget_set_animation", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "const char*", "name": "animation", "desc": "动画参数。" } ], "annotation": { "scriptable": true }, "desc": "创建动画。\n请参考[控件动画](https://github.com/zlgopen/awtk/blob/master/docs/widget_animator.md)\n\n* 除非指定auto_start=false动画创建后自动启动。\n* 除非指定auto_destroy=false动画播放完成后自动销毁。", "name": "widget_create_animator", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "const char*", "name": "name", "desc": "动画名称。" } ], "annotation": { "scriptable": true }, "desc": "播放动画。\n请参考[控件动画](https://github.com/zlgopen/awtk/blob/master/docs/widget_animator.md)\n\n* 1.widget为NULL时播放所有名称为name的动画。\n* 2.name为NULL时播放所有widget相关的动画。\n* 3.widget和name均为NULL播放所有动画。", "name": "widget_start_animator", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "const char*", "name": "name", "desc": "动画名称。" }, { "type": "float_t", "name": "time_scale", "desc": "时间倍率。" } ], "annotation": { "scriptable": true }, "desc": "设置动画的时间倍率,<0: 时间倒退,<1: 时间变慢,>1 时间变快。\n请参考[控件动画](https://github.com/zlgopen/awtk/blob/master/docs/widget_animator.md)\n\n* 1.widget为NULL时设置所有名称为name的动画的时间倍率。\n* 2.name为NULL时设置所有widget相关的动画的时间倍率。\n* 3.widget和name均为NULL设置所有动画的时间倍率。", "name": "widget_set_animator_time_scale", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "const char*", "name": "name", "desc": "动画名称。" } ], "annotation": { "scriptable": true }, "desc": "暂停动画。\n请参考[控件动画](https://github.com/zlgopen/awtk/blob/master/docs/widget_animator.md)\n\n* 1.widget为NULL时暂停所有名称为name的动画。\n* 2.name为NULL时暂停所有widget相关的动画。\n* 3.widget和name均为NULL暂停所有动画。", "name": "widget_pause_animator", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "const char*", "name": "name", "desc": "动画名称。" } ], "annotation": {}, "desc": "查找指定名称的动画。", "name": "widget_find_animator", "return": { "type": "widget_animator_t*", "desc": "成功返回动画对象失败返回NULL。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "const char*", "name": "name", "desc": "动画名称。" } ], "annotation": { "scriptable": true }, "desc": "停止动画(控件的相应属性回归原位)。\n请参考[控件动画](https://github.com/zlgopen/awtk/blob/master/docs/widget_animator.md)\n\n* 1.widget为NULL时停止所有名称为name的动画。\n* 2.name为NULL时停止所有widget相关的动画。\n* 3.widget和name均为NULL停止所有动画。", "name": "widget_stop_animator", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "const char*", "name": "name", "desc": "动画名称。" } ], "annotation": { "scriptable": true }, "desc": "销毁动画。\n请参考[控件动画](https://github.com/zlgopen/awtk/blob/master/docs/widget_animator.md)\n\n* 1.widget为NULL时销毁所有名称为name的动画。\n* 2.name为NULL时销毁所有widget相关的动画。\n* 3.widget和name均为NULL销毁所有动画。", "name": "widget_destroy_animator", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "bool_t", "name": "enable", "desc": "是否可用性。" } ], "annotation": { "scriptable": true }, "desc": "设置控件的可用性。", "name": "widget_set_enable", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "bool_t", "name": "feedback", "desc": "是否启用反馈。" } ], "annotation": { "scriptable": true }, "desc": "设置控件是否启用反馈。", "name": "widget_set_feedback", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "bool_t", "name": "auto_adjust_size", "desc": "是否根据子控件和文本自动调整控件自身大小。" } ], "annotation": { "scriptable": true }, "desc": "设置控件是否根据子控件和文本自动调整控件自身大小。", "name": "widget_set_auto_adjust_size", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "bool_t", "name": "floating", "desc": "是否启用floating布局。" } ], "annotation": { "scriptable": true }, "desc": "设置控件的floating标志。\n> floating的控件不受父控件的子控件布局参数的影响。", "name": "widget_set_floating", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "bool_t", "name": "focused", "desc": "是否获得焦点。" } ], "annotation": { "scriptable": true }, "desc": "设置控件是否获得焦点。", "name": "widget_set_focused", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "bool_t", "name": "focusable", "desc": "是否可获得焦点。" } ], "annotation": { "scriptable": true }, "desc": "设置控件是否可获得焦点。", "name": "widget_set_focusable", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "const char*", "name": "state", "desc": "状态(必须为真正的常量字符串在widget的整个生命周期有效)。" } ], "annotation": { "scriptable": true }, "desc": "设置控件的状态。", "name": "widget_set_state", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "uint8_t", "name": "opacity", "desc": "不透明度(取值0-2550表示完全透明255表示完全不透明)。" } ], "annotation": { "scriptable": true }, "desc": "设置控件的不透明度。\n\n>在嵌入式平台,半透明效果会使性能大幅下降,请谨慎使用。", "name": "widget_set_opacity", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "uint16_t", "name": "dirty_rect_tolerance", "desc": "控件脏脏矩形超出控件本身大小的最大范。" } ], "annotation": { "scriptable": true }, "desc": "设置控件脏矩形超出控件本身大小的最大范围(一般不用指定)。", "name": "widget_set_dirty_rect_tolerance", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" } ], "annotation": { "scriptable": true }, "desc": "销毁全部子控件。", "name": "widget_destroy_children", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "widget_t*", "name": "child", "desc": "子控件对象。" } ], "annotation": { "scriptable": true }, "desc": "加入一个子控件。", "name": "widget_add_child", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "widget_t*", "name": "child", "desc": "子控件对象。" } ], "annotation": { "scriptable": true }, "desc": "移出指定的子控件(并不销毁)。", "name": "widget_remove_child", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "uint32_t", "name": "index", "desc": "位置序数(大于等于总个数,则放到最后)。" }, { "type": "widget_t*", "name": "child", "desc": "子控件对象。" } ], "annotation": { "scriptable": true }, "desc": "插入子控件到指定的位置。", "name": "widget_insert_child", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "uint32_t", "name": "index", "desc": "位置序数(大于等于总个数,则放到最后)。" } ], "annotation": { "scriptable": true }, "desc": "调整控件在父控件中的位置序数。", "name": "widget_restack", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "const char*", "name": "name", "desc": "子控件的名称。" } ], "annotation": { "scriptable": true }, "desc": "查找指定名称的子控件(同widget_lookup(widget, name, FALSE))。", "name": "widget_child", "return": { "type": "widget_t*", "desc": "子控件或NULL。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "const char*", "name": "name", "desc": "子控件的名称。" }, { "type": "bool_t", "name": "recursive", "desc": "是否递归查找全部子控件。" } ], "annotation": { "scriptable": true }, "desc": "查找指定名称的子控件(返回第一个)。", "name": "widget_lookup", "return": { "type": "widget_t*", "desc": "子控件或NULL。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "const char*", "name": "type", "desc": "子控件的名称。" }, { "type": "bool_t", "name": "recursive", "desc": "是否递归查找全部子控件。" } ], "annotation": { "scriptable": true }, "desc": "查找指定类型的子控件(返回第一个)。", "name": "widget_lookup_by_type", "return": { "type": "widget_t*", "desc": "子控件或NULL。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "bool_t", "name": "visible", "desc": "是否可见。" } ], "annotation": { "scriptable": true }, "desc": "设置控件的可见性。", "name": "widget_set_visible", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "bool_t", "name": "visible", "desc": "是否可见。" } ], "annotation": { "scriptable": true }, "desc": "设置控件的可见性(不触发repaint和relayout)。", "name": "widget_set_visible_only", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "bool_t", "name": "sensitive", "desc": "是否接受用户事件。" } ], "annotation": { "scriptable": true }, "desc": "设置控件是否接受用户事件。", "name": "widget_set_sensitive", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "event_type_t", "name": "type", "desc": "事件类型。" }, { "type": "event_func_t", "name": "on_event", "desc": "事件处理函数。" }, { "type": "void*", "name": "ctx", "desc": "事件处理函数上下文。" } ], "annotation": { "scriptable": "custom" }, "desc": "注册指定事件的处理函数。\n使用示例\n\nc\nwidget_t* ok = button_create(win, 10, 10, 80, 30);\nwidget_on(ok, EVT_CLICK, on_click, NULL);\n\n", "name": "widget_on", "return": { "type": "uint32_t", "desc": "返回id用于widget_off。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "event_type_t", "name": "type", "desc": "事件类型。" }, { "type": "event_func_t", "name": "on_event", "desc": "事件处理函数。" }, { "type": "void*", "name": "ctx", "desc": "事件处理函数上下文。" }, { "type": "uint32_t", "name": "tag", "desc": "tag。" } ], "annotation": {}, "desc": "注册指定tag的事件处理函数。\n\n> 注册时指定一个tag可用widget\off\by\tag注销相同tag的事件处理函数。", "name": "widget_on_with_tag", "return": { "type": "uint32_t", "desc": "返回id用于widget_off。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "uint32_t", "name": "id", "desc": "widget_on返回的ID。" } ], "annotation": { "scriptable": true }, "desc": "注销指定事件的处理函数。", "name": "widget_off", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "const char*", "name": "name", "desc": "子控件的名称。" }, { "type": "event_type_t", "name": "type", "desc": "事件类型。" }, { "type": "event_func_t", "name": "on_event", "desc": "事件处理函数。" }, { "type": "void*", "name": "ctx", "desc": "事件处理函数上下文。" } ], "annotation": {}, "desc": "为指定名称的子控件注册指定事件的处理函数。\n递归查找指定名称的子控件然后为其注册指定事件的处理函数。", "name": "widget_child_on", "return": { "type": "uint32_t", "desc": "返回id用于widget_off。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "event_type_t", "name": "type", "desc": "事件类型。" }, { "type": "event_func_t", "name": "on_event", "desc": "事件处理函数。" }, { "type": "void*", "name": "ctx", "desc": "事件处理函数上下文。" } ], "annotation": {}, "desc": "注销指定函数的事件处理函数。", "name": "widget_off_by_func", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "void*", "name": "ctx", "desc": "事件处理函数上下文。" } ], "annotation": {}, "desc": "注销指定ctx的事件处理函数。", "name": "widget_off_by_ctx", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "uint32_t", "name": "tag", "desc": "tag。" } ], "annotation": {}, "desc": "注销指定tag的事件处理函数。", "name": "widget_off_by_tag", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "const rect_t*", "name": "r", "desc": "矩形对象(widget本地坐标)。" } ], "annotation": {}, "desc": "请求重绘指定的区域如果widget->dirty已经为TRUE直接返回。", "name": "widget_invalidate", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "const rect_t*", "name": "r", "desc": "矩形对象(widget本地坐标)。" } ], "annotation": { "scriptable": true }, "desc": "请求强制重绘控件。", "name": "widget_invalidate_force", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "canvas_t*", "name": "c", "desc": "画布对象。" } ], "annotation": {}, "desc": "绘制控件到一个canvas上。", "name": "widget_paint", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "canvas_t*", "name": "c", "desc": "画布对象。" }, { "type": "const wchar_t*", "name": "str", "desc": "文本。" }, { "type": "uint32_t", "name": "size", "desc": "文本长度。" }, { "type": "const rect_t*", "name": "r", "desc": "矩形区域。" }, { "type": "bool_t", "name": "ellipses", "desc": "宽度不够时是否显示省略号。" } ], "annotation": {}, "desc": "在canvas绘制一行文本。", "name": "widget_draw_text_in_rect", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "event_t*", "name": "e", "desc": "事件。" } ], "annotation": {}, "desc": "分发一个事件。", "name": "widget_dispatch", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "uint32_t", "name": "type", "desc": "事件类型。" } ], "annotation": {}, "desc": "分发一个简单事件。", "name": "widget_dispatch_simple_event", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "event_t*", "name": "e", "desc": "事件。" } ], "annotation": {}, "desc": "分发一个事件控件本身及所有子控件。", "name": "widget_dispatch_recursive", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "const char*", "name": "name", "desc": "属性的名称。" }, { "type": "value_t*", "name": "v", "desc": "返回属性的值。" } ], "annotation": {}, "desc": "获取控件指定属性的值。", "name": "widget_get_prop", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "const char*", "name": "name", "desc": "属性的名称。" }, { "type": "value_t*", "name": "v", "desc": "返回属性的缺省值。" } ], "annotation": {}, "desc": "获取控件指定属性的缺省值(在持久化控件时,无需保存缺省值)。", "name": "widget_get_prop_default_value", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "const char*", "name": "name", "desc": "属性的名称。" }, { "type": "value_t*", "name": "v", "desc": "属性的值。" } ], "annotation": {}, "desc": "设置控件指定属性的值。", "name": "widget_set_prop", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "const char*", "name": "name", "desc": "属性的名称。" }, { "type": "const char*", "name": "v", "desc": "属性的值。" } ], "annotation": { "scriptable": true }, "desc": "设置字符串格式的属性。", "name": "widget_set_prop_str", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "const char*", "name": "name", "desc": "属性的名称。" }, { "type": "const char*", "name": "defval", "desc": "缺省值。" } ], "annotation": { "scriptable": true }, "desc": "获取字符串格式的属性。", "name": "widget_get_prop_str", "return": { "type": "const char*", "desc": "返回属性的值。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "const char*", "name": "name", "desc": "属性的名称。" }, { "type": "void*", "name": "v", "desc": "属性的值。" } ], "annotation": { "scriptable": true }, "desc": "设置指针格式的属性。", "name": "widget_set_prop_pointer", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "const char*", "name": "name", "desc": "属性的名称。" } ], "annotation": { "scriptable": true }, "desc": "获取指针格式的属性。", "name": "widget_get_prop_pointer", "return": { "type": "void*", "desc": "返回属性的值。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "const char*", "name": "name", "desc": "属性的名称。" }, { "type": "int32_t", "name": "v", "desc": "属性的值。" } ], "annotation": { "scriptable": true }, "desc": "设置整数格式的属性。", "name": "widget_set_prop_int", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "const char*", "name": "name", "desc": "属性的名称。" }, { "type": "int32_t", "name": "defval", "desc": "缺省值。" } ], "annotation": { "scriptable": true }, "desc": "获取整数格式的属性。", "name": "widget_get_prop_int", "return": { "type": "int32_t", "desc": "返回属性的值。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "const char*", "name": "name", "desc": "属性的名称。" }, { "type": "bool_t", "name": "v", "desc": "属性的值。" } ], "annotation": { "scriptable": true }, "desc": "设置布尔格式的属性。", "name": "widget_set_prop_bool", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "const char*", "name": "name", "desc": "属性的名称。" }, { "type": "bool_t", "name": "defval", "desc": "缺省值。" } ], "annotation": { "scriptable": true }, "desc": "获取布尔格式的属性。", "name": "widget_get_prop_bool", "return": { "type": "bool_t", "desc": "返回属性的值。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" } ], "annotation": { "scriptable": true }, "desc": "判断当前控件所在的窗口是否已经打开。", "name": "widget_is_window_opened", "return": { "type": "bool_t", "desc": "返回当前控件所在的窗口是否已经打开。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "widget_t*", "name": "child", "desc": "控件对象。" } ], "annotation": { "scriptable": true }, "desc": "判断当前控件是否是指定控件的父控件(包括非直系)。", "name": "widget_is_parent_of", "return": { "type": "bool_t", "desc": "返回TRUE表示是否则表示不是。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "widget_t*", "name": "child", "desc": "控件对象。" } ], "annotation": { "scriptable": true }, "desc": "判断当前控件是否是指定控件的直系父控件。", "name": "widget_is_direct_parent_of", "return": { "type": "bool_t", "desc": "返回TRUE表示是否则表示不是。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" } ], "annotation": { "scriptable": true }, "desc": "判断当前控件是否是窗口。", "name": "widget_is_window", "return": { "type": "bool_t", "desc": "返回当前控件是否是窗口。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "widget对象。" } ], "annotation": { "scriptable": true }, "desc": "检查控件是否是system bar类型。", "name": "widget_is_system_bar", "return": { "type": "bool_t", "desc": "返回FALSE表示不是否则表示是。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "widget对象。" } ], "annotation": { "scriptable": true }, "desc": "检查控件是否是普通窗口类型。", "name": "widget_is_normal_window", "return": { "type": "bool_t", "desc": "返回FALSE表示不是否则表示是。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "widget对象。" } ], "annotation": { "scriptable": true }, "desc": "检查控件是否是对话框类型。", "name": "widget_is_dialog", "return": { "type": "bool_t", "desc": "返回FALSE表示不是否则表示是。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "widget对象。" } ], "annotation": { "scriptable": true }, "desc": "检查控件是否是弹出窗口类型。", "name": "widget_is_popup", "return": { "type": "bool_t", "desc": "返回FALSE表示不是否则表示是。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "widget对象。" } ], "annotation": { "scriptable": true }, "desc": "检查控件是否是overlay窗口类型。", "name": "widget_is_overlay", "return": { "type": "bool_t", "desc": "返回FALSE表示不是否则表示是。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "widget对象。" } ], "annotation": { "scriptable": true }, "desc": "检查控件弹出窗口控件是否已经打开了(而非挂起状态)。", "name": "widget_is_opened_popup", "return": { "type": "bool_t", "desc": "返回FALSE表示不是否则表示是。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" } ], "annotation": { "scriptable": true }, "desc": "判断当前控件是否是keyboard。\n\n> keyboard收到pointer事件时不会让当前控件失去焦点。\n\n在自定义软键盘时将所有按钮放到一个容器当中并设置为is_keyboard。\n\nc\nwidget_set_prop_bool(group, WIDGET_PROP_IS_KEYBOARD, TRUE);\n", "name": "widget_is_keyboard", "return": { "type": "bool_t", "desc": "返回FALSE表示不是否则表示是。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" } ], "annotation": { "scriptable": true }, "desc": "判断当前控件是否是设计窗口。", "name": "widget_is_designing_window", "return": { "type": "bool_t", "desc": "返回当前控件是否是设计窗口。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" } ], "annotation": { "scriptable": true }, "desc": "判断当前控件是否是窗口管理器。", "name": "widget_is_window_manager", "return": { "type": "bool_t", "desc": "返回当前控件是否是窗口管理器。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "widget_t*", "name": "child", "desc": "子控件对象。" } ], "annotation": {}, "desc": "让指定子控件抓住事件。\n控件抓住之后事件直接分发给该控件。", "name": "widget_grab", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "widget_t*", "name": "child", "desc": "子控件对象。" } ], "annotation": {}, "desc": "让指定子控件放弃抓住事件。", "name": "widget_ungrab", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "tk_visit_t", "name": "visit", "desc": "遍历的回调函数。" }, { "type": "void*", "name": "ctx", "desc": "回调函数的上下文。" } ], "annotation": { "scriptable": "custom" }, "desc": "遍历当前控件及子控件。", "name": "widget_foreach", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" } ], "annotation": { "scriptable": true }, "desc": "获取当前控件所在的窗口。", "name": "widget_get_window", "return": { "type": "widget_t*", "desc": "窗口对象。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" } ], "annotation": { "scriptable": true }, "desc": "获取当前的窗口管理器。", "name": "widget_get_window_manager", "return": { "type": "widget_t*", "desc": "窗口管理器对象。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" } ], "annotation": { "scriptable": true }, "desc": "获取当前控件的类型名称。", "name": "widget_get_type", "return": { "type": "const char*", "desc": "返回类型名。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "widget_t*", "name": "parent", "desc": "clone新控件的parent对象。" } ], "annotation": { "scriptable": true }, "desc": "clone。", "name": "widget_clone", "return": { "type": "widget_t*", "desc": "返回clone的对象。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "widget_t*", "name": "other", "desc": "要比较的控件对象。" } ], "annotation": { "scriptable": true }, "desc": "判断两个widget是否相同。", "name": "widget_equal", "return": { "type": "bool_t", "desc": "返回TRUE表示相同否则表示不同。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "timer_func_t", "name": "on_timer", "desc": "timer回调函数。" }, { "type": "uint32_t", "name": "duration_ms", "desc": "时间。" } ], "annotation": {}, "desc": "创建定时器。\n该定时器在控件销毁时自动销毁timer\_info\_t的ctx为widget。\n如果定时器的生命周期与控件无关请直接调用timer_add,以避免不必要的内存开销。\n\n使用示例\n\nc\nstatic ret_t digit_clock_on_timer(const timer_info_t* info) {\nwidget_t* widget = WIDGET(info->ctx);\n\nreturn RET_REPEAT;\n}\n...\nwidget_add_timer(widget, digit_clock_on_timer, 1000);\n\n", "name": "widget_add_timer", "return": { "type": "uint32_t", "desc": "返回timer的IDTK_INVALID_ID表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "uint32_t", "name": "timer_id", "desc": "timerID。" } ], "annotation": {}, "desc": "删除指定的timer。", "name": "widget_remove_timer", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "idle_func_t", "name": "on_idle", "desc": "idle回调函数。" } ], "annotation": {}, "desc": "创建idle。\n该idle在控件销毁时自动销毁idle\_info\_t的ctx为widget。\n如果idle的生命周期与控件无关请直接调用idle_add,以避免不必要的内存开销。", "name": "widget_add_idle", "return": { "type": "uint32_t", "desc": "返回idle的IDTK_INVALID_ID表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "const char*", "name": "name", "desc": "图片名(不带扩展名)。" }, { "type": "bitmap_t*", "name": "bitmap", "desc": "返回图片对象。" } ], "annotation": {}, "desc": "加载图片。\n返回的bitmap对象只在当前调用有效请不保存对bitmap对象的引用。\n\n\n使用示例\n\nc\nbitmap_t bitmap;\nwidget_load_image(widget, \"myimage\", &bitmap);\n\n", "name": "widget_load_image", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "bitmap_t*", "name": "bitmap", "desc": "图片对象。" } ], "annotation": {}, "desc": "卸载图片。\n\n> 一般不需要调用,只有确认在图片不再需要时才调用本函数卸载。", "name": "widget_unload_image", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "asset_type_t", "name": "type", "desc": "资源类型。" }, { "type": "const char*", "name": "name", "desc": "资源名。" } ], "annotation": {}, "desc": "加载资源。\n\n使用示例\n\nc\nconst asset_info_t* asset = widget_load_asset(widget, ASSET_TYPE_IMAGE, \"mysvg\");\n...\nwidget_unload_asset(widget, asset);\n", "name": "widget_load_asset", "return": { "type": "const asset_info_t*", "desc": "返回资源句柄。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "const asset_info_t*", "name": "asset", "desc": "资源句柄。" } ], "annotation": {}, "desc": "卸载资源。\n\n使用示例\n\nc\nconst asset_info_t* asset = widget_load_asset(widget, ASSET_TYPE_IMAGE, \"mysvg\");\n...\nwidget_unload_asset(widget, asset);\n", "name": "widget_unload_asset", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "widget对象。" } ], "annotation": { "cast": true, "scriptable": true }, "desc": "转换为widget对象(供脚本语言使用)。", "name": "widget_cast", "return": { "type": "widget_t*", "desc": "widget对象。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" } ], "annotation": { "scriptable": true }, "desc": "从父控件中移除控件并调用unref函数销毁控件。\n\n> 一般无需直接调用,关闭窗口时,自动销毁相关控件。", "name": "widget_destroy", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" } ], "annotation": { "scriptable": true }, "desc": "从父控件中移除控件并调用unref函数销毁控件。\n\n> 一般无需直接调用,关闭窗口时,自动销毁相关控件。", "name": "widget_destroy_async", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" } ], "annotation": {}, "desc": "增加控件的引用计数。", "name": "widget_ref", "return": { "type": "widget_t*", "desc": "返回控件对象。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" } ], "annotation": { "scriptable": true }, "desc": "减少控件的引用计数。引用计数为0时销毁控件。", "name": "widget_unref", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "canvas_t*", "name": "c", "desc": "画布对象。" }, { "type": "const char*", "name": "icon", "desc": "图标的名称。" }, { "type": "wstr_t*", "name": "text", "desc": "文字。" } ], "annotation": {}, "desc": "帮助子控件实现自己的绘制函数。", "name": "widget_paint_helper", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "canvas_t*", "name": "c", "desc": "画布对象。" } ], "annotation": {}, "desc": "根据控件的style绘制背景矩形。", "name": "widget_draw_background", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "canvas_t*", "name": "c", "desc": "画布对象。" }, { "type": "const rect_t*", "name": "r", "desc": "矩形区域。" } ], "annotation": { "scriptable": true }, "desc": "根据控件的style绘制边框矩形。", "name": "widget_stroke_border_rect", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "canvas_t*", "name": "c", "desc": "画布对象。" }, { "type": "const rect_t*", "name": "r", "desc": "矩形区域。" }, { "type": "image_draw_type_t", "name": "draw_type", "desc": "图片缺省绘制方式。" } ], "annotation": { "scriptable": true }, "desc": "根据控件的style绘制背景矩形。", "name": "widget_fill_bg_rect", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "canvas_t*", "name": "c", "desc": "画布对象。" }, { "type": "const rect_t*", "name": "r", "desc": "矩形区域。" }, { "type": "image_draw_type_t", "name": "draw_type", "desc": "图片缺省绘制方式。" } ], "annotation": { "scriptable": true }, "desc": "根据控件的style绘制前景矩形。", "name": "widget_fill_fg_rect", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "canvas_t*", "name": "c", "desc": "画布对象。" } ], "annotation": {}, "desc": "从widget的style中取出字体名称、大小和颜色数据设置到canvas中。", "name": "widget_prepare_text_style", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "wchar_t*", "name": "text", "desc": "文本。" } ], "annotation": {}, "desc": "计算文本的宽度。\n字体由控件当前的状态和style决定。", "name": "widget_measure_text", "return": { "type": "float_t", "desc": "返回文本的宽度。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "event_t*", "name": "e", "desc": "事件对象。" } ], "annotation": {}, "desc": "递归分发事件到targe控件。", "name": "widget_dispatch_event_to_target_recursive", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "xy_t", "name": "x", "desc": "x坐标" }, { "type": "xy_t", "name": "y", "desc": "y坐标" }, { "type": "bool_t", "name": "is_local", "desc": "TRUE表示是相对与控件左上角的坐标否则表示全局坐标。" } ], "annotation": {}, "desc": "判断一个点是否在控件内。", "name": "widget_is_point_in", "return": { "type": "bool_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "event_t*", "name": "e", "desc": "事件。" } ], "annotation": { "scriptable": true }, "desc": "递归的分发一个事件到所有target子控件。", "name": "widget_dispatch_to_target", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "event_t*", "name": "e", "desc": "事件。" } ], "annotation": { "scriptable": true }, "desc": "递归的分发一个事件到所有key_target子控件。", "name": "widget_dispatch_to_key_target", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "xy_t", "name": "x", "desc": "x坐标。" }, { "type": "xy_t", "name": "y", "desc": "y坐标。" } ], "annotation": {}, "desc": "查找x/y坐标对应的子控件。", "name": "widget_find_target", "return": { "type": "widget*", "desc": "子控件或NULL。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" } ], "annotation": {}, "desc": "语言改变后,重新翻译控件上的文本(包括子控件)。", "name": "widget_re_translate_text", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "widget对象。" }, { "type": "widget_t*", "name": "parent", "desc": "widget的父控件。" }, { "type": "widget_vtable_t*", "name": "vt", "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": {}, "desc": "初始化控件。仅在子类控件构造函数中使用。\n\n> 请用widget\create代替本函数。\n\n@depreated", "name": "widget_init", "return": { "type": "widget_t*", "desc": "widget对象本身。" } }, { "params": [ { "type": "widget_t*", "name": "parent", "desc": "widget的父控件。" }, { "type": "widget_vtable_t*", "name": "vt", "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": {}, "desc": "创建控件。仅在子类控件构造函数中使用。", "name": "widget_create", "return": { "type": "widget_t*", "desc": "widget对象本身。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "widget对象。" } ], "annotation": { "scriptable": true }, "desc": "让控件根据自己当前状态更新style。", "name": "widget_update_style", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "widget对象。" } ], "annotation": { "scriptable": true }, "desc": "让控件及子控件根据自己当前状态更新style。", "name": "widget_update_style_recursive", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "widget对象。" } ], "annotation": { "scriptable": true }, "desc": "递归的把父控件的key_target设置为自己。", "name": "widget_set_as_key_target", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "widget对象。" } ], "annotation": { "scriptable": true }, "desc": "把焦点移动下一个控件。\n\n>widget必须是当前焦点控件。", "name": "widget_focus_next", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "widget对象。" } ], "annotation": { "scriptable": true }, "desc": "把焦点移动前一个控件。\n\n>widget必须是当前焦点控件。", "name": "widget_focus_prev", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "widget对象。" }, { "type": "bool_t", "name": "active", "desc": "控件是否为当前项。" }, { "type": "bool_t", "name": "checked", "desc": "控件是否为选中项。" } ], "annotation": { "scriptable": true }, "desc": "把控件的状态转成获取style选要的状态一般只在子类中使用。", "name": "widget_get_state_for_style", "return": { "type": "const char*", "desc": "返回状态值。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "widget对象。" } ], "annotation": { "scriptable": true }, "desc": "布局当前控件及子控件。", "name": "widget_layout", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" } ], "annotation": {}, "desc": "layout子控件。", "name": "widget_layout_children", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "const char*", "name": "params", "desc": "布局参数。" } ], "annotation": { "scriptable": true }, "desc": "设置控件自己的布局参数。", "name": "widget_set_self_layout", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "const char*", "name": "params", "desc": "布局参数。" } ], "annotation": { "scriptable": true }, "desc": "设置子控件的布局参数。", "name": "widget_set_children_layout", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "const char*", "name": "x", "desc": "x参数。" }, { "type": "const char*", "name": "y", "desc": "y参数。" }, { "type": "const char*", "name": "w", "desc": "w参数。" }, { "type": "const char*", "name": "h", "desc": "h参数。" } ], "annotation": { "scriptable": true }, "desc": "设置控件自己的布局(缺省布局器)参数(过时请用widget\set\self\layout)。", "name": "widget_set_self_layout_params", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "const char*", "name": "state_and_name", "desc": "状态和名字,用英文的冒号分隔。" }, { "type": "int32_t", "name": "value", "desc": "值。" } ], "annotation": { "scriptable": true }, "desc": "设置整数类型的style。\n\n> * [state 的取值](https://github.com/zlgopen/awtk/blob/master/docs/manual/widget_state_t.md)\n> * [name 的取值](https://github.com/zlgopen/awtk/blob/master/docs/theme.md)", "name": "widget_set_style_int", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "const char*", "name": "state_and_name", "desc": "状态和名字,用英文的冒号分隔。" }, { "type": "const char*", "name": "value", "desc": "值。" } ], "annotation": { "scriptable": true }, "desc": "设置字符串类型的style。\n\n> * [state 的取值](https://github.com/zlgopen/awtk/blob/master/docs/manual/widget_state_t.md)\n> * [name 的取值](https://github.com/zlgopen/awtk/blob/master/docs/theme.md)", "name": "widget_set_style_str", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "const char*", "name": "state_and_name", "desc": "状态和名字,用英文的冒号分隔。" }, { "type": "uint32_t", "name": "value", "desc": "值。颜色值一般用十六进制表示每两个数字表示一个颜色通道从高位到低位依次是ABGR。" } ], "annotation": { "scriptable": true }, "desc": "设置颜色类型的style。\n\n> * [state 的取值](https://github.com/zlgopen/awtk/blob/master/docs/manual/widget_state_t.md)\n> * [name 的取值](https://github.com/zlgopen/awtk/blob/master/docs/theme.md)\n\n\n在下面这个例子中R=0x11 G=0x22 B=0x33 A=0xFF\n\nc\nwidget_set_style_color(label, \"style:normal:bg_color\", 0xFF332211);\n", "name": "widget_set_style_color", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" } ], "annotation": {}, "desc": "创建一个bitmap对象将控件绘制到bitmap上并返回bitmap对象。\n\n调用者需要调用bitmap_destroy销毁返回的bitmap对象。\n\nc\nbitmap_t* bitmap = widget_take_snapshot(window_manager());\nbitmap_save_png(bitmap, \"test.png\");\nbitmap_destroy(bitmap);\n", "name": "widget_take_snapshot", "return": { "type": "bitmap_t*", "desc": "返回位图对象。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "const rect_t*", "name": "r", "desc": "截屏区域输入NULL则为控件全区域截屏。" } ], "annotation": {}, "desc": "创建一个bitmap对象将控件绘制到bitmap上并且可以设置该控件的截屏区域返回bitmap对象。\n\n调用者需要调用bitmap_destroy销毁返回的bitmap对象。\n\nc\nbitmap_t* bitmap = widget_take_snapshot_rect(window_manager(), NULL);\nbitmap_save_png(bitmap, \"test.png\");\nbitmap_destroy(bitmap);\n", "name": "widget_take_snapshot_rect", "return": { "type": "bitmap_t*", "desc": "返回位图对象。" } }, { "params": [], "annotation": {}, "desc": "获取canvas对象。", "name": "widget_get_canvas", "return": { "type": "canvas_t*", "desc": "返回canvas对象。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" } ], "annotation": {}, "desc": "重置canvas对象。for designer only,调用者需要unload全部图片", "name": "widget_reset_canvas", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "canvas_t*", "name": "c", "desc": "canvas对象。" } ], "annotation": {}, "desc": "绘制背景。", "name": "widget_on_paint_background", "return": { "type": "ret_t", "desc": "返回。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "canvas_t*", "name": "c", "desc": "canvas对象。" } ], "annotation": {}, "desc": "绘制自身。", "name": "widget_on_paint_self", "return": { "type": "ret_t", "desc": "返回。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "canvas_t*", "name": "c", "desc": "canvas对象。" } ], "annotation": {}, "desc": "绘制子控件。", "name": "widget_on_paint_children", "return": { "type": "ret_t", "desc": "返回。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "canvas_t*", "name": "c", "desc": "canvas对象。" } ], "annotation": {}, "desc": "绘制边框。", "name": "widget_on_paint_border", "return": { "type": "ret_t", "desc": "返回。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "widget_vtable_t*", "name": "vt", "desc": "虚表。" } ], "annotation": {}, "desc": "检查控件是否是指定的类型。", "name": "widget_is_instance_of", "return": { "type": "bool_t", "desc": "返回TRUE表示是FALSE表示否。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" } ], "annotation": {}, "desc": "设置控件需要relayout标识。", "name": "widget_set_need_relayout_children", "return": { "type": "ret_t", "desc": "返回。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" } ], "annotation": {}, "desc": "使控件滚动到可见区域。", "name": "widget_ensure_visible_in_viewport", "return": { "type": "ret_t", "desc": "返回。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" } ], "annotation": {}, "desc": "置焦点于第一个控件。", "name": "widget_focus_first", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" } ], "annotation": {}, "desc": "获取locale_info对象。", "name": "widget_get_locale_info", "return": { "type": "locale_info_t*", "desc": "返回locale_info对象。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" } ], "annotation": {}, "desc": "获取image_manager对象。", "name": "widget_get_image_manager", "return": { "type": "image_manager_t*", "desc": "返回image_manager对象。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" } ], "annotation": {}, "desc": "获取assets_manager对象。", "name": "widget_get_assets_manager", "return": { "type": "assets_manager_t*", "desc": "返回assets_manager对象。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" } ], "annotation": {}, "desc": "获取font_manager对象。", "name": "widget_get_font_manager", "return": { "type": "font_manager_t*", "desc": "返回font_manager对象。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" } ], "annotation": {}, "desc": "更新鼠标指针。", "name": "widget_update_pointer_cursor", "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": "widget_begin_wait_pointer_cursor", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" } ], "annotation": {}, "desc": "结束等待鼠标指针。", "name": "widget_end_wait_pointer_cursor", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "const char*", "name": "state_and_name", "desc": "样式对应类型与名字。" }, { "type": "const value_t*", "name": "value", "desc": "值。" } ], "annotation": {}, "desc": "设置widget私有样式。", "name": "widget_set_style", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。。" } }, { "params": [], "annotation": {}, "desc": "计算icon text的位置。", "name": "widget_calc_icon_text_rect", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" } ], "annotation": {}, "desc": "设置需要更新Style。", "name": "widget_set_need_update_style", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "widget对象。" }, { "type": "str_t*", "name": "str", "desc": "用于保存xml结果。" } ], "annotation": {}, "desc": "将widget转换成xml。", "name": "widget_to_xml", "className": "widget_t", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } } ], "events": [ { "name": "EVT_WILL_MOVE", "desc": "控件移动前触发。", "type": "event_t" }, { "name": "EVT_MOVE", "desc": "控件移动后触发。", "type": "event_t" }, { "name": "EVT_WILL_RESIZE", "desc": "控件调整大小前触发。", "type": "event_t" }, { "name": "EVT_RESIZE", "desc": "控件调整大小后触发。", "type": "event_t" }, { "name": "EVT_WILL_MOVE_RESIZE", "desc": "控件移动并调整大小前触发。", "type": "event_t" }, { "name": "EVT_MOVE_RESIZE", "desc": "控件移动并调整大小后触发。", "type": "event_t" }, { "name": "EVT_PROP_WILL_CHANGE", "desc": "控件属性改变前触发(通过set_prop设置属性才会触发)。", "type": "prop_change_event_t" }, { "name": "EVT_PROP_CHANGED", "desc": "控件属性改变后触发(通过set_prop设置属性才会触发)。", "type": "prop_change_event_t" }, { "name": "EVT_BEFORE_PAINT", "desc": "控件绘制前触发。", "type": "paint_event_t" }, { "name": "EVT_AFTER_PAINT", "desc": "控件绘制完成时触发。", "type": "paint_event_t" }, { "name": "EVT_FOCUS", "desc": "控件得到焦点时触发。", "type": "event_t" }, { "name": "EVT_BLUR", "desc": "控件失去焦点时触发。", "type": "event_t" }, { "name": "EVT_WHEEL", "desc": "鼠标滚轮事件。", "type": "wheel_event_t" }, { "name": "EVT_POINTER_LEAVE", "desc": "鼠标指针离开控件时触发。", "type": "pointer_event_t" }, { "name": "EVT_POINTER_ENTER", "desc": "鼠标指针进入控件时触发。", "type": "pointer_event_t" }, { "name": "EVT_KEY_DOWN", "desc": "键按下事件。", "type": "pointer_event_t" }, { "name": "EVT_KEY_UP", "desc": "键释放事件。", "type": "pointer_event_t" }, { "name": "EVT_POINTER_DOWN", "desc": "指针设备按下事件。", "type": "pointer_event_t" }, { "name": "EVT_POINTER_DOWN_ABORT", "desc": "取消指针设备按下事件。", "type": "pointer_event_t" }, { "name": "EVT_POINTER_MOVE", "desc": "指针设备移动事件。", "type": "pointer_event_t" }, { "name": "EVT_POINTER_UP", "desc": "指针设备释放事件。", "type": "pointer_event_t" }, { "name": "EVT_DESTROY", "desc": "控件销毁时触发。", "type": "event_t" } ], "properties": [ { "name": "x", "desc": "x坐标(相对于父控件的x坐标)。", "type": "xy_t", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "persitent": true, "design": true, "scriptable": true } }, { "name": "y", "desc": "y坐标(相对于父控件的y坐标)。", "type": "xy_t", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "persitent": true, "design": true, "scriptable": true } }, { "name": "w", "desc": "宽度。", "type": "wh_t", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "persitent": true, "design": true, "scriptable": true } }, { "name": "h", "desc": "高度。", "type": "wh_t", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "persitent": true, "design": true, "scriptable": true } }, { "name": "name", "desc": "控件名字。", "type": "char*", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "persitent": true, "design": true, "scriptable": true } }, { "name": "pointer_cursor", "desc": "鼠标光标图片名称。", "type": "char*", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "persitent": true, "design": true, "scriptable": true } }, { "name": "tr_text", "desc": "保存用于翻译的字符串。", "type": "char*", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "persitent": true, "design": true, "scriptable": true } }, { "name": "style", "desc": "style的名称。", "type": "char*", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "persitent": true, "design": true, "scriptable": true } }, { "name": "animation", "desc": "动画参数。请参考[控件动画](https://github.com/zlgopen/awtk/blob/master/docs/widget_animator.md)", "type": "char*", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "persitent": true, "design": true, "scriptable": true } }, { "name": "enable", "desc": "启用/禁用状态。", "type": "bool_t", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "persitent": true, "design": true, "scriptable": true } }, { "name": "feedback", "desc": "是否启用按键音、触屏音和震动等反馈。", "type": "bool_t", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "persitent": true, "design": true, "scriptable": true } }, { "name": "visible", "desc": "是否可见。", "type": "bool_t", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "persitent": true, "design": true, "scriptable": true } }, { "name": "sensitive", "desc": "是否接受用户事件。", "type": "bool_t", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "persitent": true, "design": true, "scriptable": true } }, { "name": "focusable", "desc": "是否支持焦点停留。", "type": "bool_t", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "persitent": true, "design": true, "scriptable": true } }, { "name": "with_focus_state", "desc": "是否支持焦点状态。\n> 如果希望style支持焦点状态但有不希望焦点停留可用本属性。", "type": "bool_t", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "persitent": true, "design": true, "scriptable": true } }, { "name": "auto_adjust_size", "desc": "是否根据子控件和文本自动调整控件自身大小。\n\n> 为true时最好不要使用child_layout否则可能有冲突。\n> 注意:只是调整控件的本身的宽高,不会修改控件本身的位置。", "type": "bool_t", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "persitent": true, "design": true, "scriptable": true } }, { "name": "focused", "desc": "是否得到焦点。", "type": "bool_t", "annotation": { "readable": true } }, { "name": "auto_created", "desc": "是否由父控件自动创建。", "type": "bool_t", "annotation": { "readable": true } }, { "name": "dirty", "desc": "标识控件是否需要重绘。", "type": "bool_t", "annotation": { "readable": true } }, { "name": "floating", "desc": "标识控件是否启用浮动布局不受父控件的children_layout的控制。", "type": "bool_t", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "persitent": true, "design": true, "scriptable": true } }, { "name": "need_relayout_children", "desc": "标识控件是否需要重新layout子控件。", "type": "bool_t", "annotation": { "readable": true } }, { "name": "need_update_style", "desc": "标识控件是否需要update style。", "type": "bool_t", "annotation": { "readable": true } }, { "name": "ref_count", "desc": "引用计数计数为0时销毁。", "type": "int32_t", "annotation": { "readable": true } }, { "name": "initializing", "desc": "标识控件正在初始化。", "type": "bool_t", "annotation": { "readable": true } }, { "name": "loading", "desc": "标识控件正在加载。", "type": "bool_t", "annotation": { "readable": true } }, { "name": "destroying", "desc": "标识控件正在被销毁。", "type": "bool_t", "annotation": { "readable": true } }, { "name": "state", "desc": "控件的状态(取值参考widget_state_t)。", "type": "uint8_t", "annotation": { "readable": true } }, { "name": "opacity", "desc": "不透明度(0-255)0完全透明255完全不透明。", "type": "uint8_t", "annotation": { "readable": true } }, { "name": "dirty_rect_tolerance", "desc": "脏矩形超出控件本身大小的最大范围(一般不用指定)。\n\n> 如果 border 太粗或 offset 太大等原因,导致脏矩形超出控件本身大小太多(大于缺省值)时,才需要指定。", "type": "uint16_t", "annotation": { "readable": true, "design": true, "scriptable": true } }, { "name": "text", "desc": "文本。用途视具体情况而定。", "type": "wstr_t", "annotation": { "readable": true } }, { "name": "parent", "desc": "父控件", "type": "widget_t*", "annotation": { "readable": true, "scriptable": true } }, { "name": "target", "desc": "接收事件的子控件。", "type": "widget_t*", "annotation": { "private": true } }, { "name": "grab_widget", "desc": "grab事件的子控件。", "type": "widget_t*", "annotation": { "private": true } }, { "name": "grab_widget_count", "desc": "有时子控件和控件自己都会grab widget所需要grab的计数。", "type": "int32_t", "annotation": { "private": true } }, { "name": "key_target", "desc": "接收按键事件的子控件。", "type": "widget_t*", "annotation": { "private": true } }, { "name": "children", "desc": "全部子控件。", "type": "darray_t*", "annotation": { "readable": true } }, { "name": "emitter", "desc": "事件发射器。", "type": "emitter_t*", "annotation": { "readable": true } }, { "name": "astyle", "desc": "Style对象。", "type": "style_t*", "annotation": { "readable": true } }, { "name": "children_layout", "desc": "子控件布局器。请参考[控件布局参数](https://github.com/zlgopen/awtk/blob/master/docs/layout.md)", "type": "children_layouter_t*", "annotation": { "readable": true, "set_prop": true, "get_prop": true } }, { "name": "self_layout", "desc": "控件布局器。请参考[控件布局参数](https://github.com/zlgopen/awtk/blob/master/docs/layout.md)", "type": "self_layouter_t*", "annotation": { "readable": true, "set_prop": true, "get_prop": true } }, { "name": "custom_props", "desc": "自定义属性。", "type": "object_t*", "annotation": { "readable": true } }, { "name": "vt", "desc": "虚函数表。", "type": "widget_vtable_t", "annotation": { "readable": true } } ], "header": "base/widget.h", "desc": "widget_t 是所有控件、窗口和窗口管理器的基类。\nwidget_t也是一个容器,可放其它widget_t到它的内部,形成一个树形结构。\n\ngraphviz\n[default_style]\n\nwidget_t -> widget_t[arrowhead = \"diamond\"]\nwindow_t -> widget_t[arrowhead = \"empty\"]\nwindow_manager_t -> widget_t[arrowhead = \"empty\"]\nbutton_t -> widget_t[arrowhead = \"empty\"]\nlabel_t -> widget_t[arrowhead = \"empty\"]\nxxx_widget_t -> widget_t[arrowhead = \"empty\"]\n\n\n通常widget_t通过一个矩形区域向用户呈现一些信息,接受用户的输入,并据此做出适当的反应。\n它负责控件的生命周期、通用状态、事件分发和Style的管理。\n本类提供的接口(函数和属性)除非特别说明,一般都适用于子类控件。\n\n为了便于解释这里特别说明一下几个术语\n\n* 父控件与子控件:父控件与子控件指的两个控件的组合关系(这是在运行时决定的)。\n比如在窗口中放一个按钮此时我们称按钮是窗口的子控件窗口是按钮的父控件。\n\ngraphviz\n[default_style]\n\n子控件 -> 父控件[arrowhead = \"ediamond\"]\n\n\n* 子类控件与父类控件:子类控件与父类控件指的两类控件的继承关系(这是在设计时决定的)。\n比如我们称button_twidget_t的子类控件,widget_tbutton_t的父类控件。\n\ngraphviz\n[default_style]\n\n子类控件 -> 父类控件[arrowhead = \"empty\"]\n\n\n\nwidget相关的函数都只能在GUI线程中执行如果需在非GUI线程中想调用widget相关函数\n请用idle\queue或timer\queue进行串行化。\n请参考demo thread\n\nwidget\_t是抽象类,不要直接创建widget\_t的实例。控件支持两种创建方式:\n\n* 通过XML创建。如\n\nxml\n<button x=\"c\" y=\"m\" w=\"80\" h=\"30\" text=\"OK\"/>\n\n\n* 通过代码创建。如:\n\nc\nwidget_t* button = button_create(win, 10, 10, 128, 30);\nwidget_set_text(button, L\"OK\");\nwidget_on(button, EVT_CLICK, on_click, NULL);\n", "name": "widget_t", "annotation": { "scriptable": true, "widget": true }, "level": 1 }, { "type": "class", "methods": [ { "params": [], "annotation": { "constructor": true }, "desc": "获取缺省的窗口动画工厂对象。", "name": "window_animator_factory", "alias": "window_animator_factory_instance", "return": { "type": "window_animator_factory_t*", "desc": "返回窗口动画工厂对象。" } }, { "params": [ { "type": "window_animator_factory_t*", "name": "factory", "desc": "窗口动画工厂对象。" } ], "annotation": {}, "desc": "设置缺省的窗口动画工厂对象。", "name": "window_animator_factory_set", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [], "annotation": { "constructor": true }, "desc": "创建窗口动画工厂对象。", "name": "window_animator_factory_create", "return": { "type": "window_animator_factory_t*", "desc": "返回窗口动画工厂对象。" } }, { "params": [ { "type": "window_animator_factory_t*", "name": "factory", "desc": "窗口动画工厂对象。" }, { "type": "const char*", "name": "type", "desc": "窗口动画类型。" }, { "type": "window_animator_create_t", "name": "create", "desc": "创建函数。" } ], "annotation": {}, "desc": "注册窗口动画创建函数。", "name": "window_animator_factory_register", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "window_animator_factory_t*", "name": "factory", "desc": "窗口动画工厂对象。" }, { "type": "bool_t", "name": "open", "desc": "TRUE表示打开窗口时的动画FALSE表示关闭窗口时的动画。" }, { "type": "object_t*", "name": "args", "desc": "参数。" } ], "annotation": { "constructor": true }, "desc": "创建指定类型的窗口动画。", "name": "window_animator_factory_create_animator", "return": { "type": "window_animator_t*", "desc": "返回窗口动画对象。" } }, { "params": [ { "type": "window_animator_factory_t*", "name": "factory", "desc": "窗口动画工厂对象。" } ], "annotation": {}, "desc": "析构并释放窗口动画工厂对象。", "name": "window_animator_factory_destroy", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "char*", "name": "type", "desc": "动画类型。" }, { "type": "canvas_t*", "name": "c", "desc": "canvas。" }, { "type": "widget_t*", "name": "prev_win", "desc": "前一窗口。" }, { "type": "widget_t*", "name": "curr_win", "desc": "当前窗口。" } ], "annotation": { "constructor": true }, "desc": "为打开窗口创建动画。", "name": "window_animator_create_for_open", "return": { "type": "window_animator_t*", "desc": "窗口动画对象。" } }, { "params": [ { "type": "char*", "name": "type", "desc": "动画类型。" }, { "type": "canvas_t*", "name": "c", "desc": "canvas。" }, { "type": "widget_t*", "name": "prev_win", "desc": "前一窗口。" }, { "type": "widget_t*", "name": "curr_win", "desc": "当前窗口。" } ], "annotation": { "constructor": true }, "desc": "为关闭窗口创建动画。", "name": "window_animator_create_for_close", "return": { "type": "window_animator_t*", "desc": "窗口动画对象。" } } ], "events": [], "properties": [], "header": "base/window_animator_factory.h", "desc": "窗口动画工厂对象。\n\n提供通过类型创建窗口动画的能力。\n让用户可以自定义窗口动画并获得内置窗口动画同等待遇。", "name": "window_animator_factory_t", "level": 1 }, { "type": "enum", "desc": "@type string\n内置窗口动画常量定义。", "consts": [ { "desc": "中心缩放。适用于居中的对话框。", "name": "WINDOW_ANIMATOR_CENTER_SCALE" }, { "desc": "淡入淡出。适用于toast之类的提示。", "name": "WINDOW_ANIMATOR_FADE," }, { "desc": "顶部部弹出。适用于对话框。", "name": "WINDOW_ANIMATOR_POPDOWN" }, { "desc": "底部弹出。适用于对话框。", "name": "WINDOW_ANIMATOR_POPUP" }, { "desc": "向上弹出。适用于窗口。", "name": "WINDOW_ANIMATOR_SLIDE_UP" }, { "desc": "向下弹出。适用于窗口。", "name": "WINDOW_ANIMATOR_SLIDE_DOWN" }, { "desc": "向左边弹出。适用于窗口。", "name": "WINDOW_ANIMATOR_SLIDE_LEFT" }, { "desc": "向右边弹出。适用于窗口。", "name": "WINDOW_ANIMATOR_SLIDE_RIGHT" }, { "desc": "水平平移。适用于窗口。", "name": "WINDOW_ANIMATOR_HTRANSLATE" }, { "desc": "垂直平移。适用于窗口。", "name": "WINDOW_ANIMATOR_VTRANSLATE" } ], "header": "base/window_animator.h", "name": "window_animator_type_t", "prefix": "WINDOW_ANIMATOR", "level": 1 }, { "type": "class", "methods": [ { "params": [ { "type": "window_animator_t*", "name": "wa", "desc": "窗口动画对象。" }, { "type": "canvas_t*", "name": "canvas", "desc": "画布对象。" }, { "type": "uint32_t", "name": "time_ms", "desc": "当前时间(毫秒)。" } ], "annotation": {}, "desc": "更新动画。", "name": "window_animator_update", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "window_animator_t*", "name": "wa", "desc": "窗口动画对象。" } ], "annotation": {}, "desc": "begin frame", "name": "window_animator_begin_frame", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "window_animator_t*", "name": "wa", "desc": "窗口动画对象。" } ], "annotation": {}, "desc": "end frame", "name": "window_animator_end_frame", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "window_animator_t*", "name": "wa", "desc": "窗口动画对象。" } ], "annotation": {}, "desc": "销毁窗口动画对象。", "name": "window_animator_destroy", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "bool_t", "name": "open", "desc": "TRUE表示打开窗口的动画FALSE表示关闭窗口的动画。" }, { "type": "const window_animator_vtable_t*", "name": "vt", "desc": "虚表对象。" } ], "annotation": {}, "desc": "创建窗口动画对象。\n\n>供子类构造函数用。", "name": "window_animator_create", "return": { "type": "window_animator_t*", "desc": "返回窗口动画对象。" } } ], "events": [], "properties": [], "header": "base/window_animator.h", "desc": "窗口动画。", "name": "window_animator_t", "level": 1 }, { "type": "enum", "desc": "编码名称。", "consts": [ { "desc": "UTF-8。", "name": "ENCODING_UTF8" }, { "desc": "UTF-16。", "name": "ENCODING_UTF16" }, { "desc": "UTF-32。", "name": "ENCODING_UTF32" }, { "desc": "GBK。", "name": "ENCODING_GBK" }, { "desc": "BIG5-2003。", "name": "ENCODING_BIG" }, { "desc": "GB_2312-80。", "name": "ENCODING_GB2312" }, { "desc": "GB18030。", "name": "ENCODING_GB18030" } ], "header": "charset/encoding.h", "name": "encoding_name_t", "prefix": "ENCODING_NAME", "level": 1 }, { "type": "class", "methods": [ { "params": [ { "type": "encoding_name_t", "name": "from", "desc": "源字符串的编码名称。" }, { "type": "const char*", "name": "from_str", "desc": "源字符串。" }, { "type": "uint32_t", "name": "from_size", "desc": "源字符串的长度。" }, { "type": "encoding_name_t", "name": "to", "desc": "目标字符串的编码名称。" }, { "type": "const char*", "name": "", "desc": "。" }, { "type": "uint32_t", "name": "to_size", "desc": "目标字符串的最大长度。" } ], "annotation": { "static": true }, "desc": "字符集转换。", "name": "encoding_convert", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "const char*", "name": "from_str", "desc": "源字符串(utf8)。" }, { "type": "uint32_t", "name": "from_size", "desc": "源字符串的长度。" }, { "type": "const char*", "name": "to_str", "desc": "目标字符串(gbk)。" }, { "type": "uint32_t", "name": "to_size", "desc": "目标字符串的最大长度。" } ], "annotation": { "static": true }, "desc": "将utf8转换成gbk编码。", "name": "encoding_utf8_to_gbk", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "const char*", "name": "from_str", "desc": "源字符串(gbk)。" }, { "type": "uint32_t", "name": "from_size", "desc": "源字符串的长度。" }, { "type": "const char*", "name": "", "desc": "。" }, { "type": "uint32_t", "name": "to_size", "desc": "目标字符串的最大长度。" } ], "annotation": { "static": true }, "desc": "将gbk转换成utf8编码。", "name": "encoding_gbk_to_utf8", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } } ], "events": [], "properties": [], "header": "charset/encoding.h", "desc": "encoding conversion\n\n示例\n\nc\n", "name": "encoding_t", "annotation": { "fake": true }, "level": 1 }, { "params": [ { "type": "const char*", "name": "app_name", "desc": "应用程序名称。" } ], "annotation": { "global": true }, "desc": "初始化应用程序的配置信息。", "name": "app_conf_init_ini", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" }, "type": "method", "header": "conf_io/app_conf_init_ini.h", "level": 1 }, { "params": [ { "type": "const char*", "name": "app_name", "desc": "应用程序名称。" } ], "annotation": { "global": true }, "desc": "初始化应用程序的配置信息。", "name": "app_conf_init_json", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" }, "type": "method", "header": "conf_io/app_conf_init_json.h", "level": 1 }, { "params": [ { "type": "const char*", "name": "app_name", "desc": "应用程序名称。" } ], "annotation": { "global": true }, "desc": "初始化应用程序的配置信息。", "name": "app_conf_init_ubjson", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" }, "type": "method", "header": "conf_io/app_conf_init_ubjson.h", "level": 1 }, { "params": [ { "type": "conf_loader_t", "name": "load", "desc": "配置加载函数。" }, { "type": "const char*", "name": "app_name", "desc": "应用程序名称。" }, { "type": "const char*", "name": "extname", "desc": "文件扩展名。" } ], "annotation": { "global": true }, "desc": "初始化。", "name": "app_conf_init", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" }, "type": "method", "header": "conf_io/app_conf_init.h", "level": 1 }, { "type": "class", "methods": [ { "params": [ { "type": "object_t*", "name": "", "desc": "。" } ], "annotation": { "static": true }, "desc": "设置app_conf实例。", "name": "app_conf_set_instance", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [], "annotation": { "static": true }, "desc": "获取app_conf实例。", "name": "app_conf_get_instance", "return": { "type": "object_t*", "desc": "返回app_conf实例。" } }, { "params": [], "annotation": { "static": true, "scriptable": true }, "desc": "持久保存配置。", "name": "app_conf_save", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [], "annotation": { "static": true, "scriptable": true }, "desc": "重新加载配置(内存中的配置丢失)。", "name": "app_conf_reload", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "event_func_t", "name": "on_event", "desc": "事件处理函数。" }, { "type": "void*", "name": "ctx", "desc": "事件处理函数上下文。" } ], "annotation": { "static": true }, "desc": "注册配置变化事件。", "name": "app_conf_on_changed", "return": { "type": "uint32_t", "desc": "返回id用于app_conf_off_changed。" } }, { "params": [ { "type": "uint32_t", "name": "id", "desc": "app_conf_on_changed返回的ID。" } ], "annotation": { "static": true }, "desc": "注销配置变化事件。", "name": "app_conf_off_changed", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "void*", "name": "ctx", "desc": "事件处理函数上下文。" } ], "annotation": { "static": true }, "desc": "注销配置变化事件。", "name": "app_conf_off_changed_by_ctx", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [], "annotation": { "static": true, "scriptable": true }, "desc": "释放conf对象。", "name": "app_conf_deinit", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "const char*", "name": "key", "desc": "配置项的名称。" }, { "type": "const value_t*", "name": "v", "desc": "配置项的值。" } ], "annotation": { "static": true }, "desc": "设置配置项的值。", "name": "app_conf_set", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "const char*", "name": "key", "desc": "配置项的名称。" }, { "type": "value_t*", "name": "v", "desc": "配置项的值(用于返回)。" } ], "annotation": { "static": true }, "desc": "获取配置项的值。", "name": "app_conf_get", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "const char*", "name": "key", "desc": "配置项的名称。" } ], "annotation": { "static": true, "scriptable": true }, "desc": "检查配置项是否存在。", "name": "app_conf_exist", "return": { "type": "bool_t", "desc": "返回TRUE表示存在FALSE表示不存在。" } }, { "params": [ { "type": "const char*", "name": "key", "desc": "配置项的名称。" }, { "type": "int32_t", "name": "v", "desc": "配置项的值。" } ], "annotation": { "static": true, "scriptable": true }, "desc": "设置整数类型配置项的值。", "name": "app_conf_set_int", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "const char*", "name": "key", "desc": "配置项的名称。" }, { "type": "int64_t", "name": "v", "desc": "配置项的值。" } ], "annotation": { "static": true, "scriptable": true }, "desc": "设置64位整数类型配置项的值。", "name": "app_conf_set_int64", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "const char*", "name": "key", "desc": "配置项的名称。" }, { "type": "bool_t", "name": "v", "desc": "配置项的值。" } ], "annotation": { "static": true, "scriptable": true }, "desc": "设置bool类型配置项的值。", "name": "app_conf_set_bool", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "const char*", "name": "key", "desc": "配置项的名称。" }, { "type": "double", "name": "v", "desc": "配置项的值。" } ], "annotation": { "static": true, "scriptable": true }, "desc": "设置双精度类型配置项的值。", "name": "app_conf_set_double", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "const char*", "name": "key", "desc": "配置项的名称。" }, { "type": "const char*", "name": "v", "desc": "配置项的值。" } ], "annotation": { "static": true, "scriptable": true }, "desc": "设置字符串类型配置项的值。", "name": "app_conf_set_str", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "const char*", "name": "key", "desc": "配置项的名称。" }, { "type": "const wchar_t*", "name": "v", "desc": "配置项的值。" } ], "annotation": { "static": true }, "desc": "设置宽字符串类型配置项的值。", "name": "app_conf_set_wstr", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "const char*", "name": "key", "desc": "配置项的名称。" }, { "type": "int32_t", "name": "defval", "desc": "缺省值。" } ], "annotation": { "static": true, "scriptable": true }, "desc": "获取整数类型配置项的值。", "name": "app_conf_get_int", "return": { "type": "int32_t", "desc": "返回配置项的值(如果不存在返回缺省值)。" } }, { "params": [ { "type": "const char*", "name": "key", "desc": "配置项的名称。" }, { "type": "int64_t", "name": "defval", "desc": "缺省值。" } ], "annotation": { "static": true, "scriptable": true }, "desc": "获取64位整数类型配置项的值。", "name": "app_conf_get_int64", "return": { "type": "int64_t", "desc": "返回配置项的值(如果不存在返回缺省值)。" } }, { "params": [ { "type": "const char*", "name": "key", "desc": "配置项的名称。" }, { "type": "bool_t", "name": "defval", "desc": "缺省值。" } ], "annotation": { "static": true, "scriptable": true }, "desc": "获取bool类型配置项的值。", "name": "app_conf_get_bool", "return": { "type": "bool_t", "desc": "返回配置项的值(如果不存在返回缺省值)。" } }, { "params": [ { "type": "const char*", "name": "key", "desc": "配置项的名称。" }, { "type": "double", "name": "defval", "desc": "缺省值。" } ], "annotation": { "static": true, "scriptable": true }, "desc": "获取单精度浮点数类型配置项的值。", "name": "app_conf_get_double", "return": { "type": "double", "desc": "返回配置项的值(如果不存在返回缺省值)。" } }, { "params": [ { "type": "const char*", "name": "key", "desc": "配置项的名称。" }, { "type": "const char*", "name": "defval", "desc": "缺省值。" } ], "annotation": { "static": true, "scriptable": true }, "desc": "获取字符串类型配置项的值。", "name": "app_conf_get_str", "return": { "type": "const char*", "desc": "返回配置项的值(如果不存在返回缺省值)。" } }, { "params": [ { "type": "const char*", "name": "key", "desc": "配置项的名称。" }, { "type": "const wchar_t*", "name": "str", "desc": "返回值。" }, { "type": "uint32_t", "name": "max_size", "desc": "最大长度(字符数)。" } ], "annotation": { "static": true }, "desc": "获取宽字符串类型配置项的值。", "name": "app_conf_get_wstr", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "const char*", "name": "key", "desc": "配置项的名称。" } ], "annotation": { "static": true, "scriptable": true }, "desc": "删除配置项。", "name": "app_conf_remove", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } } ], "events": [], "properties": [], "header": "conf_io/app_conf.h", "desc": "应用程序的配置信息。\n\n底层实现可以是任何格式比如INIXMLJSON和UBJSON。\n\n对于树状的文档key可以是多级的用.分隔。如network.ip。\n\nconf-io是可选组件需要自己包含头文件否则64位数据类型会被截断成32位的数据。\n\nc\n#include \"conf_io/app_conf.h\"\n", "name": "app_conf_t", "annotation": { "fake": true, "scriptable": true }, "level": 1 }, { "params": [ { "type": "const char*", "name": "data", "desc": "数据。" } ], "annotation": { "global": true }, "desc": "从缓存区加载ini格式的conf doc对象。", "name": "conf_doc_load_ini", "return": { "type": "conf_doc_t*", "desc": "返回conf_doc对象。" }, "type": "method", "header": "conf_io/conf_ini.h", "level": 1 }, { "params": [ { "type": "conf_doc_t*", "name": "doc", "desc": "conf doc对象。" }, { "type": "str_t*", "name": "str", "desc": "保存结果。" } ], "annotation": { "global": true }, "desc": "保存conf doc对象为ini格式。", "name": "conf_doc_save_ini", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败" }, "type": "method", "header": "conf_io/conf_ini.h", "level": 1 }, { "params": [ { "type": "const char*", "name": "data", "desc": "JSON数据。" }, { "type": "int32_t", "name": "size", "desc": "JSON数据长度。" } ], "annotation": { "global": true }, "desc": "", "name": "conf_doc_load_json", "return": { "type": "conf_doc_t*", "desc": "返回doc对象。" }, "type": "method", "header": "conf_io/conf_json.h", "level": 1 }, { "params": [ { "type": "conf_doc_t*", "name": "doc", "desc": "doc对象。" }, { "type": "str_t*", "name": "str", "desc": "保存结果。" } ], "annotation": { "global": true }, "desc": "", "name": "conf_doc_save_json", "return": { "type": "object_t*", "desc": "返回配置对象。" }, "type": "method", "header": "conf_io/conf_json.h", "level": 1 }, { "type": "class", "methods": [ { "params": [ { "type": "uint32_t", "name": "prealloc_nodes_nr", "desc": "预先分配的节点数。" } ], "annotation": {}, "desc": "构造函数。", "name": "conf_doc_create", "return": { "type": "conf_doc_t*", "desc": "返回doc对象。" } }, { "params": [ { "type": "conf_doc_t*", "name": "doc", "desc": "文档对象。" }, { "type": "const char*", "name": "name", "desc": "节点名称。" } ], "annotation": {}, "desc": "创建一个空节点。", "name": "conf_doc_create_node", "return": { "type": "conf_node_t*", "desc": "返回节点对象。" } }, { "params": [ { "type": "conf_doc_t*", "name": "doc", "desc": "文档对象。" }, { "type": "conf_node_t*", "name": "node", "desc": "节点对象。" } ], "annotation": {}, "desc": "销毁节点对象。", "name": "conf_doc_destroy_node", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "conf_doc_t*", "name": "doc", "desc": "文档对象。" }, { "type": "conf_node_t*", "name": "node", "desc": "节点对象。" }, { "type": "conf_node_t*", "name": "sibling", "desc": "待追加节点对象。" } ], "annotation": {}, "desc": "追加一个兄弟节点。", "name": "conf_doc_append_sibling", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "conf_doc_t*", "name": "doc", "desc": "文档对象。" }, { "type": "conf_node_t*", "name": "node", "desc": "节点对象。" }, { "type": "conf_node_t*", "name": "child", "desc": "待追加节点对象。" } ], "annotation": {}, "desc": "追加一个子节点。", "name": "conf_doc_append_child", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "conf_doc_t*", "name": "doc", "desc": "文档对象。" }, { "type": "conf_node_t*", "name": "node", "desc": "节点对象。" }, { "type": "conf_node_t*", "name": "sibling", "desc": "待删除节点对象。" } ], "annotation": {}, "desc": "删除指定的兄弟节点。", "name": "conf_doc_remove_sibling", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "conf_doc_t*", "name": "doc", "desc": "文档对象。" }, { "type": "conf_node_t*", "name": "node", "desc": "节点对象。" }, { "type": "conf_node_t*", "name": "child", "desc": "待删除节点对象。" } ], "annotation": {}, "desc": "删除指定的子节点。", "name": "conf_doc_remove_child", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "conf_doc_t*", "name": "doc", "desc": "文档对象。" }, { "type": "conf_node_t*", "name": "node", "desc": "节点对象。" }, { "type": "const char*", "name": "name", "desc": "待删除节点的名称。" } ], "annotation": {}, "desc": "删除指定的子节点。", "name": "conf_doc_remove_child_by_name", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "conf_doc_t*", "name": "doc", "desc": "文档对象。" }, { "type": "conf_node_t*", "name": "node", "desc": "节点对象。" } ], "annotation": {}, "desc": "删除全部子节点。", "name": "conf_doc_remove_children", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "conf_doc_t*", "name": "doc", "desc": "文档对象。" }, { "type": "const char*", "name": "path", "desc": "节点的路径。" }, { "type": "const value_t*", "name": "v", "desc": "值。" } ], "annotation": {}, "desc": "设置指定路径节点的值。", "name": "conf_doc_set", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "conf_doc_t*", "name": "doc", "desc": "文档对象。" }, { "type": "const char*", "name": "path", "desc": "节点的路径。" }, { "type": "int32_t", "name": "v", "desc": "值。" } ], "annotation": {}, "desc": "设置指定路径节点的值。", "name": "conf_doc_set_int", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "conf_doc_t*", "name": "doc", "desc": "文档对象。" }, { "type": "const char*", "name": "path", "desc": "节点的路径。" }, { "type": "bool_t", "name": "v", "desc": "值。" } ], "annotation": {}, "desc": "设置指定路径节点的值。", "name": "conf_doc_set_bool", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "conf_doc_t*", "name": "doc", "desc": "文档对象。" }, { "type": "const char*", "name": "path", "desc": "节点的路径。" }, { "type": "float", "name": "v", "desc": "值。" } ], "annotation": {}, "desc": "设置指定路径节点的值。", "name": "conf_doc_set_float", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "conf_doc_t*", "name": "doc", "desc": "文档对象。" }, { "type": "const char*", "name": "path", "desc": "节点的路径。" }, { "type": "const char*", "name": "v", "desc": "值。" } ], "annotation": {}, "desc": "设置指定路径节点的值。", "name": "conf_doc_set_str", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "conf_doc_t*", "name": "doc", "desc": "文档对象。" }, { "type": "const char*", "name": "path", "desc": "节点的路径。" }, { "type": "value_t*", "name": "v", "desc": "用于返回值。" } ], "annotation": {}, "desc": "获取指定路径节点的值。", "name": "conf_doc_get", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "conf_doc_t*", "name": "doc", "desc": "文档对象。" }, { "type": "const char*", "name": "path", "desc": "节点的路径。" }, { "type": "int32_t", "name": "defval", "desc": "缺省值。" } ], "annotation": {}, "desc": "获取指定路径节点的值。", "name": "conf_doc_get_int", "return": { "type": "int32_t", "desc": "返回值。" } }, { "params": [ { "type": "conf_doc_t*", "name": "doc", "desc": "文档对象。" }, { "type": "const char*", "name": "path", "desc": "节点的路径。" }, { "type": "bool_t", "name": "defval", "desc": "缺省值。" } ], "annotation": {}, "desc": "获取指定路径节点的值。", "name": "conf_doc_get_bool", "return": { "type": "bool_t", "desc": "返回值。" } }, { "params": [ { "type": "conf_doc_t*", "name": "doc", "desc": "文档对象。" }, { "type": "const char*", "name": "path", "desc": "节点的路径。" }, { "type": "float", "name": "defval", "desc": "缺省值。" } ], "annotation": {}, "desc": "获取指定路径节点的值。", "name": "conf_doc_get_float", "return": { "type": "float", "desc": "返回值。" } }, { "params": [ { "type": "conf_doc_t*", "name": "doc", "desc": "文档对象。" }, { "type": "const char*", "name": "path", "desc": "节点的路径。" }, { "type": "const char*", "name": "defval", "desc": "缺省值。" } ], "annotation": {}, "desc": "获取指定路径节点的值。", "name": "conf_doc_get_str", "return": { "type": "const char*", "desc": "返回值。" } }, { "params": [ { "type": "conf_doc_t*", "name": "doc", "desc": "文档对象。" }, { "type": "const char*", "name": "path", "desc": "节点的路径。" } ], "annotation": {}, "desc": "删除指定路径的节点。", "name": "conf_doc_remove", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "conf_doc_t*", "name": "doc", "desc": "文档对象。" }, { "type": "const char*", "name": "path", "desc": "节点的路径。" } ], "annotation": {}, "desc": "删除指定路径的节点的全部子节点。", "name": "conf_doc_clear", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "conf_doc_t*", "name": "doc", "desc": "文档对象。" }, { "type": "const char*", "name": "path", "desc": "节点的路径。" } ], "annotation": {}, "desc": "和前一个兄弟节点交换位置。", "name": "conf_doc_move_up", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "conf_doc_t*", "name": "doc", "desc": "文档对象。" }, { "type": "const char*", "name": "path", "desc": "节点的路径。" } ], "annotation": {}, "desc": "和后一个兄弟节点交换位置。", "name": "conf_doc_move_down", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "conf_doc_t*", "name": "doc", "desc": "文档对象。" }, { "type": "const char*", "name": "path", "desc": "节点的路径。" } ], "annotation": {}, "desc": "判断指定路径的节点是否存在。", "name": "conf_doc_exists", "return": { "type": "bool_t", "desc": "返回TRUE表示成功FALSE表示失败。" } }, { "params": [ { "type": "conf_doc_t*", "name": "doc", "desc": "文档对象。" }, { "type": "const char*", "name": "path", "desc": "节点的路径。" } ], "annotation": {}, "desc": "检查指定节点是否在兄弟节点中排第一。", "name": "conf_doc_is_first", "return": { "type": "bool_t", "desc": "返回TRUE表示是否则表示不是。" } }, { "params": [ { "type": "conf_doc_t*", "name": "doc", "desc": "文档对象。" }, { "type": "const char*", "name": "path", "desc": "节点的路径。" } ], "annotation": {}, "desc": "检查指定节点是否在兄弟节点中排最后。", "name": "conf_doc_is_last", "return": { "type": "bool_t", "desc": "返回TRUE表示是否则表示不是。" } }, { "params": [ { "type": "conf_doc_t*", "name": "doc", "desc": "文档对象。" }, { "type": "const char*", "name": "path", "desc": "节点的路径。" } ], "annotation": {}, "desc": "追加一个子节点。", "name": "conf_doc_add_child", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "conf_doc_t*", "name": "doc", "desc": "文档对象。" } ], "annotation": {}, "desc": "析构函数。", "name": "conf_doc_destroy", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } } ], "events": [], "properties": [ { "name": "root", "desc": "根节点。", "type": "conf_node_t*" } ], "header": "conf_io/conf_node.h", "desc": "代表整个配置文件。", "name": "conf_doc_t", "level": 1 }, { "type": "enum", "desc": "节点类型。", "consts": [ { "desc": "无效节点。", "name": "CONF_NODE_NONE" }, { "desc": "对象节点。", "name": "CONF_NODE_OBJECT" }, { "desc": "数组节点。", "name": "CONF_NODE_ARRAY" }, { "desc": "简单节点。", "name": "CONF_NODE_SIMPLE" } ], "header": "conf_io/conf_node.h", "name": "conf_node_type_t", "prefix": "CONF_NODE", "level": 1 }, { "type": "enum", "desc": "节点值得类型。", "consts": [ { "desc": "无效类型。", "name": "CONF_NODE_VALUE_NONE" }, { "desc": "bool_t类型。", "name": "CONF_NODE_VALUE_BOOL" }, { "desc": "int8_t类型。", "name": "CONF_NODE_VALUE_INT8" }, { "desc": "uint8_t类型。", "name": "CONF_NODE_VALUE_UINT8" }, { "desc": "int16_t类型。", "name": "CONF_NODE_VALUE_INT16" }, { "desc": "uint16_t类型。", "name": "CONF_NODE_VALUE_UINT16" }, { "desc": "int32_t类型。", "name": "CONF_NODE_VALUE_INT32" }, { "desc": "uint32_t类型。", "name": "CONF_NODE_VALUE_UINT32" }, { "desc": "int64_t类型。", "name": "CONF_NODE_VALUE_INT64" }, { "desc": "uint64_t类型。", "name": "CONF_NODE_VALUE_UINT64" }, { "desc": "float类型。", "name": "CONF_NODE_VALUE_FLOAT32" }, { "desc": "double类型。", "name": "CONF_NODE_VALUE_DOUBLE" }, { "desc": "字符串类型。", "name": "CONF_NODE_VALUE_STRING" }, { "desc": "短字符(len<=7)串类型。", "name": "CONF_NODE_VALUE_SMALL_STR" }, { "desc": "节点类型。", "name": "CONF_NODE_VALUE_NODE" } ], "header": "conf_io/conf_node.h", "name": "conf_node_value_t", "prefix": "CONF_NODE_VALUE", "level": 1 }, { "type": "class", "methods": [ { "params": [ { "type": "conf_node_t*", "name": "node", "desc": "节点对象。" } ], "annotation": {}, "desc": "获得节点的名称。", "name": "conf_node_get_name", "return": { "type": "const char*", "desc": "返回节点名称。" } }, { "params": [ { "type": "conf_node_t*", "name": "node", "desc": "节点对象。" }, { "type": "const char*", "name": "name", "desc": "节点名称。" } ], "annotation": {}, "desc": "查找指定名称的子节点。", "name": "conf_node_find_child", "return": { "type": "conf_node_t*", "desc": "返回节点对象。" } }, { "params": [ { "type": "conf_node_t*", "name": "node", "desc": "节点对象。" }, { "type": "const char*", "name": "name", "desc": "节点名称。" } ], "annotation": {}, "desc": "查找指定名称的兄弟节点。", "name": "conf_node_find_sibling", "return": { "type": "conf_node_t*", "desc": "返回节点对象。" } }, { "params": [ { "type": "conf_node_t*", "name": "node", "desc": "节点对象。" }, { "type": "const value_t*", "name": "v", "desc": "值。" } ], "annotation": {}, "desc": "设置节点的值。", "name": "conf_node_set_value", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "conf_node_t*", "name": "node", "desc": "节点对象。" }, { "type": "value_t*", "name": "v", "desc": "值(返回)。" } ], "annotation": {}, "desc": "设置节点的值。", "name": "conf_node_get_value", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "conf_node_t*", "name": "node", "desc": "节点对象。" } ], "annotation": {}, "desc": "获取第一个子节点。", "name": "conf_node_get_first_child", "return": { "type": "conf_node_t*", "desc": "返回第一个子节点。" } }, { "params": [ { "type": "conf_node_t*", "name": "node", "desc": "节点对象。" }, { "type": "conf_node_t*", "name": "child", "desc": "子节点对象。" } ], "annotation": {}, "desc": "设置第一个子节点。", "name": "conf_node_set_first_child", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } } ], "events": [], "properties": [ { "name": "next", "desc": "下一个兄弟节点。", "type": "conf_node_t*" }, { "name": "parent", "desc": "父节点。", "type": "conf_node_t*" }, { "name": "value_type", "desc": "值的类型。", "type": "uint8_t" }, { "name": "node_type", "desc": "节点类型。", "type": "uint8_t" } ], "header": "conf_io/conf_node.h", "desc": "节点。", "name": "conf_node_t", "level": 1 }, { "params": [ { "type": "const void*", "name": "data", "desc": "数据。" }, { "type": "uint32_t", "name": "size", "desc": "数据长度。" } ], "annotation": { "global": true }, "desc": "从缓存区加载ubjson格式的conf doc对象。", "name": "conf_doc_load_ubjson", "return": { "type": "conf_doc_t*", "desc": "返回conf_doc对象。" }, "type": "method", "header": "conf_io/conf_ubjson.h", "level": 1 }, { "params": [ { "type": "conf_doc_t*", "name": "doc", "desc": "conf doc对象。" }, { "type": "ubjson_writer_t*", "name": "writer", "desc": "ubjson writer对象。" } ], "annotation": { "global": true }, "desc": "保存conf doc对象为ubjson格式。", "name": "conf_doc_save_ubjson", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败" }, "type": "method", "header": "conf_io/conf_ubjson.h", "level": 1 }, { "type": "class", "methods": [ { "params": [ { "type": "object_t*", "name": "args", "desc": "参数。" } ], "annotation": { "constructor": true }, "desc": "创建缺省的对话框高亮策略。", "name": "dialog_highlighter_default_create", "return": { "type": "dialog_highlighter_t*", "desc": "返回对话框高亮策略对象。" } } ], "events": [], "properties": [ { "name": "start_alpha", "desc": "起始alpha打开对话框的动画开始时的alpha值。", "type": "uint8_t" }, { "name": "end_alpha", "desc": "结束alpha打开对话框的动画结束(直到对话框被关闭)时的alpha值。", "type": "uint8_t" }, { "name": "system_bar_alpha", "desc": "由于在没有过度动画的情况下,截图中已经包括黑色色块,为了让 system_bar 也同步高亮部分的色块透明。", "type": "uint8_t" } ], "header": "dialog_highlighters/dialog_highlighter_default.h", "desc": "缺省对话框高亮策略。\n\n>本策略在背景上画一层半透明的蒙版来高亮(突出)对话框本身。\n>对于性能不高的平台建议将start\alpha和end\alpha设为相同。", "name": "dialog_highlighter_default_t", "level": 1 }, { "params": [], "annotation": { "global": true }, "desc": "", "name": "SDL_ShowCursor", "type": "method", "header": "src/dllexports.h", "level": 1 }, { "params": [], "annotation": { "global": true }, "desc": "", "name": "SDL_WarpMouseInWindow", "type": "method", "header": "src/dllexports.h", "level": 1 }, { "params": [], "annotation": { "global": true }, "desc": "", "name": "SDL_GetDefaultCursor", "type": "method", "header": "src/dllexports.h", "level": 1 }, { "params": [], "annotation": { "global": true }, "desc": "", "name": "SDL_SetCursor", "type": "method", "header": "src/dllexports.h", "level": 1 }, { "params": [], "annotation": { "global": true }, "desc": "", "name": "SDL_FreeCursor", "type": "method", "header": "src/dllexports.h", "level": 1 }, { "params": [], "annotation": { "global": true }, "desc": "", "name": "SDL_CreateSystemCursor", "type": "method", "header": "src/dllexports.h", "level": 1 }, { "params": [], "annotation": { "global": true }, "desc": "", "name": "SDL_GetMouseFocus", "type": "method", "header": "src/dllexports.h", "level": 1 }, { "params": [], "annotation": { "global": true }, "desc": "", "name": "SDL_MixAudioFormat", "type": "method", "header": "src/dllexports.h", "level": 1 }, { "params": [], "annotation": { "global": true }, "desc": "", "name": "SDL_DequeueAudio", "type": "method", "header": "src/dllexports.h", "level": 1 }, { "params": [], "annotation": { "global": true }, "desc": "", "name": "SDL_QueueAudio", "type": "method", "header": "src/dllexports.h", "level": 1 }, { "params": [], "annotation": { "global": true }, "desc": "", "name": "SDL_GetQueuedAudioSize", "type": "method", "header": "src/dllexports.h", "level": 1 }, { "params": [], "annotation": { "global": true }, "desc": "", "name": "SDL_ClearQueuedAudio", "type": "method", "header": "src/dllexports.h", "level": 1 }, { "params": [], "annotation": { "global": true }, "desc": "", "name": "SDL_PauseAudioDevice", "type": "method", "header": "src/dllexports.h", "level": 1 }, { "params": [], "annotation": { "global": true }, "desc": "", "name": "SDL_CloseAudioDevice", "type": "method", "header": "src/dllexports.h", "level": 1 }, { "params": [], "annotation": { "global": true }, "desc": "", "name": "SDL_OpenAudioDevice", "type": "method", "header": "src/dllexports.h", "level": 1 }, { "params": [], "annotation": { "global": true }, "desc": "", "name": "SDL_WasInit", "type": "method", "header": "src/dllexports.h", "level": 1 }, { "params": [], "annotation": { "global": true }, "desc": "", "name": "SDL_Init", "type": "method", "header": "src/dllexports.h", "level": 1 }, { "params": [], "annotation": { "global": true }, "desc": "", "name": "SDL_GetError", "type": "method", "header": "src/dllexports.h", "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": [], "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": "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": "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": { "fake": true }, "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": "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": [], "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": "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": "资源的名称。" }, { "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", "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": "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\nc\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\nc\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\nc\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": "返回color_t对象。" } } ], "events": [], "properties": [], "header": "tkc/color_parser.h", "desc": "颜色解析相关函数。\n\n示例\n\nc\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": "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": "获取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\nc\ndarray_t darray;\ndarray_init(&darray, 10, destroy, compare);\n...\ndarray_deinit(&darray);\n\n\n用darray\create创建时用darray\destroy销毁。如\n\nc\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": "date_time_t*", "name": "dt", "desc": "date_time对象。" }, { "type": "int64_t", "name": "delta", "desc": "偏移量(s)。" } ], "annotation": { "scriptable": true }, "desc": "加上一个偏移量(s)。", "name": "date_time_add_delta", "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": [], "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": "char*", "name": "buffer", "desc": "用于返回数据的缓冲区。" }, { "type": "uint32_t", "name": "size", "desc": "缓冲区大小。" } ], "annotation": {}, "desc": "读取一行文本。\n> 需要用二进制格式打开否则Windows下系统会修改换行符。", "name": "fs_file_read_line", "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\nc\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": [ { "type": "char*", "name": "filename", "desc": "用于返回完整路径的文件名。" }, { "type": "const char*", "name": "appname", "desc": "应用程序的名称。" }, { "type": "const char*", "name": "name", "desc": "文件名(不包括路径)。" } ], "annotation": {}, "desc": "生成一个保存数据文件的完整路径的文件名。", "name": "fs_build_user_storage_file_name", "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": [], "events": [], "properties": [ { "name": "size", "desc": "参数个数。", "type": "uint16_t", "annotation": { "readable": true } }, { "name": "capacity", "desc": "目前最大容量。", "type": "uint16_t", "annotation": { "readable": true } }, { "name": "args", "desc": "参数列表。", "type": "value_t*", "annotation": { "readable": true } } ], "header": "tkc/fscript.h", "desc": "扩展函数的参数。", "name": "fscript_args_t", "level": 1 }, { "type": "class", "methods": [ { "params": [ { "type": "object_t*", "name": "obj", "desc": "脚本执行上下文。" }, { "type": "const char*", "name": "script", "desc": "脚本代码。" } ], "annotation": {}, "desc": "创建引擎对象。", "name": "fscript_create", "return": { "type": "fscript_t*", "desc": "返回fscript对象。" } }, { "params": [ { "type": "fscript_t*", "name": "fscript", "desc": "脚本引擎对象。" }, { "type": "value_t*", "name": "result", "desc": "执行结果(调用者需要用value_reset函数清除result)。" } ], "annotation": {}, "desc": "", "name": "fscript_exec", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "fscript_t*", "name": "fscript", "desc": "脚本引擎对象。" } ], "annotation": {}, "desc": "销毁引擎对象。", "name": "fscript_destroy", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "object_t*", "name": "obj", "desc": "脚本执行上下文。" }, { "type": "const char*", "name": "script", "desc": "脚本代码。" }, { "type": "value_t*", "name": "result", "desc": "执行结果(调用者需要用value_reset函数清除result)。" } ], "annotation": {}, "desc": "执行一段脚本。", "name": "fscript_eval", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [], "annotation": {}, "desc": "全局初始化。", "name": "fscript_global_init", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "const char*", "name": "name", "desc": "函数名(无需加函数前缀)。" }, { "type": "fscript_func_t*", "name": "func", "desc": "函数指针。" } ], "annotation": {}, "desc": "注册全局自定义函数。", "name": "fscript_register_func", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [], "annotation": {}, "desc": "全局释放。", "name": "fscript_global_deinit", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } } ], "events": [], "properties": [ { "name": "str", "desc": "C语言实现函数可以使用这个变量可以有效避免内存分配。", "type": "str_t", "annotation": { "readable": true } }, { "name": "obj", "desc": "脚本执行上下文。", "type": "object_t*", "annotation": { "readable": true } }, { "name": "fast_vars", "desc": "快速访问变量。在脚本可以用a/b/c/d来访问需要优化时使用。", "type": "value_t*", "annotation": { "readable": true } } ], "header": "tkc/fscript.h", "desc": "一个简易的函数式脚本引擎。\n用法请参考https://github.com/zlgopen/awtk/blob/master/docs/fscript.md", "name": "fscript_t", "annotation": { "fake": true }, "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的IDTK_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\nc\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表示成功否则表示失败。" } }, { "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\nc\nchar* str = (char*)TKMEM_ALLOC(100);\n...\nTKMEM_FREE(str);\n\n\nc\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": [ { "type": "mmap_t*", "name": "mmap", "desc": "mmap对象。" }, { "type": "const char*", "name": "filename", "desc": "文件名。" }, { "type": "bool_t", "name": "writable", "desc": "是否可写。" }, { "type": "bool_t", "name": "shared", "desc": "是否共享。" } ], "annotation": { "constructor": true }, "desc": "初始化mmap对象。", "name": "mmap_create", "return": { "type": "mmap_t*", "desc": "mmap对象本身。" } }, { "params": [ { "type": "mmap_t*", "name": "mmap", "desc": "mmap对象。" } ], "annotation": {}, "desc": "销毁mmap。", "name": "mmap_destroy", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } } ], "events": [], "properties": [ { "name": "data", "desc": "内存地址。", "type": "void*", "annotation": { "readable": true } }, { "name": "size", "desc": "数据长度。", "type": "uint32_t", "annotation": { "readable": true } } ], "header": "tkc/mmap.h", "desc": "把文件内容映射到内存。", "name": "mmap_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": "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": [], "annotation": {}, "desc": "获取当前时间(微秒)。", "name": "get_time_us64", "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": "filename_pattern", "desc": "用来确定文件名的路径和文件名。" }, { "type": "uint32_t", "name": "max_size", "desc": "log文件占用最大磁盘空间(字节)。" }, { "type": "uint32_t", "name": "buff_size", "desc": "用于指定print时的buff大小。" } ], "annotation": { "scriptable": true, "constructor": true }, "desc": "创建rlog对象。\n\nc\nrlog_t* log = rlog_create(\"./logs/%d.log\", 1020*1024, 256);\nrlog_write(log, \"hello\\n\");\nrlog_destroy(log);\n", "name": "rlog_create", "return": { "type": "rlog_t*", "desc": "返回rlog对象。" } }, { "params": [ { "type": "rlog_t*", "name": "log", "desc": "日志对象。" }, { "type": "const char*", "name": "str", "desc": "日志字符串。" } ], "annotation": { "scriptable": true }, "desc": "写入一条日志记录。", "name": "rlog_write", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "rlog_t*", "name": "log", "desc": "日志对象。" }, { "type": "const char*", "name": "format", "desc": "格式字符串。" } ], "annotation": {}, "desc": "写入一条日志记录。", "name": "rlog_print", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "rlog_t*", "name": "log", "desc": "日志对象。" } ], "annotation": {}, "desc": "销毁日志对象。", "name": "rlog_destroy", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } } ], "events": [], "properties": [], "header": "tkc/rlog.h", "desc": "循环记录日志(支持多线程访问)。\n如果我们把日志写入文件中随着时间的推移日志文件会越来越大最终占满这个磁盘出现不可预料的错误。\nrlog提供一个循环记录日志的功能让日志文件始终不会超出指定的大小达到指定大小后再从头开始写。\n\n> 为了实现简单我们把日志文件分成0和1两个文件先写文件0到达指定最大值的一半时再写文件1。\n> 文件1到达指定最大值的一半时删除文件0并将文件1改名为文件0重新创建文件1继续写文件1重复此过程。", "name": "rlog_t", "annotation": { "scriptable": true }, "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\nc\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\nc\nslist_t slist;\nslist_init(&slist, destroy, compare);\n...\nslist_deinit(&slist);\n\n\n用slist\create创建时用slist\destroy销毁。如\n\nc\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\nc\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": "str_t*", "name": "str", "desc": "str对象。" }, { "type": "uint32_t", "name": "capacity", "desc": "初始容量。" } ], "annotation": { "constructor": true }, "desc": "初始化字符串对象。", "name": "str_init", "return": { "type": "str_t*", "desc": "str对象本身。" } }, { "params": [ { "type": "str_t*", "name": "str", "desc": "str对象。" }, { "type": "uint32_t", "name": "capacity", "desc": "初始容量。" } ], "annotation": { "constructor": true }, "desc": "扩展字符串到指定的容量。", "name": "str_extend", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "str_t*", "name": "str", "desc": "str对象。" }, { "type": "char*", "name": "text", "desc": "待比较的字符串。" } ], "annotation": {}, "desc": "判断两个字符串是否相等。", "name": "str_eq", "return": { "type": "bool_t", "desc": "返回是否相等。" } }, { "params": [ { "type": "str_t*", "name": "str", "desc": "str对象。" }, { "type": "char*", "name": "text", "desc": "要设置的字符串。" } ], "annotation": {}, "desc": "设置字符串。", "name": "str_set", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "str_t*", "name": "str", "desc": "str对象。" } ], "annotation": {}, "desc": "清除字符串内容。", "name": "str_clear", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "str_t*", "name": "str", "desc": "str对象。" }, { "type": "char*", "name": "text", "desc": "要设置的字符串。" }, { "type": "uint32_t", "name": "len", "desc": "字符串长度。" } ], "annotation": {}, "desc": "设置字符串。", "name": "str_set_with_len", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "str_t*", "name": "str", "desc": "str对象。" }, { "type": "char*", "name": "text", "desc": "要追加的字符串。" } ], "annotation": {}, "desc": "追加字符串。", "name": "str_append", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "str_t*", "name": "str", "desc": "str对象。" }, { "type": "char*", "name": "text", "desc": "要追加的字符串。" } ], "annotation": {}, "desc": "追加多个字符串。以NULL结束。\n\n示例\n\nc\nstr_t s;\nstr_init(&s, 0);\n\nstr_append_more(&s, \"abc\", \"123\", NULL);\nlog_debug(\"%s\\n\", s.str);\n\nstr_reset(&s);\n", "name": "str_append_more", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "str_t*", "name": "str", "desc": "str对象。" }, { "type": "char*", "name": "text", "desc": "要追加的字符串。" }, { "type": "uint32_t", "name": "len", "desc": "字符串长度。" } ], "annotation": {}, "desc": "追加字符串。", "name": "str_append_with_len", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "str_t*", "name": "str", "desc": "str对象。" }, { "type": "uint32_t", "name": "offset", "desc": "偏移量。" }, { "type": "char*", "name": "text", "desc": "要插入的字符串。" } ], "annotation": {}, "desc": "插入子字符串。", "name": "str_insert", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "str_t*", "name": "str", "desc": "str对象。" }, { "type": "uint32_t", "name": "offset", "desc": "偏移量。" }, { "type": "char*", "name": "text", "desc": "要插入的字符串。" }, { "type": "uint32_t", "name": "len", "desc": "字符串长度。" } ], "annotation": {}, "desc": "插入子字符串。", "name": "str_insert_with_len", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "str_t*", "name": "str", "desc": "str对象。" }, { "type": "uint32_t", "name": "offset", "desc": "偏移量。" }, { "type": "uint32_t", "name": "len", "desc": "长度。" } ], "annotation": {}, "desc": "删除子字符串。", "name": "str_remove", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "str_t*", "name": "str", "desc": "str对象。" }, { "type": "char", "name": "c", "desc": "要追加的字符。" } ], "annotation": {}, "desc": "追加一个字符。", "name": "str_append_char", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "str_t*", "name": "str", "desc": "str对象。" }, { "type": "int32_t", "name": "value", "desc": "要追加的整数。" } ], "annotation": {}, "desc": "追加一个整数。", "name": "str_append_int", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "str_t*", "name": "str", "desc": "str对象。" }, { "type": "const char*", "name": "format", "desc": "格式。" }, { "type": "double", "name": "value", "desc": "要追加的浮点数。" } ], "annotation": {}, "desc": "追加一个浮点数。", "name": "str_append_double", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "str_t*", "name": "str", "desc": "str对象。" }, { "type": "const char*", "name": "json_str", "desc": "待追加的字符串。" } ], "annotation": {}, "desc": "追加一个字符串,字符串前后加英文双引号,字符串本身的双引号被转义为\"。", "name": "str_append_json_str", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "str_t*", "name": "str", "desc": "str对象。" }, { "type": "const char*", "name": "key", "desc": "键。" }, { "type": "int32_t", "name": "value", "desc": "值。" } ], "annotation": {}, "desc": "追加int格式的json键值对。", "name": "str_append_json_int_pair", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "str_t*", "name": "str", "desc": "str对象。" }, { "type": "const char*", "name": "key", "desc": "键。" }, { "type": "const char*", "name": "value", "desc": "值。" } ], "annotation": {}, "desc": "追加字符串格式的json键值对。", "name": "str_append_json_str_pair", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "str_t*", "name": "str", "desc": "str对象。" }, { "type": "const char*", "name": "key", "desc": "键。" }, { "type": "double", "name": "value", "desc": "值。" } ], "annotation": {}, "desc": "追加doube格式的json键值对。", "name": "str_append_json_double_pair", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "str_t*", "name": "str", "desc": "str对象。" }, { "type": "const char*", "name": "key", "desc": "键。" }, { "type": "bool_t", "name": "value", "desc": "值。" } ], "annotation": {}, "desc": "追加bool格式的json键值对。", "name": "str_append_json_bool_pair", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "str_t*", "name": "str", "desc": "str对象。" } ], "annotation": {}, "desc": "删除最后一个字符。", "name": "str_pop", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "str_t*", "name": "str", "desc": "str对象。" } ], "annotation": {}, "desc": "对字符串进行反转义。如:把"\n"转换成'\n'。", "name": "str_unescape", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "str_t*", "name": "str", "desc": "str对象。" }, { "type": "char*", "name": "text", "desc": "要解码的XML文本。" } ], "annotation": {}, "desc": "对XML基本的entity进行解码目前仅支持<>&quota;&。", "name": "str_decode_xml_entity", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "str_t*", "name": "str", "desc": "str对象。" }, { "type": "char*", "name": "text", "desc": "要解码的XML文本。" }, { "type": "uint32_t", "name": "len", "desc": "字符串长度。" } ], "annotation": {}, "desc": "对XML基本的entity进行解码目前仅支持<>&quota;&。", "name": "str_decode_xml_entity_with_len", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "str_t*", "name": "str", "desc": "str对象。" }, { "type": "int32_t", "name": "v", "desc": "整数。" } ], "annotation": {}, "desc": "用整数初始化字符串。", "name": "str_from_int", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "str_t*", "name": "str", "desc": "str对象。" }, { "type": "double", "name": "v", "desc": "浮点数。" } ], "annotation": {}, "desc": "用浮点数初始化字符串。", "name": "str_from_float", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "str_t*", "name": "str", "desc": "str对象。" }, { "type": "value_t", "name": "v", "desc": "value。" } ], "annotation": {}, "desc": "用value初始化字符串。", "name": "str_from_value", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "str_t*", "name": "str", "desc": "str对象。" }, { "type": "wchar_t*", "name": "wstr", "desc": "Unicode字符串。" } ], "annotation": {}, "desc": "用value初始化字符串。", "name": "str_from_wstr", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "str_t*", "name": "str", "desc": "str对象。" }, { "type": "wchar_t*", "name": "wstr", "desc": "Unicode字符串" }, { "type": "uint32_t", "name": "len", "desc": "Unicode字符串的长度。" } ], "annotation": {}, "desc": "用value初始化字符串。", "name": "str_from_wstr_with_len", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "str_t*", "name": "str", "desc": "str对象。" }, { "type": "int32_t*", "name": "v", "desc": "用于返回整数。" } ], "annotation": {}, "desc": "将字符串转成整数。", "name": "str_to_int", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "str_t*", "name": "str", "desc": "str对象。" }, { "type": "double*", "name": "v", "desc": "用于返回浮点数。" } ], "annotation": {}, "desc": "将字符串转成浮点数。", "name": "str_to_float", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "str_t*", "name": "str", "desc": "str对象。" }, { "type": "char*", "name": "text", "desc": "子字符串。" } ], "annotation": {}, "desc": "判断字符串是否以指定的子串结尾。", "name": "str_end_with", "return": { "type": "bool_t", "desc": "返回是否以指定的子串结尾。" } }, { "params": [ { "type": "str_t*", "name": "str", "desc": "str对象。" }, { "type": "char*", "name": "text", "desc": "子字符串。" } ], "annotation": {}, "desc": "判断字符串是否以指定的子串开头。", "name": "str_start_with", "return": { "type": "bool_t", "desc": "返回是否以指定的子串开头。" } }, { "params": [ { "type": "str_t*", "name": "str", "desc": "str对象。" }, { "type": "char*", "name": "text", "desc": "要去除的字符集合。" } ], "annotation": {}, "desc": "去除首尾指定的字符。", "name": "str_trim", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "str_t*", "name": "str", "desc": "str对象。" }, { "type": "char*", "name": "text", "desc": "要去除的字符集合。" } ], "annotation": {}, "desc": "去除首部指定的字符。", "name": "str_trim_left", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "str_t*", "name": "str", "desc": "str对象。" }, { "type": "char*", "name": "text", "desc": "要去除的字符集合。" } ], "annotation": {}, "desc": "去除尾部指定的字符。", "name": "str_trim_right", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "str_t*", "name": "str", "desc": "str对象。" }, { "type": "char*", "name": "text", "desc": "待替换的子串。" }, { "type": "char*", "name": "new_text", "desc": "将替换成的子串。" } ], "annotation": {}, "desc": "字符串替换。", "name": "str_replace", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "str_t*", "name": "str", "desc": "str对象。" } ], "annotation": {}, "desc": "将字符串转成小写。", "name": "str_to_lower", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "str_t*", "name": "str", "desc": "str对象。" } ], "annotation": {}, "desc": "将字符串转成大写。", "name": "str_to_upper", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "str_t*", "name": "str", "desc": "str对象。" } ], "annotation": {}, "desc": "将字符串中的变量展开为obj中对应的属性值。\n\n变量的格式为${xxx}\n\n* xxx为变量名时${xxx}被展开为obj的属性xxx的值。\n* xxx为表达式时${xxx}被展开为表达式的值,表达式中可以用变量,$为变量的前缀,如${$x+$y}。\n* xxx为变量名时而不存在obj的属性时${xxx}被移出。", "name": "str_expand_vars", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "str_t*", "name": "str", "desc": "str对象。" } ], "annotation": {}, "desc": "重置字符串为空。", "name": "str_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": "char*", "annotation": { "readable": true } } ], "header": "tkc/str.h", "desc": "可变长度的UTF8字符串。\n\n示例\n\nc\nstr_t s;\nstr_init(&s, 0);\n\nstr_append(&s, \"abc\");\nstr_append(&s, \"123\");\nlog_debug(\"%s\\n\", s.str);\n\nstr_reset(&s);\n\n\n> 先调str\init进行初始化最后调用str\reset释放内存。", "name": "str_t", "level": 1 }, { "type": "class", "methods": [ { "params": [ { "type": "tk_thread_entry_t", "name": "entry", "desc": "线程函数。" }, { "type": "void*", "name": "args", "desc": "线程函数的上下文。" } ], "annotation": {}, "desc": "创建thread对象。", "name": "tk_thread_create", "return": { "type": "tk_thread_t*", "desc": "thread对象。" } }, { "params": [ { "type": "tk_thread_t*", "name": "thread", "desc": "thread对象。" }, { "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对象。" }, { "type": "uint32_t", "name": "stack_size", "desc": "栈的大小。" } ], "annotation": {}, "desc": "设置线程的栈大小。\n\n> 需要在调用start之前调用本函数。", "name": "tk_thread_set_stack_size", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "tk_thread_t*", "name": "thread", "desc": "thread对象。" }, { "type": "uint32_t", "name": "priority", "desc": "优先级。" } ], "annotation": {}, "desc": "设置线程的优先级。\n\n> 部分平台支持。", "name": "tk_thread_set_priority", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "tk_thread_t*", "name": "thread", "desc": "thread对象。" } ], "annotation": {}, "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/thread.h", "desc": "线程对象。", "name": "tk_thread_t", "level": 1 }, { "type": "class", "methods": [ { "params": [], "annotation": { "scriptable": true, "static": true }, "desc": "获取当前时间(秒)。", "name": "time_now_s", "return": { "type": "uint64_t", "desc": "返回当前时间(秒)。" } }, { "params": [], "annotation": { "scriptable": true, "static": true }, "desc": "获取当前时间(毫秒)。", "name": "time_now_ms", "return": { "type": "uint64_t", "desc": "返回当前时间(毫秒)。" } }, { "params": [], "annotation": { "scriptable": true, "static": true }, "desc": "获取当前时间(微秒)。", "name": "time_now_us", "return": { "type": "uint64_t", "desc": "返回当前时间(微秒)。" } } ], "events": [], "properties": [], "header": "tkc/time_now.h", "desc": "获取当前时间的函数。\n这里的当前时间是相对的在嵌入式系统一般相对于开机时间。\n它本身并没有任何意义一般用来计算时间间隔如实现定时器和动画等等。", "name": "time_now_t", "annotation": { "scriptable": true, "fake": true }, "level": 1 }, { "type": "class", "methods": [ { "params": [], "annotation": { "constructor": 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的IDTK_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", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } } ], "events": [], "properties": [], "header": "tkc/timer_manager.h", "desc": "定时器管理器。", "name": "timer_manager_t", "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\nc\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\nc\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": "size_t", "name": "size", "desc": "拷贝字节数。" }, { "type": "const char*", "name": "format", "desc": "格式化字符串。" }, { "type": "va_list", "name": "ap", "desc": "可变参数。" } ], "annotation": {}, "desc": "将可变参数ap按照format格式化字符串并将字符串复制到str中。", "name": "tk_vsnprintf", "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表示成功否则表示失败。" } }, { "params": [ { "type": "object_t*", "name": "obj", "desc": "object对象。" }, { "type": "str_t*", "name": "str", "desc": "用于返回结果。" } ], "annotation": {}, "desc": "将对象转换成json字符串。", "name": "object_to_json", "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" }, { "desc": "CSV格式。", "name": "VALUE_FORMAT_TYPE_CSV" } ], "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\nc\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表示s1<s2,等于0表示s1==s2,大于0表示s1>s2。" }, "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 }, { "type": "class", "methods": [ { "params": [], "annotation": {}, "desc": "创建解析器。", "name": "xml_parser_create", "return": { "type": "XmlParser*", "desc": "返回parser对象。" } }, { "params": [ { "type": "XmlParser*", "name": "thiz", "desc": "parser对象。" }, { "type": "XmlBuilder*", "name": "builder", "desc": "builder对象。" } ], "annotation": {}, "desc": "设置builder。", "name": "xml_parser_set_builder", "return": { "type": "void", "desc": "返回无。" } }, { "params": [ { "type": "XmlParser*", "name": "thiz", "desc": "parser对象。" }, { "type": "bool_t", "name": "trim_text", "desc": "是否去掉文本两端的空白字符。" } ], "annotation": {}, "desc": "设置是否去掉文本两端的空白字符。\n\n> 默认值为去掉文本两端的空白字符如果不x希望去掉调用本函数设置为FALSE。", "name": "xml_parser_set_trim_text", "return": { "type": "void", "desc": "返回无。" } }, { "params": [ { "type": "XmlParser*", "name": "thiz", "desc": "parser对象。" }, { "type": "const char*", "name": "xml", "desc": "数据。" }, { "type": "int", "name": "length", "desc": "数据长度。" } ], "annotation": {}, "desc": "解析数据。", "name": "xml_parser_parse", "return": { "type": "void", "desc": "返回无。" } }, { "params": [ { "type": "XmlParser*", "name": "thiz", "desc": "parser对象。" }, { "type": "const char*", "name": "filename", "desc": "文件名。" } ], "annotation": {}, "desc": "解析文件。", "name": "xml_parser_parse_file", "return": { "type": "void", "desc": "返回无。" } }, { "params": [ { "type": "XmlParser*", "name": "thiz", "desc": "parser对象。" } ], "annotation": {}, "desc": "销毁parser对象。", "name": "xml_parser_destroy", "return": { "type": "void", "desc": "返回无。" } } ], "events": [], "properties": [], "header": "xml/xml_parser.h", "desc": "xml解析器", "name": "XmlParser", "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", "parent": "emitter_t", "annotation": { "scriptable": true }, "level": 2 }, { "type": "class", "methods": [ { "params": [ { "type": "event_t*", "name": "event", "desc": "event对象。" } ], "annotation": { "cast": true, "scriptable": true }, "desc": "把event对象转wheel_event_t对象主要给脚本语言使用。", "name": "wheel_event_cast", "return": { "type": "wheel_event_t*", "desc": "event对象。" } }, { "params": [ { "type": "wheel_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": "wheel_event_init", "return": { "type": "event_t*", "desc": "event对象。" } } ], "events": [], "properties": [ { "name": "dy", "desc": "滚轮的y值。", "type": "int32_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": "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": "base/events.h", "desc": "值变化事件。", "name": "value_change_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对象转pointer_event_t对象主要给脚本语言使用。", "name": "pointer_event_cast", "return": { "type": "pointer_event_t*", "desc": "event对象。" } }, { "params": [ { "type": "pointer_event_t*", "name": "event", "desc": "event对象。" }, { "type": "void*", "name": "target", "desc": "事件目标。" }, { "type": "uint32_t", "name": "type", "desc": "事件类型。" }, { "type": "int32_t", "name": "x", "desc": "x的值。" }, { "type": "int32_t", "name": "y", "desc": "y的值。" } ], "annotation": {}, "desc": "初始化事件。", "name": "pointer_event_init", "return": { "type": "event_t*", "desc": "event对象。" } } ], "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": "button", "desc": "button。", "type": "uint8_t", "annotation": { "readable": true, "scriptable": true } }, { "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": "window_event_t*", "name": "event", "desc": "event对象。" }, { "type": "assets_manager_t*", "name": "am", "desc": "事件目标资源管理器。" }, { "type": "uint32_t", "name": "type", "desc": "事件类型。" }, { "type": "asset_type_t", "name": "asset_type", "desc": "资源类型。" }, { "type": "asset_info_t*", "name": "asset_info", "desc": "资源对象。" } ], "annotation": {}, "desc": "初始化事件。", "name": "window_event_init", "return": { "type": "event_t*", "desc": "event对象。" } } ], "events": [], "properties": [ { "name": "type", "desc": "触发事件的资源类型", "type": "asset_type_t*", "annotation": { "readable": true, "scriptable": true } }, { "name": "asset_info", "desc": "触发事件的资源对象", "type": "asset_info_t*", "annotation": { "readable": true, "scriptable": true } } ], "header": "base/events.h", "desc": "资源事件,由资源管理器触发。", "name": "assets_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\ngraphviz\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<image draw_type=\"center\" image=\"file://./design/default/images/xx/flag_CN.png\" />\n<gif image=\"file://./design/default/images/x2/bee.gif\" />\n<svg image=\"file://./design/default/images/svg/china.bsvg\" />\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": [], "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 }, "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", "annotation": { "scriptable": 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", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } } ], "events": [], "properties": [], "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\ngraphviz\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": "窗口管理器对象。" }, { "type": "widget_t*", "name": "window", "desc": "窗口对象。" } ], "annotation": {}, "desc": "强制立即关闭窗口。\n\n> 本函数不会执行窗口动画。", "name": "window_manager_close_window_force", "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": "widget_t*", "name": "curr_win", "desc": "当前窗口。" }, { "type": "widget_t*", "name": "target_win", "desc": "目标窗口。" }, { "type": "bool_t", "name": "close", "desc": "是否关闭当前窗口。" } ], "annotation": {}, "desc": "切换到指定窗口。", "name": "window_manager_switch_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表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "窗口管理器对象。" } ], "annotation": { "scriptable": true }, "desc": "关闭全部窗口。", "name": "window_manager_close_all", "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": 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的函数均适用于canvas\_widget\_t控件。\n\n在xml中使用"canvas"标签创建画布控件。如:\n\nxml\n<canvas name=\"paint_vgcanvas\" x=\"0\" y=\"0\" w=\"100%\" h=\"100%\" />\n\n\n> 更多用法请参考:\ncanvas_widget.xml\n\n在c代码中使用函数canvas\_widget\_create创建画布控件。如\n\nc\nwidget_t* canvas = canvas_widget_create(win, 0, 0, win->w, win->h);\n\n\n> 创建之后需要用widget\_on注册EVT\_PAINT事件并在EVT\_PAINT事件处理函数中绘制。\n\nc\nwidget_on(canvas, EVT_PAINT, on_paint_event, canvas);\n\n\n绘制时可以通过canvas接口去绘制也可以通过vgcanvas接口去绘制。\n先从evt获取canvas对象再通过canvas\_get\_vgcanvas从canvas中获取vgcanvas对象。\n\nc\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> 完整示例请参考:\ncanvas demo\n\n参考\n\n* canvas接口描述\n* vgcanvas接口描述", "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的函数均适用于color\_picker\_t控件。\n\n在xml中使用"color\_picker"标签创建颜色选择器控件。如:\n\nxml\n<color_picker x=\"0\" y=\"0\" w=\"100%\" h=\"100%\" value=\"orange\">\n<color_component x=\"0\" y=\"0\" w=\"200\" h=\"200\" name=\"sv\"/>\n<color_component x=\"210\" y=\"0\" w=\"20\" h=\"200\" name=\"h\"/>\n<color_tile x=\"0\" y=\"210\" w=\"50%\" h=\"20\" name=\"new\" bg_color=\"green\"/>\n<color_tile x=\"right\" y=\"210\" w=\"50%\" h=\"20\" name=\"old\" bg_color=\"blue\"/>\n</color_picker>\n\n\n> 更多用法请参考:\ncolor\_picker\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的函数均适用于draggable\_t控件。\n\n在xml中使用"draggable"标签创建draggable控件。如\n\nxml\n<button text=\"Drag Me\" w=\"80\" h=\"40\" x=\"10\" y=\"10\">\n<draggable />\n</button>\n\n\n拖动对话框标题时移动对话框\n\nxml\n<dialog_title x=\"0\" y=\"0\" w=\"100%\" h=\"30\" text=\"Hello AWTK\" >\n<draggable drag_window=\"true\"/>\n</dialog_title>\n\n\n> 更多用法请参考:\ndraggable.xml\n\n在c代码中使用函数draggable\_create创建按钮控件。如\n\nc\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的函数均适用于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", "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_pointer对象", "name": "guage_pointer_create", "return": { "type": "widget_t*", "desc": "对象。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "guage_pointer对象。" } ], "annotation": { "cast": true, "scriptable": true }, "desc": "转换为guage_pointer对象(供脚本语言使用)。", "name": "guage_pointer_cast", "return": { "type": "widget_t*", "desc": "guage_pointer对象。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "int32_t", "name": "angle", "desc": "指针角度。" } ], "annotation": { "scriptable": true }, "desc": "设置指针角度。12点钟方向为0度顺时钟方向为正单位为度。", "name": "guage_pointer_set_angle", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "const char*", "name": "image", "desc": "指针的图片。" } ], "annotation": { "scriptable": true }, "desc": "设置指针的图片。", "name": "guage_pointer_set_image", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "const char*", "name": "anchor_x", "desc": "指针的锚点坐标x。(后面加上px为像素点不加px为相对百分比坐标)" }, { "type": "const char*", "name": "anchor_y", "desc": "指针的锚点坐标y。(后面加上px为像素点不加px为相对百分比坐标)" } ], "annotation": { "scriptable": true }, "desc": "设置指针的旋转锚点。", "name": "guage_pointer_set_anchor", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } } ], "events": [], "properties": [ { "name": "angle", "desc": "指针角度。12点钟方向为0度顺时钟方向为正单位为度。", "type": "int32_t", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "persitent": true, "design": true, "scriptable": true } }, { "name": "image", "desc": "指针图片。\n\n图片须垂直向上图片的中心点为旋转方向。", "type": "char*", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "persitent": true, "design": true, "scriptable": true } }, { "name": "anchor_x", "desc": "图片旋转锚点x坐标。(后面加上px为像素点不加px为相对百分比坐标0.0f到1.0f)", "type": "char*", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "persitent": true, "design": true, "scriptable": true } }, { "name": "anchor_y", "desc": "图片旋转锚点x坐标。(后面加上px为像素点不加px为相对百分比坐标0.0f到1.0f)", "type": "char*", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "persitent": true, "design": true, "scriptable": true } } ], "header": "guage/guage_pointer.h", "desc": "仪表指针控件。\n\n仪表指针就是一张旋转的图片图片可以是普通图片也可以是SVG图片。\n\n在嵌入式平台上对于旋转的图片SVG图片的效率比位图高数倍所以推荐使用SVG图片。\n\nguage\_pointer\_t是widget\_t的子类控件widget\_t的函数均适用于guage\_pointer\_t控件。\n\n在xml中使用"guage\_pointer"标签创建仪表指针控件。如:\n\nxml\n<guage_pointer x=\"c\" y=\"50\" w=\"24\" h=\"140\" value=\"-128\" image=\"guage_pointer\" />\n\n\n> 更多用法请参考:\nguage.xml\n\n在c代码中使用函数guage\_pointer\_create创建仪表指针控件。如\n\nc\nwidget_t* guage_pointer = guage_pointer_create(guage, 10, 10, 100, 30);\nguage_pointer_set_image(guage_pointer, \"guage_pointer\");\n\n\n> 创建之后需要用guage\_pointer\_set\_image设置仪表指针图片。", "name": "guage_pointer_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": "创建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的函数均适用于guage\_t控件。\n\n在xml中使用"guage"标签创建表盘控件。如:\n\nxml\n<guage x=\"c\" y=\"10\" w=\"240\" h=\"240\" image=\"guage_bg\" >\n\n\n> 更多用法请参考:\nguage.xml\n\n在c代码中使用函数guage\_create创建表盘控件。如\n\nc\nwidget_t* guage = guage_create(win, 10, 10, 200, 200);\nguage_set_image(guage, \"guage_bg\");\n\n\n可用通过style来设置控件的显示风格如背景和边框等。如\n\nxml\n<guage>\n<style name=\"border\">\n<normal border_color=\"#000000\" bg_color=\"#e0e0e0\" text_color=\"black\"/>\n</style>\n</guage>\n\n\n> 更多用法请参考:\ntheme\ndefault", "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的函数均适用于image\_animation\_t控件。\n\n在xml中使用"image\_animation"标签创建图片动画控件。如:\n\nxml\n<image_animation image=\"ani\" start_index=\"1\" end_index=\"9\" auto_play=\"true\" interval=\"50\"\ndelay=\"100\"/>\n\n\n> 更多用法请参考:\nimage_animation.xml\n\n在c代码中使用函数image\_animation\_create创建图片动画控件。如\n\nc\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> 完整示例请参考:\nimage_animation\ndemo\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的函数均适用于image\_value\_t控件。\n\n在xml中使用"image\_value"标签创建图片值控件。如:\n\nxml\n<image_value value=\"0\" image=\"num_\" />\n\n\n> 更多用法请参考:\nimage\_value\n\n在c代码中使用函数image\_value\_create创建图片值控件。如\n\nc\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> 完整示例请参考:\nimage_value demo\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\nxml\n<candidates x=\"0\" y=\"0\" w=\"100%\" h=\"30\" grab_keys=\"true\"/>\n\n\n>相关文件: assets/default/raw/ui/kb_default.xml\n\n如果希望通过左右键切换不同的候选字除了设置属性grab_keys="true"还需要设置按钮的focused状态的style。\n\nxml\n<style name=\"candidates\" text_color=\"black\">\n<normal />\n<pressed bg_color=\"#c0c0c0\" border_color=\"#a0a0a0\"/>\n<over bg_color=\"#e0e0e0\" border_color=\"#a0a0a0\"/>\n<focused border_color=\"#a0a0a0\"/>\n</style>\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的函数均适用于lang_indicator\_t控件。\n\n在xml中使用"lang_indicator"标签创建lang_indicator。如\n\nxml\n<lang_indicator x=\"0\" y=\"0\" w=\"100%\" h=\"100%\" children_layout=\"default(c=2,r=2,m=5,s=5)\">\n</lang_indicator>\n\n\n可用通过style来设置控件的显示风格如背景颜色等。如\n\nxml\n<style name=\"default\" border_color=\"#a0a0a0\">\n<normal bg_color=\"#f0f0f0\" />\n</style>\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的函数均适用于line\_number\_t控件。\n\n在xml中使用"lin\e_number"标签创建行号控件一般配合mledit使用。如\n\nxml\n<mledit x=\"c\" y=\"10\" h=\"40%\" w=\"90%\" focus=\"true\" left_margin=\"36\" right_margin=\"16\"\nwrap_word=\"true\">\n<line_number x=\"0\" y=\"0\" w=\"32\" h=\"100%\" value=\"0\"/>\n<scroll_bar_d x=\"right\" y=\"0\" w=\"14\" h=\"100%\" value=\"0\"/>\n</mledit>\n\n\n> 更多用法请参考mledit.xml\n\n可用通过style来设置控件的显示风格如字体的大小和颜色等等。如\n\nxml\n<line_number>\n<style name=\"default\">\n<normal text_color=\"black\" bg_color=\"#d0d0d0\" text_align_h=\"right\"/>\n</style>\n</line_number>\n\n\n> 更多用法请参考:\ntheme default", "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的函数均适用于mledit\_t控件。\n\n在xml中使用"mledit"标签创建多行编辑器控件。如:\n\nxml\n<mledit x=\"c\" y=\"m\" w=\"300\" h=\"300\" />\n\n\n> 更多用法请参考mledit.xml\n\n在c代码中使用函数mledit\_create创建多行编辑器控件。如\n\nc\nwidget_t* tc = mledit_create(win, 10, 10, 240, 240);\n\n\n> 完整示例请参考mledit demo\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的函数均适用于progress\_circle\_t控件。\n\n在xml中使用"progress\_circle"标签创建进度圆环控件。如:\n\nxml\n<progress_circle max=\"360\" show_text=\"true\" start_angle=\"90\" />\n\n\n> 更多用法请参考:\nprogress_circle.xml\n\n在c代码中使用函数progress\_circle\_create创建进度圆环控件。如\n\nc\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> 完整示例请参考:\nprogress_circle\ndemo\n\n可用通过style来设置控件的显示风格如字体的大小和颜色等等。如\n\nxml\n<style name=\"default\">\n<normal text_color=\"green\" fg_color=\"black\" />\n</style>\n\n\n> 更多用法请参考:\ntheme\ndefault", "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的函数均适用于rich_text_view\_t控件。\n\n在xml中使用"rich_text_view"标签创建rich_text_view。如\n\nxml\n<rich_text_view x=\"0\" y=\"10\" w=\"100%\" h=\"300\">\n<rich_text line_gap=\"5\" x=\"0\" y=\"10\" w=\"-12\" h=\"100%\" margin=\"10\">\n...\n</rich_text>\n<scroll_bar_d name=\"bar\" x=\"right\" y=\"0\" w=\"12\" h=\"100%\" value=\"0\"/>\n</rich_text_view>\n\n\n可用通过style来设置控件的显示风格如背景颜色等。如\n\nxml\n<style name=\"default\" border_color=\"#a0a0a0\">\n<normal bg_color=\"#f0f0f0\" />\n</style>\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的函数均适用于rich\_text\_t控件。\n\n在xml中使用"rich\_text"标签创建图文混排控件。如:\n\nxml\n<rich_text x=\"0\" y=\"0\" w=\"100%\" h=\"60\"\ntext=\"<image name=&quota;bricks&quota;/><font align_v=&quota;middle&quota;>hello awtk!</font>\" />\n\n>\n\n> 更多用法请参考:\nrich_text.xml\n\n在c代码中使用函数rich\_text\_create创建图文混排控件。如\n\nc\nwidget_t* rich_text = rich_text_create(win, 0, 0, 0, 0);\nwidget_set_text_utf8(rich_text,\n\"<image name=\\\"bricks\\\"/><font color=\\\"gold\\\" align_v=\\\"bottom\\\" \"\n\"size=\\\"24\\\">hello awtk!</font><font color=\\\"green\\\" size=\\\"20\\\">ProTip! The \"\n\"feed shows you events from people you follow and repositories you watch. \"\n\"nhello world. </font><font color=\\\"red\\\" \"\n\"size=\\\"20\\\">确定取消中文字符测试。确定。取消。中文字符测试。</font>\");\n\nwidget_set_self_layout_params(rich_text, \"center\", \"middle\", \"100%\", \"100%\");\n\n\n> 完整示例请参考:\nrich_text demo\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的函数均适用于hscroll\_label\_t控件。\n\n在xml中使用"hscroll\_label"标签创建行号控件一般配合mledit使用。如\n\nxml\n\n\n> 更多用法请参考mledit.xml\n\n可用通过style来设置控件的显示风格如字体的大小和颜色等等。如\n\nxml\n<style name=\"default\" text_color=\"black\">\n<normal />\n<focused />\n</style>\n\n\n> 更多用法请参考:\ntheme default", "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子控件布局算法", "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的函数均适用于list\_item\_t控件。\n\n在xml中使用"list\_item"标签创建列表项控件。如:\n\nxml\n<list_view x=\"0\" y=\"30\" w=\"100%\" h=\"-80\" item_height=\"60\">\n<scroll_view name=\"view\" x=\"0\" y=\"0\" w=\"100%\" h=\"100%\">\n<list_item style=\"odd\" children_layout=\"default(rows=1,cols=0)\">\n<image draw_type=\"icon\" w=\"30\" image=\"earth\"/>\n<label w=\"-30\" text=\"1.Hello AWTK !\">\n<switch x=\"r:10\" y=\"m\" w=\"60\" h=\"20\"/>\n</label>\n</list_item>\n...\n</scroll_view>\n</list_view>\n\n\n> 更多用法请参考list\_view\_m.xml\n\n在c代码中使用函数list\_item\_create创建列表项控件。如\n\nc\nwidget_t* list_item = list_item_create(scroll_view, 0, 0, 0, 0);\n\n\n> 列表项控件大小一般由列表控制不需指定xywh参数。\n\n可以用style来实现可点击或不可点击的效果。如\n\nxml\n<style name=\"odd_clickable\" border_color=\"#a0a0a0\" border=\"bottom\" text_color=\"black\">\n<normal bg_color=\"#f5f5f5\" />\n<pressed bg_color=\"#c0c0c0\" />\n<over bg_color=\"#f5f5f5\" />\n</style>\n\n\n> 更多用法请参考theme default", "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的函数均适用于list\_view\_h\_t控件。\n\n在xml中使用"list\_view\_h"标签创建水平列表视图控件。如:\n\nxml\n<list_view_h x=\"center\" y=\"10\" w=\"90%\" h=\"100\" item_width=\"200\" spacing=\"5\">\n<scroll_view name=\"view\" w=\"100%\" h=\"100%\">\n<image style=\"border\" draw_type=\"auto\" image=\"1\" text=\"1\"/>\n...\n</scroll_view>\n</list_view_h>\n\n\n> 注意:列表项不是作为列表视图控件的直接子控件,而是作为滚动视图的子控件。\n\n\n> 更多用法请参考list\_view\_h.xml\n\n在c代码中使用函数list\_view\_h\_create创建水平列表视图控件。如\n\nc\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列表视图中的列表项可以固定高度也可以使用不同高度。请参考变高列表项\n\n列表视图控件的中可以有滚动条也可以没有滚动条。\n可以使用移动设备风格的滚动条也可以使用桌面风格的滚动条。\n\nlist\_view\_t是widget\_t的子类控件widget\_t的函数均适用于list\_view\_t控件。\n\n在xml中使用"list\_view"标签创建列表视图控件。如:\n\nxml\n<list_view x=\"0\" y=\"30\" w=\"100%\" h=\"-80\" item_height=\"60\">\n<scroll_view name=\"view\" x=\"0\" y=\"0\" w=\"100%\" h=\"100%\">\n<list_item style=\"odd\" children_layout=\"default(rows=1,cols=0)\">\n<image draw_type=\"icon\" w=\"30\" image=\"earth\"/>\n<label w=\"-30\" text=\"1.Hello AWTK !\">\n<switch x=\"r:10\" y=\"m\" w=\"60\" h=\"20\"/>\n</label>\n</list_item>\n...\n</scroll_view>\n</list_view>\n\n\n> 注意:列表项不是作为列表视图控件的直接子控件,而是作为滚动视图的子控件。\n\n\n> 更多用法请参考list\_view\_m.xml\n\n在c代码中使用函数list\_view\_create创建列表视图控件。如\n\nc\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的函数均适用于scroll\_bar\_t控件。\n\n在xml中使用"scroll\_bar"或"scroll\_bar\_d"或"scroll\_bar\_m"标签创建滚动条控件。如:\n\nxml\n<list_view x=\"0\" y=\"30\" w=\"100%\" h=\"-80\" item_height=\"60\">\n<scroll_view name=\"view\" x=\"0\" y=\"0\" w=\"100%\" h=\"100%\">\n...\n</scroll_view>\n<scroll_bar_m name=\"bar\" x=\"right\" y=\"0\" w=\"6\" h=\"100%\" value=\"0\"/>\n</list_view>\n\n\n> 更多用法请参考list\_view\_m.xml\n\n在c代码中使用函数scroll\_bar\_create创建列表项控件。如\n\nc\nwidget_t* scroll_bar = scroll_bar_create(list_view, 0, 0, 0, 0);\n\n\nxml\n<style name=\"default\">\n<normal bg_color=\"#c0c0c0\" fg_color=\"#808080\"/>\n<over bg_color=\"#c0c0c0\" fg_color=\"#808080\"/>\n<pressed bg_color=\"#c0c0c0\" fg_color=\"#808080\"/>\n</style>\n\n\n> 更多用法请参考theme default", "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": "bool_t", "name": "snap_to_page", "desc": "是否按页面对齐。" } ], "annotation": { "scriptable": true }, "desc": "设置滚动时offset是否按页面对齐。", "name": "scroll_view_set_snap_to_page", "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 } }, { "name": "snap_to_page", "desc": "滚动时offset是否按页面对齐。", "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的函数均适用于scroll\_view\_t控件。\n\n在xml中使用"scroll\_view"标签创建滚动视图控件。如:\n\nxml\n<list_view x=\"0\" y=\"30\" w=\"100%\" h=\"-80\" item_height=\"60\">\n<scroll_view name=\"view\" x=\"0\" y=\"0\" w=\"100%\" h=\"100%\">\n<list_item style=\"odd\" children_layout=\"default(rows=1,cols=0)\">\n<image draw_type=\"icon\" w=\"30\" image=\"earth\"/>\n<label w=\"-30\" text=\"1.Hello AWTK !\">\n<switch x=\"r:10\" y=\"m\" w=\"60\" h=\"20\"/>\n</label>\n</list_item>\n...\n</scroll_view>\n</list_view>\n\n\n> 滚动视图一般作为列表视图的子控件使用。\n\n> 更多用法请参考list\_view\_m.xml\n\n在c代码中使用函数scroll\_view\_create创建列表视图控件。如\n\nc\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的函数均适用于slide\_menu\_t控件。\n\n在xml中使用"slide\_menu"标签创建左右滑动菜单控件。如:\n\nxml\n<slide_menu style=\"mask\" align_v=\"top\">\n<button style=\"slide_button\" text=\"0\"/>\n<button style=\"slide_button\" text=\"1\"/>\n<button style=\"slide_button\" text=\"2\"/>\n<button style=\"slide_button\" text=\"3\"/>\n<button style=\"slide_button\" text=\"4\"/>\n</slide_menu>\n\n\n> 更多用法请参考slide_menu.xml\n\n在c代码中使用函数slide\_menu\_create创建左右滑动菜单控件。如\n\nc\nslide_menu = slide_menu_create(win, 10, 10, 300, 60);\nb = button_create(slide_menu, 0, 0, 0, 0);\nwidget_set_text_utf8(b, \"1\");\nb = button_create(slide_menu, 0, 0, 0, 0);\nwidget_set_text_utf8(b, \"2\");\nb = button_create(slide_menu, 0, 0, 0, 0);\nwidget_set_text_utf8(b, \"3\");\nb = button_create(slide_menu, 0, 0, 0, 0);\nwidget_set_text_utf8(b, \"4\");\n\n\n可按下面的方法关注当前项改变的事件\n\nc\nwidget_on(slide_menu, EVT_VALUE_CHANGED, on_current_changed, slide_menu);\n\n\n可按下面的方法关注当前按钮被点击的事件\n\nc\nwidget_on(b, EVT_CLICK, on_button_click, b);\n\n\n> 完整示例请参考slide_menu demo\n\n可用通过style来设置控件的显示风格如背景颜色和蒙版颜色等等。如\n\nxml\n<style name=\"mask\">\n<normal bg_color=\"#f0f0f0\" mask_color=\"#f0f0f0\"/>\n</style>\n\n\n> 更多用法请参考theme default", "name": "slide_menu_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_indicator对象", "name": "slide_indicator_create", "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": "创建slide_indicator对象线性显示", "name": "slide_indicator_create_linear", "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": "创建slide_indicator对象圆弧显示", "name": "slide_indicator_create_arc", "return": { "type": "widget_t*", "desc": "对象。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "slide_indicator对象。" } ], "annotation": { "cast": true, "scriptable": true }, "desc": "转换为slide_indicator对象(供脚本语言使用)。", "name": "slide_indicator_cast", "return": { "type": "widget_t*", "desc": "slide_indicator对象。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "slide_indicator对象。" }, { "type": "uint32_t", "name": "value", "desc": "当前项的序号。" } ], "annotation": { "scriptable": true }, "desc": "设置当前页的序号。", "name": "slide_indicator_set_value", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "slide_indicator对象。" }, { "type": "uint32_t", "name": "max", "desc": "数量。" } ], "annotation": { "scriptable": true }, "desc": "设置指示器的数量。", "name": "slide_indicator_set_max", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "slide_indicator对象。" }, { "type": "indicator_default_paint_t", "name": "default_paint", "desc": "默认绘制类型。" } ], "annotation": { "scriptable": true }, "desc": "设置指示器的默认绘制类型。", "name": "slide_indicator_set_default_paint", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "slide_indicator对象。" }, { "type": "uint16_t", "name": "auto_hide", "desc": "0表示禁止非0表示无操作后延迟多久隐藏。" } ], "annotation": { "scriptable": true }, "desc": "设置指示器是否自动隐藏。", "name": "slide_indicator_set_auto_hide", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "slide_indicator对象。" }, { "type": "int32_t", "name": "margin", "desc": "指示器的边距。" } ], "annotation": { "scriptable": true }, "desc": "设置指示器的边距(默认为10像素)。", "name": "slide_indicator_set_margin", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "slide_indicator对象。" }, { "type": "float_t", "name": "spacing", "desc": "指示器的间距。" } ], "annotation": { "scriptable": true }, "desc": "设置指示器的间距(指示器有弧度时为角度值,否则为直线间距)。", "name": "slide_indicator_set_spacing", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "slide_indicator对象。" }, { "type": "uint32_t", "name": "size", "desc": "指示器的大小。" } ], "annotation": { "scriptable": true }, "desc": "设置指示器的大小(默认为8)。", "name": "slide_indicator_set_size", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "slide_indicator对象。" }, { "type": "const char*", "name": "anchor_x", "desc": "锚点坐标x。(后面加上px为像素点不加px为相对百分比坐标)" }, { "type": "const char*", "name": "anchor_y", "desc": "锚点坐标y。(后面加上px为像素点不加px为相对百分比坐标)" } ], "annotation": { "scriptable": true }, "desc": "设置旋转锚点。", "name": "slide_indicator_set_anchor", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "slide_indicator对象。" }, { "type": "const char*", "name": "target_name", "desc": "指示器指示的目标控件的名称" } ], "annotation": { "scriptable": true }, "desc": "设置指示器指示的目标。", "name": "slide_indicator_set_indicated_target", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } } ], "events": [], "properties": [ { "name": "value", "desc": "值(缺省为0)。", "type": "uint32_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": "default_paint", "desc": "指示器的类型。", "type": "indicator_default_paint_t", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "persitent": true, "design": true, "scriptable": true } }, { "name": "auto_hide", "desc": "自动隐藏。0表示禁止非0表示无操作后延迟多久隐藏。", "type": "uint16_t", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "persitent": true, "design": true, "scriptable": true } }, { "name": "margin", "desc": "指示器与边缘的边距。", "type": "int32_t", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "persitent": true, "design": true, "scriptable": true } }, { "name": "spacing", "desc": "指示器的中心之间的间距(圆弧显示时,间距的单位为弧度,否则为像素)。", "type": "float_t", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "persitent": true, "design": true, "scriptable": true } }, { "name": "size", "desc": "指示器的大小。", "type": "uint32_t", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "persitent": true, "design": true, "scriptable": true } }, { "name": "anchor_x", "desc": "锚点x坐标。", "type": "float_t", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "persitent": true, "design": true, "scriptable": true } }, { "name": "anchor_y", "desc": "锚点y坐标。", "type": "float_t", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "persitent": true, "design": true, "scriptable": true } }, { "name": "indicated_target", "desc": "指示器指示的目标控件的名称。", "type": "char*", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "persitent": true, "design": true, "scriptable": true } } ], "header": "slide_view/slide_indicator.h", "desc": "slide_view的指示器控件。\n\n> 支持直线、弧线排布默认有4种绘制样式若设置了icon/active_icon则优先使用icon/active_icon\n\nslide\_indicator\_t是widget\_t的子类控件widget\_t的函数均适用于slide\_indicator\_t控件。\n\n在xml中使用"slide\_indicator"或"slide\_indicator\_arc"标签创建指示器控件。如:\n\nxml\n<slide_view name=\"view\" x=\"0\" y=\"0\" w=\"100%\" h=\"100%\">\n...\n</slide_view>\n<slide_indicator name=\"indicator\" x=\"right\" y=\"0\" w=\"6\" h=\"100%\"/>\n\n\n> 更多用法请参考slide\_view.xml\n\n在c代码中使用函数slide\_indicator\_create创建指示器控件。如\n\nc\nwidget_t* slide_indicator = slide_indicator_create(parent, 0, 0, 0, 0);\n\n\nxml\n<style name=\"default\">\n<normal fg_color=\"#FFFFFF80\" selected_fg_color=\"#FFFFFF\"/>\n</style>\n\n\n> 更多用法请参考theme default", "name": "slide_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": "创建slide_view对象", "name": "slide_view_create", "return": { "type": "widget_t*", "desc": "对象。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "slide_view对象。" } ], "annotation": { "cast": true, "scriptable": true }, "desc": "转换为slide_view对象(供脚本语言使用)。", "name": "slide_view_cast", "return": { "type": "widget_t*", "desc": "slide_view对象。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "slide_view对象。" }, { "type": "uint16_t", "name": "auto_play", "desc": "0表示禁止自动播放非0表示自动播放时每一页播放的时间。" } ], "annotation": { "scriptable": true }, "desc": "设置为自动播放模式。", "name": "slide_view_set_auto_play", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "slide_view对象。" }, { "type": "uint32_t", "name": "index", "desc": "当前页的序号。" } ], "annotation": { "scriptable": true }, "desc": "设置当前页的序号。", "name": "slide_view_set_active", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "slide_view对象。" }, { "type": "bool_t", "name": "vertical", "desc": "TRUE表示上下滑动FALSE表示左右滑动。" } ], "annotation": { "scriptable": true }, "desc": "设置为上下滑动(缺省为左右滑动)。", "name": "slide_view_set_vertical", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "slide_view对象。" }, { "type": "const char*", "name": "anim_hint", "desc": "页面切换动画。" } ], "annotation": { "scriptable": true }, "desc": "设置页面切换动画。\n\nanim_hint取值如下\n\n* "translate":平移。\n* "overlap":覆盖。\n* "overlap\_with\_alpha":覆盖并改变透明度。\n\n> 使用"overlap"或"overlap\_with\_alpha"动画时背景图片最好指定到page上。\n>\n> 使用"overlap\_with\_alpha"动画时slideview的背景设置为黑色\n> 或slideview的背景设置为透明窗口的背景设置为黑色以获得更好的视觉效果和性能。", "name": "slide_view_set_anim_hint", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "slide_view对象。" }, { "type": "bool_t", "name": "loop", "desc": "是否启用循环切换模式。" } ], "annotation": { "scriptable": true }, "desc": "设置循环切换模式。", "name": "slide_view_set_loop", "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": "vertical", "desc": "是否为上下滑动模式。", "type": "bool_t", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "persitent": true, "design": true, "scriptable": true } }, { "name": "auto_play", "desc": "自动播放。0表示禁止自动播放非0表示自动播放时每一页播放的时间。", "type": "uint16_t", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "persitent": true, "design": true, "scriptable": true } }, { "name": "loop", "desc": "循环切换模式。\n\n向后切换切换到最后一页时再往后切换就到第一页。\n向前切换切换到第一页时再往前切换就到最后一页。", "type": "bool_t", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "persitent": true, "design": true, "scriptable": true } }, { "name": "anim_hint", "desc": "页面切换效果。", "type": "char*", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "persitent": true, "design": true, "scriptable": true } } ], "header": "slide_view/slide_view.h", "desc": "滑动视图。\n\n滑动视图可以管理多个页面并通过滑动来切换当前页面。也可以管理多张图片让它们自动切换。\n\nslide\_view\_t是widget\_t的子类控件widget\_t的函数均适用于slide\_view\_t控件。\n\n在xml中使用"slide\_view"标签创建滑动视图控件。如:\n\nxml\n<slide_view x=\"0\" y=\"0\" w=\"100%\" h=\"100%\" style=\"dot\">\n<view x=\"0\" y=\"0\" w=\"100%\" h=\"100%\" children_layout=\"default(w=60,h=60,m=5,s=10)\">\n...\n</view>\n<view x=\"0\" y=\"0\" w=\"100%\" h=\"100%\" children_layout=\"default(w=60,h=60,m=5,s=10)\">\n...\n</view>\n</slide_view>\n\n\n> 更多用法请参考slide_view.xml\n\n在c代码中使用函数slide\_view\_create创建滑动视图控件。如\n\nc\nslide_view = slide_view_create(win, 0, 0, win->w, win->h);\n\n\n> 完整示例请参考:\nslide_view demo\n\n可用通过style来设置控件的显示风格如背景颜色和指示器的图标等等。如\n\nxml\n<style name=\"dot\">\n<normal icon=\"dot\" active_icon=\"active_dot\"/>\n</style>\n\n\n> 如果希望背景图片跟随滚动请将背景图片设置到页面上否则设置到slide\_view上。\n\n> 更多用法请参考theme default", "name": "slide_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": "创建switch对象", "name": "switch_create", "return": { "type": "widget_t*", "desc": "对象。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "switch对象。" }, { "type": "bool_t", "name": "value", "desc": "值" } ], "annotation": { "scriptable": true }, "desc": "设置控件的值。", "name": "switch_set_value", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "switch对象。" } ], "annotation": { "cast": true, "scriptable": true }, "desc": "转换switch对象(供脚本语言使用)。", "name": "switch_cast", "return": { "type": "widget_t*", "desc": "switch对象。" } } ], "events": [ { "name": "EVT_VALUE_WILL_CHANGE", "desc": "值(开关状态)即将改变事件。", "type": "event_t" }, { "name": "EVT_VALUE_CHANGED", "desc": "值(开关状态)改变事件。", "type": "event_t" } ], "properties": [ { "name": "value", "desc": "值。", "type": "bool_t", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "persitent": true, "design": true, "scriptable": true } }, { "name": "max_xoffset_ratio", "desc": "当开关处于关闭时,图片偏移相对于图片宽度的比例(缺省为1/3)。", "type": "float_t", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "persitent": true, "design": true, "scriptable": true } } ], "header": "switch/switch.h", "desc": "开关控件。\n\nswitch\_t是widget\_t的子类控件widget\_t的函数均适用于switch\_t控件。\n\n在xml中使用"switch"标签创建开关控件。如:\n\nxml\n<switch x=\"10\" y=\"60\" w=\"60\" h=\"22\" />\n\n\n> 更多用法请参考switch.xml\n\n在c代码中使用函数switch\_create创建开关控件。如\n\nc\nwidget_t* sw = switch_create(win, 10, 10, 80, 30);\nwidget_on(sw, EVT_VALUE_CHANGED, on_changed, NULL);\n\n\n> 完整示例请参考switch demo\n\n可用通过style来设置控件的显示风格如背景图片等。如\n\nxml\n<style name=\"default\">\n<normal bg_image=\"switch\" />\n</style>\n\n\n> 更多用法请参考theme default", "name": "switch_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": "创建text_selector对象", "name": "text_selector_create", "return": { "type": "widget_t*", "desc": "对象。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "text_selector对象。" } ], "annotation": { "cast": true, "scriptable": true }, "desc": "转换text_selector对象(供脚本语言使用)。", "name": "text_selector_cast", "return": { "type": "widget_t*", "desc": "text_selector对象。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "text_selector对象。" } ], "annotation": { "scriptable": true }, "desc": "重置所有选项。", "name": "text_selector_reset_options", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "text_selector对象。" } ], "annotation": { "scriptable": true }, "desc": "获取选项个数。", "name": "text_selector_count_options", "return": { "type": "int32_t", "desc": "返回选项个数。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "text_selector对象。" }, { "type": "int32_t", "name": "value", "desc": "值。" }, { "type": "char*", "name": "text", "desc": "文本。" } ], "annotation": { "scriptable": true }, "desc": "追加一个选项。", "name": "text_selector_append_option", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "text_selector对象。" }, { "type": "char*", "name": "options", "desc": "选项。" } ], "annotation": { "scriptable": true }, "desc": "设置选项。", "name": "text_selector_set_options", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "text_selector对象。" }, { "type": "int32_t", "name": "start", "desc": "起始值。" }, { "type": "uint32_t", "name": "nr", "desc": "个数。" }, { "type": "int32_t", "name": "step", "desc": "步长。" } ], "annotation": { "scriptable": true }, "desc": "设置一系列的整数选项。", "name": "text_selector_set_range_options", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "text_selector对象。" }, { "type": "uint32_t", "name": "index", "desc": "选项的索引。" } ], "annotation": {}, "desc": "获取第index个选项。", "name": "text_selector_get_option", "return": { "type": "text_selector_option_t*", "desc": "成功返回选项失败返回NULL。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "text_selector对象。" } ], "annotation": { "scriptable": true }, "desc": "获取text_selector的值。", "name": "text_selector_get_value", "return": { "type": "int32_t", "desc": "返回值。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "text_selector对象。" }, { "type": "int32_t", "name": "value", "desc": "值。" } ], "annotation": { "scriptable": true }, "desc": "设置text_selector的值。", "name": "text_selector_set_value", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "text_selector对象。" } ], "annotation": { "scriptable": true }, "desc": "获取text_selector的文本。", "name": "text_selector_get_text", "alias": "text_selector_get_text_value", "return": { "type": "const char*", "desc": "返回文本。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "text_selector对象。" }, { "type": "const char*", "name": "text", "desc": "文本。" } ], "annotation": { "scriptable": true }, "desc": "设置text_selector的文本。", "name": "text_selector_set_text", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "text_selector对象。" }, { "type": "uint32_t", "name": "index", "desc": "选项的索引。" } ], "annotation": { "scriptable": true }, "desc": "设置第index个选项为当前选中的选项。", "name": "text_selector_set_selected_index", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "text_selector对象。" }, { "type": "uint32_t", "name": "visible_nr", "desc": "选项数。" } ], "annotation": { "scriptable": true }, "desc": "设置可见的选项数。", "name": "text_selector_set_visible_nr", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "text_selector对象。" }, { "type": "bool_t", "name": "localize_options", "desc": "是否本地化(翻译)选项。" } ], "annotation": { "scriptable": true }, "desc": "设置是否本地化(翻译)选项。", "name": "text_selector_set_localize_options", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "text_selector对象。" }, { "type": "bool_t", "name": "loop_options", "desc": "是否循环选项。" } ], "annotation": { "scriptable": true }, "desc": "设置是否循环选项。", "name": "text_selector_set_loop_options", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "float_t", "name": "yspeed_scale", "desc": "y偏移速度比例。" } ], "annotation": { "scriptable": true }, "desc": "设置Y轴偏移速度比例。", "name": "text_selector_set_yspeed_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": "visible_nr", "desc": "可见的选项数量(只能是3或者5缺省为5)。", "type": "uint32_t", "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": "options", "desc": "设置可选项(冒号分隔值和文本,分号分隔选项,如:1:red;2:green;3:blue)。\n对于数值选项也可以指定一个范围用『-』分隔起始值、结束值和格式。\n如"1-7-%02d"表示1到7格式为『02d』格式为可选缺省为『%d』。", "type": "char*", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "persitent": true, "design": true, "scriptable": true } }, { "name": "localize_options", "desc": "是否本地化(翻译)选项(缺省为FALSE)。", "type": "bool_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": "loop_options", "desc": "是否循环选项(缺省为FALSE)。", "type": "bool_t", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "persitent": true, "design": true, "scriptable": true } } ], "header": "text_selector/text_selector.h", "desc": "文本选择器控件,通常用于选择日期和时间等。\n\n> XXX: 目前需要先设置options和visible_nr再设置其它参数(在XML中也需要按此顺序)。\n\ntext\_selector\_t是widget\_t的子类控件widget\_t的函数均适用于text\_selector\_t控件。\n\n在xml中使用"text\_selector"标签创建文本选择器控件。如:\n\nxml\n<text_selector options=\"red;green;blue;gold;orange\" visible_nr=\"3\" text=\"red\"/>\n\n\n> 更多用法请参考text\_selector.xml\n\n在c代码中使用函数text\_selector\_create创建文本选择器控件。如\n\nc\nwidget_t* ts = text_selector_create(win, 10, 10, 80, 150);\ntext_selector_set_options(ts, \"1:red;2:green;3:blue;4:orange;5:gold\");\ntext_selector_set_value(ts, 1);\nwidget_use_style(ts, \"dark\");\n\n\n> 完整示例请参考text\_selector demo\n\n可用通过style来设置控件的显示风格如字体和背景颜色等。如\n\nxml\n<style name=\"dark\" fg_color=\"#a0a0a0\" text_color=\"black\" text_align_h=\"center\">\n<normal bg_color=\"#ffffff\" mask_color=\"#404040\" border_color=\"#404040\"/>\n</style>\n\n\n> 更多用法请参考theme default", "name": "text_selector_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": "创建time_clock对象", "name": "time_clock_create", "return": { "type": "widget_t*", "desc": "对象。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "time_clock对象。" } ], "annotation": { "cast": true, "scriptable": true }, "desc": "转换为time_clock对象(供脚本语言使用)。", "name": "time_clock_cast", "return": { "type": "widget_t*", "desc": "time_clock对象。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "int32_t", "name": "hour", "desc": "小时的值。" } ], "annotation": { "scriptable": true }, "desc": "设置小时的值。", "name": "time_clock_set_hour", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "int32_t", "name": "minute", "desc": "分钟的值。" } ], "annotation": { "scriptable": true }, "desc": "设置分钟的值。", "name": "time_clock_set_minute", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "int32_t", "name": "second", "desc": "秒的值。" } ], "annotation": { "scriptable": true }, "desc": "设置秒的值。", "name": "time_clock_set_second", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "const char*", "name": "hour", "desc": "小时的图片。" } ], "annotation": { "scriptable": true }, "desc": "设置小时的图片。", "name": "time_clock_set_hour_image", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "const char*", "name": "minute_image", "desc": "分钟的图片。" } ], "annotation": { "scriptable": true }, "desc": "设置分钟的图片。", "name": "time_clock_set_minute_image", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "const char*", "name": "second_image", "desc": "秒的图片。" } ], "annotation": { "scriptable": true }, "desc": "设置秒的图片。", "name": "time_clock_set_second_image", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "const char*", "name": "bg_image", "desc": "背景图片。" } ], "annotation": { "scriptable": true }, "desc": "设置背景图片。", "name": "time_clock_set_bg_image", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "const char*", "name": "image", "desc": "图片。" } ], "annotation": { "scriptable": true }, "desc": "设置中心图片。", "name": "time_clock_set_image", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "const char*", "name": "anchor_x", "desc": "指针的锚点坐标x。" }, { "type": "const char*", "name": "anchor_y", "desc": "指针的锚点坐标y。" } ], "annotation": { "scriptable": true }, "desc": "设置小时指针的旋转锚点。\n> 后面加上px为像素点不加px为相对百分比坐标0.0f到1.0f", "name": "time_clock_set_hour_anchor", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "const char*", "name": "anchor_x", "desc": "指针的锚点坐标x。" }, { "type": "const char*", "name": "anchor_y", "desc": "指针的锚点坐标y。" } ], "annotation": { "scriptable": true }, "desc": "设置分钟指针的旋转锚点。\n> 后面加上px为像素点不加px为相对百分比坐标0.0f到1.0f", "name": "time_clock_set_minute_anchor", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "const char*", "name": "anchor_x", "desc": "指针的锚点坐标x。" }, { "type": "const char*", "name": "anchor_y", "desc": "指针的锚点坐标y。" } ], "annotation": { "scriptable": true }, "desc": "设置秒钟指针的旋转锚点。\n> 后面加上px为像素点不加px为相对百分比坐标0.0f到1.0f", "name": "time_clock_set_second_anchor", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } } ], "events": [], "properties": [ { "name": "hour", "desc": "小时。", "type": "int32_t", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "persitent": true, "design": true, "scriptable": true } }, { "name": "minute", "desc": "分钟。", "type": "int32_t", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "persitent": true, "design": true, "scriptable": true } }, { "name": "second", "desc": "秒。", "type": "int32_t", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "persitent": true, "design": true, "scriptable": true } }, { "name": "image", "desc": "中心图片。", "type": "char*", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "persitent": true, "design": true, "scriptable": true } }, { "name": "bg_image", "desc": "背景图片。", "type": "char*", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "persitent": true, "design": true, "scriptable": true } }, { "name": "hour_image", "desc": "时针图片。", "type": "char*", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "persitent": true, "design": true, "scriptable": true } }, { "name": "minute_image", "desc": "分针图片。", "type": "char*", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "persitent": true, "design": true, "scriptable": true } }, { "name": "second_image", "desc": "秒针图片。", "type": "char*", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "persitent": true, "design": true, "scriptable": true } }, { "name": "hour_anchor_x", "desc": "时针图片旋转锚点x坐标。(后面加上px为像素点不加px为相对百分比坐标0.0f到1.0f)", "type": "char*", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "persitent": true, "design": true, "scriptable": true } }, { "name": "hour_anchor_y", "desc": "时针图片旋转锚点y坐标。(后面加上px为像素点不加px为相对百分比坐标0.0f到1.0f)", "type": "char*", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "persitent": true, "design": true, "scriptable": true } }, { "name": "minute_anchor_x", "desc": "分针图片旋转锚点x坐标。(后面加上px为像素点不加px为相对百分比坐标0.0f到1.0f)", "type": "char*", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "persitent": true, "design": true, "scriptable": true } }, { "name": "minute_anchor_y", "desc": "分针图片旋转锚点y坐标。(后面加上px为像素点不加px为相对百分比坐标0.0f到1.0f)", "type": "char*", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "persitent": true, "design": true, "scriptable": true } }, { "name": "second_anchor_x", "desc": "秒针图片旋转锚点x坐标。(后面加上px为像素点不加px为相对百分比坐标0.0f到1.0f)", "type": "char*", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "persitent": true, "design": true, "scriptable": true } }, { "name": "second_anchor_y", "desc": "秒针图片旋转锚点y坐标。(后面加上px为像素点不加px为相对百分比坐标0.0f到1.0f)", "type": "char*", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "persitent": true, "design": true, "scriptable": true } } ], "header": "time_clock/time_clock.h", "desc": "模拟时钟控件。\n\ntime\_clock\_t是widget\_t的子类控件widget\_t的函数均适用于time\_clock\_t控件。\n\n在xml中使用"time\_clock"标签创建模拟时钟控件。如:\n\nxml\n<time_clock x=\"c\" y=\"m\" w=\"300\" h=\"300\" bg_image=\"clock_bg\" image=\"clock\"\nhour_image=\"clock_hour\" minute_image=\"clock_minute\" second_image=\"clock_second\"/>\n\n\n> 更多用法请参考time\_clock.xml\n\n在c代码中使用函数time\_clock\_create创建模拟时钟控件。如\n\nc\nwidget_t* tc = time_clock_create(win, 10, 10, 240, 240);\ntime_clock_set_image(tc, \"clock\");\ntime_clock_set_bg_image(tc, \"clock_bg\");\ntime_clock_set_hour_image(tc, \"clock_hour\");\ntime_clock_set_minute_image(tc, \"clock_minute\");\ntime_clock_set_second_image(tc, \"clock_second\");\n\n\n> 完整示例请参考time_clock demo\n\ntime\_clock一般不需要设置style。", "name": "time_clock_t", "parent": "widget_t", "annotation": { "scriptable": true, "design": true, "widget": true }, "level": 2 }, { "type": "class", "methods": [ { "params": [], "annotation": { "constructor": true }, "desc": "获取bitmap字体加载器对象。", "name": "font_loader_bitmap", "return": { "type": "font_loader_t*", "desc": "返回字体加载器对象。" } } ], "events": [], "properties": [], "header": "font_loader/font_loader_bitmap.h", "desc": "bitmap字体加载器。\n\nbitmap字体是用工具预先生成位图字体数据优势是速度快不占用内存缺点是字体大小固定。\n适合低端嵌入式平台。\n\ntools/font_gen用于把矢量字体(如truetype)转换成位图字体。", "name": "font_loader_bitmap_t", "parent": "font_loader_t", "annotation": { "fake": true }, "level": 2 }, { "type": "class", "methods": [ { "params": [], "annotation": { "constructor": true }, "desc": "获取freetype字体加载器对象。", "name": "font_loader_ft", "return": { "type": "font_loader_t*", "desc": "返回字体加载器对象。" } } ], "events": [], "properties": [], "header": "font_loader/font_loader_ft.h", "desc": "freetype字体加载器。\n\nfreetype主要用于加载矢量字体(如truetype)它功能强大效果优异与stb字体加载器相比缺点是代码量比较大。\n如果flash空间够大优先使用freetype否则使用stb。", "name": "font_loader_ft_t", "parent": "font_loader_t", "annotation": { "fake": true }, "level": 2 }, { "type": "class", "methods": [ { "params": [], "annotation": { "constructor": true }, "desc": "获取stb字体加载器对象。", "name": "font_loader_stb", "return": { "type": "font_loader_t*", "desc": "返回字体加载器对象。" } }, { "params": [ { "type": "const char*", "name": "name", "desc": "字体名称。" }, { "type": "const uint8_t* buff", "name": "", "desc": "。" }, { "type": "uint32_t", "name": "size", "desc": "字体数据长度。" } ], "annotation": { "static": true }, "desc": "创建stb字体对象。", "name": "font_stb_create", "return": { "type": "font_t*", "desc": "返回字体对象。" } } ], "events": [], "properties": [], "header": "font_loader/font_loader_stb.h", "desc": "stb字体加载器。\n\nstb主要用于加载矢量字体(如truetype),它功能强大,体积小巧。", "name": "font_loader_stb_t", "parent": "font_loader_t", "annotation": { "fake": true }, "level": 2 }, { "type": "class", "methods": [ { "params": [], "annotation": { "constructor": true }, "desc": "获取stb图片加载器对象。", "name": "image_loader_stb", "return": { "type": "image_loader_t*", "desc": "返回图片加载器对象。" } }, { "params": [ { "type": "int32_t", "name": "subtype", "desc": "资源类型。" }, { "type": "const uint8_t*", "name": "buff", "desc": "资源数据。" }, { "type": "uint32_t", "name": "buff_size", "desc": "资源数据长度。" }, { "type": "bitmap_t*", "name": "image", "desc": "image 对象。" }, { "type": "bool_t", "name": "require_bgra", "desc": "require_bgra" }, { "type": "bool_t", "name": "enable_bgr565", "desc": "enable_bgr565" }, { "type": "bool_t", "name": "enable_rgb565", "desc": "enable_rgb565" } ], "annotation": { "static": true }, "desc": "加载图片。", "name": "stb_load_image", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } } ], "events": [], "properties": [], "header": "image_loader/image_loader_stb.h", "desc": "stb图片加载器。\n\nstb主要用于加载jpg/png/gif等格式的图片它功能强大体积小巧。", "name": "image_loader_stb_t", "parent": "image_loader_t", "annotation": { "fake": true }, "level": 2 }, { "type": "class", "methods": [ { "params": [], "annotation": { "constructor": true }, "desc": "创建空输入法引擎对象。", "name": "input_engine_create", "export": "none", "return": { "type": "input_engine_t*", "desc": "返回输入法引擎对象。" } } ], "events": [], "properties": [], "header": "input_engines/input_engine_null.h", "desc": "空输入法引擎实现。\n\n缺省输入法可以选择启用软键盘但不启用具体的输入法引擎此时可以选择空输入法引擎实现。", "name": "input_engine_null_t", "parent": "input_engine_t", "annotation": { "fake": true }, "level": 2 }, { "type": "class", "methods": [ { "params": [], "annotation": { "constructor": true }, "desc": "创建拼音输入法引擎对象。", "name": "input_engine_create", "export": "none", "return": { "type": "input_engine_t*", "desc": "返回输入法引擎对象。" } } ], "events": [], "properties": [], "header": "input_engines/input_engine_pinyin.h", "desc": "拼音输入法引擎实现。\n\n基于谷歌拼音输入法实现。", "name": "input_engine_pinyin_t", "parent": "input_engine_t", "annotation": { "fake": true }, "level": 2 }, { "type": "class", "methods": [ { "params": [], "annotation": { "constructor": true }, "desc": "创建缺省输入法对象。", "name": "input_method_default_create", "return": { "type": "input_method_t*", "desc": "返回输入法对象。" } } ], "events": [], "properties": [], "header": "input_methods/input_method_default.h", "desc": "缺省输入法实现。输入法会启用软键盘,但是开发者可以自定义输入法引擎。\n\n目前可以选择不启用输入法引擎或启用拼音输入法引擎。\n\n开发者也可以开发手写输入法或语音输入法如果实现时遇到问题可以和我们交流。", "name": "input_method_default_t", "parent": "input_method_t", "annotation": { "fake": true }, "level": 2 }, { "type": "class", "methods": [ { "params": [], "annotation": { "constructor": true }, "desc": "创建空输入法对象。", "name": "input_method_null_create", "return": { "type": "input_method_t*", "desc": "返回输入法对象。" } } ], "events": [], "properties": [], "header": "input_methods/input_method_null.h", "desc": "空输入法实现。\n\n在不需要输入法的嵌入式平台使用空的输入法。", "name": "input_method_null_t", "parent": "input_method_t", "annotation": { "fake": true }, "level": 2 }, { "type": "class", "methods": [ { "params": [], "annotation": { "constructor": true }, "desc": "创建SDL输入法对象。", "name": "input_method_sdl_create", "return": { "type": "input_method_t*", "desc": "返回输入法对象。" } } ], "events": [], "properties": [], "header": "input_methods/input_method_sdl.h", "desc": "SDL输入法实现。\n\nSDL输入法使用平台自身的输入法引擎一般在桌面Linux、MacOS、Windows、Android和iOS上使用。", "name": "input_method_sdl_t", "parent": "input_method_t", "annotation": { "fake": true }, "level": 2 }, { "type": "class", "methods": [ { "params": [], "annotation": { "constructor": true }, "desc": "创建子控件布局对象。", "name": "children_layouter_default_create", "return": { "type": "children_layouter_t*", "desc": "返回创建子控件布局对象。" } } ], "events": [], "properties": [], "header": "layouters/children_layouter_default.h", "desc": "缺省的子控件布局算法实现。\n\n> 用法请参考:缺省子控件布局算法", "name": "children_layouter_default_t", "parent": "children_layouter_t", "level": 2 }, { "type": "class", "methods": [ { "params": [], "annotation": { "constructor": true }, "desc": "创建控件自身布局对象。", "name": "self_layouter_default_create", "return": { "type": "self_layouter_t*", "desc": "返回创建控件自身布局对象。" } } ], "events": [], "properties": [], "header": "layouters/self_layouter_default.h", "desc": "缺省的控件自身布局算法实现。\n\n> 用法请参考:缺省控件自身布局算法", "name": "self_layouter_default_t", "parent": "self_layouter_t", "level": 2 }, { "type": "class", "methods": [ { "params": [], "annotation": { "constructor": true }, "desc": "创建控件自身布局对象。", "name": "self_layouter_menu_create", "return": { "type": "self_layouter_t*", "desc": "返回创建控件自身布局对象。" } } ], "events": [], "properties": [], "header": "layouters/self_layouter_menu.h", "desc": "menu的控件自身布局算法实现(一般用于popup或dialog窗口)。\n\n> 用法请参考:缺省控件自身布局算法", "name": "self_layouter_menu_t", "parent": "self_layouter_t", "level": 2 }, { "type": "class", "methods": [ { "params": [ { "type": "wh_t", "name": "w", "desc": "宽度。" }, { "type": "wh_t", "name": "h", "desc": "高度。" }, { "type": "bool_t", "name": "alloc", "desc": "是否分配内存。" } ], "annotation": {}, "desc": "创建lcd对象。", "name": "lcd_mem_bgr565_create", "return": { "type": "lcd_t*", "desc": "返回lcd对象。" } }, { "params": [ { "type": "wh_t", "name": "w", "desc": "宽度。" }, { "type": "wh_t", "name": "h", "desc": "高度。" }, { "type": "uint8_t*", "name": "fbuff", "desc": "帧率缓冲区。" } ], "annotation": {}, "desc": "创建single fb lcd对象。", "name": "lcd_mem_bgr565_create_single_fb", "return": { "type": "lcd_t*", "desc": "返回lcd对象。" } }, { "params": [ { "type": "wh_t", "name": "w", "desc": "宽度。" }, { "type": "wh_t", "name": "h", "desc": "高度。" }, { "type": "uint8_t*", "name": "online_fb", "desc": "在线帧率缓冲区。" }, { "type": "uint8_t*", "name": "offline_fb", "desc": "离线帧率缓冲区。" } ], "annotation": {}, "desc": "创建double fb lcd对象。", "name": "lcd_mem_bgr565_create_double_fb", "return": { "type": "lcd_t*", "desc": "返回lcd对象。" } }, { "params": [ { "type": "wh_t", "name": "w", "desc": "宽度。" }, { "type": "wh_t", "name": "h", "desc": "高度。" }, { "type": "uint8_t*", "name": "online_fb", "desc": "在线帧率缓冲区。" }, { "type": "uint8_t*", "name": "offline_fb", "desc": "离线帧率缓冲区。" }, { "type": "uint8_t*", "name": "next_fb", "desc": "待显示的帧率缓冲区。" } ], "annotation": {}, "desc": "创建three fb lcd对象。", "name": "lcd_mem_bgr565_create_three_fb", "return": { "type": "lcd_t*", "desc": "返回lcd对象。" } } ], "events": [], "properties": [], "header": "lcd/lcd_mem_bgr565.h", "desc": "", "name": "lcd_mem_bgr565_t", "parent": "lcd_t", "annotation": { "fake": true }, "level": 2 }, { "type": "class", "methods": [ { "params": [ { "type": "wh_t", "name": "w", "desc": "宽度。" }, { "type": "wh_t", "name": "h", "desc": "高度。" }, { "type": "bool_t", "name": "alloc", "desc": "是否分配内存。" } ], "annotation": {}, "desc": "创建lcd对象。", "name": "lcd_mem_bgr888_create", "return": { "type": "lcd_t*", "desc": "返回lcd对象。" } }, { "params": [ { "type": "wh_t", "name": "w", "desc": "宽度。" }, { "type": "wh_t", "name": "h", "desc": "高度。" }, { "type": "uint8_t*", "name": "fbuff", "desc": "帧率缓冲区。" } ], "annotation": {}, "desc": "创建single fb lcd对象。", "name": "lcd_mem_bgr888_create_single_fb", "return": { "type": "lcd_t*", "desc": "返回lcd对象。" } }, { "params": [ { "type": "wh_t", "name": "w", "desc": "宽度。" }, { "type": "wh_t", "name": "h", "desc": "高度。" }, { "type": "uint8_t*", "name": "online_fb", "desc": "在线帧率缓冲区。" }, { "type": "uint8_t*", "name": "offline_fb", "desc": "离线帧率缓冲区。" } ], "annotation": {}, "desc": "创建double fb lcd对象。", "name": "lcd_mem_bgr888_create_double_fb", "return": { "type": "lcd_t*", "desc": "返回lcd对象。" } }, { "params": [ { "type": "wh_t", "name": "w", "desc": "宽度。" }, { "type": "wh_t", "name": "h", "desc": "高度。" }, { "type": "uint8_t*", "name": "online_fb", "desc": "在线帧率缓冲区。" }, { "type": "uint8_t*", "name": "offline_fb", "desc": "离线帧率缓冲区。" }, { "type": "uint8_t*", "name": "next_fb", "desc": "待显示的帧率缓冲区。" } ], "annotation": {}, "desc": "创建three fb lcd对象。", "name": "lcd_mem_bgr888_create_three_fb", "return": { "type": "lcd_t*", "desc": "返回lcd对象。" } } ], "events": [], "properties": [], "header": "lcd/lcd_mem_bgr888.h", "desc": "", "name": "lcd_mem_bgr888_t", "parent": "lcd_t", "annotation": { "fake": true }, "level": 2 }, { "type": "class", "methods": [ { "params": [ { "type": "wh_t", "name": "w", "desc": "宽度。" }, { "type": "wh_t", "name": "h", "desc": "高度。" }, { "type": "bool_t", "name": "alloc", "desc": "是否分配内存。" } ], "annotation": {}, "desc": "创建lcd对象。", "name": "lcd_mem_bgra8888_create", "return": { "type": "lcd_t*", "desc": "返回lcd对象。" } }, { "params": [ { "type": "wh_t", "name": "w", "desc": "宽度。" }, { "type": "wh_t", "name": "h", "desc": "高度。" }, { "type": "uint8_t*", "name": "fbuff", "desc": "帧率缓冲区。" } ], "annotation": {}, "desc": "创建single fb lcd对象。", "name": "lcd_mem_bgra8888_create_single_fb", "return": { "type": "lcd_t*", "desc": "返回lcd对象。" } }, { "params": [ { "type": "wh_t", "name": "w", "desc": "宽度。" }, { "type": "wh_t", "name": "h", "desc": "高度。" }, { "type": "uint8_t*", "name": "online_fb", "desc": "在线帧率缓冲区。" }, { "type": "uint8_t*", "name": "offline_fb", "desc": "离线帧率缓冲区。" } ], "annotation": {}, "desc": "创建double fb lcd对象。", "name": "lcd_mem_bgra8888_create_double_fb", "return": { "type": "lcd_t*", "desc": "返回lcd对象。" } }, { "params": [ { "type": "wh_t", "name": "w", "desc": "宽度。" }, { "type": "wh_t", "name": "h", "desc": "高度。" }, { "type": "uint8_t*", "name": "online_fb", "desc": "在线帧率缓冲区。" }, { "type": "uint8_t*", "name": "offline_fb", "desc": "离线帧率缓冲区。" }, { "type": "uint8_t*", "name": "next_fb", "desc": "待显示的帧率缓冲区。" } ], "annotation": {}, "desc": "创建three fb lcd对象。", "name": "lcd_mem_bgra8888_create_three_fb", "return": { "type": "lcd_t*", "desc": "返回lcd对象。" } } ], "events": [], "properties": [], "header": "lcd/lcd_mem_bgra8888.h", "desc": "", "name": "lcd_mem_bgra8888_t", "parent": "lcd_t", "annotation": { "fake": true }, "level": 2 }, { "type": "class", "methods": [ { "params": [ { "type": "wh_t", "name": "w", "desc": "宽度。" }, { "type": "wh_t", "name": "h", "desc": "高度。" } ], "annotation": {}, "desc": "创建lcd对象。", "name": "lcd_mem_fragment_create", "export": "none", "return": { "type": "lcd_t*", "desc": "返回lcd对象。" } }, { "params": [ { "type": "lcd_t*", "name": "lcd", "desc": "lcd对象。" } ], "annotation": {}, "desc": "获取framebuffer的地址。", "name": "lcd_mem_fragment_get_buff", "export": "none", "return": { "type": "uint8_t*", "desc": "返回framebuffer的地址。" } } ], "events": [], "properties": [], "header": "lcd/lcd_mem_fragment.h", "desc": "片段的LCD。\n\n在一些低端平台没有足够的内存提供一个完整的framebuffer此时我们用一小块内存模拟framebuffer\n每次只画屏幕上一小块。这样可以有些避免屏幕闪烁的问题。", "name": "lcd_mem_fragment_t", "parent": "lcd_t", "level": 2 }, { "type": "class", "methods": [ { "params": [ { "type": "wh_t", "name": "w", "desc": "宽度。" }, { "type": "wh_t", "name": "h", "desc": "高度。" }, { "type": "bool_t", "name": "alloc", "desc": "是否分配内存。" } ], "annotation": {}, "desc": "创建lcd对象。", "name": "lcd_mem_rgb565_create", "return": { "type": "lcd_t*", "desc": "返回lcd对象。" } }, { "params": [ { "type": "wh_t", "name": "w", "desc": "宽度。" }, { "type": "wh_t", "name": "h", "desc": "高度。" }, { "type": "uint8_t*", "name": "fbuff", "desc": "帧率缓冲区。" } ], "annotation": {}, "desc": "创建single fb lcd对象。", "name": "lcd_mem_rgb565_create_single_fb", "return": { "type": "lcd_t*", "desc": "返回lcd对象。" } }, { "params": [ { "type": "wh_t", "name": "w", "desc": "宽度。" }, { "type": "wh_t", "name": "h", "desc": "高度。" }, { "type": "uint8_t*", "name": "online_fb", "desc": "在线帧率缓冲区。" }, { "type": "uint8_t*", "name": "offline_fb", "desc": "离线帧率缓冲区。" } ], "annotation": {}, "desc": "创建double fb lcd对象。", "name": "lcd_mem_rgb565_create_double_fb", "return": { "type": "lcd_t*", "desc": "返回lcd对象。" } }, { "params": [ { "type": "wh_t", "name": "w", "desc": "宽度。" }, { "type": "wh_t", "name": "h", "desc": "高度。" }, { "type": "uint8_t*", "name": "online_fb", "desc": "在线帧率缓冲区。" }, { "type": "uint8_t*", "name": "offline_fb", "desc": "离线帧率缓冲区。" }, { "type": "uint8_t*", "name": "next_fb", "desc": "待显示的帧率缓冲区。" } ], "annotation": {}, "desc": "创建three fb lcd对象。", "name": "lcd_mem_rgb565_create_three_fb", "return": { "type": "lcd_t*", "desc": "返回lcd对象。" } } ], "events": [], "properties": [], "header": "lcd/lcd_mem_rgb565.h", "desc": "", "name": "lcd_mem_rgb565_t", "parent": "lcd_t", "annotation": { "fake": true }, "level": 2 }, { "type": "class", "methods": [ { "params": [ { "type": "wh_t", "name": "w", "desc": "宽度。" }, { "type": "wh_t", "name": "h", "desc": "高度。" }, { "type": "bool_t", "name": "alloc", "desc": "是否分配内存。" } ], "annotation": {}, "desc": "创建lcd对象。", "name": "lcd_mem_rgb888_create", "return": { "type": "lcd_t*", "desc": "返回lcd对象。" } }, { "params": [ { "type": "wh_t", "name": "w", "desc": "宽度。" }, { "type": "wh_t", "name": "h", "desc": "高度。" }, { "type": "uint8_t*", "name": "fbuff", "desc": "帧率缓冲区。" } ], "annotation": {}, "desc": "创建single fb lcd对象。", "name": "lcd_mem_rgb888_create_single_fb", "return": { "type": "lcd_t*", "desc": "返回lcd对象。" } }, { "params": [ { "type": "wh_t", "name": "w", "desc": "宽度。" }, { "type": "wh_t", "name": "h", "desc": "高度。" }, { "type": "uint8_t*", "name": "online_fb", "desc": "在线帧率缓冲区。" }, { "type": "uint8_t*", "name": "offline_fb", "desc": "离线帧率缓冲区。" } ], "annotation": {}, "desc": "创建double fb lcd对象。", "name": "lcd_mem_rgb888_create_double_fb", "return": { "type": "lcd_t*", "desc": "返回lcd对象。" } }, { "params": [ { "type": "wh_t", "name": "w", "desc": "宽度。" }, { "type": "wh_t", "name": "h", "desc": "高度。" }, { "type": "uint8_t*", "name": "online_fb", "desc": "在线帧率缓冲区。" }, { "type": "uint8_t*", "name": "offline_fb", "desc": "离线帧率缓冲区。" }, { "type": "uint8_t*", "name": "next_fb", "desc": "待显示的帧率缓冲区。" } ], "annotation": {}, "desc": "创建three fb lcd对象。", "name": "lcd_mem_rgb888_create_three_fb", "return": { "type": "lcd_t*", "desc": "返回lcd对象。" } } ], "events": [], "properties": [], "header": "lcd/lcd_mem_rgb888.h", "desc": "", "name": "lcd_mem_rgb888_t", "parent": "lcd_t", "annotation": { "fake": true }, "level": 2 }, { "type": "class", "methods": [ { "params": [ { "type": "wh_t", "name": "w", "desc": "宽度。" }, { "type": "wh_t", "name": "h", "desc": "高度。" }, { "type": "bool_t", "name": "alloc", "desc": "是否分配内存。" } ], "annotation": {}, "desc": "创建lcd对象。", "name": "lcd_mem_rgba8888_create", "return": { "type": "lcd_t*", "desc": "返回lcd对象。" } }, { "params": [ { "type": "wh_t", "name": "w", "desc": "宽度。" }, { "type": "wh_t", "name": "h", "desc": "高度。" }, { "type": "uint8_t*", "name": "fbuff", "desc": "帧率缓冲区。" } ], "annotation": {}, "desc": "创建single fb lcd对象。", "name": "lcd_mem_rgba8888_create_single_fb", "return": { "type": "lcd_t*", "desc": "返回lcd对象。" } }, { "params": [ { "type": "wh_t", "name": "w", "desc": "宽度。" }, { "type": "wh_t", "name": "h", "desc": "高度。" }, { "type": "uint8_t*", "name": "online_fb", "desc": "在线帧率缓冲区。" }, { "type": "uint8_t*", "name": "offline_fb", "desc": "离线帧率缓冲区。" } ], "annotation": {}, "desc": "创建double fb lcd对象。", "name": "lcd_mem_rgba8888_create_double_fb", "return": { "type": "lcd_t*", "desc": "返回lcd对象。" } }, { "params": [ { "type": "wh_t", "name": "w", "desc": "宽度。" }, { "type": "wh_t", "name": "h", "desc": "高度。" }, { "type": "uint8_t*", "name": "online_fb", "desc": "在线帧率缓冲区。" }, { "type": "uint8_t*", "name": "offline_fb", "desc": "离线帧率缓冲区。" }, { "type": "uint8_t*", "name": "next_fb", "desc": "待显示的帧率缓冲区。" } ], "annotation": {}, "desc": "创建three fb lcd对象。", "name": "lcd_mem_rgba8888_create_three_fb", "return": { "type": "lcd_t*", "desc": "返回lcd对象。" } } ], "events": [], "properties": [], "header": "lcd/lcd_mem_rgba8888.h", "desc": "", "name": "lcd_mem_rgba8888_t", "parent": "lcd_t", "annotation": { "fake": true }, "level": 2 }, { "type": "class", "methods": [ { "params": [ { "type": "wh_t", "name": "w", "desc": "宽度。" }, { "type": "wh_t", "name": "h", "desc": "高度。" }, { "type": "bitmap_format_t", "name": "format", "desc": "离线lcd的格式。一般用 BITMAP_FMT_BGR565 或 BITMAP_FMT_RGBA8888。" }, { "type": "lcd_flush_t", "name": "flush", "desc": "回调函数用于刷新GUI数据到实际的LCD。" }, { "type": "lcd_resize_t", "name": "on_resize", "desc": "用于调整LCD的大小。一般用NULL即可。" }, { "type": "lcd_destroy_t", "name": "on_destroy", "desc": "lcd销毁时的回调函数。" }, { "type": "void*", "name": "ctx", "desc": "回调函数的上下文。" } ], "annotation": {}, "desc": "创建lcd对象。", "name": "lcd_mem_special_create", "return": { "type": "lcd_t*", "desc": "返回lcd对象。" } } ], "events": [], "properties": [], "header": "lcd/lcd_mem_special.h", "desc": "特殊的LCD。\n\n通过重载flush函数来提交GUI绘制的结果到硬件。适用于\n\n* lcd 硬件不支持framebuffer如SPI接口的屏。\n* lcd 硬件支持framebuffer但是其格式特殊AWTK目前不支持。可以用flush进行格式转换。", "name": "lcd_mem_special_t", "parent": "lcd_t", "level": 2 }, { "type": "class", "methods": [ { "params": [ { "type": "wh_t", "name": "w", "desc": "宽度。" }, { "type": "wh_t", "name": "h", "desc": "高度。" }, { "type": "lcd_flush_t", "name": "flush", "desc": "用于刷新数据到硬件的回调函数。" }, { "type": "lcd_destroy_t", "name": "on_destroy", "desc": "销毁lcd时的回调函数。" }, { "type": "void*", "name": "ctx", "desc": "flush/on_destroy回调函数的上下文。" } ], "annotation": { "constructor": true }, "desc": "创建单色LCD对象。", "name": "lcd_mono_create", "return": { "type": "lcd_t*", "desc": "lcd对象。" } } ], "events": [], "properties": [ { "name": "data", "desc": "Framebuffer首地址。", "type": "uint8_t*", "annotation": { "readable": true } }, { "name": "ctx", "desc": "flush/on_destroy回调函数的上下文信息。", "type": "void*", "annotation": { "private": true } }, { "name": "on_destroy", "desc": "lcd销毁时的回调函数。", "type": "lcd_destroy_t", "annotation": { "private": true } } ], "header": "lcd/lcd_mono.h", "desc": "单色LCD。\n\nlcd\_mono是一个特殊的Framebuffer它用一个比特来表示一个pixel。\n\nlcd\_mono只是负责硬件无关的逻辑处理调用者需要在创建时提供一个flush回调函数\n在flush函数中把脏矩形中的数据刷新到硬件中。", "name": "lcd_mono_t", "parent": "lcd_t", "level": 2 }, { "type": "class", "methods": [ { "params": [ { "type": "event_source_manager_t*", "name": "manager", "desc": "event_source_manager对象。" } ], "annotation": {}, "desc": "创建事件源管理器。", "name": "event_source_manager_default_create", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } } ], "events": [], "properties": [], "header": "tkc/event_source_manager_default.h", "desc": "缺省的事件源管理器。", "name": "event_source_manager_default_t", "parent": "event_source_manager_t", "annotation": { "fake": true }, "level": 2 }, { "type": "class", "methods": [ { "params": [ { "type": "event_t*", "name": "event", "desc": "event对象。" } ], "annotation": { "cast": true, "scriptable": true }, "desc": "把event对象转prop_change_event_t对象主要给脚本语言使用。", "name": "prop_change_event_cast", "return": { "type": "prop_change_event_t*", "desc": "返回event对象。" } }, { "params": [ { "type": "prop_change_event_t*", "name": "event", "desc": "event对象。" }, { "type": "uint32_t", "name": "type", "desc": "事件类型。" }, { "type": "const char*", "name": "name", "desc": "属性名。" }, { "type": "const value_t*", "name": "value", "desc": "属性的值。" } ], "annotation": {}, "desc": "初始prop change event。", "name": "prop_change_event_init", "return": { "type": "event_t*", "desc": "返回event对象。" } } ], "events": [], "properties": [ { "name": "name", "desc": "属性的名称。", "type": "const char*", "annotation": { "readable": true, "scriptable": true } }, { "name": "value", "desc": "属性的值。", "type": "const value_t*", "annotation": { "readable": true, "scriptable": true } } ], "header": "tkc/event.h", "desc": "对象属性变化事件。", "name": "prop_change_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对象转progress_event_t对象主要给脚本语言使用。", "name": "progress_event_cast", "return": { "type": "progress_event_t*", "desc": "返回event对象。" } }, { "params": [ { "type": "progress_event_t*", "name": "event", "desc": "event对象。" }, { "type": "uint32_t", "name": "percent", "desc": "进度。" } ], "annotation": {}, "desc": "初始progress event。", "name": "progress_event_init", "return": { "type": "event_t*", "desc": "返回event对象。" } } ], "events": [], "properties": [ { "name": "percent", "desc": "进度百分比。", "type": "uint32_t", "annotation": { "readable": true, "scriptable": true } } ], "header": "tkc/event.h", "desc": "进度变化事件。", "name": "progress_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对象转done_event_t对象主要给脚本语言使用。", "name": "done_event_cast", "return": { "type": "done_event_t*", "desc": "返回event对象。" } }, { "params": [ { "type": "done_event_t*", "name": "event", "desc": "event对象。" }, { "type": "ret_t", "name": "result", "desc": "结果。" } ], "annotation": {}, "desc": "初始done event。", "name": "done_event_init", "return": { "type": "event_t*", "desc": "返回event对象。" } } ], "events": [], "properties": [ { "name": "result", "desc": "执行结果。", "type": "ret_t", "annotation": { "readable": true, "scriptable": true } } ], "header": "tkc/event.h", "desc": "执行完成事件。", "name": "done_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对象转error_event_t对象主要给脚本语言使用。", "name": "error_event_cast", "return": { "type": "error_event_t*", "desc": "返回event对象。" } }, { "params": [ { "type": "error_event_t*", "name": "event", "desc": "event对象。" }, { "type": "int32_t", "name": "code", "desc": "错误码。" }, { "type": "const char*", "name": "message", "desc": "错误消息。" } ], "annotation": {}, "desc": "初始error event。", "name": "error_event_init", "return": { "type": "event_t*", "desc": "返回event对象。" } } ], "events": [], "properties": [ { "name": "code", "desc": "错误码。", "type": "int32_t", "annotation": { "readable": true, "scriptable": true } }, { "name": "message", "desc": "错误信息。", "type": "const char*", "annotation": { "readable": true, "scriptable": true } } ], "header": "tkc/event.h", "desc": "执行完成事件。", "name": "error_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对象转cmd_exec_event_t对象主要给脚本语言使用。", "name": "cmd_exec_event_cast", "return": { "type": "cmd_exec_event_t*", "desc": "返回event对象。" } }, { "params": [ { "type": "cmd_exec_event_t*", "name": "event", "desc": "event对象。" }, { "type": "uint32_t", "name": "type", "desc": "事件类型。" }, { "type": "const char*", "name": "name", "desc": "命令名。" }, { "type": "const char*", "name": "args", "desc": "命令参数。" } ], "annotation": {}, "desc": "初始命令执行事件。", "name": "cmd_exec_event_init", "return": { "type": "event_t*", "desc": "返回event对象。" } } ], "events": [], "properties": [ { "name": "name", "desc": "命令的名称。", "type": "const char*", "annotation": { "readable": true, "scriptable": true } }, { "name": "args", "desc": "命令的参数。", "type": "const char*", "annotation": { "readable": true, "scriptable": true } }, { "name": "result", "desc": "执行结果(适用于EXECED)。", "type": "ret_t", "annotation": { "readable": true, "scriptable": true } }, { "name": "can_exec", "desc": "执行结果(适用于CAN_EXEC)。", "type": "bool_t", "annotation": { "readable": true, "scriptable": true } } ], "header": "tkc/event.h", "desc": "对象执行命令的事件。", "name": "cmd_exec_event_t", "annotation": { "scriptable": true }, "parent": "event_t", "level": 2 }, { "type": "class", "methods": [], "events": [], "properties": [], "header": "tkc/mem_allocator_debug.h", "desc": "对现有的allocator进行包装记录分配的内存用于帮助分析内存的使用和泄露。", "name": "mem_allocator_debug_t", "parent": "mem_allocator_t", "level": 2 }, { "type": "class", "methods": [], "events": [], "properties": [], "header": "tkc/mem_allocator_lock.h", "desc": "对现有的allocator进行包装提供互斥功能。", "name": "mem_allocator_lock_t", "parent": "mem_allocator_t", "level": 2 }, { "type": "class", "methods": [], "events": [], "properties": [], "header": "tkc/mem_allocator_oom.h", "desc": "对现有的allocator进行包装如果分配内存失败调用预先设置的回调函数释放内存然后再重试。", "name": "mem_allocator_oom_t", "parent": "mem_allocator_t", "level": 2 }, { "type": "class", "methods": [], "events": [], "properties": [], "header": "tkc/mem_allocator_pool.h", "desc": "对现有的allocator进行包装预先分配一部分内存用于分配小块内存可以避免内存碎片。", "name": "mem_allocator_pool_t", "parent": "mem_allocator_t", "level": 2 }, { "type": "class", "methods": [], "events": [], "properties": [], "header": "tkc/mem_allocator_simple.h", "desc": "简单的内存分配器。", "name": "mem_allocator_simple_t", "parent": "mem_allocator_t", "level": 2 }, { "type": "class", "methods": [], "events": [], "properties": [], "header": "tkc/mem_allocator_std.h", "desc": "将标准的C的内存分配函数包装成内存分配器。", "name": "mem_allocator_std_t", "parent": "mem_allocator_t", "annotation": { "fake": true }, "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": [ { "type": "ui_binary_writer_t*", "name": "writer", "desc": "writer对象。" }, { "type": "wbuffer_t*", "name": "wbuffer", "desc": "保存结果的buffer。" } ], "annotation": { "constructor": true }, "desc": "初始化ui\_binary\_writer对象。", "name": "ui_binary_writer_init", "return": { "type": "ui_builder_t*", "desc": "返回ui\_builder对象。" } } ], "events": [], "properties": [], "header": "ui_loader/ui_binary_writer.h", "desc": "生成二进制格式的UI描述数据。", "name": "ui_binary_writer_t", "parent": "ui_builder_t", "level": 2 }, { "type": "class", "methods": [ { "params": [ { "type": "const char*", "name": "name", "desc": "窗口的缺省名称。" } ], "annotation": { "constructor": true }, "desc": "获取缺省的ui\_builder对象。", "name": "ui_builder_default", "return": { "type": "ui_builder_t*", "desc": "返回ui\_builder对象。" } } ], "events": [], "properties": [], "header": "ui_loader/ui_builder_default.h", "desc": "构建widget树。", "name": "ui_builder_default_t", "parent": "ui_builder_t", "annotation": { "fake": true }, "level": 2 }, { "type": "class", "methods": [ { "params": [], "annotation": { "constructor": true }, "desc": "获取二进制格式格式的UI资源加载器对象。", "name": "default_ui_loader", "return": { "type": "ui_loader_t*", "desc": "返回UI加载器对象。" } } ], "events": [], "properties": [], "header": "ui_loader/ui_loader_default.h", "desc": "二进制格式的UI资源加载器。", "name": "ui_loader_default_t", "parent": "ui_loader_t", "annotation": { "fake": true }, "level": 2 }, { "type": "class", "methods": [ { "params": [], "annotation": { "constructor": true }, "desc": "获取XML格式的UI资源加载器对象。", "name": "xml_ui_loader", "return": { "type": "ui_loader_t*", "desc": "返回UI加载器对象。" } } ], "events": [], "properties": [], "header": "ui_loader/ui_loader_xml.h", "desc": "XML格式的UI资源加载器。", "name": "ui_loader_xml_t", "parent": "ui_loader_t", "annotation": { "fake": true }, "level": 2 }, { "type": "class", "methods": [ { "params": [ { "type": "ui_xml_writer_t*", "name": "writer", "desc": "writer对象。" }, { "type": "str_t*", "name": "str", "desc": "保存结果的str。" } ], "annotation": { "constructor": true }, "desc": "初始化ui\_xml\_writer对象。", "name": "ui_xml_writer_init", "return": { "type": "ui_builder_t*", "desc": "返回ui\_builder对象。" } } ], "events": [], "properties": [], "header": "ui_loader/ui_xml_writer.h", "desc": "生成XML格式的UI描述数据。", "name": "ui_xml_writer_t", "parent": "ui_builder_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": "创建app_bar对象", "name": "app_bar_create", "return": { "type": "widget_t*", "desc": "对象。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "app_bar对象。" } ], "annotation": { "cast": true, "scriptable": true }, "desc": "转换为app_bar对象(供脚本语言使用)。", "name": "app_bar_cast", "return": { "type": "widget_t*", "desc": "app_bar对象。" } } ], "events": [], "properties": [], "header": "widgets/app_bar.h", "desc": "app_bar控件。\n\n一个简单的容器控件一般在窗口的顶部用于显示本窗口的状态和信息。\n\n它本身不提供布局功能仅提供具有语义的标签让xml更具有可读性。\n子控件的布局可用layout\_children属性指定。\n请参考布局参数。\n\napp\_bar\_t是widget\_t的子类控件widget\_t的函数均适用于app\_bar\_t控件。\n\n在xml中使用"app\_bar"标签创建app\_bar。如\n\nxml\n<app_bar x=\"0\" y=\"0\" w=\"100%\" h=\"30\" >\n<label x=\"0\" y=\"0\" w=\"100%\" h=\"100%\" text=\"Basic Controls\" />\n</app_bar>\n\n\n在c代码中使用函数app\_bar\_create创建app\_bar。如\n\nc\nwidget_t* app_bar = app_bar_create(win, 0, 0, 320, 30);\n\n\n可用通过style来设置控件的显示风格如背景颜色等。如\n\nxml\n<style name=\"default\" border_color=\"#a0a0a0\">\n<normal bg_color=\"#f0f0f0\" />\n</style>\n", "name": "app_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": "创建button_group对象", "name": "button_group_create", "return": { "type": "widget_t*", "desc": "对象。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "button_group对象。" } ], "annotation": { "cast": true, "scriptable": true }, "desc": "转换为button_group对象(供脚本语言使用)。", "name": "button_group_cast", "return": { "type": "widget_t*", "desc": "button_group对象。" } } ], "events": [], "properties": [], "header": "widgets/button_group.h", "desc": "Button Group控件。一个简单的容器控件用于容纳一组按钮控件。\n\n它本身不提供布局功能仅提供具有语义的标签让xml更具有可读性。\n子控件的布局可用layout\_children属性指定。\n请参考布局参数。\n\nbutton\_group\_t是widget\_t的子类控件widget\_t的函数均适用于button\_group\_t控件。\n\n在xml中使用"button\_group"标签创建button\_group。如\n\nxml\n<button_group x=\"0\" y=\"m\" w=\"100%\" h=\"40\" children_layout=\"default(c=4,r=1,s=5,m=5)\">\n<button name=\"open:basic\" text=\"Basic\"/>\n<button name=\"open:button\" text=\"Buttons\"/>\n<button name=\"open:edit\" text=\"Edits\"/>\n<button name=\"open:keyboard\" text=\"KeyBoard\"/>\n</button_group>\n\n\n可用通过style来设置控件的显示风格如背景颜色等。如\n\nxml\n<style name=\"default\" border_color=\"#a0a0a0\">\n<normal bg_color=\"#f0f0f0\" />\n</style>\n", "name": "button_group_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": "创建button对象", "name": "button_create", "return": { "type": "widget_t*", "desc": "对象。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "button对象。" } ], "annotation": { "cast": true, "scriptable": true }, "desc": "转换为button对象(供脚本语言使用)。", "name": "button_cast", "return": { "type": "widget_t*", "desc": "button对象。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "int32_t", "name": "repeat", "desc": "触发EVT_CLICK事件的时间间隔(毫秒)。" } ], "annotation": { "scriptable": true }, "desc": "设置触发EVT\_CLICK事件的时间间隔。为0则不重复触发EVT\_CLICK事件。", "name": "button_set_repeat", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "uint32_t", "name": "long_press_time", "desc": "触发长按事件的时间(毫秒)。" } ], "annotation": { "scriptable": true }, "desc": "设置触发长按事件的时间。", "name": "button_set_long_press_time", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "bool_t", "name": "enable_long_press", "desc": "是否启用长按事件。" } ], "annotation": { "scriptable": true }, "desc": "设置是否启用长按事件。", "name": "button_set_enable_long_press", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } } ], "events": [ { "name": "EVT_CLICK", "desc": "点击事件。", "type": "pointer_event_t" }, { "name": "EVT_LONG_PRESS", "desc": "长按事件。", "type": "pointer_event_t" } ], "properties": [ { "name": "repeat", "desc": "重复触发EVT\_CLICK事件的时间间隔。\n\n为0则不重复触发EVT\_CLICK事件。", "type": "int32_t", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "persitent": true, "design": true, "scriptable": true } }, { "name": "enable_long_press", "desc": "是否启用长按事件为true时才触发长按事件。\n\n触发长按事件后不再触发点击事件。\n缺省不启用。", "type": "bool_t", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "persitent": true, "design": true, "scriptable": true } }, { "name": "long_press_time", "desc": "触发长按事件的时间(ms)", "type": "uint32_t", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "persitent": true, "design": true, "scriptable": true } } ], "header": "widgets/button.h", "desc": "按钮控件。\n\n点击按钮之后会触发EVT\_CLICK事件注册EVT\_CLICK事件以执行特定操作。\n\n按钮控件也可以作为容器使用使用图片和文本作为其子控件可以实现很多有趣的效果。\n\nbutton\_t是widget\_t的子类控件widget\_t的函数均适用于button\_t控件。\n\n在xml中使用"button"标签创建按钮控件。如:\n\nxml\n<button x=\"c\" y=\"m\" w=\"80\" h=\"30\" text=\"OK\"/>\n\n\n> 更多用法请参考:\nbutton.xml\n\n在c代码中使用函数button\_create创建按钮控件。如\n\nc\nwidget_t* button = button_create(win, 10, 10, 128, 30);\nwidget_set_text(button, L\"OK\");\nwidget_on(button, EVT_CLICK, on_click, NULL);\n\n\n> 创建之后需要用widget\_set\_text或widget\_set\_text\_utf8设置文本内容。\n\n> 完整示例请参考:\nbutton demo\n\n可用通过style来设置控件的显示风格如字体的大小和颜色等等。如\n\nxml\n<style name=\"default\" border_color=\"#a0a0a0\" text_color=\"black\">\n<normal bg_color=\"#f0f0f0\" />\n<pressed bg_color=\"#c0c0c0\" x_offset=\"1\" y_offset=\"1\"/>\n<over bg_color=\"#e0e0e0\" />\n<disable bg_color=\"gray\" text_color=\"#d0d0d0\" />\n</style>\n\n\n> 更多用法请参考:\ntheme\ndefault", "name": "button_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": "创建多选按钮对象", "name": "check_button_create", "return": { "type": "widget_t*", "desc": "widget对象。" } }, { "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": "创建单选按钮对象", "name": "check_button_create_radio", "return": { "type": "widget_t*", "desc": "widget对象。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "check_button对象。" }, { "type": "bool_t", "name": "value", "desc": "值(勾选为TRUE非勾选为FALSE)。" } ], "annotation": { "scriptable": true }, "desc": "设置控件的值。", "name": "check_button_set_value", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "radio_button对象。" } ], "annotation": {}, "desc": "用于radio button获取同组中勾选的radio button。", "name": "check_button_get_checked_button", "return": { "type": "widget_t*", "desc": "同组中勾选的radio button对象。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "check_button对象。" } ], "annotation": { "cast": true, "scriptable": true }, "desc": "转换check_button对象(供脚本语言使用)。", "name": "check_button_cast", "return": { "type": "widget_t*", "desc": "check_button对象。" } } ], "events": [ { "name": "EVT_VALUE_WILL_CHANGE", "desc": "值(勾选状态)即将改变事件。", "type": "event_t" }, { "name": "EVT_VALUE_CHANGED", "desc": "值(勾选状态)改变事件。", "type": "event_t" } ], "properties": [ { "name": "value", "desc": "值(勾选为TRUE非勾选为FALSE)。", "type": "bool_t", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "persitent": true, "design": true, "scriptable": true } } ], "header": "widgets/check_button.h", "desc": "勾选按钮控件(单选/多选)。\n\ncheck\_button\_t是widget\_t的子类控件widget\_t的函数均适用于check\_button\_t控件。\n\n在xml中使用"check_button"标签创建多选按钮控件。如:\n\nxml\n<check_button name=\"c1\" text=\"Book\"/>\n\n\n在xml中使用"radio_button"标签创建单选按钮控件。如:\n\nxml\n<radio_button name=\"r1\" text=\"Book\"/>\n\n\n> 更多用法请参考:\nbutton.xml\n\n在c代码中使用函数check\_button\_create创建多选按钮控件。如\n\nc\nwidget_t* button = check_button_create(win, x, y, w, h);\nwidget_set_text(button, L\"OK\");\nwidget_on(button, EVT_VALUE_CHANGED, on_changed, NULL);\n\n\n在c代码中使用函数check\_button\_create\_radio创建单选按钮控件。如\n\nc\nwidget_t* button = check_button_create_radio(win, x, y, w, h);\nwidget_set_text(button, L\"OK\");\nwidget_on(button, EVT_VALUE_CHANGED, on_changed, NULL);\n\n\n> 完整示例请参考:\nbutton demo\n\n可用通过style来设置控件的显示风格如字体的大小和颜色等等。如\n\nxml\n<style name=\"default\" icon_at=\"left\">\n<normal icon=\"unchecked\" />\n<pressed icon=\"unchecked\" />\n<over icon=\"unchecked\" text_color=\"green\"/>\n<normal_of_checked icon=\"checked\" text_color=\"blue\"/>\n<pressed_of_checked icon=\"checked\" text_color=\"blue\"/>\n<over_of_checked icon=\"checked\" text_color=\"green\"/>\n</style>\n\n\n> 更多用法请参考:\ntheme\ndefault", "name": "check_button_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": "创建clip_view对象", "name": "clip_view_create", "return": { "type": "widget_t*", "desc": "对象。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "clip_view对象。" } ], "annotation": { "cast": true, "scriptable": true }, "desc": "转换为clip_view对象(供脚本语言使用)。", "name": "clip_view_cast", "return": { "type": "widget_t*", "desc": "clip_view对象。" } } ], "events": [], "properties": [], "header": "widgets/clip_view.h", "desc": "一个裁剪子控件的容器控件。\n\n它本身不提供布局功能仅提供具有语义的标签让xml更具有可读性。\n子控件的布局可用layout\_children属性指定。\n请参考布局参数。\n\nclip\_view\_t是widget\_t的子类控件widget\_t的函数均适用于clip\_view\_t控件。\n\n在xml中使用"clip_view"标签创建clip_view在clip_view控件下的所有子控件都会被裁剪。如下button控件会被裁剪无法画出clip_view控件 \n\nxml\n<clip_view x=\"0\" y=\"0\" w=\"100\" h=\"100\">\n<button x=\"50\" y=\"10\" w=\"100\" h=\"50\" />\n</clip_view>\n\n\n备注在clip_view控件下的所有子控件都会被裁剪如果子控件本身会设置裁剪区的话在子控件中计算裁剪区的交集具体请参考scroll_view控件的scroll_view_on_paint_children函数。\n\n可用通过style来设置控件的显示风格如背景颜色等。如\n\nxml\n<style name=\"default\" border_color=\"#a0a0a0\">\n<normal bg_color=\"#f0f0f0\" />\n</style>\n", "name": "clip_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": "创建color_tile对象", "name": "color_tile_create", "return": { "type": "widget_t*", "desc": "对象。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "color_tile对象。" } ], "annotation": { "cast": true, "scriptable": true }, "desc": "转换为color_tile对象(供脚本语言使用)。", "name": "color_tile_cast", "return": { "type": "widget_t*", "desc": "color_tile对象。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "const char*", "name": "color", "desc": "背景颜色。" } ], "annotation": { "scriptable": true }, "desc": "设置背景颜色。", "name": "color_tile_set_bg_color", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "const char*", "name": "color", "desc": "边框颜色。" } ], "annotation": {}, "desc": "设置边框颜色。", "name": "color_tile_set_border_color", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "color_t", "name": "color", "desc": "背景颜色。" } ], "annotation": {}, "desc": "设置背景颜色。", "name": "color_tile_set_value", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } } ], "events": [], "properties": [ { "name": "bg_color", "desc": "背景颜色。", "type": "const char*", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "persitent": true, "design": true, "scriptable": true } }, { "name": "border_color", "desc": "边框颜色。", "type": "const char*", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "persitent": true, "design": true, "scriptable": true } } ], "header": "widgets/color_tile.h", "desc": "色块控件。\n\n用来显示一个颜色块它通过属性而不是主题来设置颜色方便在运行时动态改变颜色。\n\n可以使用value属性访问背景颜色的颜色值。\n\ncolor\_tile\_t是widget\_t的子类控件widget\_t的函数均适用于color\_tile\_t控件。\n\n在xml中使用"color_tile"标签创建色块控件。如:\n\nxml\n<color_tile x=\"c\" y=\"m\" w=\"80\" h=\"30\" bg_color=\"green\" />\n\n\n> 更多用法请参考:\ncolor_tile\n\n在c代码中使用函数color_tile\_create创建色块控件。如\n\nc\nwidget_t* color_tile = color_tile_create(win, 10, 10, 128, 30);\ncolor_tile_set_bg_color(color_tile, \"red\");\n\n> 创建之后用color\_tile\_set\_bg\_color设置背景颜色。", "name": "color_tile_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": "创建column对象", "name": "column_create", "return": { "type": "widget_t*", "desc": "对象。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "column对象。" } ], "annotation": { "cast": true, "scriptable": true }, "desc": "转换为column对象(供脚本语言使用)。", "name": "column_cast", "return": { "type": "widget_t*", "desc": "column对象。" } } ], "events": [], "properties": [], "header": "widgets/column.h", "desc": "column。一个简单的容器控件垂直排列其子控件。\n\n它本身不提供布局功能仅提供具有语义的标签让xml更具有可读性。\n子控件的布局可用layout\_children属性指定。\n请参考布局参数。\n\ncolumn\_t是widget\_t的子类控件widget\_t的函数均适用于column\_t控件。\n\n在xml中使用"column"标签创建column。如\n\nxml\n<column x=\"0\" y=\"0\" w=\"100%\" h=\"100%\" children_layout=\"default(c=1,r=0)\">\n<button name=\"open:basic\" text=\"Basic\"/>\n<button name=\"open:button\" text=\"Buttons\"/>\n<button name=\"open:edit\" text=\"Edits\"/>\n<button name=\"open:keyboard\" text=\"KeyBoard\"/>\n</column>\n\n\n可用通过style来设置控件的显示风格如背景颜色等。如\n\nxml\n<style name=\"default\" border_color=\"#a0a0a0\">\n<normal bg_color=\"#f0f0f0\" />\n</style>\n", "name": "column_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": "创建combo_box_item对象", "name": "combo_box_item_create", "return": { "type": "widget_t*", "desc": "对象。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "combo_box_item对象。" } ], "annotation": { "cast": true, "scriptable": true }, "desc": "转换combo_box_item对象(供脚本语言使用)。", "name": "combo_box_item_cast", "return": { "type": "widget_t*", "desc": "combo_box_item对象。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "combo_box_item对象。" }, { "type": "bool_t", "name": "checked", "desc": "是否被选中。" } ], "annotation": { "scriptable": true }, "desc": "设置控件是否被选中。", "name": "combo_box_item_set_checked", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "combo_box_item对象。" }, { "type": "int32_t", "name": "value", "desc": "值" } ], "annotation": { "scriptable": true }, "desc": "设置控件的值。", "name": "combo_box_item_set_value", "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": "checked", "desc": "是否被选中。", "type": "bool_t", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "persitent": true, "design": true, "scriptable": true } } ], "header": "widgets/combo_box_item.h", "desc": "ComboBox Item控件。\n\n本类仅供combo\_box控件内部使用。", "name": "combo_box_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": "创建dialog客户区对象。", "name": "dialog_client_create", "return": { "type": "widget_t*", "desc": "dialog对象。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "dialog_client对象。" } ], "annotation": { "cast": true, "scriptable": true }, "desc": "转换为dialog_client对象(供脚本语言使用)。", "name": "dialog_client_cast", "return": { "type": "widget_t*", "desc": "dialog_client对象。" } } ], "events": [], "properties": [], "header": "widgets/dialog_client.h", "desc": "对话框客户区控件。\n\n它本身不提供布局功能仅提供具有语义的标签让xml更具有可读性。\n子控件的布局可用layout\_children属性指定。\n请参考布局参数。\n\ndialog\_client\_t是widget\_t的子类控件widget\_t的函数均适用于dialog\_client\_t控件。\n\n在xml中使用"dialog\_client"标签创建dialog\_client。如\n\nxml\n<dialog anim_hint=\"center_scale(duration=300)\" x=\"c\" y=\"m\" w=\"80%\" h=\"160\" text=\"Dialog\">\n<dialog_title x=\"0\" y=\"0\" w=\"100%\" h=\"30\" text=\"Hello AWTK\" />\n<dialog_client x=\"0\" y=\"bottom\" w=\"100%\" h=\"-30\">\n<label name=\"\" x=\"center\" y=\"middle:-20\" w=\"200\" h=\"30\" text=\"Are you ready?\"/>\n<button name=\"quit\" x=\"10\" y=\"bottom:10\" w=\"40%\" h=\"30\" text=\"确定\"/>\n<button name=\"quit\" x=\"right:10\" y=\"bottom:10\" w=\"40%\" h=\"30\" text=\"取消\"/>\n</dialog_client>\n</dialog>\n\n\n在c代码中用dialog\_create\_simple创建对话框时自动创建dialog客户区对象。", "name": "dialog_client_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": "创建dialog对象。", "name": "dialog_title_create", "return": { "type": "widget_t*", "desc": "dialog对象。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "dialog_title对象。" } ], "annotation": { "cast": true, "scriptable": true }, "desc": "转换为dialog_title对象(供脚本语言使用)。", "name": "dialog_title_cast", "return": { "type": "widget_t*", "desc": "dialog_title对象。" } } ], "events": [], "properties": [], "header": "widgets/dialog_title.h", "desc": "对话框标题控件。\n\n它本身不提供布局功能仅提供具有语义的标签让xml更具有可读性。\n子控件的布局可用layout\_children属性指定。\n请参考布局参数。\n\ndialog\_title\_t是widget\_t的子类控件widget\_t的函数均适用于dialog\_title\_t控件。\n\n在xml中使用"dialog\_title"标签创建dialog\_title。如\n\nxml\n<dialog anim_hint=\"center_scale(duration=300)\" x=\"c\" y=\"m\" w=\"80%\" h=\"160\" text=\"Dialog\">\n<dialog_title x=\"0\" y=\"0\" w=\"100%\" h=\"30\" text=\"Hello AWTK\" />\n<dialog_client x=\"0\" y=\"bottom\" w=\"100%\" h=\"-30\">\n<label name=\"\" x=\"center\" y=\"middle:-20\" w=\"200\" h=\"30\" text=\"Are you ready?\"/>\n<button name=\"quit\" x=\"10\" y=\"bottom:10\" w=\"40%\" h=\"30\" text=\"确定\"/>\n<button name=\"quit\" x=\"right:10\" y=\"bottom:10\" w=\"40%\" h=\"30\" text=\"取消\"/>\n</dialog_client>\n</dialog>\n\n\n在c代码中用dialog\_create\_simple创建对话框时自动创建dialog标题对象。", "name": "dialog_title_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": "创建digit_clock对象", "name": "digit_clock_create", "return": { "type": "widget_t*", "desc": "对象。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "digit_clock对象。" } ], "annotation": { "cast": true, "scriptable": true }, "desc": "转换为digit_clock对象(供脚本语言使用)。", "name": "digit_clock_cast", "return": { "type": "widget_t*", "desc": "digit_clock对象。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "const char*", "name": "format", "desc": "格式。" } ], "annotation": { "scriptable": true }, "desc": "设置显示格式。", "name": "digit_clock_set_format", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } } ], "events": [], "properties": [ { "name": "format", "desc": "显示格式。\n\n* Y 代表年(完整显示)\n* M 代表月(1-12)\n* D 代表日(1-31)\n* h 代表时(0-23)\n* m 代表分(0-59)\n* s 代表秒(0-59)\n* w 代表星期(0-6)\n* W 代表星期的英文缩写(支持翻译)\n* YY 代表年(只显示末两位)\n* MM 代表月(01-12)\n* DD 代表日(01-31)\n* hh 代表时(00-23)\n* mm 代表分(00-59)\n* ss 代表秒(00-59)\n* MMM 代表月的英文缩写(支持翻译)\n\n如 日期时间为2018/11/12 9:10:20\n* "Y/M/D"显示为"2018/11/12"\n* "Y-M-D"显示为"2018-11-12"\n* "Y-M-D hⓂ️s"显示为"2018-11-12 9:10:20"\n* "Y-M-D hh:mm:ss"显示为"2018-11-12 09:10:20"", "type": "char*", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "persitent": true, "design": true, "scriptable": true } } ], "header": "widgets/digit_clock.h", "desc": "数字时钟控件。\n\ndigit\_clock\_t是widget\_t的子类控件widget\_t的函数均适用于digit\_clock\_t控件。\n\n在xml中使用"digit\_clock"标签创建数字时钟控件。如:\n\nxml\n<digit_clock format=\"YY/MM/DD h:mm:ss\"/>\n\n\n> 更多用法请参考digit\_clock.xml\n\n在c代码中使用函数digit\_clock\_create创建数字时钟控件。如\n\nc\nwidget_t* tc = digit_clock_create(win, 10, 10, 240, 30);\ndigit_clock_set_format(tc, \"YY/MM/DD h:mm:ss\");\n\n\n> 完整示例请参考digit\_clock demo\n\n可用通过style来设置控件的显示风格如字体的大小和颜色等等。如\n\nxml\n<style name=\"default\">\n<normal text_color=\"black\" />\n</style>\n\n\n> 更多用法请参考theme default", "name": "digit_clock_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": "创建dragger对象。", "name": "dragger_create", "return": { "type": "widget_t*", "desc": "对象。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "dragger对象。" } ], "annotation": { "cast": true, "scriptable": true }, "desc": "转换为dragger对象(供脚本语言使用)。", "name": "dragger_cast", "return": { "type": "widget_t*", "desc": "dragger对象。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "dragger控件。" }, { "type": "xy_t", "name": "x_min", "desc": "x坐标最小值。" }, { "type": "xy_t", "name": "y_min", "desc": "y坐标最小值。" }, { "type": "xy_t", "name": "x_max", "desc": "x坐标最大值。" }, { "type": "xy_t", "name": "y_max", "desc": "y坐标最大值。" } ], "annotation": { "scriptable": true }, "desc": "设置拖动的范围。", "name": "dragger_set_range", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } } ], "events": [], "properties": [ { "name": "x_min", "desc": "x坐标的最小值。", "type": "xy_t", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "persitent": true, "design": true, "scriptable": true } }, { "name": "y_min", "desc": "y坐标的最小值。", "type": "xy_t", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "persitent": true, "design": true, "scriptable": true } }, { "name": "x_max", "desc": "x坐标的最大值。", "type": "xy_t", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "persitent": true, "design": true, "scriptable": true } }, { "name": "y_max", "desc": "y坐标的最大值。", "type": "xy_t", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "persitent": true, "design": true, "scriptable": true } } ], "header": "widgets/dragger.h", "desc": "dragger控件。\n\n目前主要用于scrollbar里的滑块。", "name": "dragger_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": "创建edit对象", "name": "edit_create", "return": { "type": "widget_t*", "desc": "对象。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "edit对象。" } ], "annotation": { "cast": true, "scriptable": true }, "desc": "转换为edit对象(供脚本语言使用)。", "name": "edit_cast", "return": { "type": "widget_t*", "desc": "edit对象。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "widget对象。" } ], "annotation": { "scriptable": true }, "desc": "获取int类型的值。", "name": "edit_get_int", "return": { "type": "int32_t", "desc": "返回int的值。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "widget对象。" } ], "annotation": { "scriptable": true }, "desc": "获取double类型的值。", "name": "edit_get_double", "return": { "type": "double", "desc": "返回double的值。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "widget对象。" }, { "type": "int32_t", "name": "value", "desc": "值。" } ], "annotation": { "scriptable": true }, "desc": "设置int类型的值。", "name": "edit_set_int", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "widget对象。" }, { "type": "double", "name": "value", "desc": "值。" } ], "annotation": { "scriptable": true }, "desc": "设置double类型的值。", "name": "edit_set_double", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "widget对象。" }, { "type": "uint32_t", "name": "min", "desc": "最小长度。" }, { "type": "uint32_t", "name": "max", "desc": "最大长度。" } ], "annotation": { "scriptable": true }, "desc": "设置为文本输入及其长度限制不允许输入超过max个字符少于min个字符时进入error状态。", "name": "edit_set_text_limit", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "widget对象。" }, { "type": "int32_t", "name": "min", "desc": "最小值。" }, { "type": "int32_t", "name": "max", "desc": "最大值。" }, { "type": "uint32_t", "name": "step", "desc": "步长。" } ], "annotation": { "scriptable": true }, "desc": "设置为整数输入及取值范围。", "name": "edit_set_int_limit", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "widget对象。" }, { "type": "double", "name": "min", "desc": "最小值。" }, { "type": "double", "name": "max", "desc": "最大值。" }, { "type": "double", "name": "step", "desc": "步长。" } ], "annotation": { "scriptable": true }, "desc": "设置为浮点数输入及取值范围。", "name": "edit_set_float_limit", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "widget对象。" }, { "type": "bool_t", "name": "readonly", "desc": "只读。" } ], "annotation": { "scriptable": true }, "desc": "设置编辑器是否为只读。", "name": "edit_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": "edit_set_cancelable", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "widget对象。" }, { "type": "bool_t", "name": "auto_fix", "desc": "自动改正。" } ], "annotation": { "scriptable": true }, "desc": "设置编辑器是否为自动改正。", "name": "edit_set_auto_fix", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "widget对象。" }, { "type": "bool_t", "name": "select_none_when_focused", "desc": "是否在获得焦点时不选中文本。" } ], "annotation": { "scriptable": true }, "desc": "设置编辑器是否在获得焦点时不选中文本。", "name": "edit_set_select_none_when_focused", "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": "edit_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": "edit_set_close_im_when_blured", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "widget对象。" }, { "type": "input_type_t", "name": "type", "desc": "输入类型。" } ], "annotation": { "scriptable": true }, "desc": "设置编辑器的输入类型。", "name": "edit_set_input_type", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "widget对象。" }, { "type": "char*", "name": "action_text", "desc": "软键盘上action按钮的文本。" } ], "annotation": { "scriptable": true }, "desc": "设置软键盘上action按钮的文本。", "name": "edit_set_action_text", "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": "edit_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": "获取翻译之后的文本然后调用edit_set_tips。", "name": "edit_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": "edit_set_keyboard", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "widget对象。" }, { "type": "bool_t", "name": "password_visible", "desc": "密码是否可见。" } ], "annotation": { "scriptable": true }, "desc": "当编辑器输入类型为密码时,设置密码是否可见。", "name": "edit_set_password_visible", "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": "edit_set_focus", "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": "edit_set_cursor", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "widget对象。" }, { "type": "edit_is_valid_char_t", "name": "is_valid_char", "desc": "检查输入字符是否有效的回调函数。" } ], "annotation": {}, "desc": "设置输入字符检查函数。\n> 如果内置函数不能满足需求时,可以设置自定义的检查函数。", "name": "edit_set_is_valid_char", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "widget对象。" }, { "type": "edit_is_valid_value_t", "name": "is_valid_value", "desc": "检查输入内容是否有效的回调函数。" } ], "annotation": {}, "desc": "设置输入内容检查函数。\n> 如果内置函数不能满足需求时,可以设置自定义的检查函数。", "name": "edit_set_is_valid_value", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "widget对象。" }, { "type": "edit_fix_value_t", "name": "fix_value", "desc": "修正输入内容的回调函数。" } ], "annotation": {}, "desc": "设置修正输入内容的回调函数。\n> 如果内置函数不能满足需求时,可以设置自定义的检查函数。", "name": "edit_set_fix_value", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "widget对象。" }, { "type": "edit_inc_value_t", "name": "inc_value", "desc": "增加值的回调函数。" } ], "annotation": {}, "desc": "设置增加值的回调函数。\n> 如果内置函数不能满足需求时,可以设置自定义的检查函数。", "name": "edit_set_inc_value", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "widget对象。" }, { "type": "edit_dec_value_t", "name": "dec_value", "desc": "减少值的回调函数。" } ], "annotation": {}, "desc": "设置减少值的回调函数。\n> 如果内置函数不能满足需求时,可以设置自定义的检查函数。", "name": "edit_set_dec_value", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "widget对象。" }, { "type": "edit_pre_input_t", "name": "pre_input", "desc": "预输入处理的回调函数(处理一些特殊的键)。" } ], "annotation": {}, "desc": "设置预输入处的回调函数。\n> 如果内置函数不能满足需求时,可以设置自定义的检查函数。", "name": "edit_set_pre_input", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } } ], "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": "password_visible", "desc": "密码是否可见。", "type": "bool_t", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "persitent": true, "design": true, "scriptable": true } }, { "name": "auto_fix", "desc": "输入无效时,是否自动改正。", "type": "bool_t", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "persitent": true, "design": true, "scriptable": true } }, { "name": "select_none_when_focused", "desc": "获得焦点时不选中文本。\n\n> 主要用于没有指针设备的情况,否则软键盘无法取消选中文本。", "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 } }, { "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": "action_text", "desc": "软键盘上action按钮的文本。内置取值有\n\n* next 将焦点切换到下一个控件。\n* done 完成,关闭软键盘。\n\n也可以使用其它文本比如send表示发送。这个需要自己实现相应的功能处理EVT\_IM\_ACTION事件即可。", "type": "char*", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "persitent": true, "design": true, "scriptable": true } }, { "name": "keyboard", "desc": "自定义软键盘名称。AWTK优先查找keyboard属性设置的键盘文件名该键盘的XML文件需要在default\raw\ui目录下存在如果keyboard为空就找input_type设置的键盘类型", "type": "char*", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "persitent": true, "design": true, "scriptable": true } }, { "name": "input_type", "desc": "输入类型。", "type": "input_type_t", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "persitent": true, "design": true, "scriptable": true } }, { "name": "min", "desc": "最小值或最小长度。", "type": "double", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "persitent": true, "design": true, "scriptable": true } }, { "name": "max", "desc": "最大值或最大长度。", "type": "double", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "persitent": true, "design": true, "scriptable": true } }, { "name": "step", "desc": "步长。\n作为数值型编辑器时一次增加和减少时的数值。", "type": "double", "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 } } ], "header": "widgets/edit.h", "desc": "单行编辑器控件。\n\n在基于SDL的平台单行编辑器控件使用平台原生的输入法对于嵌入式平台使用内置的输入法。\n\n在使用内置的输入法时软键盘由输入类型决定开发者可以自定义软键盘的界面。\n\nedit\_t是widget\_t的子类控件widget\_t的函数均适用于edit\_t控件。\n\nedit\_t本身可以做为容器放入按钮等控件。有几个特殊的子控件\n\n* 名为"clear"的按钮。点击时清除编辑器中的内容。\n* 名为"inc"的按钮。点击时增加编辑器的值用于实现类似于spinbox的功能。\n* 名为"dec"的按钮。点击时减少编辑器的值用于实现类似于spinbox的功能。\n* 名为"visible"的复选框。勾选时显示密码,反之不显示密码。\n\n在xml中使用"edit"标签创建编辑器控件。如:\n\nxml\n<edit x=\"c\" y=\"m\" w=\"80\" h=\"30\"\ntips=\"age\" input_type=\"uint\" min=\"0\" max=\"150\" step=\"1\" auto_fix=\"true\" style=\"number\" />\n\n\n> XXX需要在min/max/step之前设置input\_type。\n\n>更多用法请参考:\nedit.xml\n\n在c代码中使用函数edit\_create创建编辑器控件。如\n\nc\nwidget_t* edit = edit_create(win, 10, 10, 128, 30);\nwidget_set_text(edit, L\"OK\");\n\n\n> 创建之后可以用widget\_set\_text或widget\_set\_text\_utf8设置文本内容。\n\n> 完整示例请参考:\nedit demo\n\n可用通过style来设置控件的显示风格如字体的大小和颜色等等。如\n\nxml\n<style name=\"default\" border_color=\"#a0a0a0\" text_color=\"black\" text_align_h=\"left\">\n<normal bg_color=\"#f0f0f0\" />\n<focused bg_color=\"#f0f0f0\" border_color=\"black\"/>\n<disable bg_color=\"gray\" text_color=\"#d0d0d0\" />\n<error bg_color=\"#f0f0f0\" text_color=\"red\" />\n<empty bg_color=\"#f0f0f0\" text_color=\"#a0a0a0\" />\n</style>\n\n\n> 更多用法请参考:\ntheme\ndefault", "name": "edit_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": "创建grid_item对象", "name": "grid_item_create", "return": { "type": "widget_t*", "desc": "对象。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "grid_item对象。" } ], "annotation": { "cast": true, "scriptable": true }, "desc": "转换为grid_item对象(供脚本语言使用)。", "name": "grid_item_cast", "return": { "type": "widget_t*", "desc": "grid_item对象。" } } ], "events": [], "properties": [], "header": "widgets/grid_item.h", "desc": "grid_item。一个简单的容器控件一般作为grid的子控件。\n\n它本身不提供布局功能仅提供具有语义的标签让xml更具有可读性。\n子控件的布局可用layout\_children属性指定。\n请参考布局参数。\n\ngrid\_item\_t是widget\_t的子类控件widget\_t的函数均适用于grid\_item\_t控件。\n\n在xml中使用"grid\_item"标签创建grid\_item。如\n\nxml\n<grid x=\"0\" y=\"0\" w=\"100%\" h=\"100%\" children_layout=\"default(c=2,r=2,m=5,s=5)\">\n<grid_item>\n<button x=\"c\" y=\"m\" w=\"80%\" h=\"30\" name=\"0\" text=\"0\"/>\n</grid_item>\n<grid_item>\n<button x=\"c\" y=\"m\" w=\"80%\" h=\"30\" name=\"1\" text=\"1\"/>\n</grid_item>\n<grid_item>\n<button x=\"c\" y=\"m\" w=\"80%\" h=\"30\" name=\"2\" text=\"2\"/>\n</grid_item>\n<grid_item>\n<button x=\"c\" y=\"m\" w=\"80%\" h=\"30\" name=\"3\" text=\"3\"/>\n</grid_item>\n</grid>\n\n\n\n可用通过style来设置控件的显示风格如背景颜色等。如\n\nxml\n<style name=\"default\" border_color=\"#a0a0a0\">\n<normal bg_color=\"#f0f0f0\" />\n</style>\n", "name": "grid_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": "创建grid对象", "name": "grid_create", "return": { "type": "widget_t*", "desc": "对象。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "grid对象。" } ], "annotation": { "cast": true, "scriptable": true }, "desc": "转换为grid对象(供脚本语言使用)。", "name": "grid_cast", "return": { "type": "widget_t*", "desc": "grid对象。" } } ], "events": [], "properties": [], "header": "widgets/grid.h", "desc": "grid控件。一个简单的容器控件用于网格排列一组控件。\n\n它本身不提供布局功能仅提供具有语义的标签让xml更具有可读性。\n子控件的布局可用layout\_children属性指定。\n请参考布局参数。\n\ngrid\_t是widget\_t的子类控件widget\_t的函数均适用于grid\_t控件。\n\n在xml中使用"grid"标签创建grid。如\n\nxml\n<grid x=\"0\" y=\"0\" w=\"100%\" h=\"100%\" children_layout=\"default(c=2,r=2,m=5,s=5)\">\n<button name=\"open:basic\" text=\"Basic\"/>\n<button name=\"open:button\" text=\"Buttons\"/>\n<button name=\"open:edit\" text=\"Edits\"/>\n<button name=\"open:keyboard\" text=\"KeyBoard\"/>\n</grid>\n\n\n可用通过style来设置控件的显示风格如背景颜色等。如\n\nxml\n<style name=\"default\" border_color=\"#a0a0a0\">\n<normal bg_color=\"#f0f0f0\" />\n</style>\n", "name": "grid_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": "创建group_box对象", "name": "group_box_create", "return": { "type": "widget_t*", "desc": "对象。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "group_box对象。" } ], "annotation": { "cast": true, "scriptable": true }, "desc": "转换为group_box对象(供脚本语言使用)。", "name": "group_box_cast", "return": { "type": "widget_t*", "desc": "group_box对象。" } } ], "events": [], "properties": [], "header": "widgets/group_box.h", "desc": "分组控件。\n\n单选按钮在同一个父控件中是互斥的所以通常将相关的单选按钮放在一个group\_box中。\n\n它本身不提供布局功能仅提供具有语义的标签让xml更具有可读性。\n子控件的布局可用layout\_children属性指定。\n请参考布局参数。\n\ngroup\_box\_t是widget\_t的子类控件widget\_t的函数均适用于group\_box\_t控件。\n\n在xml中使用"group\_box"标签创建group\_box。如\n\nxml\n<group_box x=\"20\" y=\"230\" w=\"50%\" h=\"90\" children_layout=\"default(r=3,c=1,ym=2,s=10)\" >\n<radio_button name=\"r1\" text=\"Book\"/>\n<radio_button name=\"r2\" text=\"Food\"/>\n<radio_button name=\"r3\" text=\"Pencil\" value=\"true\"/>\n</group_box>\n\n\n可用通过style来设置控件的显示风格如背景颜色等。如\n\nxml\n<style name=\"default\" border_color=\"#a0a0a0\">\n<normal bg_color=\"#f0f0f0\" />\n</style>\n", "name": "group_box_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": "创建label对象", "name": "label_create", "return": { "type": "widget_t*", "desc": "对象。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "int32_t", "name": "length", "desc": "最大可显示字符个数。" } ], "annotation": { "scriptable": true }, "desc": "设置显示字符的个数(小余0时全部显示)。。", "name": "label_set_length", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "bool_t", "name": "line_wrap", "desc": "是否自动换行。" } ], "annotation": { "scriptable": true }, "desc": "设置是否自动换行。", "name": "label_set_line_wrap", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "bool_t", "name": "word_wrap", "desc": "是否允许单词中换行。" } ], "annotation": { "scriptable": true }, "desc": "设置是否允许单词中换行。(需要开启自动换行才有效果)", "name": "label_set_word_wrap", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "uint32_t", "name": "min_w", "desc": "最小宽度。" }, { "type": "uint32_t", "name": "max_w", "desc": "最大宽度。" }, { "type": "uint32_t", "name": "min_h", "desc": "最小高度。" }, { "type": "uint32_t", "name": "max_h", "desc": "最大高度。" } ], "annotation": { "scriptable": true }, "desc": "根据文本内容调节控件大小。", "name": "label_resize_to_content", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "label对象。" } ], "annotation": { "cast": true, "scriptable": true }, "desc": "转换为label对象(供脚本语言使用)。", "name": "label_cast", "return": { "type": "widget_t*", "desc": "label对象。" } } ], "events": [], "properties": [ { "name": "length", "desc": "显示字符的个数(小余0时全部显示)。\n主要用于动态改变显示字符的个数来实现类似[拨号中...]的动画效果。", "type": "int32_t", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "persitent": true, "design": true, "scriptable": true } }, { "name": "line_wrap", "desc": "是否自动换行。", "type": "bool_t", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "persitent": true, "design": true, "scriptable": true } }, { "name": "word_wrap", "desc": "是否允许单词中换行。(需要开启自动换行才有效果)", "type": "bool_t", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "persitent": true, "design": true, "scriptable": true } } ], "header": "widgets/label.h", "desc": "文本控件。用于显示一行或多行文本。\n\n文本控件不会根据文本的长度自动换行只有文本内容包含换行符时才会换行。\n\n如需自动换行请使用rich\_text\_t控件。\n\nlabel\_t是widget\_t的子类控件widget\_t的函数均适用于label\_t控件。\n\n在xml中使用"label"标签创建文本控件。如:\n\nxml\n<label style=\"center\" text=\"center\"/>\n\n\n> 更多用法请参考label.xml\n\n在c代码中使用函数label\_create创建文本控件。如\n\nc\nwidget_t* label = label_create(win, 10, 10, 128, 30);\nwidget_set_text(label, L\"hello awtk!\");\n\n\n> 创建之后需要用widget\_set\_text或widget\_set\_text\_utf8设置文本内容。\n\n> 完整示例请参考label demo\n\n可用通过style来设置控件的显示风格如字体的大小和颜色等等。如\n\nxml\n<style name=\"left\">\n<normal text_color=\"red\" text_align_h=\"left\" border_color=\"#a0a0a0\" margin=\"4\" />\n</style>\n\n\n> 更多用法请参考:\ntheme default", "name": "label_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": "创建pages对象", "name": "pages_create", "return": { "type": "widget_t*", "desc": "对象。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "pages对象。" } ], "annotation": { "cast": true, "scriptable": true }, "desc": "转换为pages对象(供脚本语言使用)。", "name": "pages_cast", "return": { "type": "widget_t*", "desc": "pages对象。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "uint32_t", "name": "index", "desc": "当前Page的序号。" } ], "annotation": { "scriptable": true }, "desc": "设置当前的Page。", "name": "pages_set_active", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "char*", "name": "name", "desc": "当前Page的名字。" } ], "annotation": { "scriptable": true }, "desc": "通过页面的名字设置当前的Page。", "name": "pages_set_active_by_name", "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": "active", "desc": "当前活跃的page。", "type": "uint32_t", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "persitent": true, "design": true, "scriptable": true } } ], "header": "widgets/pages.h", "desc": "页面管理控件。\n\n只有一个Page处于active状态处于active状态的Page才能显示并接收事件。\n常用于实现标签控件中的页面管理。\n\npages\_t是widget\_t的子类控件,\nwidget\_t的函数均适用于pages\_t控件。\n\n在xml中使用"pages"标签创建页面管理控件。如:\n\nxml\n<tab_control x=\"0\" y=\"0\" w=\"100%\" h=\"100%\" >\n<pages x=\"c\" y=\"20\" w=\"90%\" h=\"-60\" value=\"1\">\n...\n</pages>\n<tab_button_group>\n...\n</tab_button_group>\n</tab_control>\n\n\n> 更多用法请参考:\ntab control", "name": "pages_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_bar对象", "name": "progress_bar_create", "return": { "type": "widget_t*", "desc": "对象。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "progress_bar对象。" } ], "annotation": { "cast": true, "scriptable": true }, "desc": "转换为progress_bar对象(供脚本语言使用)。", "name": "progress_bar_cast", "return": { "type": "widget_t*", "desc": "progress_bar对象。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "float_t", "name": "value", "desc": "进度" } ], "annotation": { "scriptable": true }, "desc": "设置进度条的进度。", "name": "progress_bar_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_bar_set_max", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "bool_t", "name": "vertical", "desc": "是否为垂直方向。" } ], "annotation": { "scriptable": true }, "desc": "设置进度条的方向。", "name": "progress_bar_set_vertical", "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_bar_set_show_text", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "bool_t", "name": "reverse", "desc": "是否反向。" } ], "annotation": { "scriptable": true }, "desc": "设置进度条是否反向。", "name": "progress_bar_set_reverse", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" } ], "annotation": { "scriptable": true }, "desc": "获取进度百分比。\n\n> 当max为100时percent和value取整后一致。", "name": "progress_bar_get_percent", "return": { "type": "uint32_t", "desc": "返回百分比。" } } ], "events": [ { "name": "EVT_VALUE_WILL_CHANGE", "desc": "值即将改变事件。", "type": "event_t" }, { "name": "EVT_VALUE_CHANGED", "desc": "值改变事件。", "type": "event_t" } ], "properties": [ { "name": "value", "desc": "进度条的值[0-max]。", "type": "float_t", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "persitent": true, "design": true, "scriptable": true } }, { "name": "max", "desc": "最大值(缺省为100)。", "type": "float_t", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "persitent": true, "design": true, "scriptable": true } }, { "name": "vertical", "desc": "进度条的是否为垂直方向。", "type": "bool_t", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "persitent": true, "design": true, "scriptable": true } }, { "name": "show_text", "desc": "是否显示文本。", "type": "bool_t", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "persitent": true, "design": true, "scriptable": true } }, { "name": "reverse", "desc": "是否反向显示。如果为TRUE水平方向从右向左表示增加垂直方向从上到下表示增加。", "type": "bool_t", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "persitent": true, "design": true, "scriptable": true } } ], "header": "widgets/progress_bar.h", "desc": "进度条控件。\n\n进度条控件可以水平显示也可以垂直显示由vertical属性决定。\n\nprogress\_bar\_t是widget\_t的子类控件widget\_t的函数均适用于progress\_bar\_t控件。\n\n在xml中使用"progress\_bar"标签创建进度条控件。如:\n\nxml\n<progress_bar name=\"bar1\" x=\"10\" y=\"128\" w=\"240\" h=\"30\" value=\"40\"/>\n<progress_bar name=\"bar2\" x=\"280\" y=\"128\" w=\"30\" h=\"118\" value=\"20\" vertical=\"true\"/>\n\n\n> 更多用法请参考:\nbasic demo\n\n在c代码中使用函数progress\_bar\_create创建进度条控件。如\n\nc\nwidget_t* progress_bar = progress_bar_create(win, 10, 10, 128, 30);\n\n\n> 完整示例请参考:\nprogress_bar demo\n\n可用通过style来设置控件的显示风格如字体的大小和颜色等等。如\n\nxml\n<style>\n<normal bg_color=\"#f0f0f0\" text_color=\"gold\" fg_color=\"#c0c0c0\" border_color=\"#a0a0a0\" />\n</style>\n\n\n> 更多用法请参考:\ntheme\ndefault", "name": "progress_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": "创建row对象", "name": "row_create", "return": { "type": "widget_t*", "desc": "对象。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "row对象。" } ], "annotation": { "cast": true, "scriptable": true }, "desc": "转换为row对象(供脚本语言使用)。", "name": "row_cast", "return": { "type": "widget_t*", "desc": "row对象。" } } ], "events": [], "properties": [], "header": "widgets/row.h", "desc": "row。一个简单的容器控件用于水平排列其子控件。\n\n它本身不提供布局功能仅提供具有语义的标签让xml更具有可读性。\n子控件的布局可用layout\_children属性指定。\n请参考布局参数。\n\nrow\_t是widget\_t的子类控件widget\_t的函数均适用于row\_t控件。\n\n在xml中使用"row"标签创建row。如\n\nxml\n<row x=\"0\" y=\"0\" w=\"100%\" h=\"100%\" children_layout=\"default(c=0,r=1)\">\n<button name=\"open:basic\" text=\"Basic\"/>\n<button name=\"open:button\" text=\"Buttons\"/>\n<button name=\"open:edit\" text=\"Edits\"/>\n<button name=\"open:keyboard\" text=\"KeyBoard\"/>\n</row>\n\n\n可用通过style来设置控件的显示风格如背景颜色等。如\n\nxml\n<style name=\"default\" border_color=\"#a0a0a0\">\n<normal bg_color=\"#f0f0f0\" />\n</style>\n", "name": "row_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": "创建slider对象", "name": "slider_create", "return": { "type": "widget_t*", "desc": "对象。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "slider对象。" } ], "annotation": { "cast": true, "scriptable": true }, "desc": "转换为slider对象(供脚本语言使用)。", "name": "slider_cast", "return": { "type": "widget_t*", "desc": "slider对象。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "double", "name": "value", "desc": "值" } ], "annotation": { "scriptable": true }, "desc": "设置滑块的值。", "name": "slider_set_value", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "double", "name": "min", "desc": "最小值" } ], "annotation": { "scriptable": true }, "desc": "设置滑块的最小值。", "name": "slider_set_min", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "double", "name": "max", "desc": "最大值" } ], "annotation": { "scriptable": true }, "desc": "设置滑块的最大值。", "name": "slider_set_max", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "double", "name": "step", "desc": "拖动的最小单位。" } ], "annotation": { "scriptable": true }, "desc": "设置滑块的拖动的最小单位。", "name": "slider_set_step", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "uint32_t", "name": "bar_size", "desc": "bar的宽度或高度。" } ], "annotation": { "scriptable": true }, "desc": "设置bar的宽度或高度。", "name": "slider_set_bar_size", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "bool_t", "name": "vertical", "desc": "是否为垂直方向。" } ], "annotation": { "scriptable": true }, "desc": "设置滑块的方向。", "name": "slider_set_vertical", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "double", "name": "value", "desc": "值。" }, { "type": "event_type_t", "name": "etype", "desc": "触发事件。" }, { "type": "bool_t", "name": "force", "desc": "不管有没有变化都设置。" } ], "annotation": {}, "desc": "设置滑块的值(public for test)。", "name": "slider_set_value_internal", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } } ], "events": [ { "name": "EVT_VALUE_WILL_CHANGE", "desc": "值即将改变事件。", "type": "event_t" }, { "name": "EVT_VALUE_CHANGING", "desc": "值正在改变事件(拖动中)。", "type": "event_t" }, { "name": "EVT_VALUE_CHANGED", "desc": "值改变事件。", "type": "event_t" } ], "properties": [ { "name": "value", "desc": "值。", "type": "double", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "persitent": true, "design": true, "scriptable": true } }, { "name": "min", "desc": "最小值。", "type": "double", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "persitent": true, "design": true, "scriptable": true } }, { "name": "max", "desc": "最大值。", "type": "double", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "persitent": true, "design": true, "scriptable": true } }, { "name": "step", "desc": "拖动的最小单位。", "type": "double", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "persitent": true, "design": true, "scriptable": true } }, { "name": "vertical", "desc": "滑块的是否为垂直方向。", "type": "bool_t", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "persitent": true, "design": true, "scriptable": true } }, { "name": "bar_size", "desc": "轴的宽度或高度单位像素为0表示为控件的宽度或高度的一半缺省为0。", "type": "uint32_t", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "persitent": true, "design": true, "scriptable": true } }, { "name": "dragger_size", "desc": "滑块的宽度或高度单位像素缺省为10。", "type": "uint32_t", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "persitent": true, "design": true, "scriptable": true } }, { "name": "dragger_adapt_to_icon", "desc": "滑块的宽度或高度是否与icon适应缺省为true。", "type": "bool_t", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "persitent": true, "design": true, "scriptable": true } }, { "name": "slide_with_bar", "desc": "是否允许在轴上滑动来改变滑块位置缺省为FALSE。", "type": "bool_t", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "persitent": true, "design": true, "scriptable": true } } ], "header": "widgets/slider.h", "desc": "滑块控件。\n\nslider\_t是widget\_t的子类控件widget\_t的函数均适用于slider\_t控件。\n\n在xml中使用"slider"标签创建滑块控件。如:\n\nxml\n<slider x=\"center\" y=\"10\" w=\"80%\" h=\"20\" value=\"10\"/>\n<slider style=\"img\" x=\"center\" y=\"50\" w=\"80%\" h=\"30\" value=\"20\" />\n<slider style=\"img\" x=\"center\" y=\"90\" w=\"80%\" h=\"30\" value=\"30\" min=\"5\" max=\"50\" step=\"5\"/>\n\n\n> 更多用法请参考:\nbasic\n\n在c代码中使用函数slider\_create创建滑块控件。如\n\nc\nwidget_t* slider = slider_create(win, 10, 10, 200, 30);\nwidget_on(slider, EVT_VALUE_CHANGED, on_changed, NULL);\nwidget_on(slider, EVT_VALUE_CHANGING, on_changing, NULL);\n\n\n> 完整示例请参考:\nslider demo\n\n可用通过style来设置控件的显示风格如图片和颜色等等。如\n\nxml\n<style name=\"img\" bg_image=\"slider_bg\" fg_image=\"slider_fg\">\n<normal icon=\"slider_drag\"/>\n<pressed icon=\"slider_drag_p\"/>\n<over icon=\"slider_drag_o\"/>\n</style>\n\n\n> 更多用法请参考:\ntheme\ndefault", "name": "slider_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": "创建tab_button_group对象", "name": "tab_button_group_create", "return": { "type": "widget_t*", "desc": "对象。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "bool_t", "name": "compact", "desc": "是否使用紧凑布局(缺省FALSE)。" } ], "annotation": { "scriptable": true }, "desc": "设置compact。", "name": "tab_button_group_set_compact", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "bool_t", "name": "scrollable", "desc": "是否允许滚动(缺省FALSE)。" } ], "annotation": { "scriptable": true }, "desc": "设置scrollable。", "name": "tab_button_group_set_scrollable", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "tab_button_group对象。" } ], "annotation": { "cast": true, "scriptable": true }, "desc": "转换tab_button_group对象(供脚本语言使用)。", "name": "tab_button_group_cast", "return": { "type": "widget_t*", "desc": "tab_button_group对象。" } } ], "events": [], "properties": [ { "name": "compact", "desc": "紧凑型排版子控件(缺省FALSE)。", "type": "bool_t", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "persitent": true, "design": true, "scriptable": true } }, { "name": "scrollable", "desc": "是否支持滚动(缺省FALSE)。\n\n> 紧凑型排版子控件时才支持滚动。", "type": "bool_t", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "persitent": true, "design": true, "scriptable": true } } ], "header": "widgets/tab_button_group.h", "desc": "标签按钮分组控件。\n\n一个简单的容器主要用于对标签按钮进行布局和管理。\n\ntab\_button\_group\_t是widget\_t的子类控件,\nwidget\_t的函数均适用于tab\_button\_group\_t控件。\n\n在xml中使用"tab\_button\_group"标签创建标签按钮分组控件。如:\n\nxml\n<tab_button_group x=\"c\" y=\"bottom:10\" w=\"90%\" h=\"30\" compact=\"true\" >\n<tab_button text=\"General\"/>\n<tab_button text=\"Network\" value=\"true\" />\n<tab_button text=\"Security\"/>\n</tab_button_group>\n\n\n> 更多用法请参考:\ntab control\n\n可用通过style来设置控件的显示风格如颜色等等。如\n\nxml\n<tab_button_group>\n<style name=\"default\">\n<normal/>\n</style>\n</tab_button_group>\n", "name": "tab_button_group_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": "创建tab_button对象", "name": "tab_button_create", "return": { "type": "widget_t*", "desc": "对象。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "tab_button对象。" } ], "annotation": { "cast": true, "scriptable": true }, "desc": "转换tab_button对象(供脚本语言使用)。", "name": "tab_button_cast", "return": { "type": "widget_t*", "desc": "tab_button对象。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "tab_button对象。" }, { "type": "uint32_t", "name": "value", "desc": "是否为当前标签。" } ], "annotation": { "scriptable": true }, "desc": "设置为当前标签。", "name": "tab_button_set_value", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "tab_button对象。" }, { "type": "char*", "name": "name", "desc": "当前项的图标。" } ], "annotation": { "scriptable": true }, "desc": "设置控件的图标。", "name": "tab_button_set_icon", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "tab_button对象。" }, { "type": "char*", "name": "name", "desc": "当前项的图标。" } ], "annotation": { "scriptable": true }, "desc": "设置控件的active图标。", "name": "tab_button_set_active_icon", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "tab_button对象。" }, { "type": "char*", "name": "name", "desc": "动态加载UI的资源名称。" } ], "annotation": { "scriptable": true }, "desc": "设置控件动态加载显示UI。", "name": "tab_button_set_load_ui", "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": "bool_t", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "persitent": true, "design": true, "scriptable": true } }, { "name": "load_ui", "desc": "激活后加载的UI名字。", "type": "char*", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "persitent": true, "design": true, "scriptable": true } }, { "name": "active_icon", "desc": "当前项的图标的名称。", "type": "char*", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "persitent": true, "design": true, "scriptable": true } }, { "name": "icon", "desc": "非当前项的图标的名称。", "type": "char*", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "persitent": true, "design": true, "scriptable": true } } ], "header": "widgets/tab_button.h", "desc": "标签按钮控件。\n\n标签按钮有点类似单选按钮但点击标签按钮之后会自动切换当前的标签页。\n\ntab\_button\_t是widget\_t的子类控件widget\_t的函数均适用于tab\_button\_t控件。\n\n在xml中使用"tab\_button"标签创建标签按钮控件。如:\n\nxml\n<!-- tab_button_view_page1.xml -->\n<view w=\"100%\" h=\"100%\">\n<label x=\"c\" y=\"m\" w=\"100%\" h=\"60\" text=\"page1\" />\n<button name=\"close\" x=\"c\" y=\"bottom:100\" w=\"80\" h=\"40\" text=\"Close\" />\n</view>\n\n\nxml\n<!-- tab_button dynamic load UI -->\n<pages name=\"pages\" x=\"right\" y=\"0\" w=\"70%\" h=\"100%\">\n</pages>\n<list_view x=\"0\" y=\"0\" w=\"30%\" h=\"100%\" item_height=\"40\" auto_hide_scroll_bar=\"true\">\n<scroll_view name=\"view\" x=\"0\" y=\"0\" w=\"-12\" h=\"100%\">\n<tab_button text=\"page1\" load_ui=\"tab_button_view_page1\" value=\"true\"/>\n<tab_button text=\"page2\" load_ui=\"tab_button_view_page2\" />\n<tab_button text=\"page3\" load_ui=\"tab_button_view_page3\" />\n<scroll_view />\n<scroll_bar_d name=\"bar\" x=\"right\" y=\"0\" w=\"12\" h=\"100%\" value=\"0\"/>\n</list_view>\n\n\nxml\n<!-- tab_button static load UI -->\n<tab_button_group x=\"c\" y=\"bottom:10\" w=\"90%\" h=\"30\" compact=\"true\" >\n<tab_button text=\"General\"/>\n<tab_button text=\"Network\" value=\"true\" />\n<tab_button text=\"Security\"/>\n</tab_button_group>\n\n\n标签按钮一般放在标签按钮分组中布局由标签按钮分组控件决定不需要指定自己的布局参数和坐标。\n\n> 更多用法请参考:\ntab control\n\n可用通过style来设置控件的显示风格如字体的大小和颜色等等。如\n\nxml\n<tab_button>\n<style name=\"default\" border_color=\"#a0a0a0\" text_color=\"black\">\n<normal bg_color=\"#d0d0d0\" />\n<pressed bg_color=\"#f0f0f0\" />\n<over bg_color=\"#e0e0e0\" />\n<normal_of_active bg_color=\"#f0f0f0\" />\n<pressed_of_active bg_color=\"#f0f0f0\" />\n<over_of_active bg_color=\"#f0f0f0\" />\n</style>\n</tab_button>\n", "name": "tab_button_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": "创建tab_control对象", "name": "tab_control_create", "return": { "type": "widget_t*", "desc": "对象。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "tab_control对象。" } ], "annotation": { "cast": true, "scriptable": true }, "desc": "转换tab_control对象(供脚本语言使用)。", "name": "tab_control_cast", "return": { "type": "widget_t*", "desc": "tab_control对象。" } } ], "events": [], "properties": [], "header": "widgets/tab_control.h", "desc": "标签控件。\n\n它本身不提供布局功能仅提供具有语义的标签让xml更具有可读性。\n\n标签控件通常会包含一个pages控件和一个tab\_button\_group控件。\n\ngraphviz\n[default_style]\n\npages_t -> tab_control_t[arrowhead = \"ediamond\"]\ntab_button_group_t -> tab_control_t[arrowhead = \"ediamond\"]\nview_t ->pages_t[arrowhead = \"ediamond\"]\ntab_button_t -> tab_button_group_t[arrowhead = \"ediamond\"]\n\n\ntab\_control\_t是widget\_t的子类控件,\nwidget\_t的函数均适用于tab\_control\_t控件。\n\n在xml中使用"tab\_control"标签创建标签控件。如:\n\nxml\n<tab_control x=\"0\" y=\"0\" w=\"100%\" h=\"100%\" >\n<pages x=\"c\" y=\"20\" w=\"90%\" h=\"-60\" value=\"1\">\n...\n</pages>\n<tab_button_group>\n...\n</tab_button_group>\n</tab_control>\n\n\n> 更多用法请参考:\ntab control", "name": "tab_control_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": "创建view对象", "name": "view_create", "return": { "type": "widget_t*", "desc": "对象。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "const char*", "name": "default_focused_child", "desc": "缺省获得焦点的子控件(可用控件名或类型)。" } ], "annotation": { "scriptable": true }, "desc": "设置缺省获得焦点的子控件(可用控件名或类型)。", "name": "view_set_default_focused_child", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "view对象。" } ], "annotation": { "cast": true, "scriptable": true }, "desc": "转换为view对象(供脚本语言使用)。", "name": "view_cast", "return": { "type": "widget_t*", "desc": "view对象。" } } ], "events": [], "properties": [ { "name": "default_focused_child", "desc": "缺省获得焦点的子控件(可用控件名或类型)。\n\n> view作为pages/slideview的直接子控件才需要设置。\n> 正常情况下,一个窗口只能指定一个初始焦点。\n> 但是对于pages/slideview来说可能希望每一个页面都有一个初始焦点此时可用default\_focused\_child来指定。", "type": "char*", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "persitent": true, "design": true, "scriptable": true } } ], "header": "widgets/view.h", "desc": "一个通用的容器控件。\n\n它本身不提供布局功能仅提供具有语义的标签让xml更具有可读性。\n子控件的布局可用layout\_children属性指定。\n请参考布局参数。\n\nview\_t是widget\_t的子类控件widget\_t的函数均适用于view\_t控件。\n\n在xml中使用"view"标签创建view。如\n\nxml\n<view x=\"0\" y=\"0\" w=\"100%\" h=\"100%\" children_layout=\"default(c=2,r=2,m=5,s=5)\">\n</view>\n\n\n可用通过style来设置控件的显示风格如背景颜色等。如\n\nxml\n<style name=\"default\" border_color=\"#a0a0a0\">\n<normal bg_color=\"#f0f0f0\" />\n</style>\n", "name": "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": "创建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\ngraphviz\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的函数均适用于dialog\_t控件。\n\n在xml中使用"dialog"标签创建对话框。如:\n\nxml\n<dialog anim_hint=\"center_scale(duration=300)\" x=\"c\" y=\"m\" w=\"80%\" h=\"160\" text=\"Dialog\">\n<dialog_title x=\"0\" y=\"0\" w=\"100%\" h=\"30\" text=\"Hello AWTK\" />\n<dialog_client x=\"0\" y=\"bottom\" w=\"100%\" h=\"-30\">\n<label name=\"\" x=\"center\" y=\"middle:-20\" w=\"200\" h=\"30\" text=\"Are you ready?\"/>\n<button name=\"quit\" x=\"10\" y=\"bottom:10\" w=\"40%\" h=\"30\" text=\"确定\"/>\n<button name=\"quit\" x=\"right:10\" y=\"bottom:10\" w=\"40%\" h=\"30\" text=\"取消\"/>\n</dialog_client>\n</dialog>\n\n\n如果你不需要对话框的标题可以这样写\n\nxml\n<dialog anim_hint=\"center_scale(duration=300)\" x=\"c\" y=\"m\" w=\"80%\" h=\"160\" text=\"Dialog\">\n<label name=\"\" x=\"center\" y=\"middle:-20\" w=\"200\" h=\"30\" text=\"Are you ready?\"/>\n<button name=\"quit\" x=\"10\" y=\"bottom:10\" w=\"40%\" h=\"30\" text=\"确定\"/>\n<button name=\"quit\" x=\"right:10\" y=\"bottom:10\" w=\"40%\" h=\"30\" text=\"取消\"/>\n</dialog>\n\n\n打开非模态对话框时其用法与普通窗口一样。打开非模态对话框时还需要调用dialog\_modal。\n\nc\nwidget_t* dlg = dialog_open(name);\n\nret = dialog_modal(dlg);\n\n\n关闭模态对话框用dialog\_quit\n\nc\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\nc\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> 更多用法请参考:\ndialog.xml\n\n> 完整C代码示例请参考\n\n* 非模态对话框\n\n* 模态对话框\n\n可用通过style来设置控件的显示风格如字体的大小和颜色等等。如\n\nxml\n<style name=\"default\">\n<normal border_color=\"#606060\" />\n</style>\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": [ { "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": [ { "params": [], "annotation": { "constructor": true }, "desc": "获取system_info对象。", "name": "system_info", "alias": "system_info_instance", "return": { "type": "system_info_t*", "desc": "返回system_info对象。" } }, { "params": [ { "type": "app_type_t", "name": "app_type", "desc": "应用程序的类型。" }, { "type": "const char*", "name": "app_name", "desc": "应用程序的名称。" }, { "type": "const char*", "name": "app_root", "desc": "应用程序的根目录,用于定位资源文件。" } ], "annotation": { "static": true }, "desc": "初始化system_info对象。", "name": "system_info_init", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [], "annotation": { "static": true }, "desc": "释放system_info对象。", "name": "system_info_deinit", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "system_info_t* info", "name": "info", "desc": "system_info对象。" }, { "type": "float_t", "name": "font_scale", "desc": "字体缩放比例。" } ], "annotation": {}, "desc": "设置字体缩放比例。", "name": "system_info_set_font_scale", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "system_info_t* info", "name": "info", "desc": "system_info对象。" }, { "type": "const char*", "name": "app_root", "desc": "app root。" } ], "annotation": {}, "desc": "设置app root。", "name": "system_info_set_app_root", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "system_info_t* info", "name": "info", "desc": "system_info对象。" }, { "type": "const char*", "name": "default_font", "desc": "缺省字体。" } ], "annotation": {}, "desc": "设置缺省字体。", "name": "system_info_set_default_font", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "system_info_t* info", "name": "info", "desc": "system_info对象。" }, { "type": "uint32_t", "name": "lcd_w", "desc": "设置LCD宽度。" } ], "annotation": {}, "desc": "设置LCD宽度。", "name": "system_info_set_lcd_w", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "system_info_t* info", "name": "info", "desc": "system_info对象。" }, { "type": "uint32_t", "name": "lcd_h", "desc": "设置LCD高度。" } ], "annotation": {}, "desc": "设置LCD高度。", "name": "system_info_set_lcd_h", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "system_info_t* info", "name": "info", "desc": "system_info对象。" }, { "type": "lcd_type_t", "name": "lcd_type", "desc": "设置LCD类型。" } ], "annotation": {}, "desc": "设置LCD类型。", "name": "system_info_set_lcd_type", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "system_info_t* info", "name": "info", "desc": "system_info对象。" }, { "type": "lcd_orientation_t", "name": "lcd_orientation", "desc": "设置LCD的旋转角度。" } ], "annotation": {}, "desc": "设置LCD的旋转角度。", "name": "system_info_set_lcd_orientation", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "system_info_t* info", "name": "info", "desc": "system_info对象。" }, { "type": "float_t", "name": "device_pixel_ratio", "desc": "设置LCD密度。" } ], "annotation": {}, "desc": "设置LCD密度。", "name": "system_info_set_device_pixel_ratio", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "const char*", "name": "name", "desc": "字体名称。" } ], "annotation": {}, "desc": "修正字体名称如果为NULL返回缺省字体。", "name": "system_info_fix_font_name", "return": { "type": "const char*", "desc": "返回有效的字体名称。" } }, { "params": [ { "type": "app_type_t", "name": "app_type", "desc": "应用程序的类型。" }, { "type": "const char*", "name": "app_name", "desc": "应用程序的名称。" }, { "type": "const char*", "name": "app_root", "desc": "应用程序的根目录,用于定位资源文件。" } ], "annotation": { "static": true }, "desc": "创建system_info对象。", "name": "system_info_create", "return": { "type": "system_info_t*", "desc": "返回创建的对象指针。" } } ], "events": [], "properties": [ { "name": "lcd_w", "desc": "显示屏的宽度。", "type": "uint32_t", "annotation": { "readable": true } }, { "name": "lcd_h", "desc": "显示屏的高度。", "type": "uint32_t", "annotation": { "readable": true } }, { "name": "lcd_type", "desc": "显示屏的类型。", "type": "lcd_type_t", "annotation": { "readable": true } }, { "name": "device_pixel_ratio", "desc": "显示屏的密度。", "type": "float_t", "annotation": { "readable": true } }, { "name": "font_scale", "desc": "字体缩放比例,用于实现字体整体放大。", "type": "float_t", "annotation": { "readable": true } }, { "name": "default_font", "desc": "缺省字体。", "type": "const char*", "annotation": { "readable": true } }, { "name": "lcd_orientation", "desc": "显示屏的旋转角度。", "type": "lcd_orientation_t", "annotation": { "readable": true } }, { "name": "device_orientation", "desc": "显示屏的方向名称,可选值:"portrait"表示竖屏,"landscape"表示横屏。\n\n> 只能通过object\_get\_prop函数访问。", "type": "const char*", "annotation": { "readable": true, "fake": true } }, { "name": "country", "desc": "locale中的国家。\n\n> 只能通过object\_get\_prop函数访问。", "type": "const char*", "annotation": { "readable": true, "fake": true } }, { "name": "language", "desc": "locale中的语言。\n\n> 只能通过object\_get\_prop函数访问。", "type": "const char*", "annotation": { "readable": true, "fake": true } }, { "name": "app_type", "desc": "应用程序的类型。", "type": "app_type_t", "annotation": { "readable": true } }, { "name": "app_name", "desc": "应用程序的名称。", "type": "const char*", "annotation": { "readable": true } }, { "name": "app_root", "desc": "应用程序的根目录,用于定位资源文件。", "type": "const char*", "annotation": { "readable": true } } ], "header": "base/system_info.h", "desc": "当前系统的信息。", "name": "system_info_t", "parent": "object_t", "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": "创建window对象", "name": "window_create", "return": { "type": "widget_t*", "desc": "对象。" } }, { "params": [], "annotation": { "constructor": true, "scriptable": true }, "desc": "以缺省的方式创建window对象。", "name": "window_create_default", "return": { "type": "widget_t*", "desc": "对象。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "window对象。" }, { "type": "bool_t", "name": "fullscreen", "desc": "是否全屏。" } ], "annotation": { "deconstructor": true, "scriptable": true }, "desc": "设置为全屏窗口。\n\n>这里全屏是指与LCD相同大小而非让SDL窗口全屏。", "name": "window_set_fullscreen", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "const char*", "name": "name", "desc": "window的名称。" } ], "annotation": { "constructor": true, "scriptable": true }, "desc": "从资源文件中加载并创建window_base对象。本函数在ui_loader/ui_builder_default里实现。", "name": "window_open", "return": { "type": "widget_t*", "desc": "对象。" } }, { "params": [ { "type": "const char*", "name": "name", "desc": "window的名称。" }, { "type": "widget_t*", "name": "to_close", "desc": "关闭该窗口。" } ], "annotation": { "constructor": true, "scriptable": true }, "desc": "从资源文件中加载并创建window对象。本函数在ui_loader/ui_builder_default里实现。", "name": "window_open_and_close", "return": { "type": "widget_t*", "desc": "对象。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "window对象。" } ], "annotation": { "deconstructor": true, "scriptable": true }, "desc": "关闭窗口。", "name": "window_close", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "window对象。" } ], "annotation": { "deconstructor": true, "scriptable": true }, "desc": "立即无条件关闭窗口(无动画)。", "name": "window_close_force", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "window对象。" } ], "annotation": { "cast": true, "scriptable": true }, "desc": "转换为window对象(供脚本语言使用)。", "name": "window_cast", "return": { "type": "widget_t*", "desc": "window对象。" } }, { "params": [ { "type": "bitmap_t*", "name": "dst", "desc": "目标图片对象。" }, { "type": "const rect_t*", "name": "dst_r", "desc": "要填充的目标区域。" }, { "type": "color_t", "name": "c", "desc": "颜色。" } ], "annotation": {}, "desc": "用颜色绘制指定的区域。", "name": "image_fill", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败返回失败则上层用软件实现。" } }, { "params": [ { "type": "bitmap_t*", "name": "dst", "desc": "目标图片对象。" }, { "type": "const rect_t*", "name": "dst_r", "desc": "要填充的目标区域。" }, { "type": "color_t", "name": "c", "desc": "颜色。" } ], "annotation": {}, "desc": "用颜色填充指定的区域。", "name": "image_clear", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败返回失败则上层用软件实现。" } }, { "params": [ { "type": "bitmap_t*", "name": "dst", "desc": "目标图片对象。" }, { "type": "bitmap_t*", "name": "src", "desc": "源图片对象。" }, { "type": "const rect_t*", "name": "src_r", "desc": "要拷贝的区域。" }, { "type": "xy_t", "name": "dx", "desc": "目标位置的x坐标。" }, { "type": "xy_t", "name": "dy", "desc": "目标位置的y坐标。" } ], "annotation": {}, "desc": "把图片指定的区域拷贝到framebuffer中。", "name": "image_copy", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败返回失败则上层用软件实现。" } }, { "params": [ { "type": "bitmap_t*", "name": "dst", "desc": "目标图片对象。" }, { "type": "bitmap_t*", "name": "src", "desc": "源图片对象。" }, { "type": "const rect_t*", "name": "src_r", "desc": "要旋转并拷贝的区域。" }, { "type": "lcd_orientation_t", "name": "o", "desc": "旋转角度(一般支持90度即可)。" } ], "annotation": {}, "desc": "把图片指定的区域进行旋转并拷贝到framebuffer相应的区域本函数主要用于辅助实现横屏和竖屏的切换一般支持90度旋转即可。", "name": "image_rotate", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败返回失败则上层用软件实现。" } }, { "params": [ { "type": "bitmap_t*", "name": "dst", "desc": "目标图片对象。" }, { "type": "bitmap_t*", "name": "src", "desc": "源图片对象。" }, { "type": "const rect_t*", "name": "dst_r", "desc": "目的区域。" }, { "type": "const rect_t*", "name": "src_r", "desc": "源区域。" }, { "type": "uint8_t", "name": "global_alpha", "desc": "全局alpha。" } ], "annotation": {}, "desc": "把图片指定的区域渲染到framebuffer指定的区域src的大小和dst的大小不一致则进行缩放。", "name": "image_blend", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败返回失败则上层用软件实现。" } } ], "events": [], "properties": [ { "name": "fullscreen", "desc": "是否全屏。\n\n>这里全屏是指与LCD相同大小而非让SDL窗口全屏。", "type": "bool_t", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "persitent": true, "design": true, "scriptable": true } } ], "header": "base/window.h", "desc": "窗口。\n\n缺省的应用程序窗口占用除system\_bar\_t之外的整个区域请不要修改它的位置和大小(除非你清楚后果)。\n\nwindow\_t是window\_base\_t的子类控件window\_base\_t的函数均适用于window\_t控件。\n\n在xml中使用"window"标签创建窗口。无需指定坐标和大小,可以指定主题和动画名称。如:\n\nxml\n<window theme=\"basic\" anim_hint=\"htranslate\">\n...\n</window>\n\n\n>\n更多用法请参考window.xml\n\n在c代码中使用函数window\_create创建窗口。如\n\nc\nwidget_t* window = window_create(NULL, 0, 0, 0, 0);\n\n\n> 无需指定父控件、坐标和大小使用0即可。\n\n> 完整示例请参考:window\ndemo\n\n可用通过style来设置窗口的风格如背景颜色或图片等。如\n\nxml\n<style name=\"bricks\">\n<normal bg_image=\"bricks\" bg_image_draw_type=\"repeat\"/>\n</style>\n\n\n> 更多用法请参考:theme\ndefault", "name": "window_t", "parent": "window_base_t", "annotation": { "scriptable": true, "design": true, "widget": true, "window": true }, "level": 3 }, { "type": "class", "methods": [ { "params": [ { "type": "const char*", "name": "url", "desc": "路径(通常是文件路径)。" }, { "type": "bool_t", "name": "create_if_not_exist", "desc": "如果不存在是否创建。" } ], "annotation": { "constructor": true }, "desc": "", "name": "conf_ini_load", "return": { "type": "object_t*", "desc": "返回配置对象。" } }, { "params": [ { "type": "object_t*", "name": "obj", "desc": "doc对象。" }, { "type": "const char*", "name": "url", "desc": "保存的位置。" } ], "annotation": { "static": true }, "desc": "将doc对象保存到指定URL。", "name": "conf_ini_save_as", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败" } } ], "events": [], "properties": [], "header": "conf_io/conf_ini.h", "desc": "conf ini对象。", "name": "conf_ini_t", "parent": "object_t", "annotation": { "fake": true }, "level": 3 }, { "type": "class", "methods": [ { "params": [ { "type": "const char*", "name": "url", "desc": "路径(通常是文件路径)。" }, { "type": "bool_t", "name": "create_if_not_exist", "desc": "如果不存在是否创建。" } ], "annotation": { "constructor": true }, "desc": "", "name": "conf_json_load", "return": { "type": "object_t*", "desc": "返回配置对象。" } }, { "params": [ { "type": "object_t*", "name": "obj", "desc": "doc对象。" }, { "type": "const char*", "name": "url", "desc": "保存的位置。" } ], "annotation": { "static": true }, "desc": "将doc对象保存到指定URL。", "name": "conf_json_save_as", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败" } } ], "events": [], "properties": [], "header": "conf_io/conf_json.h", "desc": "conf json对象。", "name": "conf_json_t", "parent": "object_t", "annotation": { "fake": true }, "level": 3 }, { "type": "class", "methods": [ { "params": [ { "type": "conf_doc_save_t", "name": "save", "desc": "保存函数。" }, { "type": "conf_doc_load_t", "name": "load", "desc": "加载函数。" }, { "type": "const char*", "name": "url", "desc": "路径。" }, { "type": "bool_t", "name": "create_if_not_exist", "desc": "如果不存在是否创建。" } ], "annotation": { "constructor": true }, "desc": "", "name": "conf_obj_create", "return": { "type": "object_t*", "desc": "返回配置对象。" } }, { "params": [ { "type": "object_t*", "name": "conf", "desc": "conf对象。" } ], "annotation": {}, "desc": "获取doc对象用于更高级的操作。", "name": "conf_obj_get_doc", "return": { "type": "conf_dot_t", "desc": "返回doc对象。" } }, { "params": [ { "type": "object_t*", "name": "conf", "desc": "conf对象。" } ], "annotation": {}, "desc": "保存文档。", "name": "conf_obj_save", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败" } }, { "params": [ { "type": "object_t*", "name": "conf", "desc": "conf对象。" }, { "type": "bool_t", "name": "readonly", "desc": "只读模式。" } ], "annotation": {}, "desc": "设置为只读模式。", "name": "conf_obj_set_readonly", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败" } } ], "events": [], "properties": [], "header": "conf_io/conf_obj.h", "desc": "conf对象。", "name": "conf_obj_t", "parent": "object_t", "annotation": { "fake": true }, "level": 3 }, { "type": "class", "methods": [ { "params": [ { "type": "const char*", "name": "url", "desc": "路径(通常是文件路径)。" }, { "type": "bool_t", "name": "create_if_not_exist", "desc": "如果不存在是否创建。" } ], "annotation": { "constructor": true }, "desc": "", "name": "conf_ubjson_load", "return": { "type": "object_t*", "desc": "返回配置对象。" } }, { "params": [ { "type": "object_t*", "name": "obj", "desc": "doc对象。" }, { "type": "const char*", "name": "url", "desc": "保存的位置。" } ], "annotation": { "static": true }, "desc": "将doc对象保存到指定URL。", "name": "conf_ubjson_save_as", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败" } } ], "events": [], "properties": [], "header": "conf_io/conf_ubjson.h", "desc": "conf json对象。", "name": "conf_ubjson_t", "parent": "object_t", "annotation": { "fake": 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": "创建gif_image对象", "name": "gif_image_create", "return": { "type": "widget_t*", "desc": "对象。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "gif_image对象。" } ], "annotation": { "cast": true, "scriptable": true }, "desc": "转换为gif_image对象(供脚本语言使用)。", "name": "gif_image_cast", "return": { "type": "widget_t*", "desc": "gif_image对象。" } } ], "events": [], "properties": [], "header": "gif_image/gif_image.h", "desc": "GIF图片控件。\n\n> 注意GIF图片的尺寸大于控件大小时会自动缩小图片但一般的嵌入式系统的硬件加速都不支持图片缩放\n所以缩放图片会导致性能明显下降。如果性能不满意时请确认一下GIF图片的尺寸是否小余控件大小。\n\ngif\_image\_t是image\_base\_t的子类控件image\_base\_t的函数均适用于gif\_image\_t控件。\n\n在xml中使用"gif"标签创建GIF图片控件。如\n\nxml\n<gif image=\"bee\"/>\n\n\n>更多用法请参考:\ngif\nimage\n\n在c代码中使用函数gif\_image\_create创建GIF图片控件。如\n\nc\nwidget_t* image = gif_image_create(win, 10, 10, 200, 200);\nimage_set_image(image, \"bee\");\n\n\n> 创建之后:\n>\n> 需要用widget\_set\_image设置图片名称。\n\n> 完整示例请参考gif image demo\n\n可用通过style来设置控件的显示风格如背景和边框等。如\n\nxml\n<gif>\n<style name=\"border\">\n<normal border_color=\"#000000\" bg_color=\"#e0e0e0\" text_color=\"black\"/>\n</style>\n</gif>\n\n\n> 更多用法请参考theme default", "name": "gif_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": "创建keyboard对象", "name": "keyboard_create", "return": { "type": "widget_t*", "desc": "对象。" } }, { "params": [ { "type": "widget_t*", "name": "parent", "desc": "keyboard对象。" } ], "annotation": { "deconstructor": true }, "desc": "关闭keyboard窗口。", "name": "keyboard_close", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "keyboard对象。" } ], "annotation": { "cast": true, "scriptable": true }, "desc": "转换为keyboard对象(供脚本语言使用)。", "name": "keyboard_cast", "return": { "type": "widget_t*", "desc": "keyboard对象。" } } ], "events": [], "properties": [], "header": "keyboard/keyboard.h", "desc": "软键盘。\n\n软键盘是一个特殊的窗口由编辑器通过输入法自动打开和关闭。\n\n这里介绍一下定制软键盘的方法\n\n编辑器输入类型和软键盘UI资源文件的对应关系:\n\n| 输入类型 | 软键盘UI资源文件|\n|----------------|:---------------:|\n| INPUT\_PHONE | kb\_phone.xml |\n| INPUT\_INT | kb\_int.xml |\n| INPUT\_FLOAT | kb\_float.xml |\n| INPUT\_UINT | kb\_uint.xml |\n| INPUT\_UFLOAT | kb\_ufloat.xml |\n| INPUT\_HEX | kb\_hex.xml |\n| INPUT\_EMAIL | kb\_ascii.xml |\n| INPUT\_PASSWORD | kb\_ascii.xml |\n| INPUT\_CUSTOM | 使用自定义的键盘 |\n| 其它 | kb\_default.xml |\n\nkeyboard中按钮子控件的名称有些特殊要求\n\n| 名称 | 功能 |\n|----------------|:---------------:|\n| return | 回车键 |\n| action | 定制按钮 |\n| backspace | 删除键 |\n| tab | tab键 |\n| space | 空格键 |\n| close | 关闭软键盘 |\n| clear | 清除编辑器的内容 |\n| cancel | 恢复编辑器的内容 |\n| back | 关闭当前窗口 |\n| back_to_home | 返回home窗口 |\n| 前缀key: | 键值 |\n| 前缀hard_key: | 模拟物理键盘 |\n| 前缀page: | 切换到页面 |\n| 前缀opt: | 多个字符选择一个,点击切换到下一个,超时提交字符(用于实现九宫格输入) |\n\n示例\n\n* 按键"a",提交输入法处理。\n\nxml\n<button repeat=\"300\" name=\"key:a\" text=\"a\"/>\n\n\n* 字符"a",直接提交到编辑器。\n\nxml\n<button repeat=\"300\" name=\"a\" text=\"a\"/>\n\n\n* 模拟物理键盘数字"1"触发key down/up事件可以用来选择候选字。\n\nxml\n<button repeat=\"300\" name=\"hard_key:1\" text=\"1\"/>\n\n\n* 九宫格输入\n\nxml\n<button repeat=\"300\" name=\"opt:._@/#\" text=\"._@/#\"/>\n<button repeat=\"300\" name=\"opt:abc\" text=\"abc\"/>\n<button repeat=\"300\" name=\"opt:def\" text=\"def\"/>\n\n\n\n* 输入语言切换\n\n有的输入法同时支持输入多种语言。\n比如T9可以同时支持中文和英文输入配合软键盘随时切换输入的语言。\n\n可以在pages的页面里指定lang属性切换到该页面时会设置输入法的语言。如\n\nxml\n<pages x=\"0\" y=\"bottom\" w=\"100%\" h=\"-28\" active=\"2\">\n<view name=\"lower\" lang=\"en_us\"\nx=\"0\" y=\"0\" w=\"100%\" h=\"100%\" children_layout=\"default(r=4,c=4,s=2,m=2)\">\n...\n</view>\n<view name=\"chinese\" lang=\"zh_cn\"\nx=\"0\" y=\"0\" w=\"100%\" h=\"100%\" children_layout=\"default(r=4,c=4,s=2,m=2)\">\n...\n</view>\n</pages>\n\n\n> 更多用法请参考:\nkb_default", "name": "keyboard_t", "parent": "window_base_t", "annotation": { "design": true, "widget": true, "window": true, "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 }, "desc": "创建mutable_image对象", "name": "mutable_image_create", "return": { "type": "widget_t*", "desc": "对象。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "mutable_image对象。" }, { "type": "mutable_image_prepare_image_t", "name": "prepare_image", "desc": "准备图片的回调函数。" }, { "type": "void*", "name": "prepare_image_ctx", "desc": "prepare_image回调函数的上下文。" } ], "annotation": {}, "desc": "设置prepare_image回调函数。\n\nprepare_image回调函数在每次绘制之前被调用用于准备下一帧要显示的图片。\n比如获取摄像头的预览图片将其设置到image参数中。\n\n注意在回调函数中只能修改图片的内容不用修改图片的大小和格式如果不匹配请先转换。", "name": "mutable_image_set_prepare_image", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "mutable_image对象。" }, { "type": "mutable_image_create_image_t", "name": "create_image", "desc": "创建图片的回调函数。" }, { "type": "void*", "name": "create_image_ctx", "desc": "create_image回调函数的上下文。" } ], "annotation": {}, "desc": "设置create_image回调函数。", "name": "mutable_image_set_create_image", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "mutable_image对象。" }, { "type": "uint32_t", "name": "w", "desc": "framebuffer宽度。" }, { "type": "uint32_t", "name": "h", "desc": "framebuffer高度。" }, { "type": "bitmap_format_t", "name": "format", "desc": "framebuffer的格式。" }, { "type": "uint8_t*", "name": "buff", "desc": "framebuffer内存。" } ], "annotation": {}, "desc": "设置framebuffer(当硬件支持多层合成时才用)。\n\n有的硬件支持多层framebuffer一层用于视图/摄像头一层用于GUI由硬件合成最终图像。\n此时可以设置用于摄像头的framebuffer图像直接绘制到该framebuffer上。", "name": "mutable_image_set_framebuffer", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "mutable_image对象。" } ], "annotation": { "cast": true }, "desc": "转换为mutable_image对象(供脚本语言使用)。", "name": "mutable_image_cast", "return": { "type": "widget_t*", "desc": "mutable_image对象。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "mutable_image对象。" } ], "annotation": { "cast": true }, "desc": "初始化 mutable_image (提供给继承的子类使用的)", "name": "mutable_image_init", "return": { "type": "widget_t*", "desc": "mutable_image对象。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "mutable_image对象。" } ], "annotation": { "cast": true }, "desc": "释放 mutable_image (提供给继承的子类使用的)", "name": "mutable_image_on_destroy", "return": { "type": "widget_t*", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "mutable_image对象。" }, { "type": "canvas_t*", "name": "canvas", "desc": "画布对象。" } ], "annotation": { "cast": true }, "desc": "mutable_image 的绘制函数 (提供给继承的子类使用的)", "name": "mutable_image_on_paint_self", "return": { "type": "widget_t*", "desc": "返回RET_OK表示成功否则表示失败。" } } ], "events": [], "properties": [], "header": "mutable_image/mutable_image.h", "desc": "mutable图片控件。\n\n像摄像头和视频的图像是变化的每一帧都不同我们把这类图片称为mutable image。\n\n本控件辅助实现摄像头和视频的显示功能。\n\nmutable\_image\_t是image\_base\_t的子类控件image\_base\_t的函数均适用于mutable\_image\_t控件。\n\n在xml中使用"mutable\_image"标签创建mutable图片控件。如\n\nxml\n<mutable_image w=\"100%\" h=\"100%\"/>\n\n\n>更多用法请参考:\nmutable\nimage\n\n在c代码中使用函数mutable\_image\_create创建mutable图片控件。如\n\nc\nwidget_t* image = mutable_image_create(win, 10, 10, 200, 200);\nmutable_image_set_prepare_image(image, get_camera_image, camera);\n\n\n> 创建之后:\n>\n> 需要用mutable\_image\_set\_create\_image设置创建图片的回调函数。\n> 需要用mutable\_image\_set\_prepare\_image设置准备图片的回调函数。\n\n> 完整示例请参考mutable image demo\n\n一般不需通过style来设置控件的显示风格如果在特殊情况下需要可以参考其它控件。", "name": "mutable_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": "创建svg_image对象", "name": "svg_image_create", "return": { "type": "widget_t*", "desc": "对象。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "image对象。" }, { "type": "char*", "name": "name", "desc": "图片名称,该图片必须存在于资源管理器。" } ], "annotation": { "scriptable": true }, "desc": "设置控件的图片名称。\n\n> 如果需要显示文件系统中的图片,只需将图片名称换成实际的文件名,并加上"file://"前缀即可。", "name": "svg_image_set_image", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "svg_image对象。" } ], "annotation": { "cast": true, "scriptable": true }, "desc": "转换为svg_image对象(供脚本语言使用)。", "name": "svg_image_cast", "return": { "type": "widget_t*", "desc": "svg_image对象。" } } ], "events": [], "properties": [], "header": "svg_image/svg_image.h", "desc": "SVG图片控件。\n\nsvg\_image\_t是image\_base\_t的子类控件image\_base\_t的函数均适用于svg\_image\_t控件。\n\n在xml中使用"svg"标签创建SVG图片控件。如\n\nxml\n<svg image=\"girl\"/>\n\n\n>更多用法请参考svg image\n\n在c代码中使用函数svg\_image\_create创建SVG图片控件。如\n\nc\nwidget_t* image = svg_image_create(win, 10, 10, 200, 200);\nimage_set_image(image, \"girl\");\n\n\n> 创建之后: 需要用widget\_set\_image设置图片名称。\n\n> 完整示例请参考svg image demo\n\n可用通过style来设置控件的显示风格如背景和边框等。如\n\nxml\n<svg>\n<style name=\"default\">\n<normal border_color=\"green\" fg_color=\"red\" />\n</style>\n</svg>\n\n\n> 更多用法请参考theme default", "name": "svg_image_t", "parent": "image_base_t", "annotation": { "scriptable": true, "design": true, "widget": true }, "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": [ { "params": [ { "type": "tk_istream_t*", "name": "stream", "desc": "istream对象。" }, { "type": "void*", "name": "buff", "desc": "返回数据的缓冲区。" }, { "type": "uint32_t", "name": "max_size", "desc": "缓冲区的大小。" } ], "annotation": {}, "desc": "读取数据。", "name": "tk_istream_read", "return": { "type": "int32_t", "desc": "返回负数表示读取失败,否则返回实际读取数据的长度。" } }, { "params": [ { "type": "tk_istream_t*", "name": "stream", "desc": "istream对象。" }, { "type": "uint32_t", "name": "offset", "desc": "偏移量。" } ], "annotation": {}, "desc": "设置偏移量。", "name": "tk_istream_seek", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "tk_istream_t*", "name": "stream", "desc": "istream对象。" } ], "annotation": {}, "desc": "获取当前读取位置。", "name": "tk_istream_tell", "return": { "type": "int32_t", "desc": "返回负数表示失败,否则返回当前读取位置。" } }, { "params": [ { "type": "tk_istream_t*", "name": "stream", "desc": "istream对象。" } ], "annotation": {}, "desc": "判断数据是否读完。", "name": "tk_istream_eos", "return": { "type": "bool_t", "desc": "返回TRUE表示数据读完否则表示还有数据。" } }, { "params": [ { "type": "tk_istream_t*", "name": "stream", "desc": "istream对象。" }, { "type": "uint32_t", "name": "timeout_ms", "desc": "超时时间。" } ], "annotation": {}, "desc": "等待数据。", "name": "tk_istream_wait_for_data", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "tk_istream_t*", "name": "stream", "desc": "istream对象。" } ], "annotation": {}, "desc": "刷新数据。", "name": "tk_istream_flush", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "tk_istream_t*", "name": "stream", "desc": "istream对象。" }, { "type": "void*", "name": "buff", "desc": "返回数据的缓冲区。" }, { "type": "uint32_t", "name": "max_size", "desc": "缓冲区的大小。" }, { "type": "uint32_t", "name": "timeout_ms", "desc": "timeout." } ], "annotation": {}, "desc": "读取指定长度的数据。", "name": "tk_istream_read_len", "return": { "type": "int32_t", "desc": "返回负数表示读取失败,否则返回实际读取数据的长度。" } }, { "params": [ { "type": "tk_istream_t*", "name": "stream", "desc": "istream对象。" }, { "type": "void*", "name": "buff", "desc": "返回数据的缓冲区。" }, { "type": "uint32_t", "name": "max_size", "desc": "缓冲区的大小。" }, { "type": "uint32_t", "name": "timeout_ms", "desc": "timeout." } ], "annotation": {}, "desc": "读取一行数据。", "name": "tk_istream_read_line", "return": { "type": "int32_t", "desc": "返回负数表示读取失败,否则返回实际读取数据的长度。" } }, { "params": [ { "type": "tk_istream_t*", "name": "stream", "desc": "istream对象。" }, { "type": "str_t*", "name": "str", "desc": "返回数据的str对象。" } ], "annotation": {}, "desc": "读取一行数据。", "name": "tk_istream_read_line_str", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } } ], "events": [], "properties": [], "header": "tkc/istream.h", "desc": "输入流的接口。", "name": "tk_istream_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": [ { "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": "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": "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": "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 } }, { "name": "suspend", "desc": "定时器是否为挂起状态。", "type": "bool_t", "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 }, "desc": "创建calibration_win对象", "name": "calibration_win_create", "return": { "type": "widget_t*", "desc": "对象。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "widget对象。" }, { "type": "calibration_win_on_done_t", "name": "on_done", "desc": "回调函数。" }, { "type": "void*", "name": "ctx", "desc": "回调函数的上下文。" } ], "annotation": {}, "desc": "设置校准完成的处理函数。", "name": "calibration_win_set_on_done", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "widget对象。" }, { "type": "calibration_win_on_click_t", "name": "on_click", "desc": "回调函数。" }, { "type": "void*", "name": "ctx", "desc": "回调函数的上下文。" } ], "annotation": {}, "desc": "设置校准点击事件的处理函数。", "name": "calibration_win_set_on_click", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "calibration_win对象。" } ], "annotation": { "cast": true, "scriptable": true }, "desc": "转换为calibration_win对象(供脚本语言使用)。", "name": "calibration_win_cast", "return": { "type": "widget_t*", "desc": "calibration_win对象。" } } ], "events": [], "properties": [], "header": "widgets/calibration_win.h", "desc": "电阻屏校准窗口。\n\ncalibration\_win\_t是window\_base\_t的子类控件,\nwindow\_base\_t的函数均适用于calibration\_win\_t控件。\n\n在xml中使用"calibration\_win"标签创建电阻屏校准窗口。如:\n\nxml\n<calibration_win name=\"cali\" w=\"100%\" h=\"100%\" text=\"Please click the center of cross\">\n</calibration_win>\n\n\n> 更多用法请参考:\nwindow.xml\n\n在c代码中使用函数calibration\_win\_create创建窗口。如\n\nc\nwidget_t* win = calibration_win_create(NULL, 0, 0, 320, 480);\n\n\n通过calibration\_win\_set\_on\_done注册回调函数用于保存校准数据。", "name": "calibration_win_t", "parent": "window_base_t", "annotation": { "scriptable": true, "design": true, "widget": true, "window": 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": "创建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": "回调函数。" }, { "type": "combo_box_custom_on_layout_combobox_popup_t", "name": "on_layout_combobox_popup", "desc": "layout 的回调函数。" } ], "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的函数均适用于combo\_box\_t控件。\n\n在xml中使用"combo_box"标签创建下拉列表控件。\n\n列表选项可以直接写在"options"属性中。如:\n\nxml\n<combo_box readonly=\"true\" x=\"10\" y=\"bottom:5\" w=\"200\" h=\"30\" tr_text=\"ok\"\noptions=\"1:ok;2:cancel;\"/>\n\n\n列表选项也可以放在独立的窗口中用属性"open_window"指定窗口的名称。如:\n\nxml\n<combo_box open_window=\"language\" readonly=\"true\" x=\"10\" y=\"bottom:50\" w=\"200\" h=\"30\"\ntr_text=\"english\"/>\n\n\nlanguage.xml:\n\nxml\n<popup close_when_click_outside=\"true\" h=\"80\" >\n<list_view x=\"0\" y=\"0\" w=\"100%\" h=\"100%\" item_height=\"30\">\n<scroll_view name=\"view\" x=\"0\" y=\"0\" w=\"-12\" h=\"100%\">\n<combo_box_item tr_text=\"english\"/>\n<combo_box_item tr_text=\"chinese\" />\n</scroll_view>\n<scroll_bar_d name=\"bar\" x=\"right\" y=\"0\" w=\"12\" h=\"100%\" value=\"0\"/>\n</list_view>\n</popup>\n\n\n> 更多用法请参考:combo_box.xml\n\n\n\n如果在文本比较长时希望在获得焦点时文本自动滚动可以放入一个hscroll_label为子控件并命名为"value"。如:\n\nxml\n<combo_box left_margin=\"6\" readonly=\"true\" x=\"10\" y=\"50\" w=\"80\" h=\"30\" options=\"leftttttttttt;centerrrrrrrrrrrrrrrr;rightttttttttt;\"\nselected_index=\"1\">\n<hscroll_label x=\"0\" y=\"0\" w=\"-30\" h=\"100%\"\nname=\"value\"\nlull=\"1000\"\nloop=\"true\"\nyoyo=\"true\"\nellipses=\"true\"\nonly_parent_focus=\"true\"/>\n<button style=\"combobox_down\" x=\"right:5\" y=\"middle\" w=\"20\" h=\"20\"/>\n</combo_box>\n\n\n在c代码中使用函数combo\_box\_create创建下拉列表控件。如\n\nc\nwidget_t* combo_box = combo_box_create(win, 10, 10, 128, 30);\n\ncombo_box_set_options(combo_box, \"left;center;right;\");\ncombo_box_set_selected_index(combo_box, 1);\n\n\n\n创建之后\n\n* 用combo\_box\_set\_options设置可选项目。\n* 用combo\_box\_set\_selected\_index设置缺省项。\n\n> 完整示例请参考:combo_box\ndemo\n\n可用通过style来设置控件的显示风格如字体的大小和颜色等等。如\n\nxml\n<combo_box>\n<style name=\"default\" border_color=\"#a0a0a0\" text_color=\"black\" text_align_h=\"left\">\n<normal bg_color=\"#f0f0f0\" />\n<focused bg_color=\"#f0f0f0\" border_color=\"black\"/>\n<empty bg_color=\"#f0f0f0\" text_color=\"#a0a0a0\" />\n</style>\n</combo_box>\n\n\n* 1.combobox的下拉按钮的style名称为combobox_down可以在主题文件中设置。\n\nxml\n<button>\n<style name=\"combobox_down\" border_color=\"#a0a0a0\">\n<normal bg_color=\"#f0f0f0\" icon=\"arrow_down_n\"/>\n<pressed bg_color=\"#c0c0c0\" icon=\"arrow_down_p\"/>\n<over bg_color=\"#e0e0e0\" icon=\"arrow_down_o\"/>\n</style>\n</button>\n\n\n* 2.combobox的弹出popup窗口的style名称为combobox_popup可以在主题文件中设置。\n\nxml\n<popup>\n<style name=\"combobox_popup\" border_color=\"red\">\n<normal bg_color=\"#808080\"/>\n</style>\n</popup>\n\n\n> 更多用法请参考:theme\ndefault", "name": "combo_box_t", "parent": "edit_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": "创建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。\n\n如果要显示svg文件请用svg\_image。\n\n如果需要支持勾选效果请设置selectable属性。\n\n如果需要支持点击效果请设置clickable属性。\n\nimage\_t是image\_base\_t的子类控件image\_base\_t的函数均适用于image\_t控件。\n\n在xml中使用"image"标签创建图片控件。如:\n\nxml\n<image style=\"border\" image=\"earth\" draw_type=\"icon\" />\n\n\n> 更多用法请参考:\nimage.xml\n\n在c代码中使用函数image\_create创建图片控件。如\n\nc\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\n\n> 绘制方式的属性值和枚举值:\nimage\_draw\_type\_name\_value\n\n> 完整示例请参考:\nimage demo\n\n可用通过style来设置控件的显示风格如背景和边框等。如\n\nxml\n<image>\n<style name=\"border\">\n<normal border_color=\"#000000\" bg_color=\"#e0e0e0\" text_color=\"black\"/>\n</style>\n</image>\n\n\n> 更多用法请参考:\ntheme\ndefault", "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": "控件对象。" }, { "type": "bool_t", "name": "always_on_top", "desc": "是否总是在最上面。" } ], "annotation": { "scriptable": true }, "desc": "设置是否总是在最上面。", "name": "overlay_set_always_on_top", "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 } }, { "name": "always_on_top", "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的函数均适用于overlay\_t控件。\n\n在xml中使用"overlay"标签创建窗口。需要指定坐标和大小,可以指定主题和动画名称。如:\n\nxml\n<overlay theme=\"basic\" x=\"100\" y=\"100\" w=\"200\" h=\"300\">\n...\n</overlay>\n\n\n>\n更多用法请参考overlay.xml\n\n在c代码中使用函数overlay\_create创建窗口。如\n\nc\nwidget_t* overlay = overlay_create(NULL, 100, 100, 200, 300);\n\n\n> 完整示例请参考:overlay\ndemo\n\n可用通过style来设置窗口的风格如背景颜色或图片等。如\n\nxml\n<style name=\"bricks\">\n<normal bg_image=\"bricks\" bg_image_draw_type=\"repeat\"/>\n</style>\n\n\n> 更多用法请参考:theme\ndefault", "name": "overlay_t", "parent": "window_base_t", "annotation": { "scriptable": true, "design": true, "widget": true, "window": 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": "创建popup对象。", "name": "popup_create", "return": { "type": "widget_t*", "desc": "popup对象。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "popup对象。" } ], "annotation": { "cast": true, "scriptable": true }, "desc": "转换为popup对象(供脚本语言使用)。", "name": "popup_cast", "return": { "type": "widget_t*", "desc": "popup对象。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "bool_t", "name": "close_when_click", "desc": "点击时是否关闭窗口。" } ], "annotation": { "scriptable": true }, "desc": "设置点击时是否关闭窗口。", "name": "popup_set_close_when_click", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "bool_t", "name": "close_when_click_outside", "desc": "点击窗口外部时是否关闭窗口。" } ], "annotation": { "scriptable": true }, "desc": "设置点击窗口外部时是否关闭窗口。", "name": "popup_set_close_when_click_outside", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "uint32_t", "name": "close_when_timeout", "desc": "大于0时为定时器时间(ms),超时关闭窗口。" } ], "annotation": { "scriptable": true }, "desc": "设置超时关闭时间(ms)。", "name": "popup_set_close_when_timeout", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } } ], "events": [], "properties": [ { "name": "close_when_click", "desc": "点击时是否关闭窗口。", "type": "bool_t", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "persitent": true, "design": true, "scriptable": true } }, { "name": "close_when_click_outside", "desc": "点击到窗口外时是否关闭窗口。", "type": "bool_t", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "persitent": true, "design": true, "scriptable": true } }, { "name": "close_when_timeout", "desc": "超时后自动关闭窗口(ms)。", "type": "uint32_t", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "persitent": true, "design": true, "scriptable": true } } ], "header": "widgets/popup.h", "desc": "弹出窗口。\n\n弹出窗口是一种特殊的窗口大小和位置可以自由设置主要用来实现右键菜单和combo\_box的下列列表等功能。\n\npopup\_t是window\_base\_t的子类控件window\_base\_t的函数均适用于popup\_t控件。\n\n在xml中使用"popup"标签创建弹出窗口。如:\n\nxml\n<popup close_when_click_outside=\"true\" x=\"c\" y=\"m\" w=\"80%\" h=\"80\" >\n<list_view x=\"0\" y=\"0\" w=\"100%\" h=\"100%\" item_height=\"30\">\n<scroll_view name=\"view\" x=\"0\" y=\"0\" w=\"-12\" h=\"100%\">\n<combo_box_item tr_text=\"english\"/>\n<combo_box_item tr_text=\"chinese\" />\n</scroll_view>\n<scroll_bar_d name=\"bar\" x=\"right\" y=\"0\" w=\"12\" h=\"100%\" value=\"0\"/>\n</list_view>\n</popup>\n\n\n>\n更多用法请参考popup\n\n在c代码中使用函数popup\_create创建弹出窗口。如\n\nc\nwidget_t* win = popup_create(NULL, 0, 0, w, h);\npopup_set_close_when_click_outside(win, TRUE);\n\n\n> 创建之后,和使用普通窗口是一样的。\n\n> 完整示例请参考:combo_box.c\n\n可用通过style来设置控件的显示风格如字体的大小和颜色等等。如\n\nxml\n<popup>\n<style name=\"default\" border_color=\"#a0a0a0\">\n<normal bg_color=\"#f0f0f0\"/>\n</style>\n</popup>\n\n\n> 更多用法请参考:theme\ndefault", "name": "popup_t", "parent": "window_base_t", "annotation": { "scriptable": true, "design": true, "widget": true, "window": 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": "创建spin_box对象", "name": "spin_box_create", "return": { "type": "widget_t*", "desc": "对象。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "spin_box对象。" } ], "annotation": { "cast": true, "scriptable": true }, "desc": "转换为spin_box对象(供脚本语言使用)。", "name": "spin_box_cast", "return": { "type": "widget_t*", "desc": "spin_box对象。" } } ], "events": [], "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的函数均适用于spin\_box\_t控件。\n\n在xml中使用"spin_box"标签创建spinbox控件。如\n\nxml\n<spin_box w=\"70%\" input_type=\"int\" min=\"-100\" max=\"100\" step=\"5\">\n\n\n>\n更多用法请参考spin_box.xml\n\n在c代码中使用函数spin_box\_create创建spinbox控件。如\n\nc\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\n\n可用通过style来设置控件的显示风格如背景和边框等。如\n\nxml\n<spin_box>\n<style name=\"default\" border_color=\"#a0a0a0\" text_color=\"black\" text_align_h=\"left\">\n<normal bg_color=\"#f0f0f0\" />\n<focused bg_color=\"#f0f0f0\" border_color=\"black\"/>\n<disable bg_color=\"gray\" text_color=\"#d0d0d0\" />\n<error bg_color=\"#f0f0f0\" text_color=\"red\" />\n<empty bg_color=\"#f0f0f0\" text_color=\"#a0a0a0\" />\n</style>\n</spin_box>\n\n\n> 更多用法请参考:theme\ndefault", "name": "spin_box_t", "parent": "edit_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": "创建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的子类控件,\nwindow\_base\_t的函数均适用于system\_bar\_t控件。\n\n在xml中使用"system\_bar"标签创建system\_bar窗口。如\n\nxml\n<system_bar h=\"30\">\n<column x=\"0\" y=\"0\" w=\"-40\" h=\"100%\">\n<label style=\"title\" x=\"10\" y=\"m\" w=\"55%\" h=\"100%\" name=\"title\"/>\n<digit_clock style=\"time\" x=\"r\" y=\"m\" w=\"40%\" h=\"100%\" format=\"hh:mm\"/>\n</column>\n<button style=\"close\" x=\"r:5\" y=\"m\" w=\"26\" h=\"26\" name=\"close\" text=\"x\"/>\n</system_bar>\n\n\n> 更多用法请参考:\nsystem_bar\n\n在c代码中使用函数system\_bar\_create创建system\_bar窗口。如\n\nc\nwidget_t* win = system_bar_create(NULL, 0, 0, 320, 30);\n\n\n> 创建之后,和使用普通窗口是一样的。\n\n可用通过style来设置控件的显示风格如背景颜色等等。如\n\nxml\n<system_bar>\n<style name=\"default\">\n<normal bg_color=\"#a0a0a0\"/>\n</style>\n</system_bar>\n\n\n> 更多用法请参考:\nsystem_bar.xml", "name": "system_bar_t", "parent": "window_base_t", "annotation": { "scriptable": true, "design": true, "widget": true, "window": true }, "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": [], "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": [ { "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_ex对象", "name": "combo_box_ex_create", "return": { "type": "widget_t*", "desc": "对象。" } } ], "events": [], "properties": [], "header": "combo_box_ex/combo_box_ex.h", "desc": "可滚动的combo_box控件。", "name": "combo_box_ex_t", "parent": "combo_box_t", "annotation": { "scriptable": true, "design": true, "widget": true }, "level": 4 }, { "type": "class", "methods": [ { "params": [ { "type": "tk_istream_t*", "name": "real_istream", "desc": "实际的istream。" }, { "type": "uint32_t", "name": "buffer_size", "desc": "缓冲区的大小。" } ], "annotation": {}, "desc": "创建istream对象。\n\n本函数自动增加real_ostream的引用计数。", "name": "tk_istream_buffered_create", "return": { "type": "tk_istream_t*", "desc": "返回istream对象。" } } ], "events": [], "properties": [], "header": "buffered/istream_buffered.h", "desc": "缓冲输入流。\n\n如果调用者每次只读取少量数据可以使用本类对底层istream进行装饰以提高读取效率。", "name": "tk_istream_buffered_t", "parent": "tk_istream_t", "level": 4 }, { "type": "class", "methods": [ { "params": [ { "type": "tk_ostream_t*", "name": "real_ostream", "desc": "实际的ostream对象。" } ], "annotation": {}, "desc": "创建ostream对象。\n\n本函数自动增加real_ostream的引用计数。", "name": "tk_ostream_buffered_create", "return": { "type": "tk_ostream_t*", "desc": "返回ostream对象。" } }, { "params": [ { "type": "tk_ostream_t*", "name": "ostream", "desc": "ostream对象。" } ], "annotation": {}, "desc": "获取当前缓存数据的长度。", "name": "tk_ostream_buffered_get_size", "return": { "type": "uint32_t", "desc": "返回缓存数据的长度。" } } ], "events": [], "properties": [], "header": "buffered/ostream_buffered.h", "desc": "先将数据写入一个缓存区调用flush时才真正写入底层的ostream。", "name": "tk_ostream_buffered_t", "parent": "tk_ostream_t", "level": 4 }, { "type": "class", "methods": [ { "params": [ { "type": "const char*", "name": "filename", "desc": "文件名。" } ], "annotation": {}, "desc": "创建istream对象。", "name": "tk_istream_file_create", "return": { "type": "tk_istream_t*", "desc": "返回istream对象。" } } ], "events": [], "properties": [], "header": "file/istream_file.h", "desc": "基于文件实现的输入流。", "name": "tk_istream_file_t", "parent": "tk_istream_t", "level": 4 }, { "type": "class", "methods": [ { "params": [ { "type": "const char*", "name": "filename", "desc": "文件名。" } ], "annotation": {}, "desc": "创建ostream对象。", "name": "tk_ostream_file_create", "return": { "type": "tk_ostream_t*", "desc": "返回ostream对象。" } }, { "params": [ { "type": "const char*", "name": "filename", "desc": "文件名。" }, { "type": "const char*", "name": "mode", "desc": "模式。" } ], "annotation": {}, "desc": "创建ostream对象。", "name": "tk_ostream_file_create_ex", "return": { "type": "tk_ostream_t*", "desc": "返回ostream对象。" } } ], "events": [], "properties": [], "header": "file/ostream_file.h", "desc": "基于文件实现的输出流。", "name": "tk_ostream_file_t", "parent": "tk_ostream_t", "level": 4 }, { "type": "class", "methods": [ { "params": [ { "type": "int", "name": "sock", "desc": "socket。" } ], "annotation": {}, "desc": "创建iostream对象。", "name": "tk_iostream_tcp_create", "return": { "type": "tk_iostream_t*", "desc": "返回iostream对象。" } } ], "events": [], "properties": [], "header": "inet/iostream_tcp.h", "desc": "基于TCP实现的输入输出流。", "name": "tk_iostream_tcp_t", "parent": "tk_iostream_t", "level": 4 }, { "type": "class", "methods": [ { "params": [ { "type": "const char*", "name": "host", "desc": "服务器地址。" }, { "type": "int", "name": "port", "desc": "端口。" } ], "annotation": {}, "desc": "创建iostream对象(客户端)。", "name": "tk_iostream_udp_create_client", "return": { "type": "tk_iostream_t*", "desc": "返回iostream对象。" } }, { "params": [ { "type": "int", "name": "sock", "desc": "socket" } ], "annotation": {}, "desc": "创建iostream对象(客户端)。", "name": "tk_iostream_udp_create", "return": { "type": "tk_iostream_t*", "desc": "返回iostream对象。" } } ], "events": [], "properties": [], "header": "inet/iostream_udp.h", "desc": "基于UDP实现的输入输出流。", "name": "tk_iostream_udp_t", "parent": "tk_iostream_t", "level": 4 }, { "type": "class", "methods": [ { "params": [ { "type": "int", "name": "sock", "desc": "socket。" } ], "annotation": {}, "desc": "创建istream对象。", "name": "tk_istream_tcp_create", "return": { "type": "tk_istream_t*", "desc": "返回istream对象。" } } ], "events": [], "properties": [], "header": "inet/istream_tcp.h", "desc": "基于TCP实现的输入流。", "name": "tk_istream_tcp_t", "parent": "tk_istream_t", "level": 4 }, { "type": "class", "methods": [ { "params": [ { "type": "int", "name": "sock", "desc": "socket。" } ], "annotation": {}, "desc": "创建istream对象。", "name": "tk_istream_udp_create", "return": { "type": "tk_istream_t*", "desc": "返回istream对象。" } }, { "params": [ { "type": "tk_istream_t*", "name": "stream", "desc": "istream对象。" }, { "type": "const char*", "name": "host", "desc": "主机或IP。" }, { "type": "int", "name": "port", "desc": "端口。" } ], "annotation": {}, "desc": "设置目标。", "name": "tk_istream_udp_set_target_with_host", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "tk_istream_t*", "name": "stream", "desc": "istream对象。" }, { "type": "struct sockaddr_in", "name": "addr", "desc": "地址。" } ], "annotation": {}, "desc": "设置目标。", "name": "tk_istream_udp_set_target_with_addr", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } } ], "events": [], "properties": [], "header": "inet/istream_udp.h", "desc": "基于UDP实现的输入流。", "name": "tk_istream_udp_t", "parent": "tk_istream_t", "level": 4 }, { "type": "class", "methods": [ { "params": [ { "type": "int", "name": "sock", "desc": "socket." } ], "annotation": {}, "desc": "创建ostream对象。", "name": "tk_ostream_tcp_create", "return": { "type": "tk_ostream_t*", "desc": "返回ostream对象。" } } ], "events": [], "properties": [], "header": "inet/ostream_tcp.h", "desc": "基于TCP实现的输出流。", "name": "tk_ostream_tcp_t", "parent": "tk_ostream_t", "level": 4 }, { "type": "class", "methods": [ { "params": [ { "type": "int", "name": "sock", "desc": "socket." } ], "annotation": {}, "desc": "创建ostream对象。", "name": "tk_ostream_udp_create", "return": { "type": "tk_ostream_t*", "desc": "返回ostream对象。" } }, { "params": [ { "type": "tk_ostream_t*", "name": "stream", "desc": "ostream对象。" }, { "type": "const char*", "name": "host", "desc": "主机或IP。" }, { "type": "int", "name": "port", "desc": "端口。" } ], "annotation": {}, "desc": "设置目标。", "name": "tk_ostream_udp_set_target_with_host", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "tk_ostream_t*", "name": "stream", "desc": "ostream对象。" }, { "type": "struct sockaddr_in", "name": "addr", "desc": "地址。" } ], "annotation": {}, "desc": "设置目标。", "name": "tk_ostream_udp_set_target_with_addr", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } } ], "events": [], "properties": [], "header": "inet/ostream_udp.h", "desc": "基于UDP实现的输出流。", "name": "tk_ostream_udp_t", "parent": "tk_ostream_t", "level": 4 }, { "type": "class", "methods": [ { "params": [ { "type": "void*", "name": "buff_in", "desc": "输入流缓冲区。" }, { "type": "uint32_t", "name": "size_in", "desc": "输入流缓冲区大小。" }, { "type": "void*", "name": "buff_out", "desc": "输入流缓冲区。" }, { "type": "uoutt32_t", "name": "size_out", "desc": "输入流缓冲区大小。" }, { "type": "bool_t", "name": "own_the_buff", "desc": "是否让istream对象拥有buff。" } ], "annotation": {}, "desc": "创建iostream对象。", "name": "tk_iostream_mem_create", "return": { "type": "tk_iostream_t*", "desc": "返回iostream对象。" } } ], "events": [], "properties": [], "header": "mem/iostream_mem.h", "desc": "基于内存实现的输入输出流。", "name": "tk_iostream_mem_t", "parent": "tk_iostream_t", "level": 4 }, { "type": "class", "methods": [ { "params": [ { "type": "uint8_t*", "name": "buff", "desc": "返回数据的缓冲区。" }, { "type": "uint32_t", "name": "size", "desc": "缓冲区的大小。" }, { "type": "uint32_t", "name": "packet_size", "desc": "缺省一次读取的数据的长度。" }, { "type": "bool_t", "name": "own_the_buff", "desc": "是否让istream对象拥有buff。" } ], "annotation": {}, "desc": "创建istream对象。", "name": "tk_istream_mem_create", "return": { "type": "tk_istream_t*", "desc": "返回istream对象。" } } ], "events": [], "properties": [], "header": "mem/istream_mem.h", "desc": "基于内存实现的输入流。", "name": "tk_istream_mem_t", "parent": "tk_istream_t", "level": 4 }, { "type": "class", "methods": [ { "params": [ { "type": "uint8_t*", "name": "buff", "desc": "返回数据的缓冲区。" }, { "type": "uint32_t", "name": "size", "desc": "缓冲区的大小。" }, { "type": "uint32_t", "name": "packet_size", "desc": "缺省一次读取的数据的长度。" }, { "type": "bool_t", "name": "own_the_buff", "desc": "是否让ostream对象拥有buff。" } ], "annotation": {}, "desc": "创建ostream对象。", "name": "tk_ostream_mem_create", "return": { "type": "tk_ostream_t*", "desc": "返回ostream对象。" } } ], "events": [], "properties": [], "header": "mem/ostream_mem.h", "desc": "基于内存实现的输出流。", "name": "tk_ostream_mem_t", "parent": "tk_ostream_t", "level": 4 }, { "type": "class", "methods": [ { "params": [ { "type": "tk_ostream_t*", "name": "real_ostream", "desc": "实际的ostream对象。" } ], "annotation": {}, "desc": "创建ostream对象。\n\n本函数自动增加real_ostream的引用计数。", "name": "tk_ostream_retry_create", "return": { "type": "tk_ostream_t*", "desc": "返回ostream对象。" } }, { "params": [ { "type": "tk_ostream_t*", "name": "ostream", "desc": "ostream对象。" }, { "type": "uint32_t", "name": "max_retry_times", "desc": "最大尝试次数。" } ], "annotation": {}, "desc": "设置最大尝试次数。", "name": "tk_ostream_retry_set_max_retry_times", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "tk_ostream_t*", "name": "ostream", "desc": "ostream对象。" }, { "type": "uint32_t", "name": "max_buffer_size", "desc": "缓存大小。" } ], "annotation": {}, "desc": "设置最大缓存大小。", "name": "tk_ostream_retry_set_max_buffer_size", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "tk_ostream_t*", "name": "ostream", "desc": "ostream对象。" } ], "annotation": {}, "desc": "清除缓存的数据。", "name": "tk_ostream_retry_clear_buffer", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } }, { "params": [ { "type": "tk_ostream_t*", "name": "ostream", "desc": "ostream对象。" }, { "type": "data_discard_policy_t", "name": "discard_policy", "desc": "丢弃策略。" } ], "annotation": {}, "desc": "设置数据丢弃策略。", "name": "tk_ostream_retry_set_discard_policy", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } } ], "events": [], "properties": [ { "name": "pending_bytes", "desc": "待重写的数据大小。", "type": "uint32_t", "annotation": { "readable": true } }, { "name": "pending_packets", "desc": "待重写的数据包的个数。", "type": "uint32_t", "annotation": { "readable": true } }, { "name": "discard_bytes", "desc": "总共丢弃数据的字节数。", "type": "uint32_t", "annotation": { "readable": true } }, { "name": "discard_packets", "desc": "总共丢弃数据包的个数。", "type": "uint32_t", "annotation": { "readable": true } }, { "name": "max_retry_times", "desc": "尝试次数超过指定的值时丢弃该数据包。", "type": "uint32_t", "annotation": { "readable": true } }, { "name": "timeout", "desc": "写超时时间(ms)。", "type": "uint32_t", "annotation": { "readable": true } }, { "name": "discard_policy", "desc": "缓存不够时,丢弃数据包的策略。", "type": "data_discard_policy_t", "annotation": { "readable": true } } ], "header": "misc/ostream_retry.h", "desc": "如果写数据失败将数据放入ring_buffer后面再重试(flush)。\n\n如果重试次数超出最大值则丢掉数据。", "name": "tk_ostream_retry_t", "parent": "tk_ostream_t", "level": 4 }, { "type": "class", "methods": [ { "params": [ { "type": "tk_iostream_t*", "name": "real_iostream", "desc": "底层的iostream。" } ], "annotation": {}, "desc": "创建iostream对象。\n\n本函数自动增加real_iostream的引用计数。", "name": "tk_iostream_noisy_create", "return": { "type": "tk_iostream_t*", "desc": "返回iostream对象。" } } ], "events": [], "properties": [], "header": "noisy/iostream_noisy.h", "desc": "在输出流中注入错误,方便进行可靠性测试。", "name": "tk_iostream_noisy_t", "parent": "tk_iostream_t", "level": 4 }, { "type": "class", "methods": [ { "params": [ { "type": "tk_ostream_t*", "name": "real_ostream", "desc": "实际的ostream对象。" } ], "annotation": {}, "desc": "创建ostream对象。\n\n> 只能由iostream_noisy调用。", "name": "tk_ostream_noisy_create", "return": { "type": "tk_ostream_t*", "desc": "返回ostream对象。" } } ], "events": [], "properties": [ { "name": "error_level", "desc": "error level.", "type": "uint32_t" }, { "name": "error_count", "desc": "注入的错误数。", "type": "uint32_t" }, { "name": "write_count", "desc": "写入的次数。", "type": "uint32_t" } ], "header": "noisy/ostream_noisy.h", "desc": "在输出流中注入错误,方便进行可靠性测试。", "name": "tk_ostream_noisy_t", "parent": "tk_ostream_t", "level": 4 }, { "type": "class", "methods": [ { "params": [ { "type": "const char*", "name": "port", "desc": "port name。" } ], "annotation": {}, "desc": "创建iostream对象。\n> 缺省配置: baudrate=115200 bytesize=8 stopbits=1 flowcontrol=0 parity=0", "name": "tk_iostream_serial_create", "return": { "type": "tk_iostream_t*", "desc": "返回iostream对象。" } }, { "params": [ { "type": "tk_iostream_t*", "name": "iostream", "desc": "串口对象。" }, { "type": "int32_t", "name": "baudrate", "desc": "波特率。" }, { "type": "bytesize_t", "name": "bytesize", "desc": "字节位数。" }, { "type": "parity_t", "name": "parity", "desc": "奇偶校验。" }, { "type": "stopbits_t", "name": "stopbits", "desc": "停止位。" }, { "type": "flowcontrol_t", "name": "flowcontrol", "desc": "流控。" } ], "annotation": {}, "desc": "配置串口。", "name": "tk_iostream_serial_config", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功否则表示失败。" } } ], "events": [], "properties": [], "header": "serial/iostream_serial.h", "desc": "基于串口实现的输入输出流。", "name": "tk_iostream_serial_t", "parent": "tk_iostream_t", "level": 4 }, { "type": "class", "methods": [ { "params": [ { "type": "int", "name": "fd", "desc": "fd。" } ], "annotation": {}, "desc": "创建istream对象。", "name": "tk_istream_serial_create", "return": { "type": "tk_istream_t*", "desc": "返回istream对象。" } } ], "events": [], "properties": [], "header": "serial/istream_serial.h", "desc": "基于串口实现的输入流。", "name": "tk_istream_serial_t", "parent": "tk_istream_t", "level": 4 }, { "type": "class", "methods": [ { "params": [ { "type": "tk_iostream_t*", "name": "real_iostream", "desc": "底层的iostream。" } ], "annotation": {}, "desc": "创建iostream对象。\n\n本函数自动增加real_iostream的引用计数。", "name": "tk_iostream_shdlc_create", "return": { "type": "tk_iostream_t*", "desc": "返回iostream对象。" } } ], "events": [], "properties": [], "header": "shdlc/iostream_shdlc.h", "desc": "基于简化版的HDLC协议实现可靠的iostream。\n\n一般用于串口通信。", "name": "tk_iostream_shdlc_t", "parent": "tk_iostream_t", "level": 4 }, { "type": "class", "methods": [ { "params": [ { "type": "tk_iostream_shdlc_t*", "name": "iostream", "desc": "iostream对象。" } ], "annotation": {}, "desc": "创建istream对象。\n\n> 只能由iostream_shdlc调用。", "name": "tk_istream_shdlc_create", "return": { "type": "tk_istream_t*", "desc": "返回istream对象。" } } ], "events": [], "properties": [ { "name": "timeout", "desc": "读写超时时间(ms)", "type": "uint32_t" }, { "name": "retry_times", "desc": "失败重传次数。", "type": "uint32_t" } ], "header": "shdlc/istream_shdlc.h", "desc": "reliable istream base on simple HDLC", "name": "tk_istream_shdlc_t", "parent": "tk_istream_t", "level": 4 }, { "type": "class", "methods": [ { "params": [ { "type": "tk_iostream_shdlc_t*", "name": "iostream", "desc": "iostream对象。" } ], "annotation": {}, "desc": "创建ostream对象。\n\n> 只能由iostream_shdlc调用。", "name": "tk_ostream_shdlc_create", "return": { "type": "tk_ostream_t*", "desc": "返回ostream对象。" } } ], "events": [], "properties": [ { "name": "timeout", "desc": "读写超时时间(ms)", "type": "uint32_t" }, { "name": "retry_times", "desc": "失败重传次数。", "type": "uint32_t" }, { "name": "compress_threshold", "desc": "激活压缩的阈值。", "type": "uint32_t" } ], "header": "shdlc/ostream_shdlc.h", "desc": "reliable ostream base on simple HDLC", "name": "tk_ostream_shdlc_t", "parent": "tk_ostream_t", "level": 4 } ]