Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/zlgopen/awtk
Browse files Browse the repository at this point in the history
  • Loading branch information
xianjimli committed Dec 16, 2024
2 parents 605d8c4 + 6a81f69 commit 2bd6a6b
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 33 deletions.
52 changes: 26 additions & 26 deletions src/base/widget.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,59 +107,59 @@ struct _widget_vtable_t {
* 是否可以滚动。
*>子类无法继承。
*/
uint32_t scrollable : 1;
bool_t scrollable;
/**
* 是否属于可输入的控件(如:edit/slider等,用户可通过界面输入/改变数据或值)。
*>子类无法继承。
*/
uint32_t inputable : 1;
bool_t inputable;
/**
* 是否是focusable。
*>子类无法继承。
*>如编辑器。
*/
uint32_t focusable : 1;
bool_t focusable;
/**
* 在查找focusable的控件时,是否跳过子控件。
*>子类无法继承。
*/
uint32_t disallow_children_focusable : 1;
bool_t disallow_children_focusable;
/**
* 收到空格键触发click事件。
*>子类无法继承。
*/
uint32_t space_key_to_activate : 1;
bool_t space_key_to_activate;
/**
* 收到回车键触发click事件。
*>子类无法继承。
*/
uint32_t return_key_to_activate : 1;
bool_t return_key_to_activate;
/**
* 是否是窗口。
*>子类无法继承。
*/
uint32_t is_window : 1;
bool_t is_window;
/**
* 是否是窗口管理。
*>子类无法继承。
*/
uint32_t is_window_manager : 1;
bool_t is_window_manager;
/**
* 是否是设计窗口。
*>子类无法继承。
*/
uint32_t is_designing_window : 1;
bool_t is_designing_window;
/**
* 是否是软键盘(点击软键盘不改变编辑器的焦点)。
*>子类无法继承。
*/
uint32_t is_keyboard : 1;
bool_t is_keyboard;

/**
* 是否允许绘制到控件区域外部。
*>子类无法继承。
*/
uint32_t allow_draw_outside : 1;
bool_t allow_draw_outside;

/**
* dynamic parent class vtable
Expand Down Expand Up @@ -352,39 +352,39 @@ struct _widget_t {
* @annotation ["set_prop","get_prop","readable","persitent","design","scriptable"]
* 启用/禁用状态。
*/
uint8_t enable : 1;
bool_t enable;
/**
* @property {bool_t} feedback
* @annotation ["set_prop","get_prop","readable","persitent","design","scriptable"]
* 是否启用按键音、触屏音和震动等反馈。
*/
uint8_t feedback : 1;
bool_t feedback;
/**
* @property {bool_t} visible
* @annotation ["set_prop","get_prop","readable","persitent","design","scriptable"]
* 是否可见。
*/
uint8_t visible : 1;
bool_t visible;
/**
* @property {bool_t} sensitive
* @annotation ["set_prop","get_prop","readable","persitent","design","scriptable"]
* 是否接受用户事件。
*/
uint8_t sensitive : 1;
bool_t sensitive;
/**
* @property {bool_t} focusable
* @annotation ["set_prop","get_prop","readable","persitent","design","scriptable"]
* 是否支持焦点停留。
*/
uint8_t focusable : 1;
bool_t focusable;

/**
* @property {bool_t} with_focus_state
* @annotation ["set_prop","get_prop","readable","persitent","design","scriptable"]
* 是否支持焦点状态。
* > 如果希望style支持焦点状态,但又不希望焦点停留,可用本属性。
*/
uint8_t with_focus_state : 1;
bool_t with_focus_state;

/**
* @property {bool_t} auto_adjust_size
Expand All @@ -394,38 +394,38 @@ struct _widget_t {
*> 为true时,最好不要使用 layout 的相关东西,否则可能有冲突。
*> 注意:只是调整控件的本身的宽高,不会修改控件本身的位置。
*/
uint8_t auto_adjust_size : 1;
bool_t auto_adjust_size;

/**
* @property {bool_t} focused
* @annotation ["readable"]
* 是否得到焦点。
*/
uint8_t focused : 1;
bool_t focused;
/**
* @property {bool_t} auto_created
* @annotation ["readable"]
* 是否由父控件自动创建。
*/
uint8_t auto_created : 1;
bool_t auto_created;
/**
* @property {bool_t} dirty
* @annotation ["readable"]
* 标识控件是否需要重绘。
*/
uint8_t dirty : 1;
bool_t dirty;
/**
* @property {bool_t} floating
* @annotation ["set_prop","get_prop","readable","persitent","design","scriptable"]
* 标识控件是否启用浮动布局,不受父控件的children_layout的控制。
*/
uint8_t floating : 1;
bool_t floating;
/**
* @property {bool_t} need_update_style
* @annotation ["readable"]
* 标识控件是否需要update style。
*/
uint8_t need_update_style : 1;
bool_t need_update_style;
/**
* @property {int32_t} ref_count
* @annotation ["readable"]
Expand All @@ -438,19 +438,19 @@ struct _widget_t {
* @annotation ["readable"]
* 标识控件正在初始化。
*/
uint8_t initializing : 1;
bool_t initializing;
/**
* @property {bool_t} loading
* @annotation ["readable"]
* 标识控件正在加载。
*/
uint8_t loading : 1;
bool_t loading;
/**
* @property {bool_t} destroying
* @annotation ["readable"]
* 标识控件正在被销毁。
*/
uint8_t destroying : 1;
bool_t destroying;
/**
* @property {char*} state
* @annotation ["set_prop","get_prop","readable"]
Expand Down
4 changes: 2 additions & 2 deletions src/tkc/object.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ typedef tk_object_t* (*tk_object_clone_t)(tk_object_t* obj);
struct _tk_object_vtable_t {
const char* type;
const char* desc;
uint32_t size : 28;
uint32_t is_collection : 1;
uint32_t size;
bool_t is_collection;
tk_object_on_destroy_t on_destroy;

tk_object_compare_t compare;
Expand Down
10 changes: 5 additions & 5 deletions src/tkc/value.h
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,8 @@ typedef struct _sized_str_t {
} sized_str_t;

typedef struct _id_info_t {
int32_t suboffset : 16;
int32_t index : 16;
int16_t suboffset;
int16_t index;
char* id;
} id_info_t;

Expand Down Expand Up @@ -220,10 +220,10 @@ typedef struct _pointer_ref_t {
*
*/
struct _value_t {
value_type_t type : 8;
value_type_t type;
/*sub_type用细分类型。目前不做定义,请根据上下文使用。*/
uint32_t sub_type : 8;
bool_t free_handle : 1;
uint8_t sub_type;
bool_t free_handle;
union {
int8_t i8;
uint8_t u8;
Expand Down

0 comments on commit 2bd6a6b

Please sign in to comment.