Files
luban-lite-t3e-pro/packages/third-party/awtk-ui/awtk/src/awtk_global.h

181 lines
4.5 KiB
C
Raw Normal View History

2023-11-09 20:19:51 +08:00
/**
* File: awtk.h
* Author: AWTK Develop Team
* Brief: awtk
*
* Copyright (c) 2018 - 2023 Guangzhou ZHIYUAN Electronics Co.,Ltd.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* License file for more details.
*
*/
/**
* History:
* ================================================================
* 2018-03-03 Li XianJing <xianjimli@hotmail.com> created
*
*/
#ifndef TK_GLOBAL_H
#define TK_GLOBAL_H
#include "base/types_def.h"
BEGIN_C_DECLS
/**
* @class global_t
* @annotation ["scriptable", "fake"]
* TK全局对象
*/
/**
* @method tk_pre_init
*
*> tk_init之前
*> tk_pre_init来初始化平台data reader等等
*
* @alias pre_init
* @annotation ["static", "scriptable"]
*
* @return {ret_t} RET_OK表示成功
*/
ret_t tk_pre_init(void);
/**
* @method tk_init
* TK
* @alias init
* @annotation ["static", "scriptable"]
* @param {wh_t} w LCD宽度
* @param {wh_t} h LCD高度
* @param {app_type_t} app_type
* @param {const char*} app_name ()
* @param {const char*} app_root ()
*
* @return {ret_t} RET_OK表示成功
*/
ret_t tk_init(wh_t w, wh_t h, app_type_t app_type, const char* app_name, const char* app_root);
/**
* @method tk_run
* TK事件主循环
* @alias run
* @annotation ["static", "scriptable"]
*
* @return {ret_t} RET_OK表示成功
*/
ret_t tk_run(void);
/**
* @method tk_quit
* 退TK事件主循环
* @alias global_quit
* @annotation ["static", "scriptable"]
*
* @return {ret_t} RET_OK表示成功
*/
ret_t tk_quit(void);
/**
* @method tk_get_pointer_x
* X坐标
* @alias global_get_pointer_x
* @annotation ["static", "scriptable"]
*
* @return {int32_t} X坐标
*/
int32_t tk_get_pointer_x(void);
/**
* @method tk_get_pointer_y
* Y坐标
* @alias global_get_pointer_y
* @annotation ["static", "scriptable"]
*
* @return {int32_t} X坐标
*/
int32_t tk_get_pointer_y(void);
/**
* @method tk_is_pointer_pressed
*
* @alias global_is_pointer_pressed
* @annotation ["static", "scriptable"]
*
* @return {bool_t}
*/
bool_t tk_is_pointer_pressed(void);
/**
* @method tk_set_lcd_orientation
* (XXX:0,90,180270)
* @param {lcd_orientation_t} orientation
*
* @return {ret_t} RET_OK表示成功
*/
ret_t tk_set_lcd_orientation(lcd_orientation_t orientation);
/**
* @method tk_enable_fast_lcd_portrait
* WITH_FAST_LCD_PORTRAIT
* tk_set_lcd_orientation
* @param {bool_t} enable
*
* @return {ret_t} RET_OK表示成功
*/
ret_t tk_enable_fast_lcd_portrait(bool_t enable);
/**
* @method tk_init_assets
*
*
* @return {ret_t} RET_OK表示成功
*/
ret_t tk_init_assets(void);
/**
* @method tk_init_internal
* init
*> public for test program
*
* @return {ret_t} RET_OK表示成功
*/
ret_t tk_init_internal(void);
/**
* @method tk_deinit_internal
* deinit
*> public for test program
*
* @return {ret_t} RET_OK表示成功
*/
ret_t tk_deinit_internal(void);
/**
* @method tk_exit
* public for web
*
* @return {ret_t} RET_OK表示成功
*/
ret_t tk_exit(void);
/**
* @method tk_run_in_ui_thread
* 线UI线程执行指定的函数
*
* @param {tk_callback_t} func
* @param {void*} ctx
* @param {bool_t} wait_until_done
*
* @return {ret_t} RET_OK表示成功
*/
ret_t tk_run_in_ui_thread(tk_callback_t func, void* ctx, bool_t wait_until_done);
END_C_DECLS
#endif /*TK_GLOBAL_H*/