improve api comment and export some functions

This commit is contained in:
lixianjing 2024-04-20 09:48:01 +08:00
parent 918f3f8a54
commit 4a74142498
7 changed files with 163 additions and 2 deletions

View File

@ -1,5 +1,8 @@
# 最新动态 # 最新动态
2024/04/20
* 完善注释,导出部分函数。
2024/04/19 2024/04/19
* 增加函数str\_shrink/wstr\_shrink。 * 增加函数str\_shrink/wstr\_shrink。
* 修复mledit初始化时最大行数小于实际行数会崩溃的问题(感谢培煌发现问题)。 * 修复mledit初始化时最大行数小于实际行数会崩溃的问题(感谢培煌发现问题)。

View File

@ -159,7 +159,6 @@ ret_t input_device_status_on_pointer_leave(input_device_status_t* ids, widget_t*
/** /**
* @method input_device_status_deinit * @method input_device_status_deinit
* *
* @annotation ["destructor"]
* @param {input_device_status_t*} ids * @param {input_device_status_t*} ids
* *
* @return {ret_t} RET_OK表示成功 * @return {ret_t} RET_OK表示成功

View File

@ -77,12 +77,69 @@ main_loop_t* main_loop_init(int w, int h);
*/ */
main_loop_t* main_loop(void); main_loop_t* main_loop(void);
/**
* @method main_loop_set
* main_loop对象
* @param {main_loop_t*} loop main_loop对象
*
* @return {ret_t} RET_OK表示成功
*/
ret_t main_loop_set(main_loop_t* loop); ret_t main_loop_set(main_loop_t* loop);
/**
* @method main_loop_run
*
* @param {main_loop_t*} l main_loop对象
*
* @return {ret_t} RET_OK表示成功
*/
ret_t main_loop_run(main_loop_t* l); ret_t main_loop_run(main_loop_t* l);
/**
* @method main_loop_wakeup
*
* @param {main_loop_t*} l main_loop对象
*
* @return {ret_t} RET_OK表示成功
*/
ret_t main_loop_wakeup(main_loop_t* l); ret_t main_loop_wakeup(main_loop_t* l);
/**
* @method main_loop_quit
* 退
* @param {main_loop_t*} l main_loop对象
*
* @return {ret_t} RET_OK表示成功
*/
ret_t main_loop_quit(main_loop_t* l); ret_t main_loop_quit(main_loop_t* l);
/**
* @method main_loop_queue_event
*
* @param {main_loop_t*} l main_loop对象
* @param {const event_queue_req_t*} e
*
* @return {ret_t} RET_OK表示成功
*/
ret_t main_loop_queue_event(main_loop_t* l, const event_queue_req_t* e); ret_t main_loop_queue_event(main_loop_t* l, const event_queue_req_t* e);
/**
* @method main_loop_recv_event
*
* @param {main_loop_t*} l main_loop对象
* @param {event_queue_req_t*} r
*
* @return {ret_t} RET_OK表示成功
*/
ret_t main_loop_recv_event(main_loop_t* l, event_queue_req_t* r); ret_t main_loop_recv_event(main_loop_t* l, event_queue_req_t* r);
/**
* @method main_loop_destroy
* main_loop对象
* @param {main_loop_t*} l main_loop对象
*
* @return {ret_t} RET_OK表示成功
*/
ret_t main_loop_destroy(main_loop_t* l); ret_t main_loop_destroy(main_loop_t* l);
/** /**

View File

@ -267,9 +267,42 @@ typedef native_window_t* (*native_window_create_t)(widget_t* widget);
*/ */
ret_t native_window_invalidate(native_window_t* win, const rect_t* r); ret_t native_window_invalidate(native_window_t* win, const rect_t* r);
/**
* @method native_window_swap_buffer
*
* @param {native_window_t*} win win对象
*
* @return {ret_t} RET_OK表示成功
*/
ret_t native_window_swap_buffer(native_window_t* win); ret_t native_window_swap_buffer(native_window_t* win);
/**
* @method native_window_gl_make_current
* opengl上下文
* @param {native_window_t*} win win对象
*
* @return {ret_t} RET_OK表示成功
*/
ret_t native_window_gl_make_current(native_window_t* win); ret_t native_window_gl_make_current(native_window_t* win);
/**
* @method native_window_preprocess_event
*
* @param {native_window_t*} win win对象
* @param {event_t*} e
*
* @return {ret_t} RET_OK表示成功
*/
ret_t native_window_preprocess_event(native_window_t* win, event_t* e); ret_t native_window_preprocess_event(native_window_t* win, event_t* e);
/**
* @method native_window_get_info
*
* @param {native_window_t*} win win对象
* @param {native_window_info_t*} info
*
* @return {ret_t} RET_OK表示成功
*/
ret_t native_window_get_info(native_window_t* win, native_window_info_t* info); ret_t native_window_get_info(native_window_t* win, native_window_info_t* info);
/*public for window manager only*/ /*public for window manager only*/

View File

@ -334,8 +334,25 @@ ret_t system_info_set_app_info(system_info_t* info, app_type_t app_type, const c
ret_t system_info_eval_exprs(system_info_t* info, const char* exprs, tk_visit_t on_expr_result, ret_t system_info_eval_exprs(system_info_t* info, const char* exprs, tk_visit_t on_expr_result,
void* ctx); void* ctx);
/**
* @method system_info_set_app_name
*
* @annotation ["static"]
* @param {system_info_t*} info system_info对象
* @param {const char*} app_name
*
* @return {ret_t} RET_OK表示成功
*/
ret_t system_info_set_app_name(system_info_t* info, const char* app_name); ret_t system_info_set_app_name(system_info_t* info, const char* app_name);
/**
* @method tk_is_swap_size_by_orientation
*
* @annotation ["static"]
* @param {lcd_orientation_t} old_orientation
* @param {lcd_orientation_t} new_orientation
* @return {bool_t}
*/
bool_t tk_is_swap_size_by_orientation(lcd_orientation_t old_orientation, bool_t tk_is_swap_size_by_orientation(lcd_orientation_t old_orientation,
lcd_orientation_t new_orientation); lcd_orientation_t new_orientation);

View File

@ -302,7 +302,6 @@ ret_t window_manager_paint(widget_t* widget);
* *
*> *>
* *
* @annotation ["private"]
* @param {widget_t*} widget * @param {widget_t*} widget
* *
* @return {ret_t} RET_OK表示成功 * @return {ret_t} RET_OK表示成功

View File

@ -32,6 +32,11 @@
BEGIN_C_DECLS BEGIN_C_DECLS
/**
* @class main_loop_simple_t
* @parent main_loop_t
*
*/
struct _main_loop_simple_t; struct _main_loop_simple_t;
typedef struct _main_loop_simple_t main_loop_simple_t; typedef struct _main_loop_simple_t main_loop_simple_t;
@ -57,12 +62,60 @@ struct _main_loop_simple_t {
main_loop_dispatch_input_t dispatch_input; main_loop_dispatch_input_t dispatch_input;
}; };
/**
* @method main_loop_simple_init
* main_loop_simple_t对象
* @param {int} w
* @param {int} h
* @param {main_loop_queue_event_t} queue_event
* @param {main_loop_recv_event_t} recv_event
*
* @return {main_loop_simple_t*} main_loop_simple_t对象
*/
main_loop_simple_t* main_loop_simple_init(int w, int h, main_loop_queue_event_t queue_event, main_loop_simple_t* main_loop_simple_init(int w, int h, main_loop_queue_event_t queue_event,
main_loop_recv_event_t recv_event); main_loop_recv_event_t recv_event);
/**
* @method main_loop_simple_reset
* main_loop_simple_t对象
* @param {main_loop_simple_t*} loop main_loop_simple_t对象
*
* @return {ret_t} RET_OK表示成功
*/
ret_t main_loop_simple_reset(main_loop_simple_t* loop); ret_t main_loop_simple_reset(main_loop_simple_t* loop);
/**
* @method main_loop_post_key_event
*
* @param {main_loop_t*} l
* @param {bool_t} pressed
* @param {uint8_t} key
*
* @return {ret_t} RET_OK表示成功
*/
ret_t main_loop_post_key_event(main_loop_t* l, bool_t pressed, uint8_t key); ret_t main_loop_post_key_event(main_loop_t* l, bool_t pressed, uint8_t key);
/**
* @method main_loop_post_pointer_event
*
* @param {main_loop_t*} l
* @param {bool_t} pressed
* @param {xy_t} x x坐标
* @param {xy_t} y y坐标
*
* @return {ret_t} RET_OK表示成功
*/
ret_t main_loop_post_pointer_event(main_loop_t* l, bool_t pressed, xy_t x, xy_t y); ret_t main_loop_post_pointer_event(main_loop_t* l, bool_t pressed, xy_t x, xy_t y);
/**
* @method main_loop_post_multi_gesture_event
*
* @param {main_loop_t*} l
* @param {multi_gesture_event_t*} event
*
* @return {ret_t} RET_OK表示成功
*/
ret_t main_loop_post_multi_gesture_event(main_loop_t* l, multi_gesture_event_t* event); ret_t main_loop_post_multi_gesture_event(main_loop_t* l, multi_gesture_event_t* event);
#ifndef MAIN_LOOP_QUEUE_SIZE #ifndef MAIN_LOOP_QUEUE_SIZE