[ { "params": [], "annotation": { "global": true, "scriptable": true }, "desc": " 初始化AWTK扩展控件。\r\n\r\n", "name": "tk_ext_widgets_init", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" }, "type": "method", "header": "ext_widgets/ext_widgets.h", "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": {}, "desc": " 初始化TK。\r\n\r\n", "name": "tk_init", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" } }, { "params": [], "annotation": {}, "desc": " 进入TK事件主循环。\r\n\r\n", "name": "tk_run", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" } }, { "params": [], "annotation": { "static": true, "scriptable": true }, "desc": " 退出TK事件主循环。\r\n\r\n", "name": "tk_quit", "alias": "global_quit", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" } }, { "params": [], "annotation": { "static": true, "scriptable": true }, "desc": " 获取全局指针的X坐标。\r\n\r\n", "name": "tk_get_pointer_x", "alias": "global_get_pointer_x", "return": { "type": "int32_t", "desc": "返回全局指针的X坐标。" } }, { "params": [], "annotation": { "static": true, "scriptable": true }, "desc": " 获取全局指针的Y坐标。\r\n\r\n", "name": "tk_get_pointer_y", "alias": "global_get_pointer_y", "return": { "type": "int32_t", "desc": "返回全局指针的X坐标。" } }, { "params": [], "annotation": { "static": true, "scriptable": true }, "desc": " 获取全局指针是否按下。\r\n\r\n", "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度)。\r\n\r\n", "name": "tk_set_lcd_orientation", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" } }, { "params": [], "annotation": { "private": true }, "desc": " 初始化资源。\r\n\r\n", "name": "tk_init_assets", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" } } ], "events": [], "properties": [], "header": "src/awtk_global.h", "desc": " TK全局对象。\r\n", "name": "global_t", "annotation": { "scriptable": true, "fake": 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": " 初始化,系统内部调用。\r\n\r\n\r\n", "name": "canvas_init", "return": { "type": "canvas_t*", "desc": "返回canvas对象本身。" } }, { "params": [ { "type": "canvas_t*", "name": "c", "desc": "canvas对象。" } ], "annotation": { "scriptable": true }, "desc": " 获取画布的宽度。\r\n\r\n\r\n\r\n", "name": "canvas_get_width", "return": { "type": "wh_t", "desc": "返回画布的宽度。" } }, { "params": [ { "type": "canvas_t*", "name": "c", "desc": "canvas对象。" } ], "annotation": { "scriptable": true }, "desc": " 获取画布的高度。\r\n\r\n\r\n\r\n", "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": " 获取裁剪区。\r\n\r\n\r\n", "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": " 设置裁剪区。\r\n\r\n\r\n", "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": " 设置裁剪区。\r\n\r\n\r\n", "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": " 设置填充颜色。\r\n\r\n\r\n", "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": " 设置文本颜色。\r\n\r\n\r\n", "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": " 设置线条颜色。\r\n\r\n\r\n", "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": " 设置填充颜色。\r\n\r\n > 供脚本语言使用。\r\n\r\n\r\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": " 设置文本颜色。\r\n\r\n > 供脚本语言使用。\r\n\r\n\r\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": " 设置线条颜色。\r\n\r\n > 供脚本语言使用。\r\n\r\n\r\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值。\r\n\r\n\r\n", "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": " 平移原点坐标。\r\n\r\n\r\n", "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": " 反向平移原点坐标。\r\n\r\n\r\n", "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": " 画垂直线。\r\n\r\n\r\n", "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": " 画水平线。\r\n\r\n\r\n", "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": " 画多个点。\r\n\r\n\r\n", "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": " 填充矩形。\r\n\r\n\r\n", "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": " 绘制矩形。\r\n\r\n\r\n", "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": " 设置字体。\r\n\r\n\r\n", "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": " 设置文本对齐方式。\r\n\r\n\r\n", "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": " 计算文本所占的宽度。\r\n\r\n\r\n", "name": "canvas_measure_text", "return": { "type": "float_t", "desc": "返回文本所占的宽度。" } }, { "params": [ { "type": "canvas_t*", "name": "c", "desc": "canvas对象。" }, { "type": "const char*", "name": "str", "desc": "字符串。" } ], "annotation": { "scriptable": true }, "desc": " 计算文本所占的宽度。\r\n\r\n > 供脚本语言使用。\r\n\r\n\r\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": " 绘制文本。\r\n\r\n\r\n", "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": " 绘制文本。\r\n\r\n > 供脚本语言使用。\r\n\r\n\r\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": " 绘制文本。\r\n\r\n\r\n", "name": "canvas_draw_text_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": " 绘制文本。\r\n\r\n > 供脚本语言使用。\r\n\r\n\r\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": " 绘制图标。\r\n\r\n\r\n", "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": "rect_t*", "name": "src", "desc": "源区域。" }, { "type": "rect_t*", "name": "dst", "desc": "目的区域。" } ], "annotation": { "scriptable": true }, "desc": " 绘制图片。\r\n\r\n\r\n", "name": "canvas_draw_image", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" } }, { "params": [ { "type": "canvas_t*", "name": "c", "desc": "canvas对象。" } ], "annotation": { "scriptable": true }, "desc": " 获取vgcanvas对象。\r\n\r\n\r\n", "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对象(供脚本语言使用)。\r\n\r\n", "name": "canvas_cast", "return": { "type": "canvas_t*", "desc": "canvas对象。" } }, { "params": [ { "type": "canvas_t*", "name": "c", "desc": "canvas对象。" } ], "annotation": { "scriptable": true }, "desc": " 释放相关资源。\r\n\r\n\r\n", "name": "canvas_reset", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" } } ], "events": [], "properties": [ { "name": "ox", "desc": " x坐标偏移。\r\n", "type": "xy_t", "annotation": { "readable": true, "scriptable": true } }, { "name": "oy", "desc": " y坐标偏移。\r\n", "type": "xy_t", "annotation": { "readable": true, "scriptable": true } } ], "header": "base/canvas.h", "desc": " canvas类。\r\n", "name": "canvas_t", "annotation": { "scriptable": true }, "level": 1 }, { "type": "class", "methods": [ { "params": [], "annotation": { "constructor": true }, "desc": " 获取缺省的子控件布局算法工厂对象。\r\n", "name": "children_layouter_factory", "return": { "type": "children_layouter_factory_t*", "desc": "返回子控件布局算法工厂对象。" } }, { "params": [ { "type": "children_layouter_factory_t*", "name": "factory", "desc": "子控件布局算法工厂对象。" } ], "annotation": {}, "desc": " 设置缺省的子控件布局算法工厂对象。\r\n\r\n", "name": "children_layouter_factory_set", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" } }, { "params": [], "annotation": { "constructor": true }, "desc": " 创建子控件布局算法工厂对象。\r\n\r\n", "name": "children_layouter_factory_create", "return": { "type": "children_layouter_factory_t*", "desc": "返回子控件布局算法工厂对象。" } }, { "params": [ { "type": "children_layouter_factory_t*", "name": "factory", "desc": "highlighter工厂对象。" }, { "type": "const char*", "name": "type", "desc": "子控件布局算法类型。" }, { "type": "children_layouter_create_t", "name": "create", "desc": "子控件布局算法创建函数。" } ], "annotation": {}, "desc": " 注册子控件布局算法创建函数。\r\n\r\n", "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": " 创建指定类型的子控件布局算法对象。\r\n\r\n", "name": "children_layouter_factory_create_layouter", "return": { "type": "children_layouter_t*", "desc": "返回窗口动画对象。" } }, { "params": [ { "type": "children_layouter_factory_t*", "name": "factory", "desc": "子控件布局算法工厂对象。" } ], "annotation": {}, "desc": " 析构并释放子控件布局算法工厂对象。\r\n\r\n", "name": "children_layouter_factory_destroy", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" } } ], "events": [], "properties": [], "header": "base/children_layouter_factory.h", "desc": " 子控件布局算法工厂。\r\n\r\n", "name": "children_layouter_factory_t", "level": 1 }, { "type": "class", "methods": [ { "params": [ { "type": "children_layouter_t*", "name": "layouter", "desc": "layouter对象。" } ], "annotation": {}, "desc": " 获取全部参数。\r\n\r\n", "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": " 对控件的子控件进行布局。\r\n\r\n\r\n", "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": " 获取指定的参数。\r\n\r\n\r\n", "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": " 获取指定的参数。\r\n\r\n\r\n", "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": " 设置字符串格式的参数。\r\n\r\n\r\n", "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": " 获取指定的浮点格式的参数。\r\n\r\n\r\n", "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": " 获取指定的整数格式的参数。\r\n\r\n\r\n", "name": "children_layouter_get_param_int", "return": { "type": "ret_t", "desc": "成功返回参数的值,失败返回缺省值。" } }, { "params": [ { "type": "children_layouter_t*", "name": "layouter", "desc": "layouter对象。" } ], "annotation": {}, "desc": " 判断layouter对象是否有效。\r\n\r\n\r\n", "name": "children_layouter_is_valid", "return": { "type": "bool_t", "desc": "返回TRUE表示有效,否则表示无效。" } }, { "params": [ { "type": "children_layouter_t*", "name": "layouter", "desc": "layouter对象。" } ], "annotation": {}, "desc": " 销毁layouter对象。\r\n\r\n\r\n", "name": "children_layouter_destroy", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" } }, { "params": [ { "type": "const char*", "name": "params", "desc": "参数。" } ], "annotation": {}, "desc": " 创建layouter对象。\r\n\r\n", "name": "children_layouter_create", "return": { "type": "children_layouter_t*", "desc": "返回layouter对象。" } } ], "events": [], "properties": [], "header": "base/children_layouter.h", "desc": " 子控件排版布局器的接口。\r\n\r\n 按特定算法对子控件进行排版布局,子类需要实现vtable中的函数。\r\n\r\n", "name": "children_layouter_t", "level": 1 }, { "type": "enum", "desc": " 剪切板数据类型定义。\r\n", "consts": [ { "desc": " 无数据。\r\n", "name": "CLIP_BOARD_DATA_TYPE_NONE" }, { "desc": " UTF8文本。\r\n", "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": " 获取缺省的剪切板对象。\r\n\r\n", "name": "clip_board", "alias": "clip_board_instance", "return": { "type": "ret_t", "desc": "返回缺省剪切板对象。" } }, { "params": [ { "type": "clip_board_t*", "name": "cl", "desc": "剪切板对象。" } ], "annotation": {}, "desc": " 设置缺省的剪切板对象。\r\n\r\n", "name": "clip_board_set", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" } }, { "params": [ { "type": "clip_board_t*", "name": "cl", "desc": "剪切板对象。" } ], "annotation": {}, "desc": " 清空剪切板中的数据。\r\n\r\n", "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": " 设置数据到剪切板中。\r\n\r\n", "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": " 从剪切板中获取数据。\r\n\r\n", "name": "clip_board_get_data", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" } }, { "params": [ { "type": "clip_board_t*", "name": "cl", "desc": "剪切板对象。" } ], "annotation": {}, "desc": " 销毁剪切板对象。\r\n\r\n", "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)数据到剪切板。\r\n\r\n", "name": "clip_board_set_text", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" } }, { "params": [], "annotation": { "static": true, "scriptable": true }, "desc": " 从剪切板中获取文本(UTF8)数据。\r\n\r\n", "name": "clip_board_get_text", "return": { "type": "const char*", "desc": "返回文本数据。" } } ], "events": [], "properties": [], "header": "base/clip_board.h", "desc": " 剪切板接口。\r\n", "name": "clip_board_t", "annotation": { "scriptable": true }, "level": 1 }, { "type": "class", "methods": [ { "params": [], "annotation": { "constructor": true }, "desc": " 获取缺省的对话框高亮策略工厂对象。\r\n", "name": "dialog_highlighter_factory", "return": { "type": "dialog_highlighter_factory_t*", "desc": "返回对话框高亮策略工厂对象。" } }, { "params": [ { "type": "dialog_highlighter_factory_t*", "name": "factory", "desc": "对话框高亮策略工厂对象。" } ], "annotation": {}, "desc": " 设置缺省的对话框高亮策略工厂对象。\r\n\r\n", "name": "dialog_highlighter_factory_set", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" } }, { "params": [], "annotation": { "constructor": true }, "desc": " 创建对话框高亮策略工厂对象。\r\n\r\n", "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": " 注册对话框高亮策略创建函数。\r\n\r\n", "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": " 创建指定类型的对话框高亮策略对象。\r\n\r\n", "name": "dialog_highlighter_factory_create_highlighter", "return": { "type": "dialog_highlighter_t*", "desc": "返回窗口动画对象。" } }, { "params": [ { "type": "dialog_highlighter_factory_t*", "name": "factory", "desc": "对话框高亮策略工厂对象。" } ], "annotation": {}, "desc": " 析构并释放对话框高亮策略工厂对象。\r\n\r\n", "name": "dialog_highlighter_factory_destroy", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" } } ], "events": [], "properties": [], "header": "base/dialog_highlighter_factory.h", "desc": " 对话框高亮策略工厂。\r\n\r\n", "name": "dialog_highlighter_factory_t", "level": 1 }, { "type": "enum", "desc": " @type string\r\n 内置的对话框高亮策略。\r\n", "consts": [ { "desc": " 缺省的对话框高亮策略。\r\n", "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": " 创建对话框高亮策略对象。\r\n\r\n>供子类构造函数用。\r\n\r\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": "背景截图。" }, { "type": "framebuffer_object_t*", "name": "fbo", "desc": "fbo对象。" } ], "annotation": {}, "desc": " 设置背景图片。\r\n\r\n", "name": "dialog_highlighter_set_bg", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" } }, { "params": [ { "type": "dialog_highlighter_t*", "name": "h", "desc": "对话框高亮策略对象。" }, { "type": "canvas_t*", "name": "c", "desc": "画布。" } ], "annotation": {}, "desc": " 初始化。在绘制完背景,在截图前调用。\r\n\r\n", "name": "dialog_highlighter_prepare", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" } }, { "params": [ { "type": "dialog_highlighter_t*", "name": "h", "desc": "对话框高亮策略对象。" }, { "type": "float_t", "name": "percent", "desc": "动画进度(0-1),1表示打开已经完成。" } ], "annotation": {}, "desc": " 绘制背景。\r\n\r\n", "name": "dialog_highlighter_draw", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" } }, { "params": [ { "type": "dialog_highlighter_t*", "name": "h", "desc": "对话框高亮策略对象。" } ], "annotation": {}, "desc": " 是否是动态绘制(方便外层优化)。\r\n\r\n", "name": "dialog_highlighter_is_dynamic", "return": { "type": "bool_t", "desc": "返回TRUE表示动态绘制,否则表示不是动态绘制。" } }, { "params": [ { "type": "dialog_highlighter_t*", "name": "h", "desc": "对话框高亮策略对象。" } ], "annotation": {}, "desc": " 销毁对话框高亮策略对象。\r\n\r\n", "name": "dialog_highlighter_destroy", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" } } ], "events": [], "properties": [ { "name": "img", "desc": " 底层窗口的截图。\r\n", "type": "bitmap_t" }, { "name": "canvas", "desc": " 画布。\r\n", "type": "canvas_t*" }, { "name": "dialog", "desc": " 对应的对话框。\r\n", "type": "widget_t*" } ], "header": "base/dialog_highlighter.h", "desc": " 对话框高亮策略。\r\n\r\n> 高亮策略的基本思路是对背景进行处理,比如将背景变暗或变模糊。\r\n\r\n", "name": "dialog_highlighter_t", "level": 1 }, { "type": "enum", "desc": " 类型常量定义。\r\n", "consts": [ { "desc": " 指针按下事件名(pointer_event_t)。\r\n", "name": "EVT_POINTER_DOWN" }, { "desc": " 指针按下事件名,在子控件处理之前触发(pointer_event_t)。\r\n", "name": "EVT_POINTER_DOWN_BEFORE_CHILDREN" }, { "desc": " 指针移动事件名(pointer_event_t)。\r\n", "name": "EVT_POINTER_MOVE" }, { "desc": " 指针移动事件名,在子控件处理之前触发(pointer_event_t)。\r\n", "name": "EVT_POINTER_MOVE_BEFORE_CHILDREN" }, { "desc": " 指针抬起事件名(pointer_event_t)。\r\n", "name": "EVT_POINTER_UP" }, { "desc": " 指针抬起事件名,在子控件处理之前触发(pointer_event_t)。\r\n", "name": "EVT_POINTER_UP_BEFORE_CHILDREN" }, { "desc": " 滚轮事件名(pointer_event_t)。\r\n", "name": "EVT_WHEEL" }, { "desc": " 鼠标滚轮事件名,在子控件处理之前触发(key_event_t)。\r\n", "name": "EVT_WHEEL_BEFORE_CHILDREN" }, { "desc": " 取消前一个指针按下事件名(pointer_event_t)。\r\n", "name": "EVT_POINTER_DOWN_ABORT" }, { "desc": " 右键/长按弹出上下文菜单的事件名(pointer_event_t)。\r\n", "name": "EVT_CONTEXT_MENU" }, { "desc": " 指针进入事件名(pointer_event_t)。\r\n", "name": "EVT_POINTER_ENTER" }, { "desc": " 指针离开事件名(pointer_event_t)。\r\n", "name": "EVT_POINTER_LEAVE" }, { "desc": " 长按事件名(pointer_event_t)。\r\n", "name": "EVT_LONG_PRESS" }, { "desc": " 点击事件名(pointer_event_t)。\r\n", "name": "EVT_CLICK" }, { "desc": " 得到焦点事件名(event_t)。\r\n", "name": "EVT_FOCUS" }, { "desc": " 失去焦点事件名(event_t)。\r\n", "name": "EVT_BLUR" }, { "desc": " 键按下事件名(key_event_t)。\r\n", "name": "EVT_KEY_DOWN" }, { "desc": " 键按下事件名,在子控件处理之前触发(key_event_t)。\r\n", "name": "EVT_KEY_DOWN_BEFORE_CHILDREN" }, { "desc": " 按键repeat事件名(key_event_t)。\r\n", "name": "EVT_KEY_REPEAT" }, { "desc": " 键抬起事件名(key_event_t)。\r\n", "name": "EVT_KEY_UP" }, { "desc": " 键抬起事件名,在子控件处理之前触发(key_event_t)。\r\n", "name": "EVT_KEY_UP_BEFORE_CHILDREN" }, { "desc": " 即将移动Widget的事件名(event_t)。\r\n", "name": "EVT_WILL_MOVE" }, { "desc": " 移动Widget的事件名(event_t)。\r\n", "name": "EVT_MOVE" }, { "desc": " 即将调整Widget大小的事件名(event_t)。\r\n", "name": "EVT_WILL_RESIZE" }, { "desc": " 调整Widget大小的事件名(event_t)。\r\n", "name": "EVT_RESIZE" }, { "desc": " 即将调整Widget大小/位置的事件名(event_t)。\r\n", "name": "EVT_WILL_MOVE_RESIZE" }, { "desc": " 调整Widget大小/位置的事件名(event_t)。\r\n", "name": "EVT_MOVE_RESIZE" }, { "desc": " 控件的值即将改变的事件名(event_t)。\r\n", "name": "EVT_VALUE_WILL_CHANGE" }, { "desc": " 控件的值改变的事件名(event_t)。\r\n", "name": "EVT_VALUE_CHANGED" }, { "desc": " 控件的值持续改变(如编辑器正在编辑)的事件名(event_t)。\r\n", "name": "EVT_VALUE_CHANGING" }, { "desc": " 绘制的事件名(paint_event_t)。\r\n", "name": "EVT_PAINT" }, { "desc": " 即将绘制的事件名(paint_event_t)。\r\n", "name": "EVT_BEFORE_PAINT" }, { "desc": " 绘制完成的事件名(paint_event_t)。\r\n", "name": "EVT_AFTER_PAINT" }, { "desc": " 绘制完成(canvas状态已经恢复)的事件名(paint_event_t)。\r\n", "name": "EVT_PAINT_DONE" }, { "desc": " locale改变的事件(event_t)。\r\n", "name": "EVT_LOCALE_CHANGED" }, { "desc": " 控件动画开始事件(event_t)。\r\n", "name": "EVT_ANIM_START" }, { "desc": " 控件动画被主动停止的事件(event_t)。\r\n", "name": "EVT_ANIM_STOP" }, { "desc": " 控件动画被暂停的事件(event_t)。\r\n", "name": "EVT_ANIM_PAUSE" }, { "desc": " 控件动画yoyo/repeat时,完成一次的事件(event_t)。\r\n", "name": "EVT_ANIM_ONCE" }, { "desc": " 控件动画完成事件(event_t)。\r\n", "name": "EVT_ANIM_END" }, { "desc": " 窗口加载完成事件(event_t)。\r\n", "name": "EVT_WINDOW_LOAD" }, { "desc": " 窗口即将打开事件(event_t)。\r\n 如果有窗口动画,在窗口动画开始前触发。如果没有窗口动画,在窗口被加载后的下一次循环中触发。\r\n", "name": "EVT_WINDOW_WILL_OPEN" }, { "desc": " 窗口打开事件(event_t)。\r\n 如果有窗口动画,在窗口动画完成时触发。如果没有窗口动画,在窗口被加载后的下一次循环中触发。\r\n", "name": "EVT_WINDOW_OPEN" }, { "desc": " 窗口被切换到后台事件(event_t)。\r\n 打开新窗口时,当前窗口被切换到后台时,对当前窗口触发本事件。\r\n", "name": "EVT_WINDOW_TO_BACKGROUND" }, { "desc": " 窗口被切换到前台事件(event_t)。\r\n 关闭当前窗口时,前一个窗口被切换到前台时,对前一个窗口触发本事件。\r\n", "name": "EVT_WINDOW_TO_FOREGROUND" }, { "desc": " 窗口关闭事件。\r\n", "name": "EVT_WINDOW_CLOSE" }, { "desc": " 请求关闭窗口的事件(event_t)。\r\n", "name": "EVT_REQUEST_CLOSE_WINDOW" }, { "desc": " 顶层窗口改变的事件(window_event_t)。\r\n", "name": "EVT_TOP_WINDOW_CHANGED" }, { "desc": " 输入法提交输入的文本事件(im_commit_event_t)。\r\n", "name": "EVT_IM_COMMIT" }, { "desc": " 输入法请求显示候选字事件(im_candidates_event_t)。\r\n", "name": "EVT_IM_SHOW_CANDIDATES" }, { "desc": " 软键盘Action点击事件(event_t)。\r\n", "name": "EVT_IM_ACTION" }, { "desc": " 请求更新软键盘上的Action按钮的信息(im_action_button_info_event_t)。\r\n", "name": "EVT_IM_ACTION_INFO" }, { "desc": " 开始拖动(event_t)。\r\n", "name": "EVT_DRAG_START" }, { "desc": " 拖动(event_t)。\r\n", "name": "EVT_DRAG" }, { "desc": " 结束拖动(event_t)。\r\n", "name": "EVT_DRAG_END" }, { "desc": " 在指定的时间内(WITH_SCREEN_SAVER_TIME),没有用户输入事件,由窗口管理器触发。\r\n", "name": "EVT_SCREEN_SAVER" }, { "desc": " 内存不足(event_t)。\r\n", "name": "EVT_LOW_MEMORY" }, { "desc": " 内存耗尽(event_t)。\r\n", "name": "EVT_OUT_OF_MEMORY" }, { "desc": " 屏幕即将旋转(event_t)。\r\n", "name": "EVT_ORIENTATION_WILL_CHANGED" }, { "desc": " 屏幕旋转(event_t)。\r\n", "name": "EVT_ORIENTATION_CHANGED" }, { "desc": " 控件创建事件(event_t)。\r\n", "name": "EVT_WIDGET_CREATED" }, { "desc": " 请求退出应用程序事件。\r\n 点击原生窗口关闭按钮时,通过窗口管理器触发,注册该事件并返回RET_STOP,可以阻止窗口关闭。\r\n", "name": "EVT_REQUEST_QUIT_APP" }, { "desc": " 主题变化(event_t)。\r\n", "name": "EVT_THEME_CHANGED" }, { "desc": " event queue其它请求编号起始值。\r\n", "name": "EVT_REQ_START" }, { "desc": " 用户定义事件起始值。\r\n", "name": "EVT_USER_START" } ], "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": " 加载字体。\r\n\r\n\r\n", "name": "font_loader_load", "return": { "type": "font_t*", "desc": "成功返回font,失败返回NULL。" } } ], "events": [], "properties": [], "header": "base/font_loader.h", "desc": " 字体加载接口。\r\n", "name": "font_loader_t", "level": 1 }, { "type": "class", "methods": [ { "params": [], "annotation": { "constructor": true }, "desc": " 获取缺省的字体管理器。\r\n", "name": "font_manager", "return": { "type": "font_manager_t*", "desc": "返回字体管理器对象。" } }, { "params": [ { "type": "font_manager_t*", "name": "fm", "desc": "字体管理器对象。" } ], "annotation": {}, "desc": " 设置缺省的字体管理器。\r\n\r\n", "name": "font_manager_set", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" } }, { "params": [ { "type": "font_loader_t*", "name": "loader", "desc": "字体加载器。" } ], "annotation": { "constructor": true }, "desc": " 创建字体管理器。\r\n\r\n", "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": " 初始化字体管理器。\r\n\r\n", "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": " 设置资源管理器对象\r\n\r\n 之所以需要设置资源管理器对象,而不是使用缺省的资源管理器对象,是因为在designer中有两个字体管理器:\r\n\r\n * 一个用于designer本身加载字体。\r\n\r\n * 一个用于被设计的窗口加载字体。\r\n\r\n这两个字体管理器需要从不同的路径加载资源。\r\n\r\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": " 向缓存中加入字体。\r\n\r\n", "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": " 从缓存中查找字体,如果没找到,再加载字体,并缓存。\r\n\r\n", "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": " 卸载指定的字体。\r\n\r\n", "name": "font_manager_unload_font", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" } }, { "params": [ { "type": "font_manager_t*", "name": "fm", "desc": "字体管理器对象。" } ], "annotation": { "scriptable": true }, "desc": " 卸载全部字体。\r\n\r\n", "name": "font_manager_unload_all", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" } }, { "params": [ { "type": "font_manager_t*", "name": "fm", "desc": "字体管理器对象。" } ], "annotation": {}, "desc": " 析构字体管理器。\r\n\r\n", "name": "font_manager_deinit", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" } }, { "params": [ { "type": "font_manager_t*", "name": "fm", "desc": "字体管理器对象。" } ], "annotation": {}, "desc": " 析构并释放字体管理器。\r\n\r\n", "name": "font_manager_destroy", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" } } ], "events": [], "properties": [ { "name": "loader", "desc": " 字体加载器。\r\n", "type": "font_loader_t*", "annotation": { "private": true } }, { "name": "assets_manager", "desc": " 资源管理器。\r\n", "type": "assets_manager_t*", "annotation": { "private": true } } ], "header": "base/font_manager.h", "desc": " 字体管理器,负责字体的加载和缓存管理。\r\n (如果使用nanovg,字体由nanovg内部管理)\r\n", "name": "font_manager_t", "annotation": { "scriptable": true }, "level": 1 }, { "type": "enum", "desc": " 字模格式常量定义。\r\n", "consts": [ { "desc": " 每个像素占用1个字节(缺省)。\r\n", "name": "GLYPH_FMT_ALPHA" }, { "desc": " 每个像素占用1个比特。\r\n", "name": "GLYPH_FMT_MONO" }, { "desc": " 每个像素占用4个字节。\r\n", "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对象。\r\n\r\n", "name": "glyph_create", "return": { "type": "glyph_t*", "desc": "glyph对象。" } }, { "params": [], "annotation": { "constructor": true }, "desc": " 克隆glyph对象。\r\n\r\n", "name": "glyph_clone", "return": { "type": "glyph_t*", "desc": "glyph对象。" } }, { "params": [ { "type": "glyph_t*", "name": "glyph", "desc": "glyph对象。" } ], "annotation": { "deconstructor": true }, "desc": " 销毁glyph对象。\r\n\r\n", "name": "glyph_destroy", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" } } ], "events": [], "properties": [ { "name": "x", "desc": " x坐标。\r\n", "type": "int16_t", "annotation": { "readable": true } }, { "name": "y", "desc": " y坐标。\r\n", "type": "int16_t", "annotation": { "readable": true } }, { "name": "w", "desc": " 宽度。\r\n", "type": "uint16_t", "annotation": { "readable": true } }, { "name": "h", "desc": " 高度。\r\n", "type": "uint16_t", "annotation": { "readable": true } }, { "name": "advance", "desc": " 占位宽度。\r\n", "type": "uint16_t", "annotation": { "readable": true } }, { "name": "format", "desc": " 格式。\r\n", "type": "uint8_t", "annotation": { "readable": true } }, { "name": "pitch", "desc": " pitch。\r\n", "type": "uint8_t", "annotation": { "readable": true } }, { "name": "data", "desc": " 数据。\r\n", "type": "const uint8_t*", "annotation": { "readable": true } } ], "header": "base/font.h", "desc": " 代表一个字符的字模。\r\n\r\n", "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": " 获取字体的高度信息。\r\n\r\n", "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": " 检查当前字体是否与指定名称和大小相匹配。\r\n\r\n\r\n", "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": " 获取指定字符和大小的字模。\r\n\r\n\r\n", "name": "font_get_glyph", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" } }, { "params": [ { "type": "font_t*", "name": "font", "desc": "font对象。" } ], "annotation": { "deconstructor": true }, "desc": " 销毁font对象。\r\n\r\n", "name": "font_destroy", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" } } ], "events": [], "properties": [], "header": "base/font.h", "desc": " 代表一种字体。\r\n\r\n", "name": "font_t", "level": 1 }, { "type": "class", "methods": [ { "params": [ { "type": "bitmap_t*", "name": "fb", "desc": "framebuffer对象。" }, { "type": "rect_t*", "name": "dst", "desc": "要填充的目标区域。" }, { "type": "color_t", "name": "c", "desc": "颜色。" } ], "annotation": {}, "desc": " 用颜色填充指定的区域。\r\n\r\n", "name": "g2d_fill_rect", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败,返回失败则上层用软件实现。" } }, { "params": [ { "type": "bitmap_t*", "name": "fb", "desc": "framebuffer对象。" }, { "type": "bitmap_t*", "name": "img", "desc": "图片对象。" }, { "type": "rect_t*", "name": "src", "desc": "要拷贝的区域。" }, { "type": "xy_t", "name": "dx", "desc": "目标位置的x坐标。" }, { "type": "xy_t", "name": "dy", "desc": "目标位置的y坐标。" } ], "annotation": {}, "desc": " 把图片指定的区域拷贝到framebuffer中。\r\n\r\n", "name": "g2d_copy_image", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败,返回失败则上层用软件实现。" } }, { "params": [ { "type": "bitmap_t*", "name": "fb", "desc": "framebuffer对象。" }, { "type": "bitmap_t*", "name": "img", "desc": "图片对象。" }, { "type": "rect_t*", "name": "src", "desc": "要旋转并拷贝的区域。" }, { "type": "lcd_orientation_t", "name": "o", "desc": "旋转角度(一般支持90度即可)。" } ], "annotation": {}, "desc": " 把图片指定的区域进行旋转并拷贝到framebuffer相应的区域,本函数主要用于辅助实现横屏和竖屏的切换,一般支持90度旋转即可。\r\n\r\n", "name": "g2d_copy_image", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败,返回失败则上层用软件实现。" } }, { "params": [ { "type": "bitmap_t*", "name": "fb", "desc": "framebuffer对象。" }, { "type": "bitmap_t*", "name": "img", "desc": "图片对象。" }, { "type": "rect_t*", "name": "dst", "desc": "目的区域。" }, { "type": "rect_t*", "name": "src", "desc": "源区域。" }, { "type": "uint8_t", "name": "global_alpha", "desc": "全局alpha。" } ], "annotation": {}, "desc": " 把图片指定的区域渲染到framebuffer指定的区域,src的大小和dst的大小不一致则进行缩放。\r\n 1.硬件不支持缩放,则返回NOT_IMPL。\r\n 2.硬件不支持全局alpha,global_alpha!=0xff时返回NOT_IMPL。\r\n\r\n", "name": "g2d_blend_image", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败,返回失败则上层用软件实现。" } } ], "events": [], "properties": [], "header": "base/g2d.h", "desc": "\r\n 2D加速接口。\r\n\r\n", "name": "g2d_t", "level": 1 }, { "type": "class", "methods": [ { "params": [ { "type": "bitmap_t*", "name": "bitmap", "desc": "位图对象。" } ], "annotation": {}, "desc": " 为位图创建缓冲区。\r\n\r\n", "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": " 创建缓冲区。\r\n\r\n > 为了兼容raw图像。\r\n\r\n", "name": "graphic_buffer_default_create_with_data", "return": { "type": "graphic_buffer_t*", "desc": "返回缓存区。" } }, { "params": [ { "type": "graphic_buffer_t*", "name": "buffer", "desc": "图像缓冲区对象。" } ], "annotation": {}, "desc": " 为读取数据而锁定缓冲区。\r\n\r\n", "name": "graphic_buffer_lock_for_read", "return": { "type": "uint8_t*", "desc": "返回缓存区的首地址。" } }, { "params": [ { "type": "graphic_buffer_t*", "name": "buffer", "desc": "图像缓冲区对象。" } ], "annotation": {}, "desc": " 为修改数据而锁定缓冲区。\r\n\r\n", "name": "graphic_buffer_lock_for_write", "return": { "type": "uint8_t*", "desc": "返回缓存区的首地址。" } }, { "params": [ { "type": "graphic_buffer_t*", "name": "buffer", "desc": "图像缓冲区对象。" } ], "annotation": {}, "desc": " 解锁缓冲区。\r\n\r\n", "name": "graphic_buffer_unlock", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" } }, { "params": [ { "type": "graphic_buffer_t*", "name": "buffer", "desc": "图像缓冲区对象。" }, { "type": "void*", "name": "data", "desc": "内存数据。" } ], "annotation": {}, "desc": " 附件到指定的内存。\r\n\r\n", "name": "graphic_buffer_attach", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" } }, { "params": [ { "type": "graphic_buffer_t*", "name": "buffer", "desc": "图像缓冲区对象。" } ], "annotation": {}, "desc": " 销毁缓冲区。\r\n\r\n", "name": "graphic_buffer_destroy", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" } } ], "events": [], "properties": [], "header": "base/graphic_buffer.h", "desc": " graphic_buffer。\r\n", "name": "graphic_buffer_t", "level": 1 }, { "type": "class", "methods": [], "events": [], "properties": [], "header": "base/hscrollable.h", "desc": " 帮助实现控件左右滚动的效果。\r\n", "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。\r\n\r\n", "name": "idle_add", "return": { "type": "uint32_t", "desc": "返回idle的ID,0表示失败。" } }, { "params": [ { "type": "idle_func_t", "name": "on_idle", "desc": "idle回调函数。" }, { "type": "void*", "name": "ctx", "desc": "idle回调函数的上下文。" } ], "annotation": { "static": true }, "desc": " 用于非GUI线程增加一个idle,本函数向主循环的事件队列中发送一个增加idle的请求。\r\n\r\n", "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。\r\n\r\n", "name": "idle_remove", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" } }, { "params": [], "annotation": { "private": true }, "desc": " 查找指定ID的idle。\r\n\r\n", "name": "idle_find", "return": { "type": "idle_info_t*", "desc": "返回idle的信息。" } }, { "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被销毁时调用(方便脚本语言去释放回调函数)。\r\n\r\n", "name": "idle_set_on_destroy", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" } }, { "params": [], "annotation": { "private": true }, "desc": " 调用全部idle的函数。\r\n\r\n", "name": "idle_dispatch", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" } }, { "params": [], "annotation": { "static": true }, "desc": " 返回idle的个数。\r\n\r\n", "name": "idle_count", "return": { "type": "uint32_t", "desc": "返回idle的个数。" } } ], "events": [], "properties": [], "header": "base/idle.h", "desc": "\r\n idle可以看作是duration为0的定时器。\r\n\r\n > idle可以用来实现一些异步处理。\r\n\r\n 示例:\r\n\r\n ```c\r\n static ret_t something_on_idle(const idle_info_t* info) {\r\n widget_t* widget = WIDGET(info->ctx);\r\n edit_t* edit = EDIT(widget);\r\n ...\r\n return RET_REMOVE;\r\n }\r\n\r\n ...\r\n\r\n idle_add(something_on_idle, edit);\r\n\r\n ```\r\n\r\n > 在非GUI线程请用idle\\_queue。\r\n\r\n", "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": " 加载图片。\r\n\r\n", "name": "image_loader_load", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" } }, { "params": [ { "type": "image_loader_t*", "name": "loader", "desc": "loader对象。" } ], "annotation": { "static": true }, "desc": " 注册图片加载器。\r\n\r\n\r\n", "name": "image_loader_register", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" } }, { "params": [ { "type": "image_loader_t*", "name": "loader", "desc": "loader对象。" } ], "annotation": { "static": true }, "desc": " 注销图片加载器。\r\n\r\n\r\n", "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": " 查找满足条件加载器并加载图片。\r\n\r\n\r\n", "name": "image_loader_load_image", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" } } ], "events": [], "properties": [], "header": "base/image_loader.h", "desc": " 图片加载接口。\r\n", "name": "image_loader_t", "level": 1 }, { "type": "class", "methods": [ { "params": [], "annotation": { "constructor": true, "scriptable": true }, "desc": " 获取缺省的图片管理器。\r\n", "name": "image_manager", "alias": "image_manager_instance", "return": { "type": "image_manager_t*", "desc": "返回图片管理器对象。" } }, { "params": [ { "type": "image_manager_t*", "name": "imm", "desc": "图片管理器对象。" } ], "annotation": {}, "desc": " 设置缺省的图片管理器。\r\n\r\n", "name": "image_manager_set", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" } }, { "params": [], "annotation": { "constructor": true }, "desc": " 创建图片管理器。\r\n\r\n", "name": "image_manager_create", "return": { "type": "image_manager_t*", "desc": "返回图片管理器对象。" } }, { "params": [ { "type": "image_manager_t*", "name": "imm", "desc": "图片管理器对象。" } ], "annotation": { "constructor": true }, "desc": " 初始化图片管理器。\r\n\r\n", "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": " 获取指定的图片。\r\n 先从缓存查找,如果没找到,再加载并缓存。\r\n\r\n\r\n", "name": "image_manager_get_bitmap", "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": " 从图片管理器中卸载指定时间内没有使用的图片。\r\n\r\n", "name": "image_manager_unload_unused", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" } }, { "params": [ { "type": "image_manager_t*", "name": "imm", "desc": "图片管理器对象。" } ], "annotation": {}, "desc": " 从图片管理器中卸载全部图片。\r\n\r\n\r\n", "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": " 从图片管理器中卸载指定的图片。\r\n\r\n", "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信息。\r\n\r\n", "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": " 设置资源管理器对象。\r\n\r\n 之所以需要设置资源管理器对象,而不是使用缺省的资源管理器对象,是因为在designer中有两个图片管理器:\r\n\r\n * 一个用于designer本身加载图片。\r\n\r\n * 一个用于被设计的窗口加载图片。\r\n\r\n这两个图片管理器需要从不同的路径加载资源。\r\n\r\n\r\n", "name": "image_manager_set_assets_manager", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" } }, { "params": [ { "type": "image_manager_t*", "name": "imm", "desc": "图片管理器对象。" } ], "annotation": {}, "desc": " 析构图片管理器。\r\n\r\n", "name": "image_manager_deinit", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" } }, { "params": [ { "type": "image_manager_t*", "name": "imm", "desc": "图片管理器对象。" } ], "annotation": {}, "desc": " 析构并释放图片管理器。\r\n\r\n", "name": "image_manager_destroy", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" } } ], "events": [], "properties": [ { "name": "images", "desc": " 缓存的图片。\r\n", "type": "darray_t", "annotation": { "private": true } }, { "name": "assets_manager", "desc": " 资源管理器。\r\n", "type": "assets_manager_t*", "annotation": { "private": true } } ], "header": "base/image_manager.h", "desc": " 图片管理器。负责加载,解码和缓存图片。\r\n", "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": " 初始化输入设备状态管理器。\r\n\r\n", "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。\r\n\r\n", "name": "input_device_status_on_input_event", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" } } ], "events": [], "properties": [], "header": "base/input_device_status.h", "desc": " 输入设备状态管理器。本类仅供窗口管理器内部使用。\r\n", "name": "input_device_status_t", "level": 1 }, { "type": "class", "methods": [ { "params": [], "annotation": { "constructor": true }, "desc": " 创建输入法引擎对象。\r\n\r\n", "name": "input_engine_create", "return": { "type": "input_engine_t*", "desc": "返回输入法引擎对象。" } }, { "params": [ { "type": "input_engine_t*", "name": "engine", "desc": "输入法引擎对象。" } ], "annotation": { "deconstructor": true }, "desc": " 销毁输入法引擎对象。\r\n\r\n", "name": "input_engine_destroy", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" } }, { "params": [ { "type": "input_engine_t*", "name": "engine", "desc": "输入法引擎对象。" } ], "annotation": {}, "desc": " 清除所有输入的按键组合和候选字。\r\n\r\n", "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": " 输入新的按键,并更新候选字。\r\n\r\n", "name": "input_engine_input", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" } } ], "events": [], "properties": [ { "name": "keys", "desc": " 当前的按键组合。\r\n", "type": "str_t", "annotation": { "private": true } }, { "name": "candidates", "desc": " 当前按键组合对应的候选字列表。\r\n", "type": "char*", "annotation": { "private": true } }, { "name": "candidates_nr", "desc": " 当前按键组合对应的候选字/词个数。\r\n", "type": "uint32_t", "annotation": { "private": true } } ], "header": "base/input_engine.h", "desc": " 输入法引擎接口。\r\n\r\n 常见的实现方式有以下几种:\r\n\r\n * 空实现。用于不需要输入法的嵌入式平台。\r\n\r\n * 拼音输入法实现。用于需要输入法的嵌入式平台。\r\n\r\n ```graphviz\r\n [default_style]\r\n\r\n input_engine_pinyin_t -> input_engine_t[arrowhead=empty style=dashed]\r\n input_engine_null_t -> input_engine_t[arrowhead=empty style=dashed]\r\n\r\n ```\r\n", "name": "input_engine_t", "level": 1 }, { "type": "enum", "desc": " 输入类型常量定义。\r\n", "consts": [ { "desc": " 文本。\r\n", "name": "INPUT_TEXT" }, { "desc": " 整数。\r\n", "name": "INPUT_INT" }, { "desc": " 非负整数。\r\n", "name": "INPUT_UINT" }, { "desc": " 16进制整数。\r\n", "name": "INPUT_HEX" }, { "desc": " 浮点数。\r\n", "name": "INPUT_FLOAT" }, { "desc": " 非负浮点数。\r\n", "name": "INPUT_UFLOAT" }, { "desc": " 邮件地址。\r\n", "name": "INPUT_EMAIL" }, { "desc": " 密码。\r\n", "name": "INPUT_PASSWORD" }, { "desc": " 电话号码。\r\n", "name": "INPUT_PHONE" }, { "desc": " 使用自定义的软键盘(如计算器等应用不希望弹出系统软键盘)。\r\n", "name": "INPUT_CUSTOM" } ], "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": " 分发一个事件。\r\n\r\n", "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": " 分发一个事件当前焦点控件。\r\n\r\n", "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": " 注册指定事件的处理函数。\r\n\r\n", "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": " 注销指定事件的处理函数。\r\n\r\n", "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": " 打开或关闭输入法。\r\n\r\n", "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按钮的信息。\r\n\r\n", "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事件。\r\n\r\n", "name": "input_method_dispatch_action", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" } }, { "params": [ { "type": "input_method_t*", "name": "im", "desc": "输入法对象。" }, { "type": "char*", "name": "text", "desc": "文本。" } ], "annotation": { "scriptable": true }, "desc": " 提交输入文本。\r\n\r\n", "name": "input_method_commit_text", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" } }, { "params": [ { "type": "input_method_t*", "name": "im", "desc": "输入法对象。" }, { "type": "bool_t", "name": "replace", "desc": "是否替换原来的文本。" }, { "type": "char*", "name": "text", "desc": "文本。" } ], "annotation": {}, "desc": " 提交输入文本。\r\n\r\n", "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": " 提交按键。\r\n\r\n", "name": "input_method_dispatch_key", "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": "候选字个数。" } ], "annotation": {}, "desc": " 请求显示候选字。\r\n\r\n", "name": "input_method_dispatch_candidates", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" } }, { "params": [], "annotation": {}, "desc": " 创建输入法对象。在具体实现中实现。\r\n\r\n", "name": "input_method_create", "return": { "type": "input_method_t*", "desc": "成功返回输入法对象,失败返回NULL。" } }, { "params": [ { "type": "input_method_t*", "name": "im", "desc": "输入法对象。" } ], "annotation": {}, "desc": " 销毁输入法对象。在具体实现中实现。\r\n\r\n", "name": "input_method_destroy", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" } }, { "params": [], "annotation": { "constructor": true, "scriptable": true }, "desc": " 获取全局输入法对象。\r\n\r\n", "name": "input_method", "alias": "input_method_instance", "return": { "type": "input_method_t*", "desc": "成功返回输入法对象,失败返回NULL。" } }, { "params": [ { "type": "input_method_t*", "name": "im", "desc": "输入法对象。" } ], "annotation": {}, "desc": " 设置全局输入法对象。\r\n\r\n", "name": "input_method_set", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" } } ], "events": [], "properties": [ { "name": "widget", "desc": " 当前的焦点控件。\r\n", "type": "widget_t*", "annotation": { "private": true } }, { "name": "keyboard", "desc": " 当前的软件键盘。\r\n", "type": "widget_t*", "annotation": { "private": true } }, { "name": "win", "desc": " 当前的窗口。\r\n", "type": "widget_t*", "annotation": { "private": true } }, { "name": "win_delta_y", "desc": " 由于软键盘的弹出,可能会将窗口向上推移,win_delta_y为推移的距离。\r\n", "type": "int32_t", "annotation": { "private": true } }, { "name": "win_old_y", "desc": " 窗口原来的位置。\r\n", "type": "int32_t", "annotation": { "private": true } }, { "name": "action_button_enable", "desc": " 软键盘的上的action按钮是否可用。\r\n", "type": "bool_t", "annotation": { "readable": true } }, { "name": "action_button_enable", "desc": " 软键盘的上的action按钮文本。\r\n", "type": "bool_t", "annotation": { "readable": true } }, { "name": "emitter", "desc": " emitter。用于实现dispatch/on/off等功能。\r\n", "type": "emitter_t", "annotation": { "private": true } }, { "name": "input_type", "desc": " 当前输入的类型。\r\n", "type": "input_type_t", "annotation": { "readable": true } } ], "header": "base/input_method.h", "desc": " 输入法接口。\r\n\r\n 常见的实现方式有以下几种:\r\n\r\n * 空实现。用于不需要输入法的嵌入式平台。\r\n\r\n * 缺省实现。用于需要输入法的嵌入式平台。\r\n\r\n * 基于SDL实现的平台原生输入法。用于桌面系统和手机系统。\r\n\r\n ```graphviz\r\n [default_style]\r\n\r\n input_method_default_t -> input_method_t [arrowhead=empty style=dashed]\r\n input_method_sdl_t -> input_method_t [arrowhead=empty style=dashed]\r\n input_method_null_t -> input_method_t [arrowhead=empty style=dashed]\r\n\r\n ```\r\n\r\n > 输入类型请参考:[input\\_type](input_type_t.md)\r\n\r\n", "name": "input_method_t", "annotation": { "scriptable": true }, "level": 1 }, { "type": "enum", "desc": " key code。\r\n", "consts": [ { "desc": " TK_KEY_RETURN\r\n", "name": "TK_KEY_RETURN" }, { "desc": " TK_KEY_ESCAPE\r\n", "name": "TK_KEY_ESCAPE" }, { "desc": " TK_KEY_BACKSPACE\r\n", "name": "TK_KEY_BACKSPACE" }, { "desc": " TK_KEY_TAB\r\n", "name": "TK_KEY_TAB" }, { "desc": " TK_KEY_SPACE\r\n", "name": "TK_KEY_SPACE" }, { "desc": " TK_KEY_EXCLAIM\r\n", "name": "TK_KEY_EXCLAIM" }, { "desc": " TK_KEY_QUOTEDBL\r\n", "name": "TK_KEY_QUOTEDBL" }, { "desc": " TK_KEY_HASH\r\n", "name": "TK_KEY_HASH" }, { "desc": " TK_KEY_PERCENT\r\n", "name": "TK_KEY_PERCENT" }, { "desc": " TK_KEY_DOLLAR\r\n", "name": "TK_KEY_DOLLAR" }, { "desc": " TK_KEY_AMPERSAND\r\n", "name": "TK_KEY_AMPERSAND" }, { "desc": " TK_KEY_QUOTE\r\n", "name": "TK_KEY_QUOTE" }, { "desc": " TK_KEY_LEFTPAREN\r\n", "name": "TK_KEY_LEFTPAREN" }, { "desc": " TK_KEY_RIGHTPAREN\r\n", "name": "TK_KEY_RIGHTPAREN" }, { "desc": " TK_KEY_ASTERISK\r\n", "name": "TK_KEY_ASTERISK" }, { "desc": " TK_KEY_PLUS\r\n", "name": "TK_KEY_PLUS" }, { "desc": " TK_KEY_COMMA\r\n", "name": "TK_KEY_COMMA" }, { "desc": " TK_KEY_MINUS\r\n", "name": "TK_KEY_MINUS" }, { "desc": " TK_KEY_PERIOD\r\n", "name": "TK_KEY_PERIOD" }, { "desc": " TK_KEY_SLASH\r\n", "name": "TK_KEY_SLASH" }, { "desc": " TK_KEY_0\r\n", "name": "TK_KEY_0" }, { "desc": " TK_KEY_1\r\n", "name": "TK_KEY_1" }, { "desc": " TK_KEY_2\r\n", "name": "TK_KEY_2" }, { "desc": " TK_KEY_3\r\n", "name": "TK_KEY_3" }, { "desc": " TK_KEY_4\r\n", "name": "TK_KEY_4" }, { "desc": " TK_KEY_5\r\n", "name": "TK_KEY_5" }, { "desc": " TK_KEY_6\r\n", "name": "TK_KEY_6" }, { "desc": " TK_KEY_7\r\n", "name": "TK_KEY_7" }, { "desc": " TK_KEY_8\r\n", "name": "TK_KEY_8" }, { "desc": " TK_KEY_9\r\n", "name": "TK_KEY_9" }, { "desc": " TK_KEY_COLON\r\n", "name": "TK_KEY_COLON" }, { "desc": " TK_KEY_SEMICOLON\r\n", "name": "TK_KEY_SEMICOLON" }, { "desc": " TK_KEY_LESS\r\n", "name": "TK_KEY_LESS" }, { "desc": " TK_KEY_EQUAL\r\n", "name": "TK_KEY_EQUAL" }, { "desc": " TK_KEY_GREATER\r\n", "name": "TK_KEY_GREATER" }, { "desc": " TK_KEY_QUESTION\r\n", "name": "TK_KEY_QUESTION" }, { "desc": " TK_KEY_AT\r\n", "name": "TK_KEY_AT" }, { "desc": " TK_KEY_LEFTBRACKET\r\n", "name": "TK_KEY_LEFTBRACKET" }, { "desc": " TK_KEY_BACKSLASH\r\n", "name": "TK_KEY_BACKSLASH" }, { "desc": " TK_KEY_RIGHTBRACKET\r\n", "name": "TK_KEY_RIGHTBRACKET" }, { "desc": " TK_KEY_CARET\r\n", "name": "TK_KEY_CARET" }, { "desc": " TK_KEY_UNDERSCORE\r\n", "name": "TK_KEY_UNDERSCORE" }, { "desc": " TK_KEY_BACKQUOTE\r\n", "name": "TK_KEY_BACKQUOTE" }, { "desc": " TK_KEY_a\r\n", "name": "TK_KEY_a" }, { "desc": " TK_KEY_b\r\n", "name": "TK_KEY_b" }, { "desc": " TK_KEY_c\r\n", "name": "TK_KEY_c" }, { "desc": " TK_KEY_d\r\n", "name": "TK_KEY_d" }, { "desc": " TK_KEY_e\r\n", "name": "TK_KEY_e" }, { "desc": " TK_KEY_f\r\n", "name": "TK_KEY_f" }, { "desc": " TK_KEY_g\r\n", "name": "TK_KEY_g" }, { "desc": " TK_KEY_h\r\n", "name": "TK_KEY_h" }, { "desc": " TK_KEY_i\r\n", "name": "TK_KEY_i" }, { "desc": " TK_KEY_j\r\n", "name": "TK_KEY_j" }, { "desc": " TK_KEY_k\r\n", "name": "TK_KEY_k" }, { "desc": " TK_KEY_l\r\n", "name": "TK_KEY_l" }, { "desc": " TK_KEY_m\r\n", "name": "TK_KEY_m" }, { "desc": " TK_KEY_n\r\n", "name": "TK_KEY_n" }, { "desc": " TK_KEY_o\r\n", "name": "TK_KEY_o" }, { "desc": " TK_KEY_p\r\n", "name": "TK_KEY_p" }, { "desc": " TK_KEY_q\r\n", "name": "TK_KEY_q" }, { "desc": " TK_KEY_r\r\n", "name": "TK_KEY_r" }, { "desc": " TK_KEY_s\r\n", "name": "TK_KEY_s" }, { "desc": " TK_KEY_t\r\n", "name": "TK_KEY_t" }, { "desc": " TK_KEY_u\r\n", "name": "TK_KEY_u" }, { "desc": " TK_KEY_v\r\n", "name": "TK_KEY_v" }, { "desc": " TK_KEY_w\r\n", "name": "TK_KEY_w" }, { "desc": " TK_KEY_x\r\n", "name": "TK_KEY_x" }, { "desc": " TK_KEY_y\r\n", "name": "TK_KEY_y" }, { "desc": " TK_KEY_z\r\n", "name": "TK_KEY_z" }, { "desc": " TK_KEY_A\r\n", "name": "TK_KEY_A" }, { "desc": " TK_KEY_B\r\n", "name": "TK_KEY_B" }, { "desc": " TK_KEY_C\r\n", "name": "TK_KEY_C" }, { "desc": " TK_KEY_D\r\n", "name": "TK_KEY_D" }, { "desc": " TK_KEY_E\r\n", "name": "TK_KEY_E" }, { "desc": " TK_KEY_F\r\n", "name": "TK_KEY_F" }, { "desc": " TK_KEY_G\r\n", "name": "TK_KEY_G" }, { "desc": " TK_KEY_H\r\n", "name": "TK_KEY_H" }, { "desc": " TK_KEY_I\r\n", "name": "TK_KEY_I" }, { "desc": " TK_KEY_J\r\n", "name": "TK_KEY_J" }, { "desc": " TK_KEY_K\r\n", "name": "TK_KEY_K" }, { "desc": " TK_KEY_L\r\n", "name": "TK_KEY_L" }, { "desc": " TK_KEY_M\r\n", "name": "TK_KEY_M" }, { "desc": " TK_KEY_N\r\n", "name": "TK_KEY_N" }, { "desc": " TK_KEY_O\r\n", "name": "TK_KEY_O" }, { "desc": " TK_KEY_P\r\n", "name": "TK_KEY_P" }, { "desc": " TK_KEY_Q\r\n", "name": "TK_KEY_Q" }, { "desc": " TK_KEY_R\r\n", "name": "TK_KEY_R" }, { "desc": " TK_KEY_S\r\n", "name": "TK_KEY_S" }, { "desc": " TK_KEY_T\r\n", "name": "TK_KEY_T" }, { "desc": " TK_KEY_U\r\n", "name": "TK_KEY_U" }, { "desc": " TK_KEY_V\r\n", "name": "TK_KEY_V" }, { "desc": " TK_KEY_W\r\n", "name": "TK_KEY_W" }, { "desc": " TK_KEY_X\r\n", "name": "TK_KEY_X" }, { "desc": " TK_KEY_Y\r\n", "name": "TK_KEY_Y" }, { "desc": " TK_KEY_Z\r\n", "name": "TK_KEY_Z" }, { "desc": " TK_KEY_DOT\r\n", "name": "TK_KEY_DOT" }, { "desc": " TK_KEY_DELETE\r\n", "name": "TK_KEY_DELETE" }, { "desc": " TK_KEY_LEFTBRACE\r\n", "name": "TK_KEY_LEFTBRACE" }, { "desc": " TK_KEY_RIGHTBRACE\r\n", "name": "TK_KEY_RIGHTBRACE" }, { "desc": " TK_KEY_LSHIFT\r\n", "name": "TK_KEY_LSHIFT" }, { "desc": " TK_KEY_RSHIFT\r\n", "name": "TK_KEY_RSHIFT" }, { "desc": " TK_KEY_LCTRL\r\n", "name": "TK_KEY_LCTRL" }, { "desc": " TK_KEY_RCTRL\r\n", "name": "TK_KEY_RCTRL" }, { "desc": " TK_KEY_LALT\r\n", "name": "TK_KEY_LALT" }, { "desc": " TK_KEY_RALT\r\n", "name": "TK_KEY_RALT" }, { "desc": " TK_KEY_CAPSLOCK\r\n", "name": "TK_KEY_CAPSLOCK" }, { "desc": " TK_KEY_HOME\r\n", "name": "TK_KEY_HOME" }, { "desc": " TK_KEY_END\r\n", "name": "TK_KEY_END" }, { "desc": " TK_KEY_INSERT\r\n", "name": "TK_KEY_INSERT" }, { "desc": " TK_KEY_UP\r\n", "name": "TK_KEY_UP" }, { "desc": " TK_KEY_DOWN\r\n", "name": "TK_KEY_DOWN" }, { "desc": " TK_KEY_LEFT\r\n", "name": "TK_KEY_LEFT" }, { "desc": " TK_KEY_RIGHT\r\n", "name": "TK_KEY_RIGHT" }, { "desc": " TK_KEY_PAGEUP\r\n", "name": "TK_KEY_PAGEUP" }, { "desc": " TK_KEY_PAGEDOWN\r\n", "name": "TK_KEY_PAGEDOWN" }, { "desc": " TK_KEY_F1\r\n", "name": "TK_KEY_F1" }, { "desc": " TK_KEY_F2\r\n", "name": "TK_KEY_F2" }, { "desc": " TK_KEY_F3\r\n", "name": "TK_KEY_F3" }, { "desc": " TK_KEY_F4\r\n", "name": "TK_KEY_F4" }, { "desc": " TK_KEY_F5\r\n", "name": "TK_KEY_F5" }, { "desc": " TK_KEY_F6\r\n", "name": "TK_KEY_F6" }, { "desc": " TK_KEY_F7\r\n", "name": "TK_KEY_F7" }, { "desc": " TK_KEY_F8\r\n", "name": "TK_KEY_F8" }, { "desc": " TK_KEY_F9\r\n", "name": "TK_KEY_F9" }, { "desc": " TK_KEY_F10\r\n", "name": "TK_KEY_F10" }, { "desc": " TK_KEY_F11\r\n", "name": "TK_KEY_F11" }, { "desc": " TK_KEY_F12\r\n", "name": "TK_KEY_F12" }, { "desc": " TK_KEY_MENU\r\n", "name": "TK_KEY_MENU" }, { "desc": " TK_KEY_COMMAND\r\n", "name": "TK_KEY_COMMAND" }, { "desc": " TK_KEY_BACK\r\n", "name": "TK_KEY_BACK" } ], "header": "base/keys.h", "name": "key_code_t", "prefix": "TK_", "annotation": { "scriptable": true }, "level": 1 }, { "type": "enum", "desc": " LCD绘制模式常量定义。\r\n", "consts": [ { "desc": " 正常绘制。\r\n", "name": "LCD_DRAW_NORMAL" }, { "desc": " 绘制窗口动画,两个窗口无重叠。\r\n 在该模式下,可以直接绘制到显存,不用绘制到framebuffer中。\r\n", "name": "LCD_DRAW_ANIMATION" }, { "desc": " 绘制窗口动画,两个窗口有重叠。\r\n (目前无特殊用途)。\r\n", "name": "LCD_DRAW_ANIMATION_OVERLAP" }, { "desc": " 如果lcd支持swap操作,在特殊情况下,可以使用该模式提速。\r\n", "name": "LCD_DRAW_SWAP" }, { "desc": " 离线模式绘制(仅适用于framebuffer)。\r\n 在该模式下,绘制的内容不会显示出来,但可以用take_snapshot取出来,主要用于窗口动画。\r\n", "name": "LCD_DRAW_OFFLINE" } ], "header": "base/lcd.h", "name": "lcd_draw_mode_t", "prefix": "LCD_DRAW_", "level": 1 }, { "type": "enum", "desc": " LCD类型常量定义。\r\n", "consts": [ { "desc": " 基于FrameBuffer的LCD。\r\n", "name": "LCD_FRAMEBUFFER" }, { "desc": " 基于寄存器的LCD。\r\n", "name": "LCD_REGISTER" }, { "desc": " 基于VGCANVS的LCD。仅在支持OpenGL时,用nanovg实现。\r\n", "name": "LCD_VGCANVAS" }, { "desc": " 单色LCD。\r\n", "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": "rect_t*", "name": "dirty_rect", "desc": "需要绘制的区域。" }, { "type": "lcd_draw_mode_t", "name": "anim_mode", "desc": "动画模式,如果可能,直接画到显存而不是离线的framebuffer。" } ], "annotation": {}, "desc": " 准备绘制。\r\n\r\n", "name": "lcd_begin_frame", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" } }, { "params": [ { "type": "lcd_t*", "name": "lcd", "desc": "lcd对象。" }, { "type": "rect_t*", "name": "rect", "desc": "裁剪区域。" } ], "annotation": {}, "desc": " 设置裁剪区域。\r\n\r\n", "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": " 获取裁剪区域。\r\n\r\n", "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。\r\n 屏幕旋转时会调用本函数,调整LCD的大小。\r\n\r\n", "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。\r\n\r\n", "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": " 设置文本颜色。\r\n\r\n", "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": " 设置线条颜色。\r\n\r\n", "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": " 设置填充颜色。\r\n\r\n", "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": " 设置字体名称。\r\n\r\n", "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": " 设置字体大小。\r\n\r\n", "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": " 绘制一条垂直线。\r\n\r\n", "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": " 绘制一条水平线。\r\n\r\n", "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": " 绘制一组点。\r\n\r\n", "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。\r\n\r\n", "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": " 绘制实心矩形。\r\n\r\n", "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": " 绘制矩形。\r\n\r\n", "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": "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则不需要实现本函数。\r\n\r\n", "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": " 测量字符串占用的宽度。\r\n\r\n", "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": " 绘制字符。\r\n\r\n", "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": "rect_t*", "name": "src", "desc": "只绘制指定区域的部分。" }, { "type": "rect_t*", "name": "dst", "desc": "绘制到目标区域。" } ], "annotation": {}, "desc": " 绘制图片。\r\n\r\n", "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": " 绘制图片。\r\n\r\n", "name": "lcd_draw_image_matrix", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" } }, { "params": [ { "type": "lcd_t*", "name": "lcd", "desc": "lcd对象。" } ], "annotation": {}, "desc": " 获取矢量图canvas。\r\n\r\n", "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模式,才支持。\r\n\r\n", "name": "lcd_take_snapshot", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" } }, { "params": [ { "type": "lcd_t*", "name": "lcd", "desc": "lcd对象。" } ], "annotation": {}, "desc": " 获取期望的位图格式。绘制期望的位图格式可以提高绘制性能。\r\n\r\n", "name": "lcd_get_desired_bitmap_format", "return": { "type": "bitmap_format_t", "desc": "返回期望的位图格式。" } }, { "params": [ { "type": "lcd_t*", "name": "lcd", "desc": "lcd对象。" } ], "annotation": { "private": true }, "desc": " 对于double fb,如果硬件支持swap,在LCD_DRAW_SWAP模式下,该函数用于切换fb。\r\n\r\n", "name": "lcd_swap", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" } }, { "params": [ { "type": "lcd_t*", "name": "lcd", "desc": "lcd对象。" } ], "annotation": {}, "desc": " 获取宽度。\r\n\r\n", "name": "lcd_get_width", "return": { "type": "wh_t", "desc": "返回宽度。" } }, { "params": [ { "type": "lcd_t*", "name": "lcd", "desc": "lcd对象。" } ], "annotation": {}, "desc": " 获取高度。\r\n\r\n", "name": "lcd_get_height", "return": { "type": "wh_t", "desc": "返回高度。" } }, { "params": [ { "type": "lcd_t*", "name": "lcd", "desc": "lcd对象。" } ], "annotation": { "private": true }, "desc": " flush。\r\n\r\n", "name": "lcd_flush", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" } }, { "params": [ { "type": "lcd_t*", "name": "lcd", "desc": "lcd对象。" } ], "annotation": { "private": true }, "desc": " sync。\r\n\r\n", "name": "lcd_sync", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" } }, { "params": [ { "type": "lcd_t*", "name": "lcd", "desc": "lcd对象。" } ], "annotation": {}, "desc": " 判读lcd是否支持swap。\r\n\r\n", "name": "lcd_is_swappable", "return": { "type": "bool_t", "desc": "返回是否支持swap。" } }, { "params": [ { "type": "lcd_t*", "name": "lcd", "desc": "lcd对象。" } ], "annotation": {}, "desc": " 完成绘制,同步到显示设备。\r\n\r\n", "name": "lcd_end_frame", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" } } ], "events": [], "properties": [ { "name": "w", "desc": " 屏幕的宽度\r\n", "type": "wh_t", "annotation": { "readable": true } }, { "name": "height", "desc": " 屏幕的高度\r\n", "type": "wh_t", "annotation": { "readable": true } }, { "name": "global_alpha", "desc": " 全局alpha\r\n", "type": "uint8_t", "annotation": { "readable": true } }, { "name": "text_color", "desc": " 文本颜色\r\n", "type": "color_t", "annotation": { "readable": true } }, { "name": "fill_color", "desc": " 填充颜色\r\n", "type": "color_t", "annotation": { "readable": true } }, { "name": "stroke_color", "desc": " 线条颜色\r\n", "type": "color_t", "annotation": { "readable": true } }, { "name": "font_name", "desc": " 字体名称。\r\n", "type": "char*", "annotation": { "readable": true } }, { "name": "font_size", "desc": " 字体大小。\r\n", "type": "uint32_t", "annotation": { "readable": true } }, { "name": "draw_mode", "desc": " 绘制模式。\r\n", "type": "lcd_draw_mode_t", "annotation": { "readable": true } }, { "name": "type", "desc": " LCD的类型。\r\n", "type": "lcd_type_t", "annotation": { "readable": true } }, { "name": "ratio", "desc": " 屏幕密度。\r\n", "type": "float_t", "annotation": { "readable": true } }, { "name": "support_dirty_rect", "desc": " 是否支持脏矩形。\r\n", "type": "bool_t", "annotation": { "readable": true } } ], "header": "base/lcd.h", "desc": " 显示设备抽象基类。\r\n", "name": "lcd_t", "level": 1 }, { "type": "class", "methods": [ { "params": [], "annotation": { "constructor": true, "scriptable": true }, "desc": " 获取缺省locale_info。\r\n\r\n", "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。\r\n\r\n", "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。\r\n\r\n", "name": "locale_info_create", "return": { "type": "locale_info_t*", "desc": "返回locale_info对象。" } }, { "params": [ { "type": "locale_info_t*", "name": "locale_info", "desc": "locale_info对象。" }, { "type": "char*", "name": "text", "desc": "待翻译的文本。" } ], "annotation": { "scriptable": true }, "desc": " 翻译字符串。\r\n\r\n", "name": "locale_info_tr", "return": { "type": "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": " 设置当前的国家和语言。\r\n\r\n", "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": { "scriptable": "custom" }, "desc": " 注册指定事件的处理函数。\r\n\r\n", "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": " 注销指定事件的处理函数。\r\n\r\n", "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": " 设置资源管理器对象。\r\n\r\n\r\n", "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": " 重新加载字符串资源。\r\n\r\n\r\n", "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对象。\r\n\r\n", "name": "locale_info_destroy", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" } } ], "events": [], "properties": [ { "name": "country;", "desc": " 国家或地区。如:CN\r\n", "type": "char*", "annotation": { "readable": true } }, { "name": "language", "desc": " 语言。如:zh\r\n", "type": "char*", "annotation": { "readable": true } }, { "name": "assets_manager", "desc": " 资源管理器。\r\n", "type": "assets_manager_t*", "annotation": { "private": true } } ], "header": "base/locale_info.h", "desc": " 本地化信息。提供字符串翻译数据管理,当前语言改变的事件通知等等。\r\n\r\n", "name": "locale_info_t", "annotation": { "scriptable": true }, "level": 1 }, { "type": "class", "methods": [ { "params": [], "annotation": { "constructor": true }, "desc": " 获取缺省的控件自身布局算法工厂对象。\r\n", "name": "self_layouter_factory", "return": { "type": "self_layouter_factory_t*", "desc": "返回控件自身布局算法工厂对象。" } }, { "params": [ { "type": "self_layouter_factory_t*", "name": "factory", "desc": "控件自身布局算法工厂对象。" } ], "annotation": {}, "desc": " 设置缺省的控件自身布局算法工厂对象。\r\n\r\n", "name": "self_layouter_factory_set", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" } }, { "params": [], "annotation": { "constructor": true }, "desc": " 创建控件自身布局算法工厂对象。\r\n\r\n", "name": "self_layouter_factory_create", "return": { "type": "self_layouter_factory_t*", "desc": "返回控件自身布局算法工厂对象。" } }, { "params": [ { "type": "self_layouter_factory_t*", "name": "factory", "desc": "highlighter工厂对象。" }, { "type": "const char*", "name": "type", "desc": "控件自身布局算法类型。" }, { "type": "self_layouter_create_t", "name": "create", "desc": "控件自身布局算法创建函数。" } ], "annotation": {}, "desc": " 注册控件自身布局算法创建函数。\r\n\r\n", "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": " 创建指定类型的控件自身布局算法对象。\r\n\r\n", "name": "self_layouter_factory_create_layouter", "return": { "type": "self_layouter_t*", "desc": "返回窗口动画对象。" } }, { "params": [ { "type": "self_layouter_factory_t*", "name": "factory", "desc": "控件自身布局算法工厂对象。" } ], "annotation": {}, "desc": " 析构并释放控件自身布局算法工厂对象。\r\n\r\n", "name": "self_layouter_factory_destroy", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" } } ], "events": [], "properties": [], "header": "base/self_layouter_factory.h", "desc": " 控件自身布局算法工厂。\r\n\r\n", "name": "self_layouter_factory_t", "level": 1 }, { "type": "class", "methods": [ { "params": [ { "type": "self_layouter_t*", "name": "layouter", "desc": "layouter对象。" } ], "annotation": {}, "desc": " 获取全部参数。\r\n\r\n", "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": " 对控件自身进行布局。\r\n\r\n", "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": " 获取指定的参数。\r\n\r\n", "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": " 获取指定的参数。\r\n\r\n", "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": " 设置字符串格式的参数。\r\n\r\n", "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": " 获取指定的浮点格式的参数。\r\n\r\n", "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": " 获取指定的整数格式的参数。\r\n\r\n", "name": "self_layouter_get_param_int", "return": { "type": "ret_t", "desc": "成功返回参数的值,失败返回缺省值。" } }, { "params": [ { "type": "self_layouter_t*", "name": "layouter", "desc": "layouter对象。" } ], "annotation": {}, "desc": " 销毁layouter对象。\r\n\r\n", "name": "self_layouter_destroy", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" } }, { "params": [ { "type": "const char*", "name": "params", "desc": "参数。" } ], "annotation": {}, "desc": " 创建layouter对象。\r\n\r\n", "name": "self_layouter_create", "return": { "type": "self_layouter_t*", "desc": "返回layouter对象。" } } ], "events": [], "properties": [], "header": "base/self_layouter.h", "desc": " 控件自身排版布局器的接口。\r\n\r\n 按特定算法对控件进行排版布局,子类需要实现vtable中的函数。\r\n", "name": "self_layouter_t", "level": 1 }, { "type": "class", "methods": [ { "params": [], "annotation": { "constructor": true }, "desc": " 初始化快捷键对象。\r\n\r\n", "name": "shortcut_init", "return": { "type": "shortcut_t*", "desc": "返回快捷键对象。" } }, { "params": [ { "type": "shortcut_t*", "name": "shortcut", "desc": "快捷键对象。" } ], "annotation": { "constructor": true }, "desc": " 初始化快捷键对象。\r\n\r\n", "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": " 比较两个快捷键对象。\r\n\r\n", "name": "shortcut_equal", "return": { "type": "bool_t", "desc": "返回TRUE表示相同,否则表示不同。" } }, { "params": [ { "type": "shortcut_t*", "name": "filter", "desc": "过滤器快捷键对象。" }, { "type": "shortcut_t*", "name": "event", "desc": "事件快捷键对象。" } ], "annotation": {}, "desc": " 检查事件与快捷键是否匹配。\r\n\r\n", "name": "shortcut_match", "return": { "type": "bool_t", "desc": "返回TRUE表示匹配,否则表示不匹配。" } } ], "events": [], "properties": [ { "name": "is_valid", "desc": " 是否有效。\r\n", "type": "bool_t", "annotation": { "readable": true } }, { "name": "key", "desc": " 键值。\r\n", "type": "uint32_t", "annotation": { "readable": true } }, { "name": "alt", "desc": " alt键是否按下。\r\n", "type": "bool_t", "annotation": { "readable": true } }, { "name": "lalt", "desc": " left alt键是否按下。\r\n", "type": "bool_t", "annotation": { "readable": true } }, { "name": "ralt", "desc": " right alt键是否按下。\r\n", "type": "bool_t", "annotation": { "readable": true } }, { "name": "ctrl", "desc": " ctrl键是否按下。\r\n", "type": "bool_t", "annotation": { "readable": true } }, { "name": "lctrl", "desc": " left ctrl键是否按下。\r\n", "type": "bool_t", "annotation": { "readable": true } }, { "name": "rctrl", "desc": " right ctrl键是否按下。\r\n", "type": "bool_t", "annotation": { "readable": true } }, { "name": "shift", "desc": " shift键是否按下。\r\n", "type": "bool_t", "annotation": { "readable": true } }, { "name": "lshift", "desc": " left shift键是否按下。\r\n", "type": "bool_t", "annotation": { "readable": true } }, { "name": "rshift", "desc": " right shift键是否按下。\r\n", "type": "bool_t", "annotation": { "readable": true } }, { "name": "cmd", "desc": " cmd/win键是否按下。\r\n", "type": "bool_t", "annotation": { "readable": true } }, { "name": "menu", "desc": " menu键是否按下。\r\n", "type": "bool_t", "annotation": { "readable": true } } ], "header": "base/shortcut.h", "desc": " 快捷键。\r\n", "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。\r\n\r\n", "name": "style_factory_create_style", "return": { "type": "style_t*", "desc": "返回style对象。" } }, { "params": [], "annotation": { "constructor": true }, "desc": " 获取缺省的style factory。\r\n", "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才设置)。\r\n\r\n", "name": "style_factory_set", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" } } ], "events": [], "properties": [], "header": "base/style_factory.h", "desc": " style工厂接口,主要用于创建style。\r\n\r\n> 在特殊情况下,可以实现自己的style工厂,比如支持CSS和可实时修改的style。\r\n\r\n", "name": "style_factory_t", "level": 1 }, { "type": "enum", "desc": " style常量定义。\r\n", "consts": [ { "desc": " 背景颜色。\r\n", "name": "STYLE_ID_BG_COLOR" }, { "desc": " 前景颜色。\r\n", "name": "STYLE_ID_FG_COLOR" }, { "desc": " 蒙版颜色。\r\n", "name": "STYLE_ID_MASK_COLOR" }, { "desc": " 字体名称。\r\n", "name": "STYLE_ID_FONT_NAME" }, { "desc": " 字体大小。\r\n", "name": "STYLE_ID_FONT_SIZE" }, { "desc": " 字体风格(粗体、斜体等)。\r\n", "name": "STYLE_ID_FONT_STYLE" }, { "desc": " 文本颜色。\r\n", "name": "STYLE_ID_TEXT_COLOR" }, { "desc": " 提示文本颜色。\r\n", "name": "STYLE_ID_TIPS_TEXT_COLOR" }, { "desc": " 文本水平对齐的方式。\r\n", "name": "STYLE_ID_TEXT_ALIGN_H" }, { "desc": " 文本垂直对齐的方式。\r\n", "name": "STYLE_ID_TEXT_ALIGN_V" }, { "desc": " 边框颜色。\r\n", "name": "STYLE_ID_BORDER_COLOR" }, { "desc": " 边框线宽。\r\n", "name": "STYLE_ID_BORDER_WIDTH" }, { "desc": " 边框类型。\r\n", "name": "STYLE_ID_BORDER" }, { "desc": " 图片的名称。\r\n", "name": "STYLE_ID_BG_IMAGE" }, { "desc": " 图片的显示方式。\r\n", "name": "STYLE_ID_BG_IMAGE_DRAW_TYPE" }, { "desc": " 图标的名称。\r\n", "name": "STYLE_ID_ICON" }, { "desc": " 图片的名称。\r\n", "name": "STYLE_ID_FG_IMAGE" }, { "desc": " 图片的显示方式。\r\n", "name": "STYLE_ID_FG_IMAGE_DRAW_TYPE" }, { "desc": " 间距。\r\n", "name": "STYLE_ID_SPACER" }, { "desc": " 边距。\r\n", "name": "STYLE_ID_MARGIN" }, { "desc": " 左边距。\r\n", "name": "STYLE_ID_MARGIN_LEFT" }, { "desc": " 右边距。\r\n", "name": "STYLE_ID_MARGIN_RIGHT" }, { "desc": " 顶边距。\r\n", "name": "STYLE_ID_MARGIN_TOP" }, { "desc": " 底边距。\r\n", "name": "STYLE_ID_MARGIN_BOTTOM" }, { "desc": " 图标的位置。\r\n", "name": "STYLE_ID_ICON_AT" }, { "desc": " Active图标的名称。\r\n", "name": "STYLE_ID_ACTIVE_ICON" }, { "desc": " X方向的偏移,方便实现按下的效果。\r\n", "name": "STYLE_ID_X_OFFSET" }, { "desc": " Y方向的偏移,方便实现按下的效果。\r\n", "name": "STYLE_ID_Y_OFFSET" }, { "desc": " 编辑器中选中区域的背景颜色。\r\n", "name": "STYLE_ID_SELECTED_BG_COLOR" }, { "desc": " 编辑器中选中区域的前景颜色。\r\n", "name": "STYLE_ID_SELECTED_FG_COLOR" }, { "desc": " 编辑器中选中区域的文本颜色。\r\n", "name": "STYLE_ID_SELECTED_TEXT_COLOR" }, { "desc": " 圆角半径(仅在WITH_VGCANVAS定义时生效)。\r\n", "name": "STYLE_ID_ROUND_RADIUS" } ], "header": "base/style.h", "name": "style_id_t", "prefix": "STYLE", "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更新数据。\r\n\r\n", "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对象是否有效\r\n\r\n", "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的整数格式的值。\r\n\r\n", "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的颜色值。\r\n\r\n", "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的字符串格式的值。\r\n\r\n", "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有效)。\r\n\r\n", "name": "style_set", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" } }, { "params": [ { "type": "style_t*", "name": "s", "desc": "style对象。" } ], "annotation": { "scriptable": true }, "desc": " 检查style是否是mutable的。\r\n\r\n", "name": "style_is_mutable", "return": { "type": "bool_t", "desc": "返回TRUE表示是,否则表示不是。" } }, { "params": [ { "type": "style_t*", "name": "s", "desc": "style对象。" } ], "annotation": {}, "desc": " 销毁style对象\r\n\r\n", "name": "style_destroy", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" } } ], "events": [], "properties": [], "header": "base/style.h", "desc": " 控件风格。\r\n\r\n widget从style对象中,获取诸如字体、颜色和图片相关的参数,根据这些参数来绘制界面。\r\n\r\n ```c\r\n style_t* style = widget->astyle;\r\n int32_t margin = style_get_int(style, STYLE_ID_MARGIN, 2);\r\n int32_t icon_at = style_get_int(style, STYLE_ID_ICON_AT, ICON_AT_AUTO);\r\n uint16_t font_size = style_get_int(style, STYLE_ID_FONT_SIZE, TK_DEFAULT_FONT_SIZE);\r\n ```\r\n\r\n 属性名称的请参考[style\\_id](style_id_t.md)\r\n\r\n", "name": "style_t", "annotation": { "scriptable": true }, "level": 1 }, { "type": "class", "methods": [ { "params": [ { "type": "asset_info_t*", "name": "res", "desc": "数据资源。" } ], "annotation": { "constructor": true }, "desc": " 创建联想字对象。\r\n\r\n", "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。\r\n\r\n", "name": "suggest_words_find", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" } }, { "params": [ { "type": "suggest_words_t*", "name": "suggest_words", "desc": "联想字对象。" } ], "annotation": {}, "desc": " @deconstructor\r\n 销毁联想字对象。\r\n\r\n", "name": "suggest_words_destroy", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" } } ], "events": [], "properties": [ { "name": "words", "desc": " 联想字列表。find函数执行成功后会更新。\r\n", "type": "char*", "annotation": { "private": true } }, { "name": "words_nr", "desc": " 联想字/词个数。find函数执行成功后会更新。\r\n", "type": "uint32_t", "annotation": { "private": true } } ], "header": "base/suggest_words.h", "desc": " 输入法联想字词。\r\n", "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对象\r\n\r\n", "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对象。\r\n\r\n", "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": " 处理点击事件。\r\n\r\n", "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": " 处理拖动事件。\r\n\r\n", "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": " 粘贴文本。\r\n\r\n", "name": "text_edit_paste", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" } }, { "params": [ { "type": "text_edit_t*", "name": "text_edit", "desc": "text_edit对象。" } ], "annotation": {}, "desc": " 剪切文本。\r\n\r\n", "name": "text_edit_cut", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" } }, { "params": [ { "type": "text_edit_t*", "name": "text_edit", "desc": "text_edit对象。" } ], "annotation": {}, "desc": " 拷贝文本。\r\n\r\n", "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": " 处理按键事件。\r\n\r\n", "name": "text_edit_key_down", "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": " 选择指定范围的文本。\r\n\r\n", "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": " 全选。\r\n\r\n", "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": " 取消选择。\r\n\r\n", "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": " 设置光标位置。\r\n\r\n", "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": " 获取光标位置。\r\n\r\n", "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": " 获取编辑器的状态。\r\n\r\n", "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": " 设置是否自动折行。\r\n\r\n", "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不可见,将其设置为可见。\r\n\r\n", "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": " 设置光标的看见性。\r\n\r\n", "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": " 设置最大行数。\r\n\r\n", "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": " 设置是否马赛克字符(用于密码)。\r\n\r\n", "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": " 设置提示信息。\r\n\r\n", "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": " 设置马赛克字符。\r\n\r\n", "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": " 绘制文本。\r\n\r\n", "name": "text_edit_paint", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" } }, { "params": [ { "type": "text_edit_t*", "name": "text_edit", "desc": "text_edit对象。" } ], "annotation": {}, "desc": " 重新排版。\r\n\r\n", "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": " 设置滚动偏移。\r\n\r\n", "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": " 设置状态改变回调函数。\r\n\r\n", "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对象。\r\n\r\n", "name": "text_edit_destroy", "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": " 获取缺省的主题对象。\r\n", "name": "theme", "alias": "theme_instance", "return": { "type": "theme_t*", "desc": "返回主题对象。" } }, { "params": [ { "type": "theme_t*", "name": "theme", "desc": "主题对象。" } ], "annotation": {}, "desc": " 设置缺省的主题对象。\r\n\r\n", "name": "theme_set", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" } }, { "params": [ { "type": "const uint8_t*", "name": "data", "desc": "主题数据。" } ], "annotation": { "constructor": true }, "desc": " 创建主题对象。\r\n\r\n", "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": " 初始化主题对象。\r\n\r\n", "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。\r\n\r\n", "name": "theme_find_style", "return": { "type": "theme_t*", "desc": "返回主题对象。" } }, { "params": [ { "type": "theme_t*", "name": "theme", "desc": "主题对象。" } ], "annotation": {}, "desc": " 析构主题对象。\r\n\r\n", "name": "theme_deinit", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" } }, { "params": [ { "type": "theme_t*", "name": "theme", "desc": "主题对象。" } ], "annotation": {}, "desc": " 析构并释放主题对象。\r\n\r\n", "name": "theme_destroy", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" } } ], "events": [], "properties": [], "header": "base/theme.h", "desc": " 主题。\r\n\r\n 负责管理缺省的主题数据,方便实现style\\_const。\r\n\r\n", "name": "theme_t", "annotation": { "scriptable": true }, "level": 1 }, { "type": "class", "methods": [ { "params": [ { "type": "timer_get_time_t", "name": "get_time", "desc": "获取当前时间的函数。" } ], "annotation": { "private": true, "static": true }, "desc": " 初始化定时器系统。\r\n\r\n", "name": "timer_prepare", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" } }, { "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。\r\n\r\n", "name": "timer_add", "return": { "type": "uint32_t", "desc": "返回timer的ID,TK_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的请求。\r\n timer回调函数,回调函数返回RET_REPEAT,则下次继续执行,否则自动移出。\r\n\r\n", "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。\r\n\r\n", "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,重置之后定时器重新开始计时。\r\n\r\n", "name": "timer_reset", "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,修改之后定时器重新开始计时。\r\n\r\n", "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被销毁时调用(方便脚本语言去释放回调函数)。\r\n\r\n", "name": "timer_set_on_destroy", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" } }, { "params": [], "annotation": { "private": true }, "desc": " 查找指定ID的timer。\r\n\r\n", "name": "timer_find", "return": { "type": "timer_info_t*", "desc": "返回timer的信息。" } }, { "params": [], "annotation": { "private": true }, "desc": " 检查全部timer的函数,如果时间到期,调用相应的timer函数。\r\n\r\n", "name": "timer_dispatch", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" } }, { "params": [], "annotation": { "static": true }, "desc": " 返回timer的个数。\r\n\r\n", "name": "timer_count", "return": { "type": "uint32_t", "desc": "返回timer的个数。" } }, { "params": [], "annotation": { "static": true }, "desc": " 返回最近的timer到期时间。\r\n\r\n", "name": "timer_next_time", "return": { "type": "uint32_t", "desc": "返回最近的timer到期时间。" } } ], "events": [], "properties": [], "header": "base/timer.h", "desc": " 定时器系统。\r\n\r\n > 本定时器精度较低,最高精度为1000/FPS,如果需要高精度的定时器,请用OS提供的定时器。\r\n\r\n 示例:\r\n\r\n ```c\r\n static ret_t my_on_timer(const timer_info_t* info) {\r\n widget_t* widget = WIDGET(info->ctx);\r\n ...\r\n return RET_REPEAT;\r\n }\r\n\r\n ...\r\n\r\n timer_add(my_on_timer, widget, 1000);\r\n ```\r\n > 在非GUI线程请用timer\\_queue。\r\n\r\n", "name": "timer_t", "annotation": { "scriptable": true, "fake": true }, "level": 1 }, { "type": "enum", "desc": " LCD旋转角度(XXX:目前仅支持0度和90度,逆时针方向)。\r\n", "consts": [ { "desc": " LCD没有旋转。\r\n", "name": "LCD_ORIENTATION_0" }, { "desc": " LCD旋转90度。\r\n", "name": "LCD_ORIENTATION_90" }, { "desc": " LCD旋转180度。\r\n", "name": "LCD_ORIENTATION_180" }, { "desc": " LCD旋转270度。\r\n", "name": "LCD_ORIENTATION_270" } ], "header": "base/types_def.h", "name": "lcd_orientation_t", "prefix": "LCD_ORIENTATION_", "level": 1 }, { "type": "enum", "desc": " 垂直对齐的常量定义。\r\n", "consts": [ { "desc": " 无效对齐方式。\r\n", "name": "ALIGN_V_NONE" }, { "desc": " 居中对齐。\r\n", "name": "ALIGN_V_MIDDLE" }, { "desc": " 顶部对齐。\r\n", "name": "ALIGN_V_TOP" }, { "desc": " 底部对齐。\r\n", "name": "ALIGN_V_BOTTOM" } ], "header": "base/types_def.h", "name": "align_v_t", "prefix": "ALIGN_V_", "annotation": { "scriptable": true }, "level": 1 }, { "type": "enum", "desc": " 水平对齐的常量定义。\r\n", "consts": [ { "desc": " 无效对齐方式。\r\n", "name": "ALIGN_H_NONE" }, { "desc": " 居中对齐。\r\n", "name": "ALIGN_H_CENTER" }, { "desc": " 左边对齐。\r\n", "name": "ALIGN_H_LEFT" }, { "desc": " 右边对齐。\r\n", "name": "ALIGN_H_RIGHT" } ], "header": "base/types_def.h", "name": "align_h_t", "prefix": "ALIGN_H_", "annotation": { "scriptable": true }, "level": 1 }, { "type": "enum", "desc": " 控件边框类型。\r\n", "consts": [ { "desc": " 无边框。\r\n", "name": "BORDER_NONE" }, { "desc": " 左边框线。\r\n", "name": "BORDER_LEFT" }, { "desc": " 右边框线。\r\n", "name": "BORDER_RIGHT" }, { "desc": " 上边框线。\r\n", "name": "BORDER_TOP" }, { "desc": " 下边框线。\r\n", "name": "BORDER_BOTTOM" }, { "desc": " 全边框线。\r\n", "name": "BORDER_ALL" } ], "header": "base/types_def.h", "name": "border_type_t", "prefix": "BORDER_TYPE_", "level": 1 }, { "type": "enum", "desc": " 图标所在的位置。\r\n", "consts": [ { "desc": " 自动选择位置。\r\n", "name": "ICON_AT_AUTO" }, { "desc": " 水平左边,垂直居中。\r\n", "name": "ICON_AT_LEFT" }, { "desc": " 水平右边,垂直居中(not used now)。\r\n", "name": "ICON_AT_RIGHT" }, { "desc": " 水平居中,垂直顶部(not used now)。\r\n", "name": "ICON_AT_TOP" }, { "desc": " 水平居中,垂直低部(not used now)。\r\n", "name": "ICON_AT_BOTTOM" } ], "header": "base/types_def.h", "name": "icon_at_type_t", "prefix": "ICON_AT", "level": 1 }, { "type": "enum", "desc": " 应用程序类型。\r\n", "consts": [ { "desc": " 嵌入式或移动APP\r\n", "name": "APP_MOBILE" }, { "desc": " 模拟器。\r\n", "name": "APP_SIMULATOR" }, { "desc": " 桌面应用程序。\r\n", "name": "APP_DESKTOP" } ], "header": "base/types_def.h", "name": "app_type_t", "prefix": "APP_", "level": 1 }, { "type": "enum", "desc": " 位图格式常量定义。\r\n", "consts": [ { "desc": " 无效格式。\r\n", "name": "BITMAP_FMT_NONE" }, { "desc": " 一个像素占用4个字节,RGBA占一个字节,按内存地址递增。\r\n", "name": "BITMAP_FMT_RGBA8888" }, { "desc": " 一个像素占用4个字节,ABGR占一个字节,按内存地址递增。\r\n", "name": "BITMAP_FMT_ABGR8888" }, { "desc": " 一个像素占用4个字节,BGRA占一个字节,按内存地址递增。\r\n", "name": "BITMAP_FMT_BGRA8888" }, { "desc": " 一个像素占用4个字节,ARGB占一个字节,按内存地址递增。\r\n", "name": "BITMAP_FMT_ARGB8888" }, { "desc": " 一个像素占用2个字节,RGB分别占用5,6,5位, 按内存地址递增。\r\n", "name": "BITMAP_FMT_RGB565" }, { "desc": " 一个像素占用2个字节,BGR分别占用5,6,5位, 按内存地址递增。\r\n", "name": "BITMAP_FMT_BGR565" }, { "desc": " 一个像素占用3个字节,RGB占一个字节,按内存地址递增。\r\n", "name": "BITMAP_FMT_RGB888" }, { "desc": " 一个像素占用3个字节,RGB占一个字节,按内存地址递增。\r\n", "name": "BITMAP_FMT_BGR888" }, { "desc": " 一个像素占用1个字节。\r\n", "name": "BITMAP_FMT_GRAY" }, { "desc": " 一个像素占用1比特。\r\n", "name": "BITMAP_FMT_MONO" } ], "header": "base/types_def.h", "name": "bitmap_format_t", "prefix": "BITMAP_FMT_", "annotation": { "scriptable": true }, "level": 1 }, { "type": "enum", "desc": " 位图标志常量定义。\r\n", "consts": [ { "desc": " 无特殊标志。\r\n", "name": "BITMAP_FLAG_NONE" }, { "desc": " 不透明图片。\r\n", "name": "BITMAP_FLAG_OPAQUE" }, { "desc": " 图片内容不会变化。\r\n", "name": "BITMAP_FLAG_IMMUTABLE" }, { "desc": " OpenGL Texture, bitmap的id是有效的texture id。\r\n", "name": "BITMAP_FLAG_TEXTURE" }, { "desc": " 如果是MUTABLE的图片,更新时需要设置此标志,底层可能会做特殊处理,比如更新图片到GPU。\r\n", "name": "BITMAP_FLAG_CHANGED" }, { "desc": " 预乘alpha。\r\n", "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时,调用本函数进一步处理。\r\n\r\n\r\n\r\n", "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的属性时,调用本函数进一步处理。\r\n\r\n\r\n\r\n", "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全部属性结束时,调用本函数进一步处理。\r\n\r\n\r\n\r\n", "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结束时,调用本函数进一步处理。\r\n\r\n\r\n\r\n", "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在解析开始时,调用本函数做些准备工作。\r\n\r\n\r\n\r\n", "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在解析结束时,调用本函数做些收尾工作。\r\n\r\n\r\n\r\n", "name": "ui_builder_on_end", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" } } ], "events": [], "properties": [], "header": "base/ui_builder.h", "desc": "\r\n 界面构造器接口。\r\n\r\n 负责把ui\\_loader解析的数据进一步处理,至于具体做什么,由具体实现决定。常见的实现有:\r\n\r\n * 构建widget对象树。\r\n\r\n * 生成二进制的UI描述数据。\r\n\r\n * 生成XML格式的UI描述数据。\r\n\r\n ```graphviz\r\n [default_style]\r\n\r\n ui_builder_defualt_t -> ui_builder_t[arrowhead = \"empty\"]\r\n ui_xml_writer_t -> ui_builder_t[arrowhead = \"empty\"]\r\n ui_binary_writer_t -> ui_builder_t[arrowhead = \"empty\"]\r\n ```\r\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": " 请求反馈。\r\n\r\n\r\n", "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": " 初始化。\r\n 设置实际的处理函数。\r\n\r\n\r\n", "name": "ui_feedback_init", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" } } ], "events": [], "properties": [], "header": "base/ui_feedback.h", "desc": "\r\n 提供按键音、触屏音和震动等反馈。\r\n", "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进一步处理。\r\n\r\n\r\n\r\n", "name": "ui_loader_load", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" } }, { "params": [ { "type": "const char*", "name": "name", "desc": "资源名。" } ], "annotation": {}, "desc": "\r\n 从指定的资源加载widget对象,通常用于加载非窗口的widget。\r\n\r\n>需要自己将widget加入窗口后,再调用widget\\_layout。\r\n\r\n\r\n\r\n", "name": "ui_loader_load_widget", "return": { "type": "widget_t*", "desc": "返回widget对象。" } } ], "events": [], "properties": [], "header": "base/ui_loader.h", "desc": "\r\n UI加载器。\r\n\r\n 负责从资源加载界面描述数据,然后分发给ui\\_builder,由ui\\_builder进一步处理。\r\n\r\n 常见的实现有两种:\r\n\r\n * XML格式的加载器。\r\n\r\n * 二进制格式的加载器。\r\n\r\n ```graphviz\r\n [default_style]\r\n\r\n ui_loader_defualt_t -> ui_loader_t[arrowhead = \"empty\"]\r\n ui_loader_xml_t -> ui_loader_t[arrowhead = \"empty\"]\r\n\r\n ```\r\n\r\n", "name": "ui_loader_t", "level": 1 }, { "type": "class", "methods": [], "events": [], "properties": [], "header": "base/velocity.h", "desc": " velocity。\r\n", "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是framebuffer,format指定data的格式。" }, { "type": "void*", "name": "data", "desc": "framebuffer或其它ctx。" } ], "annotation": { "constructor": true }, "desc": " 创建vgcanvas。\r\n\r\n", "name": "vgcanvas_create", "return": { "type": "vgcanvas_t", "desc": "返回vgcanvas" } }, { "params": [ { "type": "vgcanvas_t*", "name": "vg", "desc": "vgcanvas对象。" } ], "annotation": { "cast": true, "scriptable": true }, "desc": " 转换为vgcanvas对象(供脚本语言使用)。\r\n\r\n", "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是framebuffer,format指定data的格式。" }, { "type": "void*", "name": "data", "desc": "framebuffer或其它ctx。" } ], "annotation": {}, "desc": " 重新初始化,系统内部调用。\r\n\r\n\r\n", "name": "vgcanvas_reinit", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" } }, { "params": [ { "type": "vgcanvas_t*", "name": "vg", "desc": "vgcanvas对象。" } ], "annotation": {}, "desc": " 重置状态。\r\n\r\n\r\n", "name": "vgcanvas_reset", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" } }, { "params": [ { "type": "vgcanvas_t*", "name": "vg", "desc": "vgcanvas对象。" } ], "annotation": { "scriptable": true }, "desc": " flush\r\n\r\n\r\n", "name": "vgcanvas_flush", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" } }, { "params": [ { "type": "vgcanvas_t*", "name": "vg", "desc": "vgcanvas对象。" }, { "type": "rect_t*", "name": "dirty_rect", "desc": "需要绘制的区域。" } ], "annotation": {}, "desc": " 开始绘制,系统内部调用。\r\n\r\n\r\n", "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": " 用颜色清除指定矩形区域。\r\n\r\n\r\n", "name": "vgcanvas_clear_rect", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" } }, { "params": [ { "type": "vgcanvas_t*", "name": "vg", "desc": "vgcanvas对象。" } ], "annotation": { "scriptable": true }, "desc": " 清除之前的路径,并重新开始一条路径。\r\n\r\n\r\n", "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": " 移动当前点到指定点。\r\n\r\n\r\n", "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": " 生成一条线段(从当前点到目标点)。\r\n\r\n\r\n", "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": " 生成一条二次贝塞尔曲线。\r\n\r\n\r\n", "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": " 生成一条三次贝塞尔曲线。\r\n\r\n\r\n", "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": " 生成一条圆弧路径到指定点。\r\n\r\n\r\n", "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": " 生成一条圆弧。\r\n\r\n\r\n", "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": " 检查点是否在当前路径中。\r\n\r\n\r\n", "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": " 生成一个矩形路径。\r\n\r\n\r\n", "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": " 生成一个圆角矩形路径。\r\n\r\n\r\n", "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": " 生成一个椭圆路径。\r\n\r\n\r\n", "name": "vgcanvas_ellipse", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" } }, { "params": [ { "type": "vgcanvas_t*", "name": "vg", "desc": "vgcanvas对象。" } ], "annotation": { "scriptable": true }, "desc": " 闭合路径。\r\n\r\n >闭合路径是指把起点和终点连接起来,形成一个封闭的多边形。\r\n\r\n\r\n", "name": "vgcanvas_close_path", "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": " 旋转。\r\n\r\n\r\n", "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": " 缩放。\r\n\r\n\r\n", "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": " 平移。\r\n\r\n\r\n", "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": " 变换矩阵。\r\n\r\n\r\n", "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": " 设置变换矩阵。\r\n\r\n\r\n", "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": " 矩形裁剪。\r\n\r\n\r\n", "name": "vgcanvas_clip_rect", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" } }, { "params": [ { "type": "vgcanvas_t*", "name": "vg", "desc": "vgcanvas对象。" } ], "annotation": { "scriptable": true }, "desc": " 填充多边形。\r\n\r\n\r\n", "name": "vgcanvas_fill", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" } }, { "params": [ { "type": "vgcanvas_t*", "name": "vg", "desc": "vgcanvas对象。" } ], "annotation": { "scriptable": true }, "desc": " 画线。\r\n\r\n\r\n", "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": " 用图片填充/画多边形(可能存在可移植性问题,除非必要请勿使用)。\r\n 多边形的顶点必须在图片范围内,可以通过矩阵变化画到不同的位置。\r\n\r\n\r\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": " 设置字体的名称。\r\n\r\n\r\n", "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": " 设置字体的大小。\r\n\r\n\r\n", "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": " 设置文本水平对齐的方式。\r\n\r\n\r\n", "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": " 设置文本垂直对齐的方式。\r\n\r\n\r\n", "name": "vgcanvas_set_text_baseline", "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": " 绘制文本。\r\n\r\n\r\n", "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": " 测量文本的宽度。\r\n\r\n\r\n", "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": " 绘制图片。\r\n\r\n\r\n", "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": " 绘制图标。\r\n\r\n 绘制图标时会根据屏幕密度进行自动缩放,而绘制普通图片时不会。\r\n\r\n\r\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": " 设置是否启用反走样。\r\n\r\n\r\n", "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": " 设置全局透明度。\r\n\r\n\r\n", "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": " 设置线条的宽度。\r\n\r\n\r\n", "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": " 设置填充颜色。\r\n\r\n\r\n", "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": " 设置填充颜色。\r\n\r\n\r\n", "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": " 设置填充颜色为线性渐变色。\r\n\r\n\r\n", "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": " 设置填充颜色为径向渐变色。\r\n\r\n\r\n", "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": " 设置线条颜色。\r\n\r\n\r\n", "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": " 设置线条颜色。\r\n\r\n\r\n", "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": " 设置线条颜色为线性渐变色。\r\n\r\n\r\n", "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": " 设置线条颜色为径向渐变色。\r\n\r\n\r\n", "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。\r\n\r\n\r\n", "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。\r\n\r\n\r\n", "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。\r\n\r\n\r\n", "name": "vgcanvas_set_miter_limit", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" } }, { "params": [ { "type": "vgcanvas_t*", "name": "vg", "desc": "vgcanvas对象。" } ], "annotation": { "scriptable": true }, "desc": " 保存当前的状态。如颜色和矩阵等信息。\r\n\r\n > save/restore必须配套使用,否则可能导致状态混乱。\r\n\r\n\r\n", "name": "vgcanvas_save", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" } }, { "params": [ { "type": "vgcanvas_t*", "name": "vg", "desc": "vgcanvas对象。" } ], "annotation": { "scriptable": true }, "desc": " 恢复上次save的状态。\r\n\r\n> save/restore必须配套使用,否则可能导致状态混乱。\r\n\r\n\r\n", "name": "vgcanvas_restore", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" } }, { "params": [ { "type": "vgcanvas_t*", "name": "vg", "desc": "vgcanvas对象。" } ], "annotation": {}, "desc": " 结束绘制。系统内部调用。\r\n\r\n", "name": "vgcanvas_end_frame", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" } }, { "params": [ { "type": "vgcanvas_t*", "name": "vgcanvas", "desc": "vgcanvas对象。" } ], "annotation": {}, "desc": " 获取宽度。\r\n\r\n", "name": "vgcanvas_get_width", "return": { "type": "wh_t", "desc": "返回宽度。" } }, { "params": [ { "type": "vgcanvas_t*", "name": "vgcanvas", "desc": "vgcanvas对象。" } ], "annotation": {}, "desc": " 获取高度。\r\n\r\n", "name": "vgcanvas_get_height", "return": { "type": "wh_t", "desc": "返回高度。" } }, { "params": [ { "type": "vgcanvas_t*", "name": "vg", "desc": "vgcanvas对象。" } ], "annotation": {}, "desc": " 销毁vgcanvas对象。\r\n\r\n", "name": "vgcanvas_destroy", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" } } ], "events": [], "properties": [ { "name": "w", "desc": " canvas的宽度\r\n", "type": "wh_t", "annotation": { "readable": true, "scriptable": true } }, { "name": "h", "desc": " canvas的高度\r\n", "type": "wh_t", "annotation": { "readable": true, "scriptable": true } }, { "name": "ratio", "desc": " 显示比例。\r\n", "type": "float_t", "annotation": { "readable": true, "scriptable": true } }, { "name": "anti_alias", "desc": " 是否启用反走样功能。\r\n", "type": "bool_t", "annotation": { "readable": true, "scriptable": true } }, { "name": "line_width", "desc": " 线宽。\r\n", "type": "float_t", "annotation": { "readable": true, "scriptable": true } }, { "name": "global_alpha", "desc": " 全局alpha。\r\n", "type": "float_t", "annotation": { "readable": true, "scriptable": true } }, { "name": "miter_limit", "desc": " miter\\_limit。\r\n @see http://www.w3school.com.cn/tags/canvas_miterlimit.asp\r\n", "type": "float_t", "annotation": { "readable": true, "scriptable": true } }, { "name": "line_cap", "desc": " line\\_cap。\r\n @see http://www.w3school.com.cn/tags/canvas_linecap.asp\r\n", "type": "const char*", "annotation": { "readable": true, "scriptable": true } }, { "name": "line_join", "desc": " line\\_join。\r\n @see http://www.w3school.com.cn/tags/canvas_linejoin.asp\r\n", "type": "const char*", "annotation": { "readable": true, "scriptable": true } }, { "name": "font", "desc": " 字体。\r\n", "type": "char*", "annotation": { "readable": true, "scriptable": true } }, { "name": "font_size", "desc": " 字体大小。\r\n", "type": "float_t", "annotation": { "readable": true, "scriptable": true } }, { "name": "text_align", "desc": " 文本对齐方式。\r\n\r\n @see http://www.w3school.com.cn/tags/canvas_textalign.asp\r\n", "type": "const char*", "annotation": { "readable": true, "scriptable": true } }, { "name": "text_baseline", "desc": " 文本基线。\r\n\r\n @see http://www.w3school.com.cn/tags/canvas_textbaseline.asp\r\n", "type": "const char*", "annotation": { "readable": true, "scriptable": true } }, { "name": "fill_color", "desc": " 填充颜色\r\n", "type": "color_t", "annotation": { "readable": true } }, { "name": "stroke_color", "desc": " 线条颜色\r\n", "type": "color_t", "annotation": { "readable": true } }, { "name": "buff;", "desc": " frame buffer\r\n", "type": "uint32_t*", "annotation": { "private": true } }, { "name": "format;", "desc": " frame buffer format\r\n", "type": "bitmap_format_t", "annotation": { "private": true } } ], "header": "base/vgcanvas.h", "desc": " 矢量图画布抽象基类。\r\n\r\n 具体实现时可以使用agg,nanovg, cairo和skia等方式。\r\n\r\n cairo和skia体积太大,不适合嵌入式平台,但在PC平台也是一种选择。\r\n\r\n 目前我们只提供了基于nanovg的实现,支持软件渲染和硬件渲染。\r\n\r\n 我们对nanovg进行了一些改进:\r\n\r\n * 可以用agg/agge实现软件渲染(暂时不支持文本绘制)。\r\n\r\n * 可以用bgfx使用DirectX(Windows平台)和Metal(iOS)平台硬件加速。\r\n\r\n ```graphviz\r\n [default_style]\r\n\r\n vgcanvas_cairo_t -> vgcanvas_t[arrowhead = \"empty\"]\r\n vgcanvas_nanovg_t -> vgcanvas_t[arrowhead = \"empty\"]\r\n opengl -> vgcanvas_nanovg_t[arrowhead = \"none\"]\r\n bgfx -> vgcanvas_nanovg_t[arrowhead = \"none\"]\r\n agg -> vgcanvas_nanovg_t[arrowhead = \"none\"]\r\n agge -> vgcanvas_nanovg_t[arrowhead = \"none\"]\r\n vgcanvas_skia_t -> vgcanvas_t[arrowhead = \"empty\"]\r\n vgcanvas_agge_t -> vgcanvas_t[arrowhead = \"empty\"]\r\n ```\r\n\r\n 示例:\r\n\r\n ```c\r\n vgcanvas_t* vg = canvas_get_vgcanvas(c);\r\n vgcanvas_save(vg);\r\n vgcanvas_translate(vg, 0, 100);\r\n\r\n vgcanvas_set_line_width(vg, 1);\r\n vgcanvas_set_fill_color(vg, color_init(0xff, 0, 0, 0xff));\r\n vgcanvas_rect(vg, 5, 5, 100, 100);\r\n vgcanvas_fill(vg);\r\n vgcanvas_restore(vg);\r\n ```\r\n\r\n >请参考:https://www.w3schools.com/tags/ref_canvas.asp\r\n\r\n", "name": "vgcanvas_t", "annotation": { "scriptable": true }, "level": 1 }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "动画应用的控件。" }, { "type": "const char*", "name": "params", "desc": "参数。" } ], "annotation": { "global": true }, "desc": " 创建animator对象。\r\n\r\n", "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": " 获取缺省的控件动画管理器。\r\n", "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": " 设置缺省的控件动画管理器。\r\n\r\n", "name": "widget_animator_manager_set", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" } }, { "params": [], "annotation": { "constructor": true }, "desc": " 创建控件动画管理器。\r\n\r\n", "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": " 初始化控件动画管理器。\r\n\r\n", "name": "widget_animator_manager_init", "return": { "type": "widget_animator_manager_t*", "desc": "返回控件动画管理器。" } }, { "params": [ { "type": "widget_animator_manager_t*", "name": "am", "desc": "控件动画管理器。" } ], "annotation": {}, "desc": " 析构控件动画管理器。\r\n\r\n", "name": "widget_animator_manager_deinit", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" } }, { "params": [ { "type": "widget_animator_manager_t*", "name": "am", "desc": "控件动画管理器。" } ], "annotation": {}, "desc": " 析构并释放控件动画管理器。\r\n\r\n", "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": " 添加指定的动画,动画在创建时调用本函数。\r\n\r\n", "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": " 移出指定的动画,动画在销毁时调用本函数。。\r\n\r\n", "name": "widget_animator_manager_remove", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" } }, { "params": [ { "type": "widget_animator_manager_t*", "name": "am", "desc": "控件动画管理器。" } ], "annotation": {}, "desc": " 获取动画个数。\r\n\r\n", "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": " 播放满足条件的动画。\r\n 1.widget为NULL时,播放所有名称为name的动画。\r\n 2.name为NULL时,播放所有widget相关的动画。\r\n 3.widget和name均为NULL,播放所有动画。\r\n\r\n", "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": " 停止满足条件的动画。\r\n 1.widget为NULL时,停止所有名称为name的动画。\r\n 2.name为NULL时,停止所有widget相关的动画。\r\n 3.widget和name均为NULL,停止所有动画。\r\n\r\n", "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": " 暂停满足条件的动画。\r\n 1.widget为NULL时,暂停所有名称为name的动画。\r\n 2.name为NULL时,暂停所有widget相关的动画。\r\n 3.widget和name均为NULL,暂停所有动画。\r\n\r\n", "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": " 查找满足条件的动画。\r\n\r\n", "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": " 销毁满足条件的动画。\r\n\r\n", "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": " 设置时间倍率。\r\n 设置动画的时间倍率,<0: 时间倒退,<1: 时间变慢,>1 时间变快。\r\n\r\n", "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)。\r\n\r\n\r\n", "name": "widget_animator_manager_time_elapse", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" } } ], "events": [], "properties": [ { "name": "time_scale", "desc": " 时间倍率,可以让时间变快或变慢。\r\n", "type": "float_t" } ], "header": "base/widget_animator_manager.h", "desc": " 控件动画管理器。\r\n", "name": "widget_animator_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": " 初始化。仅供子类内部使用。\r\n\r\n", "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": " 设置名称。\r\n\r\n", "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模式。\r\n\r\n", "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": " 设置为重复模式。\r\n\r\n", "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": " 设置为逆向模式。\r\n\r\n", "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": " 设置时间倍率,用于实现时间加速减速和停滞的功能。\r\n\r\n", "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": " 注册指定事件的处理函数。\r\n 事件类型。目前支持:EVT_ANIM_START,EVT_ANIM_STOP,EVT_ANIM_PAUSE,EVT_ANIM_ONCE和EVT_ANIM_END。\r\n\r\n", "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": " 注销指定事件的处理函数。\r\n\r\n", "name": "widget_animator_off", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" } }, { "params": [ { "type": "widget_animator_t*", "name": "animator", "desc": "动画对象。" } ], "annotation": {}, "desc": " 启动动画。\r\n\r\n", "name": "widget_animator_start", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" } }, { "params": [ { "type": "widget_animator_t*", "name": "animator", "desc": "动画对象。" } ], "annotation": {}, "desc": " 停止动画。\r\n\r\n", "name": "widget_animator_stop", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" } }, { "params": [ { "type": "widget_animator_t*", "name": "animator", "desc": "动画对象。" } ], "annotation": {}, "desc": " 暂停动画。\r\n\r\n", "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": " 设置完成时是否自动销毁动画对象(缺省销毁)。\r\n\r\n", "name": "widget_animator_set_destroy_when_done", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" } }, { "params": [ { "type": "widget_animator_t*", "name": "animator", "desc": "动画对象。" }, { "type": "uint32_t", "name": "delta_time", "desc": "时间增量。" } ], "annotation": { "private": true }, "desc": " 时间流失,更新动画(由动画管理器调用)。\r\n\r\n", "name": "widget_animator_time_elapse", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" } }, { "params": [ { "type": "widget_animator_t*", "name": "animator", "desc": "动画对象。" } ], "annotation": {}, "desc": " 销毁animator对象。\r\n\r\n", "name": "widget_animator_destroy", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" } } ], "events": [], "properties": [ { "name": "name", "desc": " 名称。\r\n", "type": "char*" }, { "name": "widget", "desc": " 控件对象。\r\n", "type": "widget_t*", "annotation": { "private": true } }, { "name": "reversed", "desc": " 逆向运行,在yoyo模式下自动设置。\r\n", "type": "bool_t", "annotation": { "private": true } }, { "name": "yoyo_times", "desc": " yoyo剩余次数。\r\n", "type": "uint32_t", "annotation": { "private": true } }, { "name": "repeat_times", "desc": " 重复剩余次数。\r\n", "type": "uint32_t", "annotation": { "private": true } }, { "name": "now", "desc": " 当前时间(毫秒)。\r\n", "type": "uint32_t", "annotation": { "private": true } }, { "name": "time_scale", "desc": " 时间倍率。\r\n", "type": "float_t", "annotation": { "private": true } }, { "name": "start_time", "desc": " 起始时间(毫秒)。\r\n", "type": "uint32_t", "annotation": { "private": true } }, { "name": "delay", "desc": " 延迟执行时间(毫秒)。\r\n", "type": "uint32_t", "annotation": { "private": true } }, { "name": "duration", "desc": " 单次动画执行时间(毫秒)。\r\n", "type": "uint32_t", "annotation": { "private": true } }, { "name": "state", "desc": " 动画的状态。\r\n", "type": "animator_state_t", "annotation": { "private": true } }, { "name": "emitter", "desc": " emitter\r\n", "type": "uint32_t", "annotation": { "private": true } }, { "name": "destroy_when_done;", "desc": " 播放完成时是否自动销毁(缺省销毁)。\r\n", "type": "bool_t", "annotation": { "private": true } }, { "name": "forever", "desc": " 是否永远播放(yoyo_times/repeat_times为0时,自动设置此标志)。\r\n", "type": "bool_t", "annotation": { "private": true } }, { "name": "widget_destroy_id", "desc": " widget_destroy_id。\r\n", "type": "uint32_t", "annotation": { "private": true } }, { "name": "easing", "desc": " 插值函数。\r\n", "type": "easing_func_t", "annotation": { "private": true } }, { "name": "update", "desc": " update函数,子类需要实现。\r\n", "type": "widget_animator_update_t", "annotation": { "private": true } }, { "name": "destroy", "desc": " destroy函数,子类需要实现。\r\n", "type": "widget_animator_destroy_t", "annotation": { "private": true } } ], "header": "base/widget_animator.h", "desc": " 控件动画接口。\r\n", "name": "widget_animator_t", "level": 1 }, { "type": "enum", "desc": " 控件的属性。\r\n", "consts": [ { "desc": " 用于执行某些特殊的命令(比如控制动画的启停),主要是方便MVVM通过属性来控制动画。\r\n", "name": "WIDGET_PROP_EXEC" }, { "desc": " X坐标。\r\n", "name": "WIDGET_PROP_X" }, { "desc": " Y坐标。\r\n", "name": "WIDGET_PROP_Y" }, { "desc": " 宽度。\r\n", "name": "WIDGET_PROP_W" }, { "desc": " 高度。\r\n", "name": "WIDGET_PROP_H" }, { "desc": " Canvas。\r\n", "name": "WIDGET_PROP_CANVAS" }, { "desc": " Canvas。\r\n", "name": "WIDGET_PROP_LOCALIZE_OPTIONS" }, { "desc": " Native Window。\r\n", "name": "WIDGET_PROP_NATIVE_WINDOW" }, { "desc": " dialog highlight。\r\n", "name": "WIDGET_PROP_HIGHLIGHT" }, { "desc": " slider中的bar的的宽度或高度。\r\n", "name": "WIDGET_PROP_BAR_SIZE" }, { "desc": " 不透明度。\r\n", "name": "WIDGET_PROP_OPACITY" }, { "desc": " 最小宽度。\r\n", "name": "WIDGET_PROP_MIN_W" }, { "desc": " 最大宽度。\r\n", "name": "WIDGET_PROP_MAX_W" }, { "desc": " 子控件布局参数。\r\n", "name": "WIDGET_PROP_CHILDREN_LAYOUT" }, { "desc": " 子控件布局参数(过时)。\r\n", "name": "WIDGET_PROP_LAYOUT" }, { "desc": " 控件布局参数。\r\n", "name": "WIDGET_PROP_SELF_LAYOUT" }, { "desc": " layout宽度。\r\n", "name": "WIDGET_PROP_LAYOUT_W" }, { "desc": " layout高度。\r\n", "name": "WIDGET_PROP_LAYOUT_H" }, { "desc": " 虚拟宽度。\r\n", "name": "WIDGET_PROP_VIRTUAL_W" }, { "desc": " 虚拟高度。\r\n", "name": "WIDGET_PROP_VIRTUAL_H" }, { "desc": " 名称。\r\n", "name": "WIDGET_PROP_NAME" }, { "desc": " 类型。\r\n", "name": "WIDGET_PROP_TYPE" }, { "desc": " 是否可以关闭。\r\n", "name": "WIDGET_PROP_CLOSABLE" }, { "desc": " 鼠标指针。\r\n", "name": "WIDGET_PROP_CURSOR" }, { "desc": " 值。\r\n", "name": "WIDGET_PROP_VALUE" }, { "desc": " 长度。\r\n", "name": "WIDGET_PROP_LENGTH" }, { "desc": " 文本。\r\n", "name": "WIDGET_PROP_TEXT" }, { "desc": " 待翻译文本。\r\n", "name": "WIDGET_PROP_TR_TEXT" }, { "desc": " style。\r\n", "name": "WIDGET_PROP_STYLE" }, { "desc": " 是否启用。\r\n", "name": "WIDGET_PROP_ENABLE" }, { "desc": " 是否启用按键音等反馈。\r\n", "name": "WIDGET_PROP_FEEDBACK" }, { "desc": " 是否启用floating布局。\r\n", "name": "WIDGET_PROP_FLOATING" }, { "desc": " 边距。\r\n", "name": "WIDGET_PROP_MARGIN" }, { "desc": " 间距。\r\n", "name": "WIDGET_PROP_SPACING" }, { "desc": " 左边距。\r\n", "name": "WIDGET_PROP_LEFT_MARGIN" }, { "desc": " 右边距。\r\n", "name": "WIDGET_PROP_RIGHT_MARGIN" }, { "desc": " 顶边距。\r\n", "name": "WIDGET_PROP_TOP_MARGIN" }, { "desc": " 底边距。\r\n", "name": "WIDGET_PROP_BOTTOM_MARGIN" }, { "desc": " 步长。\r\n", "name": "WIDGET_PROP_STEP" }, { "desc": " 是否可见。\r\n", "name": "WIDGET_PROP_VISIBLE" }, { "desc": " 是否接受用户事件。\r\n", "name": "WIDGET_PROP_SENSITIVE" }, { "desc": " 控件动画。\r\n", "name": "WIDGET_PROP_ANIMATION" }, { "desc": " 窗口动画。\r\n", "name": "WIDGET_PROP_ANIM_HINT" }, { "desc": " 窗口设置为全部大小。\r\n", "name": "WIDGET_PROP_FULLSCREEN" }, { "desc": " 打开窗口动画。\r\n", "name": "WIDGET_PROP_OPEN_ANIM_HINT" }, { "desc": " 关闭窗口动画。\r\n", "name": "WIDGET_PROP_CLOSE_ANIM_HINT" }, { "desc": " 最小值。\r\n", "name": "WIDGET_PROP_MIN" }, { "desc": " 提示信息。\r\n", "name": "WIDGET_PROP_TIPS" }, { "desc": " 输入类型。\r\n", "name": "WIDGET_PROP_INPUT_TYPE" }, { "desc": " 只读模式。\r\n", "name": "WIDGET_PROP_READONLY" }, { "desc": " 密码是否可见。\r\n", "name": "WIDGET_PROP_PASSWORD_VISIBLE" }, { "desc": " 是否处于active状态。\r\n", "name": "WIDGET_PROP_ACTIVE" }, { "desc": " 是否为垂直模式。\r\n", "name": "WIDGET_PROP_VERTICAL" }, { "desc": " 是否显示文本。\r\n", "name": "WIDGET_PROP_SHOW_TEXT" }, { "desc": " X方向的偏移。\r\n", "name": "WIDGET_PROP_XOFFSET" }, { "desc": " Y方向的偏移。\r\n", "name": "WIDGET_PROP_YOFFSET" }, { "desc": " 垂直对齐模式。\r\n", "name": "WIDGET_PROP_ALIGN_V" }, { "desc": " 水平对齐模式。\r\n", "name": "WIDGET_PROP_ALIGN_H" }, { "desc": " 是否自动播放或指定播放的时间。\r\n", "name": "WIDGET_PROP_AUTO_PLAY" }, { "desc": " 是否循环播放或循环播放的次数。\r\n", "name": "WIDGET_PROP_LOOP" }, { "desc": " 是否启用自动更正功能。\r\n", "name": "WIDGET_PROP_AUTO_FIX" }, { "desc": " X最小值。\r\n", "name": "WIDGET_PROP_X_MIN" }, { "desc": " X最大值。\r\n", "name": "WIDGET_PROP_X_MAX" }, { "desc": " Y最小值。\r\n", "name": "WIDGET_PROP_Y_MIN" }, { "desc": " Y最大值。\r\n", "name": "WIDGET_PROP_Y_MAX" }, { "desc": " 最大值。\r\n", "name": "WIDGET_PROP_MAX" }, { "desc": " 行数或每行的高度。\r\n", "name": "WIDGET_PROP_ROW" }, { "desc": " 控件状态。\r\n", "name": "WIDGET_PROP_STATE_FOR_STYLE" }, { "desc": " 窗口主题名称。\r\n", "name": "WIDGET_PROP_THEME" }, { "desc": " window stage\r\n", "name": "WIDGET_PROP_STAGE" }, { "desc": " 图片管理器。\r\n", "name": "WIDGET_PROP_IMAGE_MANAGER" }, { "desc": " 资源管理器。\r\n", "name": "WIDGET_PROP_ASSETS_MANAGER" }, { "desc": " locale_info。\r\n", "name": "WIDGET_PROP_LOCALE_INFO" }, { "desc": " 字体管理器。\r\n", "name": "WIDGET_PROP_FONT_MANAGER" }, { "desc": " 窗口的主题对象。\r\n", "name": "WIDGET_PROP_THEME_OBJ" }, { "desc": " 缺省的主题对象。\r\n", "name": "WIDGET_PROP_DEFAULT_THEME_OBJ" }, { "desc": " 项的宽度。\r\n", "name": "WIDGET_PROP_ITEM_WIDTH" }, { "desc": " 项的高度。\r\n", "name": "WIDGET_PROP_ITEM_HEIGHT" }, { "desc": " 项的缺省高度。\r\n", "name": "WIDGET_PROP_DEFAULT_ITEM_HEIGHT" }, { "desc": " X方向是否可拖动。\r\n", "name": "WIDGET_PROP_XSLIDABLE" }, { "desc": " Y方向是否可拖动。\r\n", "name": "WIDGET_PROP_YSLIDABLE" }, { "desc": " 重复次数。\r\n", "name": "WIDGET_PROP_REPEAT" }, { "desc": " 是否启用长按。\r\n", "name": "WIDGET_PROP_ENABLE_LONG_PRESS" }, { "desc": " 是否启用动画。\r\n", "name": "WIDGET_PROP_ANIMATABLE" }, { "desc": " 是否自动隐藏滚动条。\r\n", "name": "WIDGET_PROP_AUTO_HIDE_SCROLL_BAR" }, { "desc": " 图片名称。\r\n", "name": "WIDGET_PROP_IMAGE" }, { "desc": " 显示格式。\r\n", "name": "WIDGET_PROP_FORMAT" }, { "desc": " 图片绘制类型。\r\n", "name": "WIDGET_PROP_DRAW_TYPE" }, { "desc": " 是否可选择。\r\n", "name": "WIDGET_PROP_SELECTABLE" }, { "desc": " 是否可点击。\r\n", "name": "WIDGET_PROP_CLICKABLE" }, { "desc": " X方向缩放比例。\r\n", "name": "WIDGET_PROP_SCALE_X" }, { "desc": " Y方向缩放比例。\r\n", "name": "WIDGET_PROP_SCALE_Y" }, { "desc": " x锚点。\r\n", "name": "WIDGET_PROP_ANCHOR_X" }, { "desc": " y锚点。\r\n", "name": "WIDGET_PROP_ANCHOR_Y" }, { "desc": " 选中角度(幅度)\r\n", "name": "WIDGET_PROP_ROTATION" }, { "desc": " 紧凑模式。\r\n", "name": "WIDGET_PROP_COMPACT" }, { "desc": " 是否支持滚动。\r\n", "name": "WIDGET_PROP_SCROLLABLE" }, { "desc": " 图标名称。\r\n", "name": "WIDGET_PROP_ICON" }, { "desc": " 选项集合。\r\n", "name": "WIDGET_PROP_OPTIONS" }, { "desc": " 是否被选中。\r\n", "name": "WIDGET_PROP_SELECTED" }, { "desc": " 是否被勾选。\r\n", "name": "WIDGET_PROP_CHECKED" }, { "desc": " active状态下的图标。\r\n", "name": "WIDGET_PROP_ACTIVE_ICON" }, { "desc": " 要打开窗口的名称。\r\n", "name": "WIDGET_PROP_OPEN_WINDOW" }, { "desc": " 被选中项的索引。\r\n", "name": "WIDGET_PROP_SELECTED_INDEX" }, { "desc": " 点击窗口时关闭窗口。\r\n", "name": "WIDGET_PROP_CLOSE_WHEN_CLICK" }, { "desc": " 点击窗口外部时关闭窗口。\r\n", "name": "WIDGET_PROP_CLOSE_WHEN_CLICK_OUTSIDE" }, { "desc": " 行间距。\r\n", "name": "WIDGET_PROP_LINE_GAP" }, { "desc": " 背景颜色(仅仅使用于color tile)。\r\n", "name": "WIDGET_PROP_BG_COLOR" }, { "desc": " 边框颜色(仅仅使用于color tile)。\r\n", "name": "WIDGET_PROP_BORDER_COLOR" }, { "desc": " 延迟时间(毫秒)\r\n", "name": "WIDGET_PROP_DELAY" }, { "desc": " 是否为键盘。\r\n", "name": "WIDGET_PROP_IS_KEYBOARD" }, { "desc": " 是否为焦点控件。\r\n", "name": "WIDGET_PROP_FOCUSED" }, { "desc": " (过时请用focused)。\r\n", "name": "WIDGET_PROP_FOCUS" }, { "desc": " 是否支持焦点停留。\r\n", "name": "WIDGET_PROP_FOCUSABLE" }, { "desc": " 是否支持焦点状态(如果希望style支持焦点状态,但有不希望焦点停留,可用本属性)。\r\n", "name": "WIDGET_PROP_WITH_FOCUS_STATE" }, { "desc": " 将焦点移到下一个的键值。\r\n", "name": "WIDGET_PROP_MOVE_FOCUS_NEXT_KEY" }, { "desc": " 将焦点移到下一个的键值。\r\n", "name": "WIDGET_PROP_MOVE_FOCUS_PREV_KEY" } ], "header": "base/widget_consts.h", "name": "widget_prop_t", "prefix": "WIDGET_PROP_", "annotation": { "scriptable": true, "string": true }, "level": 1 }, { "type": "enum", "desc": " 控件的类型。\r\n", "consts": [ { "desc": " 无特殊类型。\r\n", "name": "WIDGET_TYPE_NONE" }, { "desc": " 窗口管理器。\r\n", "name": "WIDGET_TYPE_WINDOW_MANAGER" }, { "desc": " 普通窗口。\r\n", "name": "WIDGET_TYPE_NORMAL_WINDOW" }, { "desc": " overlay窗口。\r\n", "name": "WIDGET_TYPE_OVERLAY" }, { "desc": " 工具条。\r\n", "name": "WIDGET_TYPE_TOOL_BAR" }, { "desc": " 对话框。\r\n", "name": "WIDGET_TYPE_DIALOG" }, { "desc": " 弹出窗口。\r\n", "name": "WIDGET_TYPE_POPUP" }, { "desc": " system bar window\r\n", "name": "WIDGET_TYPE_SYSTEM_BAR" }, { "desc": " system bar window ato bottom\r\n", "name": "WIDGET_TYPE_SYSTEM_BAR_BOTTOM" }, { "desc": " 精灵窗口。\r\n", "name": "WIDGET_TYPE_SPRITE" }, { "desc": " 键盘窗口。\r\n", "name": "WIDGET_TYPE_KEYBOARD" }, { "desc": " 拖放状态窗口。\r\n", "name": "WIDGET_TYPE_DND" }, { "desc": " 文本控件。\r\n", "name": "WIDGET_TYPE_LABEL" }, { "desc": " 按钮控件。\r\n", "name": "WIDGET_TYPE_BUTTON" }, { "desc": " 图片控件。\r\n", "name": "WIDGET_TYPE_IMAGE" }, { "desc": " 文本编辑控件。\r\n", "name": "WIDGET_TYPE_EDIT" }, { "desc": " 进度条控件。\r\n", "name": "WIDGET_TYPE_PROGRESS_BAR" }, { "desc": " 分组控件。\r\n", "name": "WIDGET_TYPE_GROUP_BOX" }, { "desc": " 多选按钮控件。\r\n", "name": "WIDGET_TYPE_CHECK_BUTTON" }, { "desc": " 单选按钮控件。\r\n", "name": "WIDGET_TYPE_RADIO_BUTTON" }, { "desc": " 对话框标题。\r\n", "name": "WIDGET_TYPE_DIALOG_TITLE" }, { "desc": " 对话框客户区域。\r\n", "name": "WIDGET_TYPE_DIALOG_CLIENT" }, { "desc": " 滑块控件。\r\n", "name": "WIDGET_TYPE_SLIDER" }, { "desc": " 视图控件。\r\n", "name": "WIDGET_TYPE_VIEW" }, { "desc": " 下拉选择框控件。\r\n", "name": "WIDGET_TYPE_COMBO_BOX" }, { "desc": " 下拉选择框的列表项控件。\r\n", "name": "WIDGET_TYPE_COMBO_BOX_ITEM" }, { "desc": " 滑动视图控件。\r\n", "name": "WIDGET_TYPE_SLIDE_VIEW" }, { "desc": " 滑动视图的指示器控件。\r\n", "name": "WIDGET_TYPE_SLIDE_INDICATOR" }, { "desc": " 滑动视图的指示器控件(圆弧显示)。\r\n", "name": "WIDGET_TYPE_SLIDE_INDICATOR_ARC" }, { "desc": " 多页控件。\r\n", "name": "WIDGET_TYPE_PAGES" }, { "desc": " 标签按钮控件。\r\n", "name": "WIDGET_TYPE_TAB_BUTTON" }, { "desc": " 标签控件。\r\n", "name": "WIDGET_TYPE_TAB_CONTROL" }, { "desc": " 标签按钮分组控件。\r\n", "name": "WIDGET_TYPE_TAB_BUTTON_GROUP" }, { "desc": " 按钮分组控件。\r\n", "name": "WIDGET_TYPE_BUTTON_GROUP" }, { "desc": " 候选字控件。\r\n", "name": "WIDGET_TYPE_CANDIDATES" }, { "desc": " 数值编辑控件。\r\n", "name": "WIDGET_TYPE_SPIN_BOX" }, { "desc": " 拖动块控件。\r\n", "name": "WIDGET_TYPE_DRAGGER" }, { "desc": " 滚动条控件。\r\n", "name": "WIDGET_TYPE_SCROLL_BAR" }, { "desc": " 桌面版滚动条控件。\r\n", "name": "WIDGET_TYPE_SCROLL_BAR_DESKTOP" }, { "desc": " 移动版滚动条控件。\r\n", "name": "WIDGET_TYPE_SCROLL_BAR_MOBILE" }, { "desc": " 滚动视图控件。\r\n", "name": "WIDGET_TYPE_SCROLL_VIEW" }, { "desc": " 列表视图控件。\r\n", "name": "WIDGET_TYPE_LIST_VIEW" }, { "desc": " 水平列表视图控件。\r\n", "name": "WIDGET_TYPE_LIST_VIEW_H" }, { "desc": " 列表项控件。\r\n", "name": "WIDGET_TYPE_LIST_ITEM" }, { "desc": " 颜色选择器控件。\r\n", "name": "WIDGET_TYPE_COLOR_PICKER" }, { "desc": " 颜色选择器组件控件。\r\n", "name": "WIDGET_TYPE_COLOR_COMPONENT" }, { "desc": " 颜色块控件。\r\n", "name": "WIDGET_TYPE_COLOR_TILE" }, { "desc": " 富文本控件。\r\n", "name": "WIDGET_TYPE_RICH_TEXT" }, { "desc": " AppBar控件。\r\n", "name": "WIDGET_TYPE_APP_BAR" }, { "desc": " 网格控件。\r\n", "name": "WIDGET_TYPE_GRID" }, { "desc": " 网格项目控件。\r\n", "name": "WIDGET_TYPE_GRID_ITEM" }, { "desc": " 行控件。\r\n", "name": "WIDGET_TYPE_ROW" }, { "desc": " 列控件。\r\n", "name": "WIDGET_TYPE_COLUMN" }, { "desc": " 电阻屏校准窗口。\r\n", "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": " 窗口的生命周期常量定义。\r\n", "consts": [ { "desc": " 初始状态。\r\n", "name": "WINDOW_STAGE_NONE" }, { "desc": " 创建完成。\r\n", "name": "WINDOW_STAGE_CREATED" }, { "desc": " 窗口已经打开(窗口打开动画完成后,处于该状态,直到窗口被关闭)\r\n", "name": "WINDOW_STAGE_OPENED" }, { "desc": " 窗口已关闭。\r\n", "name": "WINDOW_STAGE_CLOSED" } ], "header": "base/widget_consts.h", "name": "window_stage_t", "prefix": "WINDOW_STAGE_", "annotation": { "scriptable": true }, "level": 1 }, { "type": "enum", "desc": " 窗口的closable常量定义。\r\n", "consts": [ { "desc": " 窗口可关闭。\r\n", "name": "WINDOW_CLOSABLE_YES" }, { "desc": " 窗口不可关闭。\r\n", "name": "WINDOW_CLOSABLE_NO" }, { "desc": " 窗口需要确认后才能关闭。\r\n", "name": "WINDOW_CLOSABLE_CONFIRM" } ], "header": "base/widget_consts.h", "name": "window_closable_t", "prefix": "WINDOW_CLOSABLE_", "annotation": { "scriptable": true }, "level": 1 }, { "type": "enum", "desc": " 控件状态常量定义。\r\n\r\n 这里指定常用的状态值,扩展控件可以在自己的头文件中定义私有的状态。\r\n", "consts": [ { "desc": " 无效状态。\r\n", "name": "WIDGET_STATE_NONE" }, { "desc": " 正常状态。\r\n", "name": "WIDGET_STATE_NORMAL" }, { "desc": " 指针按下状态。\r\n", "name": "WIDGET_STATE_PRESSED" }, { "desc": " 指针悬浮状态。\r\n", "name": "WIDGET_STATE_OVER" }, { "desc": " 禁用状态。\r\n", "name": "WIDGET_STATE_DISABLE" }, { "desc": " 聚焦状态。\r\n", "name": "WIDGET_STATE_FOCUSED" }, { "desc": " 勾选状态。\r\n", "name": "WIDGET_STATE_CHECKED" }, { "desc": " 没勾选状态。\r\n", "name": "WIDGET_STATE_UNCHECKED" }, { "desc": " 编辑器无内容状态。\r\n", "name": "WIDGET_STATE_EMPTY" }, { "desc": " 编辑器无内容同时聚焦的状态。\r\n", "name": "WIDGET_STATE_EMPTY_FOCUS" }, { "desc": " 输入错误状态。\r\n", "name": "WIDGET_STATE_ERROR" }, { "desc": " 选中状态。\r\n", "name": "WIDGET_STATE_SELECTED" }, { "desc": " 正常状态(选中项)。\r\n", "name": "WIDGET_STATE_NORMAL_OF_CHECKED" }, { "desc": " 指针按下状态(选中项)。\r\n", "name": "WIDGET_STATE_PRESSED_OF_CHECKED" }, { "desc": " 指针悬浮状态(选中项)。\r\n", "name": "WIDGET_STATE_OVER_OF_CHECKED" }, { "desc": " 焦点状态(选中项)。\r\n", "name": "WIDGET_STATE_FOCUSED_OF_CHECKED" }, { "desc": " 正常状态(当前项)。\r\n", "name": "WIDGET_STATE_NORMAL_OF_ACTIVE" }, { "desc": " 指针按下状态(当前项)。\r\n", "name": "WIDGET_STATE_PRESSED_OF_ACTIVE" }, { "desc": " 指针悬浮状态(当前项)。\r\n", "name": "WIDGET_STATE_OVER_OF_ACTIVE" }, { "desc": " 焦点状态(当前项)。\r\n", "name": "WIDGET_STATE_FOCUSED_OF_ACTIVE" } ], "header": "base/widget_consts.h", "name": "widget_state_t", "prefix": "WIDGET_", "annotation": { "scriptable": true, "string": true }, "level": 1 }, { "type": "class", "methods": [ { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" } ], "annotation": { "scriptable": true }, "desc": " 获取子控件的个数。\r\n\r\n", "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": " 获取指定索引的子控件。\r\n\r\n", "name": "widget_get_child", "return": { "type": "widget_t*", "desc": "子控件。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" } ], "annotation": { "scriptable": true }, "desc": " 获取控件在父控件中的索引编号。\r\n\r\n", "name": "widget_index_of", "return": { "type": "int32_t", "desc": "在父控件中的索引编号。" } }, { "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": " 移动控件。\r\n\r\n", "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": " 调整控件的大小。\r\n\r\n", "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": " 移动控件并调整控件的大小。\r\n\r\n", "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": " 设置控件的值。\r\n 只是对widget\\_set\\_prop的包装,值的意义由子类控件决定。\r\n\r\n", "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": " 设置控件的值(以动画形式变化到指定的值)。\r\n 只是对widget\\_set\\_prop的包装,值的意义由子类控件决定。\r\n\r\n", "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": " 增加控件的值。\r\n 只是对widget\\_set\\_prop的包装,值的意义由子类控件决定。\r\n\r\n", "name": "widget_add_value", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "wchar_t*", "name": "text", "desc": "文本。" } ], "annotation": {}, "desc": " 设置控件的文本。\r\n 只是对widget\\_set\\_prop的包装,文本的意义由子类控件决定。\r\n\r\n", "name": "widget_set_text", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "char*", "name": "style", "desc": "style的名称。" } ], "annotation": { "scriptable": true }, "desc": " 启用指定的主题。\r\n\r\n", "name": "widget_use_style", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "char*", "name": "text", "desc": "文本。" } ], "annotation": { "scriptable": true }, "desc": " 设置控件的文本。\r\n 只是对widget\\_set\\_prop的包装,文本的意义由子类控件决定。\r\n\r\n", "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": "文本。" } ], "annotation": { "scriptable": true }, "desc": " 获取翻译之后的文本,然后调用widget_set_text。\r\n\r\n", "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的包装,值的意义由子类控件决定。\r\n\r\n", "name": "widget_get_value", "return": { "type": "int32_t", "desc": "返回值。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" } ], "annotation": { "scriptable": true }, "desc": " 获取控件的文本。\r\n 只是对widget\\_get\\_prop的包装,文本的意义由子类控件决定。\r\n\r\n", "name": "widget_get_text", "return": { "type": "wchar_t*", "desc": "返回文本。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "point_t*", "name": "p", "desc": "坐标点。" } ], "annotation": {}, "desc": " 将屏幕坐标转换成控件内的本地坐标,即相对于控件左上角的坐标。\r\n\r\n", "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": " 将控件内的本地坐标转换成全局坐标。\r\n\r\n", "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": " 将控件内的本地坐标转换成屏幕上的坐标。\r\n\r\n", "name": "widget_to_screen", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "char*", "name": "name", "desc": "名称。" } ], "annotation": { "scriptable": true }, "desc": " 设置控件的名称。\r\n\r\n", "name": "widget_set_name", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "char*", "name": "name", "desc": "主题的名称。" } ], "annotation": { "scriptable": true }, "desc": " 设置theme的名称,用于动态切换主题。名称与当前主题名称相同,则重新加载全部资源。\r\n\r\n > 目前只支持带有文件系统的平台。\r\n\r\n\r\n", "name": "widget_set_theme", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "char*", "name": "cursor", "desc": "图片名称(无扩展名)。" } ], "annotation": { "scriptable": true }, "desc": " 设置鼠标指针的图片名。\r\n\r\n", "name": "widget_set_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文件使用)。\r\n 请参考[控件动画](https://github.com/zlgopen/awtk/blob/master/docs/widget_animator.md)\r\n\r\n\r\n", "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": " 创建动画。\r\n 请参考[控件动画](https://github.com/zlgopen/awtk/blob/master/docs/widget_animator.md)\r\n\r\n * 除非指定auto_start=false,动画创建后自动启动。\r\n * 除非指定auto_destroy=false,动画播放完成后自动销毁。\r\n\r\n\r\n", "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": " 播放动画。\r\n 请参考[控件动画](https://github.com/zlgopen/awtk/blob/master/docs/widget_animator.md)\r\n\r\n * 1.widget为NULL时,播放所有名称为name的动画。\r\n * 2.name为NULL时,播放所有widget相关的动画。\r\n * 3.widget和name均为NULL,播放所有动画。\r\n\r\n\r\n", "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 时间变快。\r\n 请参考[控件动画](https://github.com/zlgopen/awtk/blob/master/docs/widget_animator.md)\r\n\r\n * 1.widget为NULL时,设置所有名称为name的动画的时间倍率。\r\n * 2.name为NULL时,设置所有widget相关的动画的时间倍率。\r\n * 3.widget和name均为NULL,设置所有动画的时间倍率。\r\n\r\n\r\n", "name": "widget_set_animator_time_scale", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "char*", "name": "name", "desc": "动画名称。" } ], "annotation": { "scriptable": true }, "desc": " 暂停动画。\r\n 请参考[控件动画](https://github.com/zlgopen/awtk/blob/master/docs/widget_animator.md)\r\n\r\n * 1.widget为NULL时,暂停所有名称为name的动画。\r\n * 2.name为NULL时,暂停所有widget相关的动画。\r\n * 3.widget和name均为NULL,暂停所有动画。\r\n\r\n\r\n", "name": "widget_pause_animator", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "char*", "name": "name", "desc": "动画名称。" } ], "annotation": { "scriptable": true }, "desc": " 查找指定名称的动画。\r\n\r\n\r\n", "name": "widget_find_animator", "return": { "type": "widget_animator_t*", "desc": "成功返回动画对象,失败返回NULL。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "char*", "name": "name", "desc": "动画名称。" } ], "annotation": { "scriptable": true }, "desc": " 停止动画(控件的相应属性回归原位)。\r\n 请参考[控件动画](https://github.com/zlgopen/awtk/blob/master/docs/widget_animator.md)\r\n\r\n * 1.widget为NULL时,停止所有名称为name的动画。\r\n * 2.name为NULL时,停止所有widget相关的动画。\r\n * 3.widget和name均为NULL,停止所有动画。\r\n\r\n\r\n", "name": "widget_stop_animator", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "char*", "name": "name", "desc": "动画名称。" } ], "annotation": { "scriptable": true }, "desc": " 销毁动画。\r\n 请参考[控件动画](https://github.com/zlgopen/awtk/blob/master/docs/widget_animator.md)\r\n\r\n * 1.widget为NULL时,销毁所有名称为name的动画。\r\n * 2.name为NULL时,销毁所有widget相关的动画。\r\n * 3.widget和name均为NULL,销毁所有动画。\r\n\r\n\r\n", "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": " 设置控件的可用性。\r\n\r\n", "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": " 设置控件是否启用反馈。\r\n\r\n", "name": "widget_set_feedback", "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标志。\r\n> floating的控件不受父控件的子控件布局参数的影响。\r\n\r\n\r\n", "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": " 设置控件的是否聚焦。\r\n\r\n", "name": "widget_set_focused", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "const char*", "name": "state", "desc": "状态(必须为真正的常量字符串,在widget的整个生命周期有效)。" } ], "annotation": {}, "desc": " 设置控件的状态。\r\n\r\n", "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-255,0表示完全透明,255表示完全不透明)。" } ], "annotation": {}, "desc": " 设置控件的不透明度。\r\n\r\n>在嵌入式平台,半透明效果会使性能大幅下降,请谨慎使用。\r\n\r\n\r\n", "name": "widget_set_opacity", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" } ], "annotation": {}, "desc": " 销毁全部子控件。\r\n\r\n", "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": {}, "desc": " 加入一个子控件。\r\n\r\n", "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": {}, "desc": " 移出指定的子控件(并不销毁)。\r\n\r\n", "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": {}, "desc": " 插入子控件到指定的位置。\r\n\r\n", "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": {}, "desc": " 调整控件在父控件中的位置序数。\r\n\r\n", "name": "widget_restack", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "char*", "name": "name", "desc": "子控件的名称。" } ], "annotation": { "scriptable": true }, "desc": " 查找指定名称的子控件(同widget_lookup(widget, name, FALSE))。\r\n\r\n", "name": "widget_child", "return": { "type": "widget_t*", "desc": "子控件或NULL。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "char*", "name": "name", "desc": "子控件的名称。" }, { "type": "bool_t", "name": "recursive", "desc": "是否递归查找全部子控件。" } ], "annotation": { "scriptable": true }, "desc": " 查找指定名称的子控件(返回第一个)。\r\n\r\n", "name": "widget_lookup", "return": { "type": "widget_t*", "desc": "子控件或NULL。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "char*", "name": "type", "desc": "子控件的名称。" }, { "type": "bool_t", "name": "recursive", "desc": "是否递归查找全部子控件。" } ], "annotation": { "scriptable": true }, "desc": " 查找指定类型的子控件(返回第一个)。\r\n\r\n", "name": "widget_lookup_by_type", "return": { "type": "widget_t*", "desc": "子控件或NULL。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "bool_t", "name": "visible", "desc": "是否可见。" }, { "type": "bool_t", "name": "recursive", "desc": "是否递归设置全部子控件。" } ], "annotation": { "scriptable": true }, "desc": " 设置控件的可见性。\r\n\r\n", "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)。\r\n\r\n", "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": " 设置控件是否接受用户事件。\r\n\r\n", "name": "widget_set_sensitive", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "uint32_t", "name": "type", "desc": "事件类型。" }, { "type": "event_func_t", "name": "on_event", "desc": "事件处理函数。" }, { "type": "void*", "name": "ctx", "desc": "事件处理函数上下文。" } ], "annotation": { "scriptable": "custom" }, "desc": " 注册指定事件的处理函数。\r\n 使用示例:\r\n\r\n ```c\r\n widget_t* ok = button_create(win, 10, 10, 80, 30);\r\n widget_on(ok, EVT_CLICK, on_click, NULL);\r\n\r\n ```\r\n\r\n", "name": "widget_on", "return": { "type": "int32_t", "desc": "返回id,用于widget_off。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "uint32_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": { "scriptable": "custom" }, "desc": " 注册指定tag的事件处理函数。\r\n\r\n > 注册时指定一个tag,可用widget\\_off\\_by\\_tag注销相同tag的事件处理函数。\r\n\r\n\r\n", "name": "widget_on_with_tag", "return": { "type": "int32_t", "desc": "返回id,用于widget_off。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "int32_t", "name": "id", "desc": "widget_on返回的ID。" } ], "annotation": { "scriptable": true }, "desc": " 注销指定事件的处理函数。\r\n\r\n", "name": "widget_off", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "char*", "name": "name", "desc": "子控件的名称。" }, { "type": "uint32_t", "name": "type", "desc": "事件类型。" }, { "type": "event_func_t", "name": "on_event", "desc": "事件处理函数。" }, { "type": "void*", "name": "ctx", "desc": "事件处理函数上下文。" } ], "annotation": {}, "desc": " 为指定名称的子控件注册指定事件的处理函数。\r\n 递归查找指定名称的子控件,然后为其注册指定事件的处理函数。\r\n\r\n", "name": "widget_child_on", "return": { "type": "int32_t", "desc": "返回id,用于widget_off。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "uint32_t", "name": "type", "desc": "事件类型。" }, { "type": "event_func_t", "name": "on_event", "desc": "事件处理函数。" }, { "type": "void*", "name": "ctx", "desc": "事件处理函数上下文。" } ], "annotation": {}, "desc": " 注销指定函数的事件处理函数。\r\n\r\n", "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的事件处理函数。\r\n\r\n", "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的事件处理函数。\r\n\r\n", "name": "widget_off_by_tag", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "rect_t*", "name": "r", "desc": "矩形对象(widget本地坐标)。" } ], "annotation": {}, "desc": " 请求重绘指定的区域,如果widget->dirty已经为TRUE,直接返回。\r\n\r\n", "name": "widget_invalidate", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "rect_t*", "name": "r", "desc": "矩形对象(widget本地坐标)。" } ], "annotation": { "scriptable": true }, "desc": " 请求强制重绘控件。\r\n\r\n", "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": { "private": true }, "desc": " 绘制控件到一个canvas上。\r\n\r\n", "name": "widget_paint", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "event_t*", "name": "e", "desc": "事件。" } ], "annotation": {}, "desc": " 分发一个事件。\r\n\r\n", "name": "widget_dispatch", "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": " 获取控件指定属性的值。\r\n\r\n", "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": " 获取控件指定属性的缺省值(在持久化控件时,无需保存缺省值)。\r\n\r\n", "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": " 设置控件指定属性的值。\r\n\r\n", "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": " 设置字符串格式的属性。\r\n\r\n", "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": " 获取字符串格式的属性。\r\n\r\n", "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": {}, "desc": " 设置指针格式的属性。\r\n\r\n", "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": {}, "desc": " 获取指针格式的属性。\r\n\r\n", "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": " 设置整数格式的属性。\r\n\r\n", "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": " 获取整数格式的属性。\r\n\r\n", "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": " 设置布尔格式的属性。\r\n\r\n", "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": " 获取布尔格式的属性。\r\n\r\n", "name": "widget_get_prop_bool", "return": { "type": "bool_t", "desc": "返回属性的值。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" } ], "annotation": { "scriptable": true }, "desc": " 判断当前控件所在的窗口是否已经打开。\r\n\r\n", "name": "widget_is_window_opened", "return": { "type": "bool_t", "desc": "返回当前控件所在的窗口是否已经打开。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" } ], "annotation": { "scriptable": true }, "desc": " 判断当前控件是否是窗口。\r\n\r\n", "name": "widget_is_window", "return": { "type": "bool_t", "desc": "返回当前控件是否是窗口。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" } ], "annotation": { "scriptable": true }, "desc": " 判断当前控件是否是设计窗口。\r\n\r\n", "name": "widget_is_designing_window", "return": { "type": "bool_t", "desc": "返回当前控件是否是设计窗口。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" } ], "annotation": { "scriptable": true }, "desc": " 判断当前控件是否是窗口管理器。\r\n\r\n", "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": " 让指定子控件抓住事件。\r\n 控件抓住之后,事件直接分发给该控件。\r\n\r\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": " 让指定子控件放弃抓住事件。\r\n\r\n", "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": " 遍历当前控件及子控件。\r\n\r\n", "name": "widget_foreach", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" } ], "annotation": { "scriptable": true }, "desc": " 获取当前控件所在的窗口。\r\n\r\n", "name": "widget_get_window", "return": { "type": "widget_t*", "desc": "窗口对象。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" } ], "annotation": { "scriptable": true }, "desc": " 获取当前的窗口管理器。\r\n\r\n", "name": "widget_get_window_manager", "return": { "type": "widget_t*", "desc": "窗口管理器对象。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" } ], "annotation": { "scriptable": true }, "desc": " 获取当前控件的类型名称。\r\n\r\n", "name": "widget_get_type", "return": { "type": "char*", "desc": "返回类型名。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "widget_t*", "name": "parent", "desc": "clone新控件的parent对象。" } ], "annotation": { "scriptable": true }, "desc": " clone。\r\n\r\n", "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是否相同。\r\n\r\n", "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": " 创建定时器。\r\n 该定时器在控件销毁时自动销毁,**timer\\_info\\_t**的ctx为widget。\r\n 如果定时器的生命周期与控件无关,请直接调用**timer_add**,以避免不必要的内存开销。\r\n\r\n 使用示例:\r\n\r\n ```c\r\n static ret_t digit_clock_on_timer(const timer_info_t* info) {\r\n widget_t* widget = WIDGET(info->ctx);\r\n\r\n return RET_REPEAT;\r\n }\r\n ...\r\n widget_add_timer(widget, digit_clock_on_timer, 1000);\r\n\r\n ```\r\n\r\n", "name": "widget_add_timer", "return": { "type": "uint32_t", "desc": "返回timer的ID,TK_INVALID_ID表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "idle_func_t", "name": "on_idle", "desc": "idle回调函数。" } ], "annotation": {}, "desc": " 创建idle。\r\n 该idle在控件销毁时自动销毁,**idle\\_info\\_t**的ctx为widget。\r\n 如果idle的生命周期与控件无关,请直接调用**idle_add**,以避免不必要的内存开销。\r\n\r\n", "name": "widget_add_idle", "return": { "type": "uint32_t", "desc": "返回idle的ID,TK_INVALID_ID表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "const char*", "name": "name", "desc": "图片名(不带扩展名)。" }, { "type": "bitmap_t*", "name": "bitmap", "desc": "返回图片对象。" } ], "annotation": {}, "desc": " 加载图片。\r\n 返回的bitmap对象只在当前调用有效,请不保存对bitmap对象的引用。\r\n\r\n\r\n 使用示例:\r\n\r\n ```c\r\n bitmap_t bitmap;\r\n widget_load_image(widget, \"myimage\", &bitmap);\r\n\r\n ```\r\n\r\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": " 卸载图片。\r\n\r\n> 一般不需要调用,只有确认在图片不再需要时才调用本函数卸载。\r\n\r\n\r\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": " 加载资源。\r\n\r\n 使用示例:\r\n\r\n ```c\r\n const asset_info_t* asset = widget_load_asset(widget, ASSET_TYPE_IMAGE, \"mysvg\");\r\n ...\r\n widget_unload_asset(widget, asset);\r\n ```\r\n\r\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": " 卸载资源。\r\n\r\n 使用示例:\r\n\r\n ```c\r\n const asset_info_t* asset = widget_load_asset(widget, ASSET_TYPE_IMAGE, \"mysvg\");\r\n ...\r\n widget_unload_asset(widget, asset);\r\n ```\r\n\r\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对象(供脚本语言使用)。\r\n\r\n", "name": "widget_cast", "return": { "type": "widget_t*", "desc": "widget对象。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" } ], "annotation": { "scriptable": true }, "desc": " 销毁控件。\r\n 一般无需直接调用,关闭窗口时,自动销毁相关控件。\r\n\r\n", "name": "widget_destroy", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" } ], "annotation": { "private": true }, "desc": " 判断当前控件是否是keyboard。\r\n\r\n> keyboard收到pointer事件时,不会让当前控件失去焦点。\r\n\r\n 在自定义软键盘时,将所有按钮放到一个容器当中,并设置为is_keyboard。\r\n\r\n ```c\r\n widget_set_prop_bool(group, WIDGET_PROP_IS_KEYBOARD, TRUE);\r\n ```\r\n\r\n\r\n", "name": "widget_is_keyboard", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "canvas_t*", "name": "c", "desc": "画布对象。" }, { "type": "char*", "name": "icon", "desc": "图标的名称。" }, { "type": "wstr_t*", "name": "text", "desc": "文字。" } ], "annotation": { "private": true }, "desc": " 帮助子控件实现自己的绘制函数。\r\n\r\n", "name": "widget_paint_helper", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "canvas_t*", "name": "c", "desc": "画布对象。" }, { "type": "rect_t*", "name": "r", "desc": "矩形区域。" } ], "annotation": { "private": true }, "desc": " 根据控件的style绘制边框矩形。\r\n\r\n", "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": "rect_t*", "name": "r", "desc": "矩形区域。" }, { "type": "image_draw_type_t", "name": "draw_type", "desc": "图片缺省绘制方式。" } ], "annotation": { "private": true }, "desc": " 根据控件的style绘制背景矩形。\r\n\r\n", "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": "rect_t*", "name": "r", "desc": "矩形区域。" }, { "type": "image_draw_type_t", "name": "draw_type", "desc": "图片缺省绘制方式。" } ], "annotation": { "private": true }, "desc": " 根据控件的style绘制前景矩形。\r\n\r\n", "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": { "private": true }, "desc": " 从widget的style中取出字体名称、大小和颜色数据,设置到canvas中。\r\n\r\n\r\n", "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": { "private": true }, "desc": " 计算文本的宽度。\r\n 字体由控件当前的状态和style决定。\r\n\r\n", "name": "widget_measure_text", "return": { "type": "float_t", "desc": "返回文本的宽度。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "event_t*", "name": "e", "desc": "事件对象。" } ], "annotation": { "private": true }, "desc": " 递归分发事件到targe控件。\r\n\r\n", "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": { "private": true }, "desc": " 判断一个点是否在控件内。\r\n\r\n", "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": { "private": true }, "desc": " 递归的分发一个事件到所有target子控件。\r\n\r\n", "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": { "private": true }, "desc": " 递归的分发一个事件到所有key_target子控件。\r\n\r\n", "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": { "private": true }, "desc": " 查找x/y坐标对应的子控件。\r\n\r\n", "name": "widget_find_target", "return": { "type": "widget*", "desc": "子控件或NULL。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" } ], "annotation": { "private": true }, "desc": " 语言改变后,重新翻译控件上的文本(包括子控件)。\r\n\r\n", "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": { "private": true }, "desc": " 初始化控件。仅在子类控件构造函数中使用。\r\n\r\n > 请用widget\\_create代替本函数。\r\n\r\n @depreated\r\n\r\n", "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": { "private": true }, "desc": " 创建控件。仅在子类控件构造函数中使用。\r\n\r\n", "name": "widget_create", "return": { "type": "widget_t*", "desc": "widget对象本身。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "widget对象。" } ], "annotation": { "private": true }, "desc": " 让控件根据自己当前状态更新style。\r\n\r\n", "name": "widget_update_style", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "widget对象。" } ], "annotation": { "private": true }, "desc": " 递归的把父控件的key_target设置为自己。\r\n\r\n\r\n", "name": "widget_set_as_key_target", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "widget对象。" } ], "annotation": { "private": true }, "desc": " 把焦点移动下一个控件。\r\n\r\n>widget必须是当前焦点控件。\r\n\r\n", "name": "widget_focus_next", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "widget对象。" } ], "annotation": { "private": true }, "desc": " 把焦点移动前一个控件。\r\n\r\n>widget必须是当前焦点控件。\r\n\r\n", "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": { "private": true }, "desc": " 把控件的状态转成获取style选要的状态,一般只在子类中使用。\r\n\r\n", "name": "widget_get_state_for_style", "return": { "type": "const char*", "desc": "返回状态值。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "widget对象。" } ], "annotation": { "scriptable": true }, "desc": " 布局当前控件及子控件。\r\n\r\n", "name": "widget_layout", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" } ], "annotation": {}, "desc": " layout子控件。\r\n\r\n", "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": " 设置控件自己的布局参数。\r\n\r\n", "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": " 设置子控件的布局参数。\r\n\r\n", "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)。\r\n\r\n", "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。\r\n\r\n", "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。\r\n\r\n", "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": "值。" } ], "annotation": { "scriptable": true }, "desc": " 设置颜色类型的style。\r\n\r\n", "name": "widget_set_style_color", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" } }, { "params": [], "annotation": {}, "desc": " 获取canvas对象。\r\n\r\n", "name": "widget_get_canvas", "return": { "type": "canvas_t*", "desc": "返回canvas对象。" } } ], "events": [ { "name": "EVT_WILL_MOVE", "desc": " 控件移动前触发。\r\n", "type": "event_t" }, { "name": "EVT_MOVE", "desc": " 控件移动后触发。\r\n", "type": "event_t" }, { "name": "EVT_WILL_RESIZE", "desc": " 控件调整大小前触发。\r\n", "type": "event_t" }, { "name": "EVT_RESIZE", "desc": " 控件调整大小后触发。\r\n", "type": "event_t" }, { "name": "EVT_WILL_MOVE_RESIZE", "desc": " 控件移动并调整大小前触发。\r\n", "type": "event_t" }, { "name": "EVT_MOVE_RESIZE", "desc": " 控件移动并调整大小后触发。\r\n", "type": "event_t" }, { "name": "EVT_PROP_WILL_CHANGE", "desc": " 控件属性改变前触发(通过set_prop设置属性,才会触发)。\r\n", "type": "prop_change_event_t" }, { "name": "EVT_PROP_CHANGED", "desc": " 控件属性改变后触发(通过set_prop设置属性,才会触发)。\r\n", "type": "prop_change_event_t" }, { "name": "EVT_BEFORE_PAINT", "desc": " 控件绘制前触发。\r\n", "type": "paint_event_t" }, { "name": "EVT_AFTER_PAINT", "desc": " 控件绘制完成时触发。\r\n", "type": "paint_event_t" }, { "name": "EVT_FOCUS", "desc": " 控件得到焦点时触发。\r\n", "type": "event_t" }, { "name": "EVT_BLUR", "desc": " 控件失去焦点时触发。\r\n", "type": "event_t" }, { "name": "EVT_WHEEL", "desc": " 鼠标滚轮事件。\r\n", "type": "wheel_event_t" }, { "name": "EVT_POINTER_LEAVE", "desc": " 鼠标指针离开控件时触发。\r\n", "type": "pointer_event_t" }, { "name": "EVT_POINTER_ENTER", "desc": " 鼠标指针进入控件时触发。\r\n", "type": "pointer_event_t" }, { "name": "EVT_KEY_DOWN", "desc": " 键按下事件。\r\n", "type": "pointer_event_t" }, { "name": "EVT_KEY_UP", "desc": " 键释放事件。\r\n", "type": "pointer_event_t" }, { "name": "EVT_POINTER_DOWN", "desc": " 指针设备按下事件。\r\n", "type": "pointer_event_t" }, { "name": "EVT_POINTER_DOWN_ABORT", "desc": " 取消指针设备按下事件。\r\n", "type": "pointer_event_t" }, { "name": "EVT_POINTER_MOVE", "desc": " 指针设备移动事件。\r\n", "type": "pointer_event_t" }, { "name": "EVT_POINTER_UP", "desc": " 指针设备释放事件。\r\n", "type": "pointer_event_t" }, { "name": "EVT_DESTROY", "desc": " 控件销毁时触发。\r\n", "type": "event_t" } ], "properties": [ { "name": "x", "desc": " x坐标(相对于父控件的x坐标)。\r\n", "type": "xy_t", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "persitent": true, "design": true, "scriptable": true } }, { "name": "y", "desc": " y坐标(相对于父控件的y坐标)。\r\n", "type": "xy_t", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "persitent": true, "design": true, "scriptable": true } }, { "name": "w", "desc": " 宽度。\r\n", "type": "wh_t", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "persitent": true, "design": true, "scriptable": true } }, { "name": "h", "desc": " 高度。\r\n", "type": "wh_t", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "persitent": true, "design": true, "scriptable": true } }, { "name": "name", "desc": " 控件名字。\r\n", "type": "char*", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "persitent": true, "design": true, "scriptable": true } }, { "name": "tr_text", "desc": " 保存用于翻译的字符串。\r\n", "type": "char*", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "persitent": true, "design": true, "scriptable": true } }, { "name": "style", "desc": " style的名称。\r\n", "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)\r\n", "type": "char*", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "persitent": true, "design": true, "scriptable": true } }, { "name": "enable", "desc": " 启用/禁用状态。\r\n", "type": "bool_t", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "persitent": true, "design": true, "scriptable": true } }, { "name": "feedback", "desc": " 是否启用按键音、触屏音和震动等反馈。\r\n", "type": "bool_t", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "persitent": true, "design": true, "scriptable": true } }, { "name": "visible", "desc": " 是否可见。\r\n", "type": "bool_t", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "writable": true, "persitent": true, "design": true, "scriptable": true } }, { "name": "sensitive", "desc": " 是否接受用户事件。\r\n", "type": "bool_t", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "writable": true, "persitent": true, "design": true, "scriptable": true } }, { "name": "focusable", "desc": " 是否支持焦点停留。\r\n", "type": "bool_t", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "writable": true, "persitent": true, "design": true, "scriptable": true } }, { "name": "with_focus_state", "desc": " 是否支持焦点状态。\r\n > 如果希望style支持焦点状态,但有不希望焦点停留,可用本属性。\r\n", "type": "bool_t", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "writable": true, "persitent": true, "design": true, "scriptable": true } }, { "name": "focused", "desc": " 是否得到焦点。\r\n", "type": "bool_t", "annotation": { "readable": true } }, { "name": "auto_created", "desc": " 是否由父控件自动创建。\r\n", "type": "bool_t", "annotation": { "readable": true } }, { "name": "dirty", "desc": " 标识控件是否需要重绘。\r\n", "type": "bool_t", "annotation": { "readable": true } }, { "name": "floating", "desc": " 标识控件是否启用浮动布局,不受父控件的children_layout的控制。\r\n", "type": "bool_t", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "persitent": true, "design": true, "scriptable": true } }, { "name": "need_relayout_children", "desc": " 标识控件是否需要重新layout子控件。\r\n", "type": "bool_t", "annotation": { "readable": true } }, { "name": "need_update_style", "desc": " 标识控件是否需要update style。\r\n", "type": "bool_t", "annotation": { "readable": true } }, { "name": "can_not_destroy", "desc": " 标识控件目前不能被销毁(比如正在分发事件),如果此时调用widget\\_destroy,自动异步处理。\r\n", "type": "uint16_t", "annotation": { "readable": true } }, { "name": "initializing", "desc": " 标识控件正在初始化。\r\n", "type": "bool_t", "annotation": { "readable": true } }, { "name": "destroying", "desc": " 标识控件正在被销毁。\r\n", "type": "bool_t", "annotation": { "readable": true } }, { "name": "state", "desc": " 控件的状态(取值参考widget_state_t)。\r\n", "type": "uint8_t", "annotation": { "readable": true } }, { "name": "opacity", "desc": " 不透明度(0-255),0完全透明,255完全不透明。\r\n", "type": "uint8_t", "annotation": { "readable": true } }, { "name": "text", "desc": " 文本。用途视具体情况而定。\r\n", "type": "wstr_t", "annotation": { "readable": true } }, { "name": "parent", "desc": " 父控件\r\n", "type": "widget_t*", "annotation": { "readable": true } }, { "name": "target", "desc": " 接收事件的子控件。\r\n", "type": "widget_t*", "annotation": { "private": true } }, { "name": "grab_widget", "desc": " grab事件的子控件。\r\n", "type": "widget_t*", "annotation": { "private": true } }, { "name": "grab_widget_count", "desc": " 有时子控件和控件自己都会grab widget,所需要grab的计数。\r\n", "type": "int32_t", "annotation": { "private": true } }, { "name": "key_target", "desc": " 接收按键事件的子控件。\r\n", "type": "widget_t*", "annotation": { "private": true } }, { "name": "children", "desc": " 全部子控件。\r\n", "type": "darray_t*", "annotation": { "readable": true } }, { "name": "emitter", "desc": " 事件发射器。\r\n", "type": "emitter_t*", "annotation": { "readable": true } }, { "name": "astyle", "desc": " Style对象。\r\n", "type": "style_t*", "annotation": { "readable": true } }, { "name": "children_layout", "desc": " 子控件布局器。请参考[控件布局参数](https://github.com/zlgopen/awtk/blob/master/docs/layout.md)\r\n", "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)\r\n", "type": "self_layouter_t*", "annotation": { "readable": true, "set_prop": true, "get_prop": true } }, { "name": "custom_props", "desc": " 自定义属性。\r\n", "type": "object_t*", "annotation": { "readable": true } }, { "name": "vt", "desc": " 虚函数表。\r\n", "type": "widget_vtable_t", "annotation": { "readable": true } } ], "header": "base/widget.h", "desc": " **widget_t** 是所有控件、窗口和窗口管理器的基类。\r\n **widget_t**也是一个容器,可放其它**widget_t**到它的内部,形成一个树形结构。\r\n\r\n ```graphviz\r\n [default_style]\r\n\r\n widget_t -> widget_t[arrowhead = \"diamond\"]\r\n window_t -> widget_t[arrowhead = \"empty\"]\r\n window_manager_t -> widget_t[arrowhead = \"empty\"]\r\n button_t -> widget_t[arrowhead = \"empty\"]\r\n label_t -> widget_t[arrowhead = \"empty\"]\r\n xxx_widget_t -> widget_t[arrowhead = \"empty\"]\r\n ```\r\n\r\n 通常**widget_t**通过一个矩形区域向用户呈现一些信息,接受用户的输入,并据此做出适当的反应。\r\n 它负责控件的生命周期、通用状态、事件分发和Style的管理。\r\n 本类提供的接口(函数和属性)除非特别说明,一般都适用于子类控件。\r\n\r\n 为了便于解释,这里特别说明一下几个术语:\r\n\r\n * **父控件与子控件**:父控件与子控件指的两个控件的组合关系(这是在运行时决定的)。\r\n 比如:在窗口中放一个按钮,此时,我们称按钮是窗口的子控件,窗口是按钮的父控件。\r\n\r\n ```graphviz\r\n [default_style]\r\n\r\n 子控件 -> 父控件[arrowhead = \"ediamond\"]\r\n ```\r\n\r\n * **子类控件与父类控件**:子类控件与父类控件指的两类控件的继承关系(这是在设计时决定的)。\r\n 比如:我们称**button_t**是**widget_t**的子类控件,**widget_t**是**button_t**的父类控件。\r\n\r\n ```graphviz\r\n [default_style]\r\n\r\n 子类控件 -> 父类控件[arrowhead = \"empty\"]\r\n\r\n ```\r\n\r\n widget相关的函数都只能在GUI线程中执行,如果需在非GUI线程中想调用widget相关函数,\r\n 请用idle\\_queue或timer\\_queue进行串行化。\r\n 请参考[demo thread](https://github.com/zlgopen/awtk/blob/master/demos/demo_thread_app.c)\r\n\r\n **widget\\_t**是抽象类,不要直接创建**widget\\_t**的实例。控件支持两种创建方式:\r\n\r\n * 通过XML创建。如:\r\n\r\n ```xml\r\n \r\n ```\r\n\r\n 拖动对话框标题时移动对话框:\r\n\r\n ```xml\r\n \r\n \r\n \r\n ```\r\n\r\n > 更多用法请参考:\r\n [draggable.xml](https://github.com/zlgopen/awtk/blob/master/demos/assets/default/raw/ui/draggable.xml)\r\n\r\n 在c代码中使用函数draggable\\_create创建按钮控件。如:\r\n\r\n ```c\r\n widget_t* draggable = draggable_create(target, 0, 0, 0, 0);\r\n ```\r\n\r\n > draggable本身不可见,故无需style。\r\n\r\n", "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": " 创建guage_pointer对象\r\n\r\n", "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对象(供脚本语言使用)。\r\n\r\n", "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度,顺时钟方向为正,单位为度。\r\n\r\n", "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": " 设置指针的图片。\r\n\r\n", "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": " 设置指针的旋转锚点。\r\n\r\n", "name": "guage_pointer_set_anchor", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" } } ], "events": [], "properties": [ { "name": "angle", "desc": " 指针角度。12点钟方向为0度,顺时钟方向为正,单位为度。\r\n", "type": "int32_t", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "persitent": true, "design": true, "scriptable": true } }, { "name": "image", "desc": " 指针图片。\r\n\r\n 图片须垂直向上,图片的中心点为旋转方向。\r\n\r\n", "type": "char*", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "persitent": true, "design": true, "scriptable": true } }, { "name": "anchor_x", "desc": " 旋转锚点x坐标。\r\n", "type": "float_t", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "persitent": true, "design": true, "scriptable": true } }, { "name": "anchor_y", "desc": " 旋转锚点y坐标。\r\n", "type": "float_t", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "persitent": true, "design": true, "scriptable": true } } ], "header": "guage/guage_pointer.h", "desc": " 仪表指针控件。\r\n\r\n 仪表指针就是一张旋转的图片,图片可以是普通图片也可以是SVG图片。\r\n\r\n 在嵌入式平台上,对于旋转的图片,SVG图片的效率比位图高数倍,所以推荐使用SVG图片。\r\n\r\n guage\\_pointer\\_t是[widget\\_t](widget_t.md)的子类控件,widget\\_t的函数均适用于guage\\_pointer\\_t控件。\r\n\r\n 在xml中使用\"guage\\_pointer\"标签创建仪表指针控件。如:\r\n\r\n ```xml\r\n \r\n ```\r\n\r\n > 更多用法请参考:\r\n [guage.xml](https://github.com/zlgopen/awtk/blob/master/demos/assets/default/raw/ui/guage.xml)\r\n\r\n 在c代码中使用函数guage\\_pointer\\_create创建仪表指针控件。如:\r\n\r\n ```c\r\n widget_t* guage_pointer = guage_pointer_create(guage, 10, 10, 100, 30);\r\n guage_pointer_set_image(guage_pointer, \"guage_pointer\");\r\n ```\r\n\r\n > 创建之后,需要用guage\\_pointer\\_set\\_image设置仪表指针图片。\r\n\r\n\r\n", "name": "guage_pointer_t", "parent": "widget_t", "annotation": { "scriptable": true, "design": true, "widget": true }, "level": 2 }, { "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": "\r\n 创建fd事件源。\r\n\r\n\r\n\r\n", "name": "event_source_fd_create", "return": { "type": "event_source_t*", "desc": "返回事件源对象。" } } ], "events": [], "properties": [], "header": "tkc/event_source_fd.h", "desc": "\r\n fd事件源。用于文件、管道和套接字。\r\n\r\n", "name": "event_source_fd_t", "parent": "object", "level": 2 }, { "type": "class", "methods": [ { "params": [ { "type": "idle_manager_t*", "name": "idle_manager", "desc": "定时器管理器对象。" } ], "annotation": {}, "desc": "\r\n 创建idle事件源。\r\n\r\n\r\n\r\n", "name": "event_source_idle_create", "return": { "type": "event_source_t*", "desc": "返回事件源对象。" } }, { "params": [ { "type": "event_source_manager_t*", "name": "manager", "desc": "event_source_manager对象。" } ], "annotation": {}, "desc": "\r\n 创建事件源管理器。\r\n\r\n\r\n\r\n", "name": "event_source_manager_default_create", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" } } ], "events": [], "properties": [], "header": "tkc/event_source_idle.h", "desc": "\r\n idle事件源。\r\n\r\n", "name": "event_source_idle_t", "parent": "object", "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对象\r\n\r\n", "name": "guage_create", "return": { "type": "widget_t*", "desc": "对象。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "guage对象。" } ], "annotation": { "cast": true, "scriptable": true }, "desc": " 转换为guage对象(供脚本语言使用)。\r\n\r\n", "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": " 设置背景图片的名称。\r\n\r\n", "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": " 设置图片的显示方式。\r\n\r\n > 绘制方式的属性值和枚举值:\r\n [image\\_draw\\_type\\_name\\_value](https://github.com/zlgopen/awtk/blob/master/src/base/enums.c#L98)\r\n\r\n\r\n", "name": "guage_set_draw_type", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" } } ], "events": [], "properties": [ { "name": "image", "desc": " 背景图片。\r\n", "type": "char*", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "persitent": true, "design": true, "scriptable": true } }, { "name": "draw_type", "desc": " 图片的绘制方式。\r\n", "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": " 表盘控件。\r\n\r\n 表盘控件就是一张图片。\r\n\r\n guage\\_t是[widget\\_t](widget_t.md)的子类控件,widget\\_t的函数均适用于guage\\_t控件。\r\n\r\n 在xml中使用\"guage\"标签创建表盘控件。如:\r\n\r\n ```xml\r\n \r\n ```\r\n\r\n > 更多用法请参考:\r\n [guage.xml](https://github.com/zlgopen/awtk/blob/master/demos/assets/default/raw/ui/guage.xml)\r\n\r\n 在c代码中使用函数guage\\_create创建表盘控件。如:\r\n\r\n ```c\r\n widget_t* guage = guage_create(win, 10, 10, 200, 200);\r\n guage_set_image(guage, \"guage_bg\");\r\n ```\r\n\r\n 可用通过style来设置控件的显示风格,如背景和边框等。如:\r\n\r\n ```xml\r\n \r\n \r\n \r\n ```\r\n\r\n > 更多用法请参考:\r\n [theme\r\n default](https://github.com/zlgopen/awtk/blob/master/demos/assets/default/raw/styles/default.xml)\r\n\r\n", "name": "guage_t", "parent": "widget_t", "annotation": { "scriptable": true, "design": true, "widget": true }, "level": 2 }, { "type": "class", "methods": [ { "params": [ { "type": "timer_manager_t*", "name": "timer_manager", "desc": "定时器管理器对象。" } ], "annotation": {}, "desc": "\r\n 创建timer事件源。\r\n\r\n\r\n\r\n", "name": "event_source_timer_create", "return": { "type": "event_source_t*", "desc": "返回事件源对象。" } } ], "events": [], "properties": [], "header": "tkc/event_source_timer.h", "desc": "\r\n timer事件源。\r\n\r\n", "name": "event_source_timer_t", "parent": "object", "level": 2 }, { "type": "class", "methods": [ { "params": [ { "type": "event_source_t*", "name": "source", "desc": "event_source对象。" } ], "annotation": {}, "desc": "\r\n 获取文件描述符。\r\n\r\n\r\n\r\n", "name": "event_source_get_fd", "return": { "type": "int32_t", "desc": "返回文件描述符。" } }, { "params": [ { "type": "event_source_t*", "name": "source", "desc": "event_source对象。" } ], "annotation": {}, "desc": "\r\n 分发事件。\r\n\r\n\r\n\r\n", "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": "\r\n 设置tag,方便通过tag一次移除多个事件源。\r\n\r\n\r\n\r\n", "name": "event_source_set_tag", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" } }, { "params": [ { "type": "event_source_t*", "name": "source", "desc": "event_source对象。" } ], "annotation": {}, "desc": "\r\n 对于没有文件描述符的事件源,需要自己检查是否准备就绪。\r\n\r\n\r\n\r\n", "name": "event_source_check", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" } }, { "params": [ { "type": "event_source_t*", "name": "source", "desc": "event_source对象。" } ], "annotation": {}, "desc": "\r\n 获取唤醒时间(ms)。\r\n\r\n\r\n\r\n", "name": "event_source_get_wakeup_time", "return": { "type": "uint32_t", "desc": "返回唤醒时间(ms)。" } } ], "events": [], "properties": [], "header": "tkc/event_source.h", "desc": "\r\n 表示一个事件源。\r\n\r\n 事件源有下列两种方式:\r\n\r\n * 对于有文件描述符的事件源(如socket),get_fd返回一个有效的文件描述符。\r\n * 对于定时器,则get_wakeup_time返回下次唤醒的时间。\r\n\r\n", "name": "event_source_t", "parent": "object", "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对象\r\n\r\n", "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": " 设置是否循环播放。\r\n\r\n", "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": " 设置图片前缀。\r\n\r\n", "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": " 设置播放间隔时间。\r\n\r\n", "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": " 设置延迟播放时间(仅适用于自动播放)。\r\n\r\n", "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": " 设置是否自动播放。\r\n\r\n", "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\",\r\n \"fire3\"。\r\n\r\n", "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\", ...,\r\n \"fire99\"。\r\n\r\n若指定的图片不存在,则重复上一张图片。\r\n\r\n\r\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": " 播放。\r\n\r\n", "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)。\r\n\r\n", "name": "image_animation_stop", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "image_animation对象。" } ], "annotation": { "scriptable": true }, "desc": " 暂停。\r\n\r\n", "name": "image_animation_pause", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "image_animation对象。" } ], "annotation": { "scriptable": true }, "desc": " 手动切换到下一张图片。\r\n\r\n", "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": " 设置生成图片名的格式。\r\n\r\n XXX:生成图片名时,第一个参数是图片名前缀,第二个是序数,只能在此前提下设置格式。\r\n\r\n ```\r\n const char* format = image_animation->format ? image_animation->format : \"%s%d\";\r\n tk_snprintf(name, TK_NAME_LEN, format, image_animation->image, image_animation->index);\r\n ```\r\n\r\n\r\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图片,以释放内存空间。\r\n\r\n", "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对象(供脚本语言使用)。\r\n\r\n", "name": "image_animation_cast", "return": { "type": "widget_t*", "desc": "image_animation对象。" } } ], "events": [], "properties": [ { "name": "image", "desc": " 图片名称的前缀。\r\n", "type": "char*", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "persitent": true, "design": true, "scriptable": true } }, { "name": "sequence", "desc": " 播放的序列,字符可选值为数字和英文大小写字母,字符可以重复。如:0123456789或者123123abcd。\r\n\r\n", "type": "char*", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "persitent": true, "design": true, "scriptable": true } }, { "name": "start_index", "desc": " 图片起始序数。\r\n", "type": "uint32_t", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "persitent": true, "design": true, "scriptable": true } }, { "name": "end_index", "desc": " 图片结束序数。\r\n", "type": "uint32_t", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "persitent": true, "design": true, "scriptable": true } }, { "name": "loop", "desc": " 是否循环播放。\r\n", "type": "bool_t", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "persitent": true, "design": true, "scriptable": true } }, { "name": "auto_play", "desc": " 是否自动播放。\r\n", "type": "bool_t", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "persitent": true, "design": true, "scriptable": true } }, { "name": "unload_after_paint", "desc": " 绘制完成后unload图片,以释放内存空间。\r\n", "type": "bool_t", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "persitent": true, "design": true, "scriptable": true } }, { "name": "format", "desc": " 索引到图片名转换时的格式,缺省为\"%s%d\"。\r\n", "type": "char*", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "persitent": true, "design": true, "scriptable": true } }, { "name": "interval", "desc": " 每张图片播放的时间(毫秒)。\r\n", "type": "uint32_t", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "persitent": true, "design": true, "scriptable": true } }, { "name": "delay", "desc": " 自动播放时延迟播放的时间(毫秒)。\r\n", "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": " 图片动画控件,指定一个图片前缀,依次显示指定序列的图片,从而形成动画效果。\r\n\r\n 图片序列可以用sequence指定,也可以用start\\_index和end\\_index指定一个范围。\r\n\r\n image\\_animation\\_t是[widget\\_t](widget_t.md)的子类控件,widget\\_t的函数均适用于image\\_animation\\_t控件。\r\n\r\n 在xml中使用\"image\\_animation\"标签创建图片动画控件。如:\r\n\r\n ```xml\r\n \r\n ```\r\n\r\n > 更多用法请参考:\r\n [image_animation.xml](https://github.com/zlgopen/awtk/blob/master/demos/assets/default/raw/ui/image_animation.xml)\r\n\r\n 在c代码中使用函数image\\_animation\\_create创建图片动画控件。如:\r\n\r\n ```c\r\n image_animation = image_animation_create(win, 10, 10, 200, 200);\r\n image_animation_set_image(image_animation, \"ani\");\r\n image_animation_set_interval(image_animation, 50);\r\n image_animation_set_range_sequence(image_animation, 1, 9);\r\n image_animation_play(image_animation);\r\n ```\r\n\r\n > 完整示例请参考:\r\n [image_animation\r\n demo](https://github.com/zlgopen/awtk-c-demos/blob/master/demos/image_animation.c)\r\n\r\n 可用通过style来设置控件的显示风格,如背景颜色和边框等等,不过一般情况并不需要。\r\n\r\n", "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对象\r\n\r\n", "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": " 设置图片前缀。\r\n\r\n", "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": " 设置格式。\r\n\r\n", "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": "value", "desc": "值。" } ], "annotation": { "scriptable": true }, "desc": " 设置值。\r\n\r\n", "name": "image_value_set_value", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "image_value对象。" } ], "annotation": { "cast": true, "scriptable": true }, "desc": " 转换为image_value对象(供脚本语言使用)。\r\n\r\n", "name": "image_value_cast", "return": { "type": "widget_t*", "desc": "image_value对象。" } } ], "events": [], "properties": [ { "name": "image", "desc": " 图片名称的前缀。\r\n", "type": "char*", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "persitent": true, "design": true, "scriptable": true } }, { "name": "format", "desc": " 数值到字符串转换时的格式,缺省为\"%d\"。\r\n", "type": "char*", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "persitent": true, "design": true, "scriptable": true } }, { "name": "value", "desc": " 值。\r\n", "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": " 图片值控件。\r\n\r\n 可以用图片来表示如电池电量、WIFI信号强度和其它各种数值的值。\r\n\r\n 其原理如下:\r\n\r\n * 1.把value以format为格式转换成字符串。\r\n * 2.把每个字符与image(图片文件名前缀)映射成一个图片名。\r\n * 3.最后把这些图片显示出来。\r\n\r\nimage\\_value\\_t是[widget\\_t](widget_t.md)的子类控件,widget\\_t的函数均适用于image\\_value\\_t控件。\r\n\r\n在xml中使用\"image\\_value\"标签创建图片值控件。如:\r\n\r\n ```xml\r\n \r\n ```\r\n\r\n > 更多用法请参考:\r\n [image\\_value](https://github.com/zlgopen/awtk/blob/master/demos/assets/default/raw/ui/image_value.xml)\r\n\r\n 在c代码中使用函数image\\_value\\_create创建图片值控件。如:\r\n\r\n ```c\r\n image_value = image_value_create(win, 10, 10, 200, 200);\r\n image_value_set_image(image_value, \"num_\");\r\n image_value_set_value(image_value, 100);\r\n ```\r\n\r\n > 完整示例请参考:\r\n [image_value demo](https://github.com/zlgopen/awtk-c-demos/blob/master/demos/image_value.c)\r\n\r\n 可用通过style来设置控件的显示风格,如背景颜色和边框等等,不过一般情况并不需要。\r\n\r\n", "name": "image_value_t", "parent": "widget_t", "annotation": { "scriptable": true, "design": true, "widget": true }, "level": 2 }, { "type": "class", "methods": [ { "params": [ { "type": "event_t*", "name": "event", "desc": "event对象。" } ], "annotation": { "cast": true, "scriptable": true }, "desc": " 把event对象转prop_change_event_t对象,主要给脚本语言使用。\r\n\r\n", "name": "prop_change_event_cast", "return": { "type": "prop_change_event_t*", "desc": "对象。" } } ], "events": [], "properties": [ { "name": "name", "desc": " 属性的名称。\r\n", "type": "const char*", "annotation": { "readable": true, "scriptable": true } }, { "name": "value", "desc": " 属性的值。\r\n", "type": "const value_t*", "annotation": { "readable": true, "scriptable": true } } ], "header": "tkc/event.h", "desc": " 对象属性变化事件。\r\n", "name": "prop_change_event_t", "annotation": { "scriptable": true }, "parent": "event_t", "level": 2 }, { "type": "class", "methods": [ { "params": [ { "type": "widget_t*", "name": "parent", "desc": "父控件" }, { "type": "xy_t", "name": "x", "desc": "x坐标" }, { "type": "xy_t", "name": "y", "desc": "y坐标" }, { "type": "wh_t", "name": "w", "desc": "宽度" }, { "type": "wh_t", "name": "h", "desc": "高度" } ], "annotation": { "constructor": true }, "desc": " 创建candidates对象\r\n\r\n", "name": "candidates_create", "return": { "type": "widget_t*", "desc": "对象。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "candidates对象。" } ], "annotation": { "cast": true, "scriptable": true }, "desc": " 转换为candidates对象(供脚本语言使用)。\r\n\r\n", "name": "candidates_cast", "return": { "type": "widget_t*", "desc": "candidates对象。" } } ], "events": [], "properties": [], "header": "keyboard/candidates.h", "desc": " 输入法候选字词控件。\r\n", "name": "candidates_t", "parent": "widget_t", "annotation": { "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": " 创建keyboard对象\r\n\r\n", "name": "keyboard_create", "return": { "type": "widget_t*", "desc": "对象。" } }, { "params": [ { "type": "widget_t*", "name": "parent", "desc": "keyboard对象。" } ], "annotation": { "deconstructor": true }, "desc": " 关闭keyboard窗口。\r\n\r\n", "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对象(供脚本语言使用)。\r\n\r\n", "name": "keyboard_cast", "return": { "type": "widget_t*", "desc": "keyboard对象。" } } ], "events": [], "properties": [], "header": "keyboard/keyboard.h", "desc": " 软键盘。\r\n\r\n 软键盘是一个特殊的窗口,由编辑器通过输入法自动打开和关闭。\r\n\r\n 这里介绍一下定制软键盘的方法:\r\n\r\n 编辑器输入类型和软键盘UI资源文件的对应关系:\r\n\r\n| 输入类型 | 软键盘UI资源文件|\r\n|----------------|:---------------:|\r\n| INPUT\\_PHONE | kb\\_phone.xml |\r\n| INPUT\\_INT | kb\\_int.xml |\r\n| INPUT\\_FLOAT | kb\\_float.xml |\r\n| INPUT\\_UINT | kb\\_uint.xml |\r\n| INPUT\\_UFLOAT | kb\\_ufloat.xml |\r\n| INPUT\\_HEX | kb\\_hex.xml |\r\n| INPUT\\_EMAIL | kb\\_ascii.xml |\r\n| INPUT\\_PASSWORD | kb\\_ascii.xml |\r\n| INPUT\\_CUSTOM | 使用自定义的键盘 |\r\n| 其它 | kb\\_default.xml |\r\n\r\n keyboard中按钮子控件的名称有些特殊要求:\r\n\r\n| 名称 | 功能 |\r\n|----------------|:---------------:|\r\n| return | 回车键 |\r\n| action | 定制按钮 |\r\n| backspace | 删除键 |\r\n| tab | tab键 |\r\n| space | 空格键 |\r\n| close | 关闭软键盘 |\r\n| 前缀key: | 键值 |\r\n| 前缀page: | 切换到页面 |\r\n\r\n\r\n > 更多用法请参考:\r\n [kb_default](https://github.com/zlgopen/awtk/blob/master/demos/assets/default/raw/ui/kb_default.xml)\r\n\r\n", "name": "keyboard_t", "parent": "widget_t", "annotation": { "design": true, "widget": true, "window": true, "scriptable": true }, "level": 2 }, { "type": "class", "methods": [ { "params": [ { "type": "widget_t*", "name": "parent", "desc": "父控件" }, { "type": "xy_t", "name": "x", "desc": "x坐标" }, { "type": "xy_t", "name": "y", "desc": "y坐标" }, { "type": "wh_t", "name": "w", "desc": "宽度" }, { "type": "wh_t", "name": "h", "desc": "高度" } ], "annotation": { "constructor": true, "scriptable": true }, "desc": " 创建line_number对象\r\n\r\n", "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": " 设置顶部边距。\r\n\r\n", "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": " 设置顶部边距。\r\n\r\n", "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": " 设置行高。\r\n\r\n", "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偏移。\r\n\r\n", "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对象(供脚本语言使用)。\r\n\r\n", "name": "line_number_cast", "return": { "type": "widget_t*", "desc": "line_number对象。" } } ], "events": [], "properties": [], "header": "mledit/line_number.h", "desc": "\r\n 行号。多行编辑器的行号。\r\n\r\n line\\_number\\_t是[widget\\_t](widget_t.md)的子类控件,widget\\_t的函数均适用于line\\_number\\_t控件。\r\n\r\n 在xml中使用\"lin\\e_number\"标签创建行号控件,一般配合mledit使用。如:\r\n\r\n ```xml\r\n \r\n \r\n \r\n \r\n ```\r\n\r\n > 更多用法请参考:[mledit.xml](\r\nhttps://github.com/zlgopen/awtk/blob/master/demos/assets/default/raw/ui/mledit.xml)\r\n\r\n 可用通过style来设置控件的显示风格,如字体的大小和颜色等等。如:\r\n\r\n ```xml\r\n \r\n \r\n \r\n ```\r\n\r\n > 更多用法请参考:\r\n [theme default](\r\nhttps://github.com/zlgopen/awtk/blob/master/demos/assets/default/raw/styles/default.xml#L556)\r\n\r\n", "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对象\r\n\r\n", "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": " 设置编辑器是否为只读。\r\n\r\n", "name": "mledit_set_readonly", "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": " 设置为焦点。\r\n\r\n", "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": " 设置编辑器是否自动折行。\r\n\r\n", "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": " 设置编辑器的最大行数。\r\n\r\n", "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": " 设置编辑器的输入提示。\r\n\r\n", "name": "mledit_set_input_tips", "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": " 设置编辑器光标位置。\r\n\r\n", "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": " 设置编辑器滚动速度。\r\n\r\n", "name": "mledit_set_scroll_line", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "mledit对象。" } ], "annotation": { "cast": true, "scriptable": true }, "desc": " 转换为mledit对象(供脚本语言使用)。\r\n\r\n", "name": "mledit_cast", "return": { "type": "widget_t*", "desc": "mledit对象。" } } ], "events": [ { "name": "EVT_VALUE_CHANGING", "desc": " 文本正在改变事件(编辑中)。\r\n", "type": "event_t" }, { "name": "EVT_VALUE_CHANGED", "desc": " 文本改变事件。\r\n", "type": "event_t" } ], "properties": [ { "name": "readonly", "desc": " 编辑器是否为只读。\r\n", "type": "bool_t", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "persitent": true, "design": true, "scriptable": true } }, { "name": "top_margin", "desc": " 上边距。\r\n", "type": "uint8_t", "annotation": { "set_prop": true, "get_prop": true, "readable": true } }, { "name": "bottom_margin", "desc": " 下边距。\r\n", "type": "uint8_t", "annotation": { "set_prop": true, "get_prop": true, "readable": true } }, { "name": "left_margin", "desc": " 左边距。\r\n", "type": "uint8_t", "annotation": { "set_prop": true, "get_prop": true, "readable": true } }, { "name": "right_margin", "desc": " 右边距。\r\n", "type": "uint8_t", "annotation": { "set_prop": true, "get_prop": true, "readable": true } }, { "name": "tips", "desc": " 输入提示。\r\n", "type": "char*", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "persitent": true, "design": true, "scriptable": true } }, { "name": "wrap_word", "desc": " 是否自动折行。\r\n", "type": "bool_t", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "persitent": true, "design": true, "scriptable": true } }, { "name": "max_lines", "desc": " 最大行数。\r\n", "type": "uint32_t", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "persitent": true, "design": true, "scriptable": true } }, { "name": "scroll_line", "desc": " 鼠标一次滚动行数。\r\n", "type": "float_t", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "persitent": true, "design": true, "scriptable": true } } ], "header": "mledit/mledit.h", "desc": " 多行编辑器控件。\r\n\r\n mledit\\_t是[widget\\_t](widget_t.md)的子类控件,widget\\_t的函数均适用于mledit\\_t控件。\r\n\r\n 在xml中使用\"mledit\"标签创建多行编辑器控件。如:\r\n\r\n ```xml\r\n \r\n ```\r\n\r\n > 更多用法请参考:[mledit.xml](\r\n https://github.com/zlgopen/awtk/blob/master/demos/assets/default/raw/ui/mledit.xml)\r\n\r\n 在c代码中使用函数mledit\\_create创建多行编辑器控件。如:\r\n\r\n ```c\r\n widget_t* tc = mledit_create(win, 10, 10, 240, 240);\r\n ```\r\n\r\n > 完整示例请参考:[mledit demo](\r\n https://github.com/zlgopen/awtk-c-demos/blob/master/demos/mledit.c)\r\n\r\n time\\_clock一般不需要设置style。\r\n\r\n", "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对象\r\n\r\n\r\n", "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对象(供脚本语言使用)。\r\n\r\n\r\n", "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": " 设置值。\r\n\r\n\r\n", "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": " 设置最大值。\r\n\r\n\r\n", "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": " 设置环线的厚度。\r\n\r\n\r\n", "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": " 设置起始角度。\r\n\r\n\r\n", "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": " 设置单位。\r\n\r\n\r\n", "name": "progress_circle_set_unit", "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": " 设置是否显示文本。\r\n\r\n\r\n", "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": " 设置是否为逆时针方向。\r\n\r\n\r\n", "name": "progress_circle_set_counter_clock_wise", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" } } ], "events": [ { "name": "EVT_VALUE_WILL_CHANGE", "desc": " 值即将改变事件。\r\n", "type": "event_t" }, { "name": "EVT_VALUE_CHANGED", "desc": " 值改变事件。\r\n", "type": "event_t" } ], "properties": [ { "name": "value", "desc": " 值(缺省为0)。\r\n", "type": "float_t", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "persitent": true, "design": true, "scriptable": true } }, { "name": "max", "desc": " 最大值(缺省为100)。\r\n", "type": "uint32_t", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "persitent": true, "design": true, "scriptable": true } }, { "name": "start_angle", "desc": " 起始角度(单位为度,缺省-90)。\r\n", "type": "int32_t", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "persitent": true, "design": true, "scriptable": true } }, { "name": "line_width", "desc": " 环线的厚度(缺省为8)。\r\n", "type": "uint32_t", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "persitent": true, "design": true, "scriptable": true } }, { "name": "unit", "desc": " 单元(缺省无)。\r\n", "type": "char*", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "persitent": true, "design": true, "scriptable": true } }, { "name": "counter_clock_wise", "desc": " 是否为逆时针方向(缺省为FALSE)。\r\n", "type": "bool_t", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "persitent": true, "design": true, "scriptable": true } }, { "name": "show_text", "desc": " 是否显示文本(缺省为TRUE)。\r\n", "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": " 进度圆环控件。\r\n\r\n progress\\_circle\\_t是[widget\\_t](widget_t.md)的子类控件,widget\\_t的函数均适用于progress\\_circle\\_t控件。\r\n\r\n 在xml中使用\"progress\\_circle\"标签创建进度圆环控件。如:\r\n\r\n ```xml\r\n \r\n ```\r\n\r\n > 更多用法请参考:\r\n [progress_circle.xml](https://github.com/zlgopen/awtk/blob/master/demos/assets/default/raw/ui/progress_circle.xml)\r\n\r\n 在c代码中使用函数progress\\_circle\\_create创建进度圆环控件。如:\r\n\r\n ```c\r\n progress_circle = progress_circle_create(win, 10, 10, 200, 200);\r\n progress_circle_set_max(progress_circle, 360);\r\n widget_set_value(progress_circle, 128);\r\n ```\r\n\r\n > 完整示例请参考:\r\n [progress_circle\r\n demo](https://github.com/zlgopen/awtk-c-demos/blob/master/demos/progress_circle.c)\r\n\r\n 可用通过style来设置控件的显示风格,如字体的大小和颜色等等。如:\r\n\r\n ```xml\r\n \r\n ```\r\n\r\n > 更多用法请参考:\r\n [theme\r\n default](https://github.com/zlgopen/awtk/blob/master/demos/assets/default/raw/styles/default.xml#L467)\r\n\r\n", "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对象\r\n\r\n", "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": " 设置文本。\r\n\r\n", "name": "rich_text_set_text", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "rich_text对象。" } ], "annotation": { "cast": true, "scriptable": true }, "desc": " 转换为rich_text对象(供脚本语言使用)。\r\n\r\n", "name": "rich_text_cast", "return": { "type": "widget_t*", "desc": "rich_text对象。" } } ], "events": [], "properties": [ { "name": "line_gap", "desc": " 行间距。\r\n", "type": "int32_t", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "persitent": true, "design": true, "scriptable": true } } ], "header": "rich_text/rich_text.h", "desc": " 图文混排控件,实现简单的图文混排。\r\n\r\n rich\\_text\\_t是[widget\\_t](widget_t.md)的子类控件,widget\\_t的函数均适用于rich\\_text\\_t控件。\r\n\r\n 在xml中使用\"rich\\_text\"标签创建图文混排控件。如:\r\n\r\n ```xml\r\n hello awtk!\" />\r\n ```\r\n >\r\n\r\n > 更多用法请参考:\r\n [rich_text.xml](https://github.com/zlgopen/awtk/blob/master/demos/assets/default/raw/ui/rich_text.xml)\r\n\r\n 在c代码中使用函数rich\\_text\\_create创建图文混排控件。如:\r\n\r\n ```c\r\n widget_t* rich_text = rich_text_create(win, 0, 0, 0, 0);\r\n widget_set_text_utf8(rich_text,\r\n \"hello awtk!ProTip! The \"\r\n \"feed shows you events from people you follow and repositories you watch. \"\r\n \"nhello world. 确定取消中文字符测试。确定。取消。中文字符测试。\");\r\n\r\n widget_set_self_layout_params(rich_text, \"center\", \"middle\", \"100%\", \"100%\");\r\n ```\r\n\r\n > 完整示例请参考:\r\n [rich_text demo](https://github.com/zlgopen/awtk-c-demos/blob/master/demos/rich_text.c)\r\n\r\n 可用通过style来设置控件的显示风格,如背景颜色等等。而字体的大小和颜色则由文本内部的属性决定。\r\n\r\n 目前支持image和font两个tag:\r\n\r\n * image 支持的属性有:\r\n * name 图片的名称。\r\n * w 图片的宽度。\r\n * h 图片的高度。\r\n\r\n * font 支持的属性有:\r\n * color 颜色。\r\n * size 大小。\r\n * align_v 垂直方向对齐的方式(top|middle|bottom)。\r\n * bold 粗体(暂不支持)\r\n * italic 斜体(暂不支持)\r\n * underline 下划线(暂不支持)\r\n\r\n", "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对象\r\n\r\n", "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。\r\n\r\n", "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。\r\n\r\n", "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。\r\n\r\n", "name": "hscroll_label_set_only_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。\r\n\r\n", "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。\r\n\r\n", "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。\r\n\r\n", "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偏移(一般无需用户调用)。。\r\n\r\n", "name": "hscroll_label_set_xoffset", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" } ], "annotation": { "scriptable": true }, "desc": " 启动(一般无需用户调用)。\r\n\r\n", "name": "hscroll_label_start", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" } ], "annotation": { "scriptable": true }, "desc": " 停止(一般无需用户调用)。\r\n\r\n", "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对象(供脚本语言使用)。\r\n\r\n", "name": "hscroll_label_cast", "return": { "type": "widget_t*", "desc": "hscroll_label对象。" } } ], "events": [], "properties": [ { "name": "only_focus", "desc": " 只有处于focus时才滚动(缺省否)。\r\n", "type": "bool_t", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "persitent": true, "design": true, "scriptable": true } }, { "name": "loop", "desc": " loop是否循环滚动(缺省FALSE)。\r\n", "type": "bool_t", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "persitent": true, "design": true, "scriptable": true } }, { "name": "yoyo", "desc": " 是否往返滚动(缺省FALSE)。\r\n", "type": "bool_t", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "persitent": true, "design": true, "scriptable": true } }, { "name": "ellipses", "desc": " 文本显示不下时,在行尾显示省略号(缺省FALSE)。\r\n", "type": "bool_t", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "persitent": true, "design": true, "scriptable": true } }, { "name": "lull", "desc": " 滚动之间的间歇时间(ms),缺省3000ms。\r\n", "type": "int32_t", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "persitent": true, "design": true, "scriptable": true } }, { "name": "duration", "desc": " 完整的滚动一次需要的时间(ms),缺省5000ms。\r\n", "type": "int32_t", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "scriptable": true } }, { "name": "xoffset", "desc": " 偏移量。\r\n", "type": "int32_t", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "scriptable": true } }, { "name": "text_w", "desc": " 文本的宽度。\r\n", "type": "int32_t", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "scriptable": true } } ], "header": "scroll_label/hscroll_label.h", "desc": "\r\n 可水平滚动的文本控件,方便实现长文本滚动。\r\n\r\n\r\n hscroll\\_label\\_t是[widget\\_t](widget_t.md)的子类控件,widget\\_t的函数均适用于hscroll\\_label\\_t控件。\r\n\r\n 在xml中使用\"hscroll\\_label\"标签创建行号控件,一般配合mledit使用。如:\r\n\r\n ```xml\r\n ```\r\n\r\n > 更多用法请参考:[mledit.xml](\r\nhttps://github.com/zlgopen/awtk/blob/master/demos/assets/default/raw/ui/mledit.xml)\r\n\r\n 可用通过style来设置控件的显示风格,如字体的大小和颜色等等。如:\r\n\r\n ```xml\r\n \r\n ```\r\n\r\n > 更多用法请参考:\r\n [theme default](\r\nhttps://github.com/zlgopen/awtk/blob/master/demos/assets/default/raw/styles/default.xml)\r\n\r\n", "name": "hscroll_label_t", "parent": "widget_t", "annotation": { "scriptable": true, "design": true, "widget": true }, "level": 2 }, { "type": "class", "methods": [ { "params": [], "annotation": { "constructor": true }, "desc": "\r\n 创建子控件布局对象。\r\n\r\n\r\n", "name": "children_layouter_list_view_create", "return": { "type": "children_layouter_t*", "desc": "返回创建子控件布局对象。" } } ], "events": [], "properties": [], "header": "scroll_view/children_layouter_list_view.h", "desc": "\r\n listview的子控件布局算法实现。\r\n\r\n> 用法请参考:[listview子控件布局算法](\r\nhttps://github.com/zlgopen/awtk/blob/master/docs/children_layouter_list_view.md)\r\n\r\n", "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对象\r\n\r\n", "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对象(供脚本语言使用)。\r\n\r\n", "name": "list_item_cast", "return": { "type": "widget_t*", "desc": "list_item对象。" } } ], "events": [], "properties": [], "header": "scroll_view/list_item.h", "desc": " 列表项控件。\r\n\r\n 列表项控件是一个简单的容器控件,一般作为列表视图中滚动视图的子控件。\r\n\r\n list\\_item\\_t是[widget\\_t](widget_t.md)的子类控件,widget\\_t的函数均适用于list\\_item\\_t控件。\r\n\r\n 在xml中使用\"list\\_item\"标签创建列表项控件。如:\r\n\r\n ```xml\r\n \r\n \r\n \r\n \r\n \r\n \r\n ...\r\n \r\n \r\n ```\r\n\r\n > 更多用法请参考:[list\\_view\\_m.xml](\r\nhttps://github.com/zlgopen/awtk/blob/master/demos/assets/default/raw/ui/list_view_m.xml)\r\n\r\n 在c代码中使用函数list\\_item\\_create创建列表项控件。如:\r\n\r\n ```c\r\n widget_t* list_item = list_item_create(scroll_view, 0, 0, 0, 0);\r\n ```\r\n\r\n > 列表项控件大小一般由列表控制,不需指定xywh参数。\r\n\r\n 可以用style来实现可点击或不可点击的效果。如:\r\n\r\n ```xml\r\n \r\n ```\r\n\r\n > 更多用法请参考:[theme default](\r\nhttps://github.com/zlgopen/awtk/blob/master/demos/assets/default/raw/styles/default.xml#L372)\r\n\r\n", "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对象\r\n\r\n", "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": " 设置列表项的宽度。\r\n\r\n", "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": " 设置列表项的间距。\r\n\r\n", "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对象(供脚本语言使用)。\r\n\r\n", "name": "list_view_h_cast", "return": { "type": "widget_t*", "desc": "list_view_h对象。" } } ], "events": [], "properties": [ { "name": "item_width", "desc": " 列表项的宽度。\r\n", "type": "int32_t", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "persitent": true, "design": true, "scriptable": true } }, { "name": "spacing", "desc": " 间距。\r\n", "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": " 水平列表视图控件。\r\n\r\n list\\_view\\_h\\_t是[widget\\_t](widget_t.md)的子类控件,widget\\_t的函数均适用于list\\_view\\_h\\_t控件。\r\n\r\n 在xml中使用\"list\\_view\\_h\"标签创建水平列表视图控件。如:\r\n\r\n ```xml\r\n \r\n \r\n \r\n ...\r\n \r\n \r\n ```\r\n\r\n > 注意:列表项不是作为列表视图控件的直接子控件,而是作为滚动视图的子控件。\r\n\r\n\r\n > 更多用法请参考:[list\\_view\\_h.xml](\r\nhttps://github.com/zlgopen/awtk/blob/master/demos/assets/default/raw/ui/list_view_h.xml)\r\n\r\n 在c代码中使用函数list\\_view\\_h\\_create创建水平列表视图控件。如:\r\n\r\n ```c\r\n widget_t* list_view = list_view_h_create(win, 0, 0, 0, 0);\r\n ```\r\n\r\n 用代码构造列表视图是比较繁琐的事情,最好用XML来构造。\r\n 如果需要动态修改,可以使用widget\\_clone来增加列表项,使用widget\\_remove\\_child来移出列表项。\r\n\r\n 可用通过style来设置控件的显示风格,如背景颜色和边框颜色等(一般情况不需要)。\r\n\r\n", "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对象\r\n\r\n", "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": " 设置列表项的高度。\r\n\r\n", "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": " 设置列表项的缺省高度。\r\n\r\n", "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": " 设置是否自动隐藏滚动条。\r\n\r\n", "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对象(供脚本语言使用)。\r\n\r\n", "name": "list_view_cast", "return": { "type": "widget_t*", "desc": "list_view对象。" } } ], "events": [], "properties": [ { "name": "item_height", "desc": " 列表项的高度。如果 item_height > 0,所有列表项使用固定高度,否则使用列表项自身的高度。\r\n", "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,则使用缺省高度。\r\n", "type": "int32_t", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "persitent": true, "design": true, "scriptable": true } }, { "name": "auto_hide_scroll_bar", "desc": " 如果不需要滚动条时,自动隐藏滚动条。\r\n", "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": " 列表视图控件。\r\n\r\n 列表视图控件是一个可以垂直滚动的列表控件。\r\n\r\n 如果不需要滚动,可以用view控件配置适当的layout参数作为列表控件。\r\n\r\n 列表视图中的列表项可以固定高度,也可以使用不同高度。请参考[变高列表项](\r\nhttps://github.com/zlgopen/awtk/blob/master/demos/assets/default/raw/ui/list_view_vh.xml)\r\n\r\n 列表视图控件的中可以有滚动条,也可以没有滚动条。\r\n 可以使用移动设备风格的滚动条,也可以使用桌面风格的滚动条。\r\n\r\n list\\_view\\_t是[widget\\_t](widget_t.md)的子类控件,widget\\_t的函数均适用于list\\_view\\_t控件。\r\n\r\n 在xml中使用\"list\\_view\"标签创建列表视图控件。如:\r\n\r\n ```xml\r\n \r\n \r\n \r\n \r\n \r\n \r\n ...\r\n \r\n \r\n ```\r\n\r\n > 注意:列表项不是作为列表视图控件的直接子控件,而是作为滚动视图的子控件。\r\n\r\n\r\n > 更多用法请参考:[list\\_view\\_m.xml](\r\nhttps://github.com/zlgopen/awtk/blob/master/demos/assets/default/raw/ui/list_view_m.xml)\r\n\r\n 在c代码中使用函数list\\_view\\_create创建列表视图控件。如:\r\n\r\n ```c\r\n widget_t* list_view = list_view_create(win, 0, 0, 0, 0);\r\n ```\r\n\r\n 用代码构造列表视图是比较繁琐的事情,最好用XML来构造。\r\n 如果需要动态修改,可以使用widget\\_clone来增加列表项,使用widget\\_remove\\_child来移出列表项。\r\n\r\n 可用通过style来设置控件的显示风格,如背景颜色和边框颜色等(一般情况不需要)。\r\n\r\n", "name": "list_view_t", "parent": "widget_t", "annotation": { "scriptable": true, "design": true, "widget": true }, "level": 2 }, { "type": "class", "methods": [ { "params": [ { "type": "object_t*", "name": "obj", "desc": "object对象。" } ], "annotation": { "deconstructor": true, "scriptable": true, "gc": true }, "desc": " 引用计数减1。引用计数为0时,销毁对象。\r\n\r\n\r\n", "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。\r\n\r\n\r\n", "name": "object_ref", "return": { "type": "object_t*", "desc": "返回object对象。" } }, { "params": [ { "type": "const object_vtable_t*", "name": "vt", "desc": "虚函数表。" } ], "annotation": {}, "desc": " 创建对象。\r\n\r\n > 仅供子类调用。\r\n\r\n\r\n", "name": "object_create", "return": { "type": "ret_t", "desc": "返回object对象。" } }, { "params": [ { "type": "object_t*", "name": "obj", "desc": "object对象。" } ], "annotation": { "scriptable": true }, "desc": " 获取对象的类型名称。\r\n\r\n\r\n", "name": "object_get_type", "return": { "type": "const char*", "desc": "返回对象的类型名称。" } }, { "params": [ { "type": "object_t*", "name": "obj", "desc": "object对象。" } ], "annotation": { "scriptable": true }, "desc": " 获取对象的描述信息。\r\n\r\n\r\n", "name": "object_get_desc", "return": { "type": "const char*", "desc": "返回对象的描述信息。" } }, { "params": [ { "type": "object_t*", "name": "obj", "desc": "object对象。" } ], "annotation": { "scriptable": true }, "desc": " 获取对象占用内存的大小。\r\n\r\n\r\n", "name": "object_get_size", "return": { "type": "uint32_t", "desc": "返回对象占用内存的大小。" } }, { "params": [ { "type": "object_t*", "name": "obj", "desc": "object对象。" } ], "annotation": { "scriptable": true }, "desc": " 判断对象是否是集合。\r\n\r\n\r\n", "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": " 设置对象的名称。\r\n\r\n\r\n", "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": " 比较两个对象。\r\n\r\n\r\n", "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": " 获取指定属性的值。\r\n\r\n\r\n", "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": " 获取指定属性的字符串类型的值。\r\n\r\n\r\n", "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": " 获取指定属性的指针类型的值。\r\n\r\n\r\n", "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类型的值。\r\n\r\n\r\n", "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": " 获取指定属性的整数类型的值。\r\n\r\n\r\n", "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类型的值。\r\n\r\n\r\n", "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": " 获取指定属性的浮点数类型的值。\r\n\r\n\r\n", "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": " 删除指定属性。\r\n\r\n\r\n", "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": " 设置指定属性的值。\r\n\r\n\r\n", "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": " 设置指定属性的字符串类型的值。\r\n\r\n\r\n", "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": { "scriptable": true }, "desc": " 设置指定属性的指针类型的值。\r\n\r\n\r\n", "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类型的值。\r\n\r\n\r\n", "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": " 设置指定属性的整数类型的值。\r\n\r\n\r\n", "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类型的值。\r\n\r\n\r\n", "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": " 设置指定属性的浮点数类型的值。\r\n\r\n\r\n", "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": " 拷贝指定的属性。\r\n\r\n\r\n", "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": { "scriptable": "custom" }, "desc": " 遍历所有属性。\r\n\r\n\r\n", "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": " 检查是否存在指定的属性。\r\n\r\n\r\n", "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中获取。\r\n\r\n\r\n", "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": " 检查是否可以执行指定的命令。\r\n\r\n\r\n", "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": " 执行指定的命令。\r\n\r\n", "name": "object_exec", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" } }, { "params": [ { "type": "object_t*", "name": "obj", "desc": "object对象。" } ], "annotation": { "scriptable": true }, "desc": " 触发EVT_PROPS_CHANGED事件。\r\n\r\n\r\n", "name": "object_notify_changed", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" } }, { "params": [ { "type": "object_t*", "name": "obj", "desc": "object对象。" }, { "type": "const char*", "name": "path", "desc": "属性的path,各级之间用.分隔。" }, { "type": "value_t*", "name": "v", "desc": "返回属性的值。" } ], "annotation": {}, "desc": " 获取指定path属性的值。\r\n\r\n\r\n", "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": " 获取指定属性的字符串类型的值。\r\n\r\n\r\n", "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": " 获取指定属性的指针类型的值。\r\n\r\n\r\n", "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类型的值。\r\n\r\n\r\n", "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": " 获取指定属性的整数类型的值。\r\n\r\n\r\n", "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类型的值。\r\n\r\n\r\n", "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": " 获取指定属性的浮点数类型的值。\r\n\r\n\r\n", "name": "object_get_prop_float_by_path", "return": { "type": "float_t", "desc": "返回指定属性的浮点数类型的值。" } } ], "events": [], "properties": [ { "name": "ref_count", "desc": " 引用计数。\r\n", "type": "int32_t", "annotation": { "readable": true, "scriptable": true } }, { "name": "name", "desc": " 对象的名称。\r\n", "type": "char*", "annotation": { "readable": true, "scriptable": true } } ], "header": "tkc/object.h", "desc": "\r\n 对象接口。\r\n\r\n", "name": "object_t", "parent": "emitter_t", "annotation": { "scriptable": true }, "level": 2 }, { "type": "class", "methods": [ { "params": [ { "type": "widget_t*", "name": "parent", "desc": "父控件" }, { "type": "xy_t", "name": "x", "desc": "x坐标" }, { "type": "xy_t", "name": "y", "desc": "y坐标" }, { "type": "wh_t", "name": "w", "desc": "宽度" }, { "type": "wh_t", "name": "h", "desc": "高度" } ], "annotation": { "constructor": true, "scriptable": true }, "desc": " 创建scroll_bar对象\r\n\r\n > 根据宏WITH_DESKTOP_STYLE决定创建desktop风格还是mobile风格的滚动条\r\n\r\n\r\n", "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对象(供脚本语言使用)。\r\n\r\n", "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对象\r\n\r\n", "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对象\r\n\r\n", "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": " 设置参数。\r\n\r\n", "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": " 滚动到指定的值。\r\n\r\n", "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事件。\r\n\r\n", "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事件。\r\n\r\n", "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事件。\r\n\r\n", "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事件。\r\n\r\n", "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风格的滚动条。\r\n\r\n", "name": "scroll_bar_is_mobile", "return": { "type": "bool_t", "desc": "返回TRUE表示是mobile风格的,否则表示不是mobile风格的。" } } ], "events": [], "properties": [ { "name": "virtual_size", "desc": " 虚拟宽度或高度。\r\n", "type": "int32_t", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "persitent": true, "design": true, "scriptable": true } }, { "name": "value", "desc": " 当前的值。\r\n", "type": "int32_t", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "persitent": true, "design": true, "scriptable": true } }, { "name": "row", "desc": " 行的高度。\r\n", "type": "int32_t", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "persitent": true, "design": true, "scriptable": true } }, { "name": "animatable", "desc": " 滚动时是否启用动画。\r\n", "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": " 滚动条控件。\r\n\r\n> 目前只支持垂直滚动。\r\n\r\n scroll\\_bar\\_t是[widget\\_t](widget_t.md)的子类控件,widget\\_t的函数均适用于scroll\\_bar\\_t控件。\r\n\r\n 在xml中使用\"scroll\\_bar\"或\"scroll\\_bar\\_d\"或\"scroll\\_bar\\_m\"标签创建滚动条控件。如:\r\n\r\n ```xml\r\n \r\n \r\n ...\r\n \r\n \r\n \r\n ```\r\n\r\n > 更多用法请参考:[list\\_view\\_m.xml](\r\nhttps://github.com/zlgopen/awtk/blob/master/demos/assets/default/raw/ui/list_view_m.xml)\r\n\r\n 在c代码中使用函数scroll\\_bar\\_create创建列表项控件。如:\r\n\r\n ```c\r\n widget_t* scroll_bar = scroll_bar_create(list_view, 0, 0, 0, 0);\r\n ```\r\n\r\n ```xml\r\n \r\n ```\r\n\r\n > 更多用法请参考:[theme default](\r\nhttps://github.com/zlgopen/awtk/blob/master/demos/assets/default/raw/styles/default.xml#L350)\r\n\r\n", "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对象\r\n\r\n", "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对象(供脚本语言使用)。\r\n\r\n", "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": " 设置虚拟宽度。\r\n\r\n", "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": " 设置虚拟高度。\r\n\r\n", "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方向滑动。\r\n\r\n", "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方向滑动。\r\n\r\n", "name": "scroll_view_set_yslidable", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" } }, { "params": [ { "type": "widget_t*", "name": "widget", "desc": "控件对象。" }, { "type": "int32_t", "name": "xoffset", "desc": "x偏移量。" }, { "type": "int32_t", "name": "yoffset", "desc": "y偏移量。" } ], "annotation": { "scriptable": true }, "desc": " 设置偏移量。\r\n\r\n", "name": "scroll_view_set_offset", "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": " 滚动到指定的偏移量。\r\n\r\n", "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": " 滚动到指定的偏移量。\r\n\r\n", "name": "scroll_view_scroll_delta_to", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" } } ], "events": [], "properties": [ { "name": "virtual_w", "desc": " 虚拟宽度。\r\n", "type": "wh_t", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "persitent": true, "design": true, "scriptable": true } }, { "name": "virtual_h", "desc": " 虚拟高度。\r\n", "type": "wh_t", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "persitent": true, "design": true, "scriptable": true } }, { "name": "xoffset", "desc": " x偏移量。\r\n", "type": "int32_t", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "persitent": true, "design": true, "scriptable": true } }, { "name": "yoffset", "desc": " y偏移量。\r\n", "type": "int32_t", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "scriptable": true } }, { "name": "xslidable", "desc": " 是否允许x方向滑动。\r\n", "type": "bool_t", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "scriptable": true } }, { "name": "yslidable", "desc": " 是否允许y方向滑动。\r\n", "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": " 滚动视图。\r\n\r\n scroll\\_view\\_t是[widget\\_t](widget_t.md)的子类控件,widget\\_t的函数均适用于scroll\\_view\\_t控件。\r\n\r\n 在xml中使用\"scroll\\_view\"标签创建滚动视图控件。如:\r\n\r\n ```xml\r\n \r\n \r\n \r\n \r\n \r\n \r\n ...\r\n \r\n \r\n ```\r\n\r\n > 滚动视图一般作为列表视图的子控件使用。\r\n\r\n > 更多用法请参考:[list\\_view\\_m.xml](\r\nhttps://github.com/zlgopen/awtk/blob/master/demos/assets/default/raw/ui/list_view_m.xml)\r\n\r\n 在c代码中使用函数scroll\\_view\\_create创建列表视图控件。如:\r\n\r\n ```c\r\n widget_t* scroll_view = scroll_view_create(win, 0, 0, 0, 0);\r\n ```\r\n\r\n 可用通过style来设置控件的显示风格,如背景颜色和边框颜色等(一般情况不需要)。\r\n\r\n", "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对象\r\n\r\n", "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对象(供脚本语言使用)。\r\n\r\n", "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": " 设置当前项。\r\n\r\n", "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": " 设置垂直对齐方式。\r\n\r\n", "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": " 设置最小缩放比例。\r\n\r\n", "name": "slide_menu_set_min_scale", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" } } ], "events": [ { "name": "EVT_VALUE_WILL_CHANGE", "desc": " 值(当前项)即将改变事件。\r\n", "type": "event_t" }, { "name": "EVT_VALUE_CHANGED", "desc": " 值(当前项)改变事件。\r\n", "type": "event_t" } ], "properties": [ { "name": "value", "desc": " 值。代表当前选中项的索引。\r\n", "type": "int32_t", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "persitent": true, "design": true, "scriptable": true } }, { "name": "align_v", "desc": " 垂直对齐方式。\r\n", "type": "align_v_t", "annotation": { "set_prop": true, "get_prop": true, "readable": true, "persitent": true, "design": true, "scriptable": true } }, { "name": "min_scale", "desc": " 最小缩放比例。\r\n", "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": " 左右滑动菜单控件。\r\n\r\n 一般用一组按钮作为子控件,通过左右滑动改变当前的项。除了当菜单使用外,也可以用来切换页面。\r\n\r\n slide\\_menu\\_t是[widget\\_t](widget_t.md)的子类控件,widget\\_t的函数均适用于slide\\_menu\\_t控件。\r\n\r\n 在xml中使用\"slide\\_menu\"标签创建左右滑动菜单控件。如:\r\n\r\n ```xml\r\n \r\n