improve api docs

This commit is contained in:
xianjimli 2018-08-07 18:50:48 +08:00
parent e09444412b
commit 6687d82dea
9 changed files with 333 additions and 123 deletions

View File

@ -142,6 +142,14 @@ bin\demoui
## 最新动态
* 2018/08/07
* 完善API docs
* 完善awtk-lua。
* 2018/08/06
* 完善API docs
* lua绑定放入独立的项目awtk-lua。
* 2018/08/05
* 重写IDL生成工具。

19
src/base/bitmap.c Executable file → Normal file
View File

@ -19,8 +19,18 @@
*
*/
#include "base/mem.h"
#include "base/bitmap.h"
bitmap_t* bitmap_create(void) {
bitmap_t* bitmap = TKMEM_ZALLOC(bitmap_t);
return_value_if_fail(bitmap != NULL, NULL);
bitmap->should_free_handle = TRUE;
return bitmap;
}
ret_t bitmap_destroy(bitmap_t* bitmap) {
return_value_if_fail(bitmap != NULL && bitmap->destroy != NULL, RET_BAD_PARAMS);
@ -28,7 +38,14 @@ ret_t bitmap_destroy(bitmap_t* bitmap) {
bitmap->specific_destroy(bitmap);
}
return bitmap->destroy(bitmap);
bitmap->destroy(bitmap);
if (bitmap->should_free_handle) {
memset(bitmap, 0x00, sizeof(bitmap_t));
TKMEM_FREE(bitmap);
}
return RET_OK;
}
#include "blend/pixel_pack_unpack.h"

View File

