From d3a4dbfbcc0041fd1c87ef8c3d6f7a91fdbeaa6d Mon Sep 17 00:00:00 2001 From: lixianjing Date: Sun, 11 Oct 2020 01:19:38 -0700 Subject: [PATCH] update api doc --- dllexports/awtk.def | 3 + src/base/widget.h | 2 + tools/idl_gen/idl.json | 126 +++++++++++++++++++++++++++++++++++++++-- 3 files changed, 127 insertions(+), 4 deletions(-) diff --git a/dllexports/awtk.def b/dllexports/awtk.def index 93822c3a3..b1967a659 100644 --- a/dllexports/awtk.def +++ b/dllexports/awtk.def @@ -384,6 +384,7 @@ EXPORTS lcd_draw_points lcd_get_point_color lcd_fill_rect + lcd_clear_rect lcd_stroke_rect lcd_draw_glyph lcd_measure_text @@ -1274,6 +1275,7 @@ EXPORTS canvas_draw_hline canvas_draw_points canvas_fill_rect + canvas_clear_rect canvas_stroke_rect canvas_set_font canvas_set_text_align @@ -1485,6 +1487,7 @@ EXPORTS pages_set_active_by_name label_create label_set_length + label_set_line_wrap label_resize_to_content label_cast group_box_create diff --git a/src/base/widget.h b/src/base/widget.h index 1945f587a..919af47bf 100644 --- a/src/base/widget.h +++ b/src/base/widget.h @@ -1548,6 +1548,7 @@ const char* widget_get_prop_str(widget_t* widget, const char* name, const char* /** * @method widget_set_prop_pointer * 设置指针格式的属性。 + * @annotation ["scriptable"] * @param {widget_t*} widget 控件对象。 * @param {const char*} name 属性的名称。 * @param {void**} v 属性的值。 @@ -1559,6 +1560,7 @@ ret_t widget_set_prop_pointer(widget_t* widget, const char* name, void* v); /** * @method widget_get_prop_pointer * 获取指针格式的属性。 + * @annotation ["scriptable"] * @param {widget_t*} widget 控件对象。 * @param {const char*} name 属性的名称。 * diff --git a/tools/idl_gen/idl.json b/tools/idl_gen/idl.json index 59fc25e06..512295c90 100644 --- a/tools/idl_gen/idl.json +++ b/tools/idl_gen/idl.json @@ -10543,7 +10543,43 @@ } ], "annotation": {}, - "desc": "绘制矩形。", + "desc": "填充实心矩形。", + "name": "lcd_clear_rect", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "lcd_t*", + "name": "lcd", + "desc": "lcd对象。" + }, + { + "type": "xy_t", + "name": "x", + "desc": "x坐标。" + }, + { + "type": "xy_t", + "name": "y", + "desc": "y坐标。" + }, + { + "type": "wh_t", + "name": "w", + "desc": "宽度。" + }, + { + "type": "wh_t", + "name": "h", + "desc": "高度。" + } + ], + "annotation": {}, + "desc": "绘制矩形边框。", "name": "lcd_stroke_rect", "return": { "type": "ret_t", @@ -17770,6 +17806,10 @@ "desc": "长度。", "name": "WIDGET_PROP_LENGTH" }, + { + "desc": "自动换行。", + "name": "WIDGET_PROP_LINE_WRAP" + }, { "desc": "文本。", "name": "WIDGET_PROP_TEXT" @@ -20791,7 +20831,9 @@ "desc": "属性的值。" } ], - "annotation": {}, + "annotation": { + "scriptable": true + }, "desc": "设置指针格式的属性。", "name": "widget_set_prop_pointer", "return": { @@ -20812,7 +20854,9 @@ "desc": "属性的名称。" } ], - "annotation": {}, + "annotation": { + "scriptable": true + }, "desc": "获取指针格式的属性。", "name": "widget_get_prop_pointer", "return": { @@ -35447,13 +35491,51 @@ "annotation": { "scriptable": true }, - "desc": "填充矩形。", + "desc": "绘制矩形。", "name": "canvas_fill_rect", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" } }, + { + "params": [ + { + "type": "canvas_t*", + "name": "c", + "desc": "canvas对象。" + }, + { + "type": "xy_t", + "name": "x", + "desc": "x坐标。" + }, + { + "type": "xy_t", + "name": "y", + "desc": "y坐标。" + }, + { + "type": "wh_t", + "name": "w", + "desc": "宽度。" + }, + { + "type": "wh_t", + "name": "h", + "desc": "高度。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "填充矩形。", + "name": "canvas_clear_rect", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, { "params": [ { @@ -42020,6 +42102,29 @@ "desc": "返回RET_OK表示成功,否则表示失败。" } }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "控件对象。" + }, + { + "type": "bool_t", + "name": "line_wrap", + "desc": "是否自动换行。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "设置是否自动换行。", + "name": "label_set_line_wrap", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, { "params": [ { @@ -42092,6 +42197,19 @@ "design": true, "scriptable": true } + }, + { + "name": "line_wrap", + "desc": "是否自动换行。", + "type": "bool_t", + "annotation": { + "set_prop": true, + "get_prop": true, + "readable": true, + "persitent": true, + "design": true, + "scriptable": true + } } ], "header": "widgets/label.h",