mirror of
https://gitee.com/zlgopen/awtk.git
synced 2024-11-30 02:58:26 +08:00
improve script binding
This commit is contained in:
parent
691241f7c5
commit
ac715579b3
@ -32,6 +32,7 @@ typedef ret_t (*bitmap_destroy_t)(bitmap_t* bitmap);
|
||||
|
||||
/**
|
||||
* @class bitmap_t
|
||||
* @order -9
|
||||
* @annotation ["scriptable"]
|
||||
* 位图。
|
||||
*/
|
||||
|
@ -29,6 +29,7 @@ BEGIN_C_DECLS
|
||||
/**
|
||||
* @class point_t
|
||||
* @annotation ["scriptable"]
|
||||
* @order -10
|
||||
* 点。包括一个x坐标和一个y坐标。
|
||||
*/
|
||||
typedef struct _point_t {
|
||||
@ -48,6 +49,7 @@ typedef struct _point_t {
|
||||
|
||||
/**
|
||||
* @class pointf_t
|
||||
* @order -10
|
||||
* @annotation ["scriptable"]
|
||||
* 点(浮点数)。包括一个x坐标和一个y坐标。
|
||||
*/
|
||||
@ -68,6 +70,7 @@ typedef struct _pointf_t {
|
||||
|
||||
/**
|
||||
* @class rect_t
|
||||
* @order -10
|
||||
* @annotation ["scriptable"]
|
||||
* 矩形。包括一个x坐标、y坐标、宽度和高度。
|
||||
*/
|
||||
|
@ -151,6 +151,7 @@ typedef struct _sized_str_t {
|
||||
|
||||
/**
|
||||
* @class value_t
|
||||
* @order -10
|
||||
* @annotation ["scriptable"]
|
||||
* 一个通用数据类型,用来存放整数、浮点数、字符串和其它对象。
|
||||
*
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -60,6 +60,10 @@ class IDLGenerator {
|
||||
return this.getValue(str);
|
||||
}
|
||||
|
||||
parseOrder(str) {
|
||||
return parseInt(this.getValue(str));
|
||||
}
|
||||
|
||||
parsePrefix(str) {
|
||||
return this.getValue(str);
|
||||
}
|
||||
@ -222,6 +226,8 @@ class IDLGenerator {
|
||||
cls.annotation = this.parseAnnotation(iter);
|
||||
}else if (iter.indexOf('@alias') >= 0) {
|
||||
cls.alias = this.parseAlias(iter);
|
||||
}else if (iter.indexOf('@order') >= 0) {
|
||||
cls.order = this.parseOrder(iter);
|
||||
} else if (iter.indexOf('@parent') >= 0) {
|
||||
cls.parent = this.parseParent(iter);
|
||||
} else {
|
||||
@ -380,7 +386,10 @@ class IDLGenerator {
|
||||
|
||||
sort() {
|
||||
this.result.sort((a, b) => {
|
||||
return a.level - b.level;
|
||||
let aLevel = a.order || a.level;
|
||||
let bLevel = b.order || b.level;
|
||||
|
||||
return aLevel - bLevel;
|
||||
});
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user