@ -34,6 +34,7 @@ typedef ret_t (*bitmap_destroy_t)(bitmap_t* bitmap);
/**
* @enum bitmap_format_t
* @prefix BITMAP_FMT_
* @annotation ["scriptable"]
*
*/
typedef enum _bitmap_format_t {
@ -61,6 +62,7 @@ typedef enum _bitmap_format_t {
/**
* @enum _bitmap_format_t
* @annotation ["scriptable"]
* @prefix BITMAP_FLAG_
*
*/
@ -89,36 +91,37 @@ typedef enum _bitmap_flag_t {
/**
* @class bitmap_t
* @annotation ["scriptable"]
*
*/
struct _bitmap_t {
/**
* @property {wh_t} w
* @annotation ["readable"]
* @annotation ["readable", "scriptable"]
*
*/
wh_t w;
/**
* @property {wh_t} h
* @annotation ["readable"]
* @annotation ["readable", "scriptable"]
*
*/
wh_t h;
/**
* @property {uint16_t} flags
* @annotation ["readable"]
* @annotation ["readable", "scriptable"]
* {bitmap_flag_t}
*/
uint16_t flags;
/**
* @property {uint16_t} format
* @annotation ["readable"]
* @annotation ["readable", "scriptable"]
* {bitmap_format_t}
*/
uint16_t format;
/**
* @property {char*} name
* @annotation ["readable"]
* @annotation ["readable", "scriptable"]
*
*/
const char* name;
@ -131,6 +134,7 @@ struct _bitmap_t {
/*private members*/
bool_t should_free_handle;
/* 显示特定的数据如OpenGL texture IDpicasso/agg中图片等。*/
void* specific;
/*specific_destroy的上下文*/
@ -142,9 +146,18 @@ struct _bitmap_t {
bitmap_destroy_t destroy;
};
/**
* @method bitmap_create
* (使)
* @annotation ["constructor", "scriptable"]
* @return {bitmap_t*} bitmap对象
*/
bitmap_t* bitmap_create(void);
/**
* @method bitmap_destroy
*
* @annotation ["deconstructor", "scriptable"]
* @param {bitmap_t*} bitmap bitmap对象
* @return {ret_t} RET_OK表示成功
*/

View File

@ -166,7 +166,7 @@ static ret_t combo_box_on_item_click(void* ctx, event_t* e) {
widget_set_text(widget, item->text.str);
}
if(old_index != index) {
if (old_index != index) {
event_t e = event_init(EVT_VALUE_CHANGED, widget);
widget_dispatch(widget, &e);
}

View File

@ -965,4 +965,3 @@ widget_t* edit_create_ex(widget_t* parent, xy_t x, xy_t y, wh_t w, wh_t h,
widget_t* edit_create(widget_t* parent, xy_t x, xy_t y, wh_t w, wh_t h) {
return edit_create_ex(parent, x, y, w, h, &s_edit_vtable);
}

View File

@ -40,6 +40,7 @@ typedef struct _bitmap_header_t {
/**
* @class image_manager_t
* @annotation ["scriptable"]
*
*/
typedef struct _image_manager_t {
@ -61,7 +62,7 @@ typedef struct _image_manager_t {
/**
* @method image_manager
*
* @annotation ["constructor"]
* @annotation ["constructor", "scriptable"]
* @return {image_manager_t*}
*/
image_manager_t* image_manager(void);
@ -99,6 +100,7 @@ image_manager_t* image_manager_init(image_manager_t* imm, image_loader_t* loader
/**
* @method image_manager_load
*
* @annotation ["scriptable"]
* @param {image_manager_t*} imm
* @param {char*} name
* @param {bitmap_t*} image

64
src/base/resource_manager.h Executable file → Normal file
View File

@ -28,16 +28,57 @@ BEGIN_C_DECLS
/**
* @enum resource_type_t
* @prefix RESOURCE_TYPE_
* @annotation ["scriptable"]
*
*/
typedef enum _resource_type_t {
/**
* @const RESOURCE_TYPE_NONE
*
*/
RESOURCE_TYPE_NONE,
/**
* @const RESOURCE_TYPE_FONT
*
*/
RESOURCE_TYPE_FONT,
/**
* @const RESOURCE_TYPE_IMAGE
*
*/
RESOURCE_TYPE_IMAGE,
/**
* @const RESOURCE_TYPE_THEME
*
*/
RESOURCE_TYPE_THEME,
/**
* @const RESOURCE_TYPE_UI
* UI数据资源
*/
RESOURCE_TYPE_UI,
/**
* @const RESOURCE_TYPE_XML
* XML数据资源
*/
RESOURCE_TYPE_XML,
/**
* @const RESOURCE_TYPE_STRINGS
*
*/
RESOURCE_TYPE_STRINGS,
/**
* @const RESOURCE_TYPE_DATA
*
*/
RESOURCE_TYPE_DATA
} resource_type_t;
@ -85,20 +126,37 @@ typedef struct _preload_res_t {
/**
* @class resource_info_t
* @annotation ["constructor", "scriptable"]
*
*/
typedef struct _resource_info_t {
/**
* @property {uint16_t} type
* @annotation ["readable","scriptable"]
*
*/
uint16_t type;
uint8_t subtype;
uint8_t is_in_rom;
/**
* @property {uint32_t} size
* @annotation ["readable","scriptable"]
*
*/
uint32_t size;
uint32_t refcount; /*is_in_rom == FALSE,才有效*/
/**
* @property {char*} name
* @annotation ["readable","scriptable"]
*
*/
char name[NAME_LEN + 1];
uint8_t data[4];
} resource_info_t;
/**
* @class resource_manager_t
* @annotation ["scriptable"]
*
*/
typedef struct _resource_manager_t {
@ -108,7 +166,7 @@ typedef struct _resource_manager_t {
/**
* @method resource_manager
*
* @annotation ["constructor"]
* @annotation ["constructor", "scriptable"]
*
* @return {resource_manager_t*} resource manager对象
*/
@ -157,6 +215,7 @@ ret_t resource_manager_add(resource_manager_t* rm, const void* info);
/**
* @method resource_manager_ref
*
* @annotation ["scriptable"]
* @param {resource_manager_t*} rm resource manager对象
* @param {resource_type_t} type
* @param {char*} name
@ -169,8 +228,9 @@ const resource_info_t* resource_manager_ref(resource_manager_t* rm, resource_typ
/**
* @method resource_manager_unref
*
* @annotation ["scriptable"]
* @param {resource_manager_t*} rm resource manager对象
* @param {resource_info_t} info
* @param {resource_info_t*} info
*
* @return {ret_t} RET_OK表示成功
*/

View File

@ -29,7 +29,7 @@ BEGIN_C_DECLS
/*widget props*/
/**
* @enum widget_prop_t
* @enum widget_prop_t
* @annotation ["scriptable", "string"]
* @prefix WIDGET_PROP_
*
@ -199,300 +199,300 @@ BEGIN_C_DECLS
/**
* @const WIDGET_PROP_MIN
*
*
*/
#define WIDGET_PROP_MIN "min"
/**
* @const WIDGET_PROP_MAX
*
*
*/
#define WIDGET_PROP_MAX "max"
/**
* @const WIDGET_PROP_TIPS
*
*
*/
#define WIDGET_PROP_TIPS "tips"
/**
* @const WIDGET_PROP_INPUT_TYPE
*
*
*/
#define WIDGET_PROP_INPUT_TYPE "input_type"
/**
* @const WIDGET_PROP_READONLY
*
*
*/
#define WIDGET_PROP_READONLY "readonly"
/**
* @const WIDGET_PROP_PASSWORD_VISIBLE
*
*
*/
#define WIDGET_PROP_PASSWORD_VISIBLE "password_visible"
/**
* @const WIDGET_PROP_ACTIVE
*
*
*/
#define WIDGET_PROP_ACTIVE "active"
/**
* @const WIDGET_PROP_VERTICAL
*
*
*/
#define WIDGET_PROP_VERTICAL "vertical"
/**
* @const WIDGET_PROP_SHOW_TEXT
*
*
*/
#define WIDGET_PROP_SHOW_TEXT "show_text"
/**
* @const WIDGET_PROP_XOFFSET
*
*
*/
#define WIDGET_PROP_XOFFSET "xoffset"
/**
* @const WIDGET_PROP_YOFFSET
*
*
*/
#define WIDGET_PROP_YOFFSET "yoffset"
/**
* @const WIDGET_PROP_AUTO_PLAY
*
*
*/
#define WIDGET_PROP_AUTO_PLAY "auto_play"
/**
* @const WIDGET_PROP_AUTO_FIX
*
*
*/
#define WIDGET_PROP_AUTO_FIX "auto_fix"
/**
* @const WIDGET_PROP_X_MIN
*
*
*/
#define WIDGET_PROP_X_MIN "x_min"
/**
* @const WIDGET_PROP_X_MAX
*
*
*/
#define WIDGET_PROP_X_MAX "x_max"
/**
* @const WIDGET_PROP_Y_MIN
*
*
*/
#define WIDGET_PROP_Y_MIN "y_min"
/**
* @const WIDGET_PROP_Y_MAX
*
*
*/
#define WIDGET_PROP_Y_MAX "y_max"
/**
* @const WIDGET_PROP_MAX
*
*
*/
#define WIDGET_PROP_MAX "max"
/**
* @const WIDGET_PROP_ROW
*
*
*/
#define WIDGET_PROP_ROW "row"
/**
* @const WIDGET_PROP_THEME
*
*
*/
#define WIDGET_PROP_THEME "theme"
/**
* @const WIDGET_PROP_SCRIPT
*
*
*/
#define WIDGET_PROP_SCRIPT "script"
/**
* @const WIDGET_PROP_ITEM_WIDTH
*
*
*/
#define WIDGET_PROP_ITEM_WIDTH "item_width"
/**
* @const WIDGET_PROP_ITEM_HEIGHT
*
*
*/
#define WIDGET_PROP_ITEM_HEIGHT "item_height"
/**
* @const WIDGET_PROP_DEFAULT_ITEM_HEIGHT
*
*
*/
#define WIDGET_PROP_DEFAULT_ITEM_HEIGHT "default_item_height"
/**
* @const WIDGET_PROP_XSLIDABLE
*
*
*/
#define WIDGET_PROP_XSLIDABLE "xslidable"
/**
* @const WIDGET_PROP_YSLIDABLE
*
*
*/
#define WIDGET_PROP_YSLIDABLE "yslidable"
/**
* @const WIDGET_PROP_REPEAT
*
*
*/
#define WIDGET_PROP_REPEAT "repeat"
/**
* @const WIDGET_PROP_ANIMATABLE
*
*
*/
#define WIDGET_PROP_ANIMATABLE "animatable"
/**
* @const WIDGET_PROP_AUTO_HIDE_SCROLL_BAR
*
*
*/
#define WIDGET_PROP_AUTO_HIDE_SCROLL_BAR "auto_hide_scroll_bar"
/**
* @const WIDGET_PROP_IMAGE
*
*
*/
#define WIDGET_PROP_IMAGE "image"
/**
* @const WIDGET_PROP_DRAW_TYPE
*
*
*/
#define WIDGET_PROP_DRAW_TYPE "draw_type"
/**
* @const WIDGET_PROP_SELECTABLE
*
*
*/
#define WIDGET_PROP_SELECTABLE "selectable"
/**
* @const WIDGET_PROP_CLICKABLE
*
*
*/
#define WIDGET_PROP_CLICKABLE "clickable"
/**
* @const WIDGET_PROP_SCALE_X
*
*
*/
#define WIDGET_PROP_SCALE_X "scale_x"
/**
* @const WIDGET_PROP_SCALE_Y
*
*
*/
#define WIDGET_PROP_SCALE_Y "scale_y"
/**
* @const WIDGET_PROP_ANCHOR_X
* x锚点
* x锚点
*/
#define WIDGET_PROP_ANCHOR_X "anchor_x"
/**
* @const WIDGET_PROP_ANCHOR_Y
* y锚点
* y锚点
*/
#define WIDGET_PROP_ANCHOR_Y "anchor_y"
/**
* @const WIDGET_PROP_ROTATION
* ()
* ()
*/
#define WIDGET_PROP_ROTATION "rotation"
/**
* @const WIDGET_PROP_SUB_THEME
* sub theme
* sub theme
*/
#define WIDGET_PROP_SUB_THEME "sub_theme"
/**
* @const WIDGET_PROP_COMPACT
*
*
*/
#define WIDGET_PROP_COMPACT "compact"
/**
* @const WIDGET_PROP_ICON
*
*
*/
#define WIDGET_PROP_ICON "icon"
/**
* @const WIDGET_PROP_OPTIONS
*
*
*/
#define WIDGET_PROP_OPTIONS "options"
/**
* @const WIDGET_PROP_SELECTED
*
*
*/
#define WIDGET_PROP_SELECTED "selected"
/**
* @const WIDGET_PROP_ACTIVE_ICON
* active状态下的图标
* active状态下的图标
*/
#define WIDGET_PROP_ACTIVE_ICON "active_icon"
/**
* @const WIDGET_PROP_OPEN_WINDOW
*
*
*/
#define WIDGET_PROP_OPEN_WINDOW "open_window"
/**
* @const WIDGET_PROP_SELECTED_INDEX
*
*
*/
#define WIDGET_PROP_SELECTED_INDEX "selected_index"
/**
* @const WIDGET_PROP_CLOSE_WHEN_CLICK
*
*
*/
#define WIDGET_PROP_CLOSE_WHEN_CLICK "close_when_click"
/**
* @const WIDGET_PROP_CLOSE_WHEN_CLICK_OUTSIDE
*
*
*/
#define WIDGET_PROP_CLOSE_WHEN_CLICK_OUTSIDE "close_when_click_outside"
/**
* @const WIDGET_PROP_LINE_GAP
*
*
*/
#define WIDGET_PROP_LINE_GAP "line_gap"
/**
* @enum widget_type_t
* @enum widget_type_t
* @annotation ["scriptable", "string"]
* @prefix WIDGET_TYPE_
*
@ -500,239 +500,238 @@ BEGIN_C_DECLS
/**
* @const WIDGET_TYPE_NONE
*
*
*/
#define WIDGET_TYPE_NONE "widget"
/**
* @const WIDGET_TYPE_WINDOW_MANAGER
*
*
*/
#define WIDGET_TYPE_WINDOW_MANAGER "window_manager"
/**
* @const WIDGET_TYPE_NORMAL_WINDOW
*
*
*/
#define WIDGET_TYPE_NORMAL_WINDOW "window"
/**
* @const WIDGET_TYPE_TOOL_BAR
*
*
*/
#define WIDGET_TYPE_TOOL_BAR "tool_bar"
/**
* @const WIDGET_TYPE_DIALOG
*
*
*/
#define WIDGET_TYPE_DIALOG "dialog"
/**
* @const WIDGET_TYPE_POPUP
*
*
*/
#define WIDGET_TYPE_POPUP "popup"
/**
* @const WIDGET_TYPE_SPRITE
*
*
*/
#define WIDGET_TYPE_SPRITE "sprite"
/**
* @const WIDGET_TYPE_KEYBOARD
*
*
*/
#define WIDGET_TYPE_KEYBOARD "keyboard"
/**
* @const WIDGET_TYPE_DND
*
*
*/
#define WIDGET_TYPE_DND "dnd"
/**
* @const WIDGET_TYPE_LABEL
*
*
*/
#define WIDGET_TYPE_LABEL "label"
/**
* @const WIDGET_TYPE_BUTTON
*
*
*/
#define WIDGET_TYPE_BUTTON "button"
/**
* @const WIDGET_TYPE_IMAGE
*
*
*/
#define WIDGET_TYPE_IMAGE "image"
/**
* @const WIDGET_TYPE_EDIT
*
*
*/
#define WIDGET_TYPE_EDIT "edit"
/**
* @const WIDGET_TYPE_PROGRESS_BAR
*
*
*/
#define WIDGET_TYPE_PROGRESS_BAR "progress_bar"
/**
* @const WIDGET_TYPE_GROUP_BOX
*
*
*/
#define WIDGET_TYPE_GROUP_BOX "group_box"
/**
* @const WIDGET_TYPE_CHECK_BUTTON
*
*
*/
#define WIDGET_TYPE_CHECK_BUTTON "check_button"
/**
* @const WIDGET_TYPE_RADIO_BUTTON
*
*
*/
#define WIDGET_TYPE_RADIO_BUTTON "radio_button"
/**
* @const WIDGET_TYPE_DIALOG_TITLE
*
*
*/
#define WIDGET_TYPE_DIALOG_TITLE "dialog_title"
/**
* @const WIDGET_TYPE_DIALOG_CLIENT
*
*
*/
#define WIDGET_TYPE_DIALOG_CLIENT "dialog_client"
/**
* @const WIDGET_TYPE_SLIDER
*
*
*/
#define WIDGET_TYPE_SLIDER "slider"
/**
* @const WIDGET_TYPE_VIEW
*
*
*/
#define WIDGET_TYPE_VIEW "view"
/**
* @const WIDGET_TYPE_COMBO_BOX
*
*
*/
#define WIDGET_TYPE_COMBO_BOX "combo_box"
/**
* @const WIDGET_TYPE_COMBO_BOX_ITEM
*
*
*/
#define WIDGET_TYPE_COMBO_BOX_ITEM "combo_box_item"
/**
* @const WIDGET_TYPE_SLIDE_VIEW
*
*
*/
#define WIDGET_TYPE_SLIDE_VIEW "slide_view"
/**
* @const WIDGET_TYPE_PAGES
*
*
*/
#define WIDGET_TYPE_PAGES "pages"
/**
* @const WIDGET_TYPE_TAB_BUTTON
*
*
*/
#define WIDGET_TYPE_TAB_BUTTON "tab_button"
/**
* @const WIDGET_TYPE_TAB_CONTROL
*
*
*/
#define WIDGET_TYPE_TAB_CONTROL "tab_control"
/**
* @const WIDGET_TYPE_TAB_BUTTON_GROUP
*
*
*/
#define WIDGET_TYPE_TAB_BUTTON_GROUP "tab_button_group"
/**
* @const WIDGET_TYPE_BUTTON_GROUP
*
*
*/
#define WIDGET_TYPE_BUTTON_GROUP "button_group"
/**
* @const WIDGET_TYPE_CANDIDATES
*
*
*/
#define WIDGET_TYPE_CANDIDATES "candidates"
/**
* @const WIDGET_TYPE_SPIN_BOX
*
*
*/
#define WIDGET_TYPE_SPIN_BOX "spin_box"
/**
* @const WIDGET_TYPE_DRAGGER
*
*
*/
#define WIDGET_TYPE_DRAGGER "dragger"
/**
* @const WIDGET_TYPE_SCROLL_BAR
*
*
*/
#define WIDGET_TYPE_SCROLL_BAR "scroll_bar"
/**
* @const WIDGET_TYPE_SCROLL_BAR_DESKTOP
*
*
*/
#define WIDGET_TYPE_SCROLL_BAR_DESKTOP "scroll_bar_d"
/**
* @const WIDGET_TYPE_SCROLL_BAR_MOBILE
*
*
*/
#define WIDGET_TYPE_SCROLL_BAR_MOBILE "scroll_bar_m"
/**
* @const WIDGET_TYPE_SCROLL_VIEW
*
*
*/
#define WIDGET_TYPE_SCROLL_VIEW "scroll_view"
/**
* @const WIDGET_TYPE_LIST_VIEW
*
*
*/
#define WIDGET_TYPE_LIST_VIEW "list_view"
/**
* @const WIDGET_TYPE_LIST_VIEW_H
*
*
*/
#define WIDGET_TYPE_LIST_VIEW_H "list_view_h"
/**
* @const WIDGET_TYPE_LIST_ITEM
*
*
*/
#define WIDGET_TYPE_LIST_ITEM "list_item"
/**
* @enum widget_state_t
* @annotation ["scriptable"]

View File

@ -278,7 +278,10 @@
],
"header": "base/bitmap.h",
"name": "bitmap_format_t",
"prefix": "BITMAP_FMT_"
"prefix": "BITMAP_FMT_",
"annotation": {
"scriptable": true
}
},
{
"type": "enum",
@ -303,11 +306,27 @@
],
"header": "base/bitmap.h",
"name": "_bitmap_format_t",
"prefix": "BITMAP_FLAG_"
"prefix": "BITMAP_FLAG_",
"annotation": {
"scriptable": true
}
},
{
"type": "class",
"methods": [
{
"params": [],
"annotation": {
"constructor": true,
"scriptable": true
},
"desc": "创建图片对象(一般供脚本语言中使用)。",
"name": "bitmap_create",
"return": {
"type": "bitmap_t*",
"desc": "返回bitmap对象。"
}
},
{
"params": [
{
@ -316,7 +335,10 @@
"desc": "bitmap对象。"
}
],
"annotation": {},
"annotation": {
"deconstructor": true,
"scriptable": true
},
"desc": "销毁图片。",
"name": "bitmap_destroy",
"return": {
@ -331,7 +353,8 @@
"desc": "宽度。",
"type": "wh_t",
"annotation": {
"readable": true
"readable": true,
"scriptable": true
}
},
{
@ -339,7 +362,8 @@
"desc": "高度。",
"type": "wh_t",
"annotation": {
"readable": true
"readable": true,
"scriptable": true
}
},
{
@ -347,7 +371,8 @@
"desc": "标志。请参考{bitmap_flag_t}。",
"type": "uint16_t",
"annotation": {
"readable": true
"readable": true,
"scriptable": true
}
},
{
@ -355,7 +380,8 @@
"desc": "格式。请参考{bitmap_format_t}。",
"type": "uint16_t",
"annotation": {
"readable": true
"readable": true,
"scriptable": true
}
},
{
@ -363,7 +389,8 @@
"desc": "名称。",
"type": "char*",
"annotation": {
"readable": true
"readable": true,
"scriptable": true
}
},
{
@ -377,7 +404,10 @@
],
"header": "base/bitmap.h",
"desc": "位图。",
"name": "bitmap_t"
"name": "bitmap_t",
"annotation": {
"scriptable": true
}
},
{
"type": "enum",
@ -4047,7 +4077,8 @@
{
"params": [],
"annotation": {
"constructor": true
"constructor": true,
"scriptable": true
},
"desc": "获取缺省的图片管理器。",
"name": "image_manager",
@ -4131,7 +4162,9 @@
"desc": "用于返回图片。"
}
],
"annotation": {},
"annotation": {
"scriptable": true
},
"desc": "加载指定的图片。",
"name": "image_manager_load",
"return": {
@ -4286,7 +4319,10 @@
],
"header": "base/image_manager.h",
"desc": "图片管理器。负责加载,解码和缓存图片。",
"name": "image_manager_t"
"name": "image_manager_t",
"annotation": {
"scriptable": true
}
},
{
"type": "class",
@ -7157,10 +7193,46 @@
{
"type": "enum",
"desc": "资源类型常量定义。",
"consts": [],
"consts": [
{
"desc": "无效资源。",
"name": "RESOURCE_TYPE_NONE"
},
{
"desc": "字体资源。",
"name": "RESOURCE_TYPE_FONT"
},
{
"desc": "图片资源。",
"name": "RESOURCE_TYPE_IMAGE"
},
{
"desc": "主题资源。",
"name": "RESOURCE_TYPE_THEME"
},
{
"desc": "UI数据资源。",
"name": "RESOURCE_TYPE_UI"
},
{
"desc": "XML数据资源。",
"name": "RESOURCE_TYPE_XML"
},
{
"desc": "字符串数据资源。",
"name": "RESOURCE_TYPE_STRINGS"
},
{
"desc": "其它数据资源。",
"name": "RESOURCE_TYPE_DATA"
}
],
"header": "base/resource_manager.h",
"name": "resource_type_t",
"prefix": "RESOURCE_TYPE_"
"prefix": "RESOURCE_TYPE_",
"annotation": {
"scriptable": true
}
},
{
"type": "enum",
@ -7197,10 +7269,42 @@
{
"type": "class",
"methods": [],
"properties": [],
"properties": [
{
"name": "type",
"desc": "类型。",
"type": "uint16_t",
"annotation": {
"readable": true,
"scriptable": true
}
},
{
"name": "size",
"desc": "大小。",
"type": "uint32_t",
"annotation": {
"readable": true,
"scriptable": true
}
},
{
"name": "name",
"desc": "名称。",
"type": "char*",
"annotation": {
"readable": true,
"scriptable": true
}
}
],
"header": "base/resource_manager.h",
"desc": "单个资源的描述信息。",
"name": "resource_info_t"
"name": "resource_info_t",
"annotation": {
"constructor": true,
"scriptable": true
}
},
{
"type": "class",
@ -7208,7 +7312,8 @@
{
"params": [],
"annotation": {
"constructor": true
"constructor": true,
"scriptable": true
},
"desc": "获取缺省资源管理器。",
"name": "resource_manager",
@ -7313,7 +7418,9 @@
"desc": "资源的名称。"
}
],
"annotation": {},
"annotation": {
"scriptable": true
},
"desc": "在资源管理器的缓存中查找指定的资源并引用它,如果缓存中不存在,尝试加载该资源。",
"name": "resource_manager_ref",
"return": {
@ -7329,12 +7436,14 @@
"desc": "resource manager对象。"
},
{
"type": "resource_info_t",
"type": "resource_info_t*",
"name": "info",
"desc": "资源。"
}
],
"annotation": {},
"annotation": {
"scriptable": true
},
"desc": "释放指定的资源。",
"name": "resource_manager_unref",
"return": {
@ -7451,7 +7560,10 @@
"properties": [],
"header": "base/resource_manager.h",
"desc": "资源管理器。",
"name": "resource_manager_t"
"name": "resource_manager_t",
"annotation": {
"scriptable": true
}
},
{
"type": "class",