improve dialog and system bar

This commit is contained in:
lixianjing 2023-05-16 18:42:02 +08:00
parent 7de03b1152
commit 66de428114
39 changed files with 1229 additions and 224 deletions

View File

@ -41,7 +41,7 @@ static ret_t new_window_set_param(widget_t* new_win, widget_t* curr_win) {
widget_t* state_pages = NULL;
widget_t *widget_fullscreen = NULL, *widget_new_fullscreen = NULL;
bool_t fullscreen = FALSE;
widget_t *widget_anim_hint = NULL, *widget_anim_duration = NULL, *widget_anim_easing = NULL;
widget_t *widget_anim_hint = NULL, *widget_anim_duration = NULL, *widget_anim_easing = NULL, *widget_highlight = NULL;
char anim_hint[TK_NAME_LEN + 1] = {0}, anim_duration[TK_NAME_LEN + 1] = {0},
anim_easing[TK_NAME_LEN + 1] = {0};
char anim[ARRAY_SIZE(anim_hint) + ARRAY_SIZE(anim_duration) + ARRAY_SIZE(anim_easing) +
@ -66,11 +66,26 @@ static ret_t new_window_set_param(widget_t* new_win, widget_t* curr_win) {
widget_get_text_utf8(widget_anim_easing, anim_easing, ARRAY_SIZE(anim_easing));
}
tk_snprintf(widget_name, ARRAY_SIZE(widget_name), "anim_hint(%s):highlight", new_win->name);
widget_highlight = widget_lookup(curr_win, widget_name, TRUE);
if (widget_highlight != NULL) {
if (widget_get_prop_bool(widget_highlight, WIDGET_PROP_VALUE, FALSE)) {
widget_set_prop_str(new_win, WIDGET_PROP_HIGHLIGHT, "default(alpha=100)");
} else {
widget_set_prop_str(new_win, WIDGET_PROP_HIGHLIGHT, "");
}
}
if (!tk_str_eq(anim_hint, "none")) {
tk_snprintf(anim, ARRAY_SIZE(anim), "%s(duration=%s,easing=%s)", anim_hint, anim_duration,
anim_easing);
widget_set_prop_bool(new_win, WIDGET_PROP_DISABLE_ANIM, FALSE);
widget_set_prop_str(new_win, WIDGET_PROP_ANIM_HINT, anim);
if (tk_str_eq(anim_hint, "popup")) {
widget_set_self_layout_params(new_win, NULL, "b:10", NULL, NULL);
} else if (tk_str_eq(anim_hint, "popdown")) {
widget_set_self_layout_params(new_win, NULL, "10", NULL, NULL);
}
log_debug("%s\r\n", anim);
} else {
widget_set_prop_bool(new_win, WIDGET_PROP_DISABLE_ANIM, TRUE);
@ -106,7 +121,9 @@ static ret_t on_open_window(void* ctx, event_t* e) {
new_win = window_open_with_prefix(name);
if (new_win != NULL) {
if (!tk_str_eq(name, "center")) {
new_window_set_param(new_win, curr_win);
}
init_children_widget(new_win, (void*)new_win);
}
@ -161,9 +178,14 @@ static void init_children_widget(widget_t* widget, void* ctx) {
ret_t application_init(void) {
widget_t* win = NULL;
widget_t* state_pages = NULL;
window_open("system_bar");
win = window_open_with_prefix("window");
widget_t* system_bar_top = window_open("system_bar");
widget_t* system_bar_bottom = window_open("system_bar_bottom");
widget_use_style(system_bar_bottom, "system_bar");
widget_set_prop_str(widget_lookup_by_type(system_bar_bottom, "digit_clock", TRUE), "format", "hh:mm::ss");
widget_set_prop_str(widget_lookup_by_type(system_bar_top, "digit_clock", TRUE), "format", "hh:mm::ss");
win = window_open_with_prefix("window");
init_children_widget(win, (void*)win);
widget_set_prop_int(win, WIDGET_PROP_CLOSABLE, WINDOW_CLOSABLE_NO);

View File

@ -2,6 +2,9 @@
<style name="default">
<normal bg_color="#606060"/>
</style>
<style name="system_bar">
<normal bg_color="#404040"/>
</style>
</system_bar_bottom>
<label>

View File

@ -0,0 +1,9 @@
<dialog anim_hint="center_scale(duration=300)" highlight="default(start_alpha=0, end_alpha=80)"
x="0" y="m" w="100%" h="160">
<dialog_title x="0" y="0" w="100%" h="30" text="Hello AWTK" />
<dialog_client x="0" y="bottom" w="100%" h="-30">
<label name="" x="center" y="middle:-20" w="200" h="30" text="Are you ready?"/>
<button name="open:center" x="10" y="bottom:10" w="40%" h="30" text="Yes"/>
<button name="close()" x="right:10" y="bottom:10" w="40%" h="30" text="No"/>
</dialog_client>
</dialog>

View File

@ -1,9 +1,10 @@
<dialog name="dialog" x="c" y="m" w="294" h="92" highlight="default(alpha=100)" move_focus_prev_key="up" move_focus_next_key="down">
<dialog name="dialog" x="c" y="m" w="294" h="140" move_focus_prev_key="up" move_focus_next_key="down">
<dialog_title x="0" y="0" w="100%" h="36" text="dialog">
<draggable drag_window="true"/>
<button name="close()" x="r:10" y="10" w="20" h="20" text="X"/>
</dialog_title>
<dialog_client x="0" y="b" w="100%" h="-36">
<button name="open:center" x="c" y="50" w="100" h="36" text="open dialog"/>
<edit name="edit" x="c" y="10" w="-20" h="36" tips="test keyboard popup" auto_fix="true"/>
</dialog_client>
</dialog>

View File

@ -21,11 +21,11 @@
<combo_box_ex name="anim_hint(window):easing" w="160" item_height="30" readonly="true" localize_options="false" options="linear;quadratic_in;quadratic_out;quadratic_inout;cubic_in;cubic_out;sin_in;sin_out;sin_inout;pow_in;pow_out;pow_inout;circular_in;circular_out;circular_inout;elastic_in;elastic_out;elastic_inout;back_in;back_out;back_inout;bounce_in;bounce_out;bounce_inout" value="0"/>
</view>
</view>
<view name="view_dialog" h="140" children_layout="default(r=0,c=1,x=10,s=10)">
<view name="view_dialog" h="160" children_layout="default(r=0,c=1,x=10,s=10)">
<label name="lb" h="28" text="dialog"/>
<view name="view_anim_hint" h="22" children_layout="default(r=1,c=0,x=0,y=0,s=0)">
<label name="lb_ti" w="74" text="anim hint"/>
<combo_box_ex name="anim_hint(dialog)" w="160" item_height="30" readonly="true" localize_options="false" options="none;center_scale;fade;popup;popdown" value="1"/>
<combo_box_ex name="anim_hint(dialog)" w="160" item_height="30" readonly="true" localize_options="false" options="none;center_scale;fade;popup;popdown" value="4"/>
</view>
<view name="view_duration" h="22" children_layout="default(r=1,c=0,x=0,y=0,s=0)">
<label name="lb_ti" w="74" text="duration"/>
@ -35,6 +35,10 @@
<label name="lb_ti" w="74" text="easing"/>
<combo_box_ex name="anim_hint(dialog):easing" w="160" item_height="30" readonly="true" localize_options="false" options="linear;quadratic_in;quadratic_out;quadratic_inout;cubic_in;cubic_out;sin_in;sin_out;sin_inout;pow_in;pow_out;pow_inout;circular_in;circular_out;circular_inout;elastic_in;elastic_out;elastic_inout;back_in;back_out;back_inout;bounce_in;bounce_out;bounce_inout" value="0"/>
</view>
<view name="view_highlight" h="22" children_layout="default(r=1,c=0,x=0,y=0,s=0)">
<label name="lb_ti" w="74" text="highlight"/>
<switch name="anim_hint(dialog):highlight" w="44" value="true"/>
</view>
</view>
</view>
<button name="open:dialog" x="r:10" y="b:56" w="100" h="36" text="open dialog"/>

View File

@ -2,6 +2,7 @@
2023/05/16
* 修复候选框打印警告问题(感谢智明提供补丁)
* 修改对话框重叠system\_bar的高亮显示不正常和底部的system\_bar导致窗口动画不正常的问题(感谢智明提供补丁)
2023/05/13
* 扩展debugger接口支持VSCode DAP协议。

View File

@ -254,6 +254,7 @@ extern TK_CONST_DATA_ALIGN(const unsigned char ui_uiex_popup[]);
extern TK_CONST_DATA_ALIGN(const unsigned char ui_uiex_page_label[]);
extern TK_CONST_DATA_ALIGN(const unsigned char ui_uiex_kb_uint[]);
extern TK_CONST_DATA_ALIGN(const unsigned char ui_win_anim_window[]);
extern TK_CONST_DATA_ALIGN(const unsigned char ui_win_anim_center[]);
extern TK_CONST_DATA_ALIGN(const unsigned char ui_win_anim_dialog[]);
extern TK_CONST_DATA_ALIGN(const unsigned char xml_test[]);
extern TK_CONST_DATA_ALIGN(const unsigned char data_com_zlg_app_json[]);
@ -1171,6 +1172,7 @@ ret_t assets_init_dark(void) {
assets_manager_add(am, ui_uiex_page_label);
assets_manager_add(am, ui_uiex_kb_uint);
assets_manager_add(am, ui_win_anim_window);
assets_manager_add(am, ui_win_anim_center);
assets_manager_add(am, ui_win_anim_dialog);
assets_manager_add(am, xml_test);
assets_manager_add(am, data_com_zlg_app_json);

View File

@ -254,6 +254,7 @@
#include "default/inc/ui/uiex/page_label.data"
#include "default/inc/ui/uiex/kb_uint.data"
#include "default/inc/ui/win_anim/window.data"
#include "default/inc/ui/win_anim/center.data"
#include "default/inc/ui/win_anim/dialog.data"
#include "default/inc/xml/test.data"
#include "default/inc/data/com_zlg_app_json.data"
@ -1171,6 +1172,7 @@ ret_t assets_init_default(void) {
assets_manager_add(am, ui_uiex_page_label);
assets_manager_add(am, ui_uiex_kb_uint);
assets_manager_add(am, ui_win_anim_window);
assets_manager_add(am, ui_win_anim_center);
assets_manager_add(am, ui_win_anim_dialog);
assets_manager_add(am, xml_test);
assets_manager_add(am, data_com_zlg_app_json);

View File

@ -207,6 +207,7 @@ extern TK_CONST_DATA_ALIGN(const unsigned char ui_kb_uint[]);
extern TK_CONST_DATA_ALIGN(const unsigned char ui_scroll_view_v[]);
extern TK_CONST_DATA_ALIGN(const unsigned char ui_slide_view_animating_time[]);
extern TK_CONST_DATA_ALIGN(const unsigned char ui_win_anim_window[]);
extern TK_CONST_DATA_ALIGN(const unsigned char ui_win_anim_center[]);
extern TK_CONST_DATA_ALIGN(const unsigned char ui_win_anim_dialog[]);
extern TK_CONST_DATA_ALIGN(const unsigned char xml_test[]);
extern TK_CONST_DATA_ALIGN(const unsigned char data_com_zlg_app_json[]);
@ -745,6 +746,7 @@ ret_t assets_init_dark(void) {
assets_manager_add(am, ui_scroll_view_v);
assets_manager_add(am, ui_slide_view_animating_time);
assets_manager_add(am, ui_win_anim_window);
assets_manager_add(am, ui_win_anim_center);
assets_manager_add(am, ui_win_anim_dialog);
assets_manager_add(am, xml_test);
assets_manager_add(am, data_com_zlg_app_json);

View File

@ -207,6 +207,7 @@
#include "default/inc/ui/scroll_view_v.data"
#include "default/inc/ui/slide_view_animating_time.data"
#include "default/inc/ui/win_anim/window.data"
#include "default/inc/ui/win_anim/center.data"
#include "default/inc/ui/win_anim/dialog.data"
#include "default/inc/xml/test.data"
#include "default/inc/data/com_zlg_app_json.data"
@ -745,6 +746,7 @@ ret_t assets_init_default(void) {
assets_manager_add(am, ui_scroll_view_v);
assets_manager_add(am, ui_slide_view_animating_time);
assets_manager_add(am, ui_win_anim_window);
assets_manager_add(am, ui_win_anim_center);
assets_manager_add(am, ui_win_anim_dialog);
assets_manager_add(am, xml_test);
assets_manager_add(am, data_com_zlg_app_json);

View File

@ -1,48 +1,54 @@
TK_CONST_DATA_ALIGN(const unsigned char style_system_bar_bottom[]) = {
0x03,0x00,0x00,0x01,0x74,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x73,0x79,0x73,0x74,0x65,0x6d,0x5f,0x62,
0x03,0x00,0x00,0x01,0xed,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x73,0x79,0x73,0x74,0x65,0x6d,0x5f,0x62,
0x61,0x72,0x5f,0x62,0x6f,0x74,0x74,0x6f,0x6d,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0xfd,0xfc,0xfb,0xfa,0x00,0x00,0x00,0x00,0x07,0x00,0x00,0x00,0xc8,0x02,0x00,0x00,
0x00,0x00,0x00,0x00,0xfd,0xfc,0xfb,0xfa,0x00,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x2c,0x03,0x00,0x00,
0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x64,0x65,0x66,0x61,0x75,0x6c,0x74,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x73,0x79,0x73,0x74,0x65,0x6d,0x5f,0x62,0x61,0x72,0x5f,0x62,0x6f,0x74,0x74,0x6f,
0x6d,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xdd,0x02,0x00,0x00,
0x6d,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x41,0x03,0x00,0x00,
0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x73,0x79,0x73,0x74,0x65,0x6d,0x5f,0x62,
0x61,0x72,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x73,0x79,0x73,0x74,0x65,0x6d,0x5f,0x62,0x61,0x72,0x5f,0x62,0x6f,0x74,0x74,0x6f,
0x6d,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x56,0x03,0x00,0x00,
0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x74,0x69,0x74,0x6c,0x65,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x6c,0x61,0x62,0x65,0x6c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x09,0x03,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x82,0x03,0x00,0x00,
0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x74,0x69,0x6d,0x65,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x64,0x69,0x67,0x69,0x74,0x5f,0x63,0x6c,0x6f,0x63,0x6b,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x03,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x99,0x03,0x00,0x00,
0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x63,0x6c,0x6f,0x73,0x65,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x62,0x75,0x74,0x74,0x6f,0x6e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x35,0x03,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xae,0x03,0x00,0x00,
0x70,0x72,0x65,0x73,0x73,0x65,0x64,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x63,0x6c,0x6f,0x73,0x65,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x62,0x75,0x74,0x74,0x6f,0x6e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x4a,0x03,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc3,0x03,0x00,0x00,
0x6f,0x76,0x65,0x72,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x63,0x6c,0x6f,0x73,0x65,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x62,0x75,0x74,0x74,0x6f,0x6e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x5f,0x03,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xd8,0x03,0x00,0x00,
0x64,0x69,0x73,0x61,0x62,0x6c,0x65,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x63,0x6c,0x6f,0x73,0x65,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x62,0x75,0x74,0x74,0x6f,0x6e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,
0x07,0x09,0x04,0x00,0x62,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x00,0x60,0x60,0x60,0xff,0x02,0x00,0x00,
0x00,0x06,0x0d,0x04,0x00,0x74,0x65,0x78,0x74,0x5f,0x61,0x6c,0x69,0x67,0x6e,0x5f,0x68,0x00,0x02,0x00,
0x00,0x00,0x07,0x0b,0x04,0x00,0x74,0x65,0x78,0x74,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x00,0xff,0xff,0xff,
0xff,0x01,0x00,0x00,0x00,0x07,0x0b,0x04,0x00,0x74,0x65,0x78,0x74,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x00,
0xff,0xff,0xff,0xff,0x01,0x00,0x00,0x00,0x0e,0x05,0x08,0x00,0x69,0x63,0x6f,0x6e,0x00,0x63,0x6c,0x6f,
0x73,0x65,0x5f,0x6e,0x00,0x01,0x00,0x00,0x00,0x0e,0x05,0x08,0x00,0x69,0x63,0x6f,0x6e,0x00,0x63,0x6c,
0x6f,0x73,0x65,0x5f,0x70,0x00,0x01,0x00,0x00,0x00,0x0e,0x05,0x08,0x00,0x69,0x63,0x6f,0x6e,0x00,0x63,
0x6c,0x6f,0x73,0x65,0x5f,0x6e,0x00,0x01,0x00,0x00,0x00,0x0e,0x05,0x08,0x00,0x69,0x63,0x6f,0x6e,0x00,
0x63,0x6c,0x6f,0x73,0x65,0x5f,0x64,0x00,0x00,0x00,0x00,0x00,};/*932*/
0x07,0x09,0x04,0x00,0x62,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x00,0x60,0x60,0x60,0xff,0x01,0x00,0x00,
0x00,0x07,0x09,0x04,0x00,0x62,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x00,0x40,0x40,0x40,0xff,0x02,0x00,
0x00,0x00,0x06,0x0d,0x04,0x00,0x74,0x65,0x78,0x74,0x5f,0x61,0x6c,0x69,0x67,0x6e,0x5f,0x68,0x00,0x02,
0x00,0x00,0x00,0x07,0x0b,0x04,0x00,0x74,0x65,0x78,0x74,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x00,0xff,0xff,
0xff,0xff,0x01,0x00,0x00,0x00,0x07,0x0b,0x04,0x00,0x74,0x65,0x78,0x74,0x5f,0x63,0x6f,0x6c,0x6f,0x72,
0x00,0xff,0xff,0xff,0xff,0x01,0x00,0x00,0x00,0x0e,0x05,0x08,0x00,0x69,0x63,0x6f,0x6e,0x00,0x63,0x6c,
0x6f,0x73,0x65,0x5f,0x6e,0x00,0x01,0x00,0x00,0x00,0x0e,0x05,0x08,0x00,0x69,0x63,0x6f,0x6e,0x00,0x63,
0x6c,0x6f,0x73,0x65,0x5f,0x70,0x00,0x01,0x00,0x00,0x00,0x0e,0x05,0x08,0x00,0x69,0x63,0x6f,0x6e,0x00,
0x63,0x6c,0x6f,0x73,0x65,0x5f,0x6e,0x00,0x01,0x00,0x00,0x00,0x0e,0x05,0x08,0x00,0x69,0x63,0x6f,0x6e,
0x00,0x63,0x6c,0x6f,0x73,0x65,0x5f,0x64,0x00,0x00,0x00,0x00,0x00,};/*1053*/

View File

@ -0,0 +1,42 @@
TK_CONST_DATA_ALIGN(const unsigned char ui_win_anim_center[]) = {
0x04,0x00,0x01,0x01,0xfd,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x77,0x69,0x6e,0x5f,0x61,0x6e,0x69,0x6d,
0x2f,0x63,0x65,0x6e,0x74,0x65,0x72,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x12,0x12,0x22,0x11,0x64,0x69,0x61,0x6c,0x6f,0x67,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x64,0x00,0x00,0x00,0xa0,0x00,0x00,0x00,0x73,0x65,0x6c,0x66,
0x5f,0x6c,0x61,0x79,0x6f,0x75,0x74,0x00,0x64,0x65,0x66,0x61,0x75,0x6c,0x74,0x28,0x78,0x3d,0x30,0x2c,
0x79,0x3d,0x6d,0x2c,0x77,0x3d,0x31,0x30,0x30,0x25,0x2c,0x68,0x3d,0x31,0x36,0x30,0x29,0x00,0x61,0x6e,
0x69,0x6d,0x5f,0x68,0x69,0x6e,0x74,0x00,0x63,0x65,0x6e,0x74,0x65,0x72,0x5f,0x73,0x63,0x61,0x6c,0x65,
0x28,0x64,0x75,0x72,0x61,0x74,0x69,0x6f,0x6e,0x3d,0x33,0x30,0x30,0x29,0x00,0x68,0x69,0x67,0x68,0x6c,
0x69,0x67,0x68,0x74,0x00,0x64,0x65,0x66,0x61,0x75,0x6c,0x74,0x28,0x73,0x74,0x61,0x72,0x74,0x5f,0x61,
0x6c,0x70,0x68,0x61,0x3d,0x30,0x2c,0x20,0x65,0x6e,0x64,0x5f,0x61,0x6c,0x70,0x68,0x61,0x3d,0x38,0x30,
0x29,0x00,0x00,0x64,0x69,0x61,0x6c,0x6f,0x67,0x5f,0x74,0x69,0x74,0x6c,0x65,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x64,0x00,0x00,0x00,0x1e,0x00,0x00,0x00,0x73,0x65,0x6c,0x66,0x5f,0x6c,0x61,0x79,0x6f,
0x75,0x74,0x00,0x64,0x65,0x66,0x61,0x75,0x6c,0x74,0x28,0x78,0x3d,0x30,0x2c,0x79,0x3d,0x30,0x2c,0x77,
0x3d,0x31,0x30,0x30,0x25,0x2c,0x68,0x3d,0x33,0x30,0x29,0x00,0x74,0x65,0x78,0x74,0x00,0x48,0x65,0x6c,
0x6c,0x6f,0x20,0x41,0x57,0x54,0x4b,0x00,0x00,0x00,0x64,0x69,0x61,0x6c,0x6f,0x67,0x5f,0x63,0x6c,0x69,
0x65,0x6e,0x74,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x64,0x00,0x00,0x00,0xe2,0xff,0xff,0xff,0x73,0x65,
0x6c,0x66,0x5f,0x6c,0x61,0x79,0x6f,0x75,0x74,0x00,0x64,0x65,0x66,0x61,0x75,0x6c,0x74,0x28,0x78,0x3d,
0x30,0x2c,0x79,0x3d,0x62,0x6f,0x74,0x74,0x6f,0x6d,0x2c,0x77,0x3d,0x31,0x30,0x30,0x25,0x2c,0x68,0x3d,
0x2d,0x33,0x30,0x29,0x00,0x00,0x6c,0x61,0x62,0x65,0x6c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0xc8,0x00,0x00,0x00,0x1e,0x00,0x00,0x00,0x73,0x65,0x6c,0x66,0x5f,0x6c,
0x61,0x79,0x6f,0x75,0x74,0x00,0x64,0x65,0x66,0x61,0x75,0x6c,0x74,0x28,0x78,0x3d,0x63,0x65,0x6e,0x74,
0x65,0x72,0x2c,0x79,0x3d,0x6d,0x69,0x64,0x64,0x6c,0x65,0x3a,0x2d,0x32,0x30,0x2c,0x77,0x3d,0x32,0x30,
0x30,0x2c,0x68,0x3d,0x33,0x30,0x29,0x00,0x6e,0x61,0x6d,0x65,0x00,0x00,0x74,0x65,0x78,0x74,0x00,0x41,
0x72,0x65,0x20,0x79,0x6f,0x75,0x20,0x72,0x65,0x61,0x64,0x79,0x3f,0x00,0x00,0x00,0x62,0x75,0x74,0x74,
0x6f,0x6e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0a,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x28,0x00,0x00,0x00,
0x1e,0x00,0x00,0x00,0x73,0x65,0x6c,0x66,0x5f,0x6c,0x61,0x79,0x6f,0x75,0x74,0x00,0x64,0x65,0x66,0x61,
0x75,0x6c,0x74,0x28,0x78,0x3d,0x31,0x30,0x2c,0x79,0x3d,0x62,0x6f,0x74,0x74,0x6f,0x6d,0x3a,0x31,0x30,
0x2c,0x77,0x3d,0x34,0x30,0x25,0x2c,0x68,0x3d,0x33,0x30,0x29,0x00,0x6e,0x61,0x6d,0x65,0x00,0x6f,0x70,
0x65,0x6e,0x3a,0x63,0x65,0x6e,0x74,0x65,0x72,0x00,0x74,0x65,0x78,0x74,0x00,0x59,0x65,0x73,0x00,0x00,
0x00,0x62,0x75,0x74,0x74,0x6f,0x6e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x28,0x00,0x00,0x00,0x1e,0x00,0x00,0x00,0x73,0x65,0x6c,0x66,0x5f,0x6c,0x61,0x79,0x6f,0x75,0x74,
0x00,0x64,0x65,0x66,0x61,0x75,0x6c,0x74,0x28,0x78,0x3d,0x72,0x69,0x67,0x68,0x74,0x3a,0x31,0x30,0x2c,
0x79,0x3d,0x62,0x6f,0x74,0x74,0x6f,0x6d,0x3a,0x31,0x30,0x2c,0x77,0x3d,0x34,0x30,0x25,0x2c,0x68,0x3d,
0x33,0x30,0x29,0x00,0x6e,0x61,0x6d,0x65,0x00,0x63,0x6c,0x6f,0x73,0x65,0x28,0x29,0x00,0x74,0x65,0x78,
0x74,0x00,0x4e,0x6f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,};/*813*/

View File

@ -1,39 +1,44 @@
TK_CONST_DATA_ALIGN(const unsigned char ui_win_anim_dialog[]) = {
0x04,0x00,0x01,0x01,0xba,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x77,0x69,0x6e,0x5f,0x61,0x6e,0x69,0x6d,
0x04,0x00,0x01,0x01,0x1b,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x77,0x69,0x6e,0x5f,0x61,0x6e,0x69,0x6d,
0x2f,0x64,0x69,0x61,0x6c,0x6f,0x67,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x12,0x12,0x22,0x11,0x64,0x69,0x61,0x6c,0x6f,0x67,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x26,0x01,0x00,0x00,0x5c,0x00,0x00,0x00,0x73,0x65,0x6c,0x66,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x26,0x01,0x00,0x00,0x8c,0x00,0x00,0x00,0x73,0x65,0x6c,0x66,
0x5f,0x6c,0x61,0x79,0x6f,0x75,0x74,0x00,0x64,0x65,0x66,0x61,0x75,0x6c,0x74,0x28,0x78,0x3d,0x63,0x2c,
0x79,0x3d,0x6d,0x2c,0x77,0x3d,0x32,0x39,0x34,0x2c,0x68,0x3d,0x39,0x32,0x29,0x00,0x6e,0x61,0x6d,0x65,
0x00,0x64,0x69,0x61,0x6c,0x6f,0x67,0x00,0x68,0x69,0x67,0x68,0x6c,0x69,0x67,0x68,0x74,0x00,0x64,0x65,
0x66,0x61,0x75,0x6c,0x74,0x28,0x61,0x6c,0x70,0x68,0x61,0x3d,0x31,0x30,0x30,0x29,0x00,0x6d,0x6f,0x76,
0x65,0x5f,0x66,0x6f,0x63,0x75,0x73,0x5f,0x70,0x72,0x65,0x76,0x5f,0x6b,0x65,0x79,0x00,0x75,0x70,0x00,
0x6d,0x6f,0x76,0x65,0x5f,0x66,0x6f,0x63,0x75,0x73,0x5f,0x6e,0x65,0x78,0x74,0x5f,0x6b,0x65,0x79,0x00,
0x64,0x6f,0x77,0x6e,0x00,0x00,0x64,0x69,0x61,0x6c,0x6f,0x67,0x5f,0x74,0x69,0x74,0x6c,0x65,0x00,0x00,
0x79,0x3d,0x6d,0x2c,0x77,0x3d,0x32,0x39,0x34,0x2c,0x68,0x3d,0x31,0x34,0x30,0x29,0x00,0x6e,0x61,0x6d,
0x65,0x00,0x64,0x69,0x61,0x6c,0x6f,0x67,0x00,0x6d,0x6f,0x76,0x65,0x5f,0x66,0x6f,0x63,0x75,0x73,0x5f,
0x70,0x72,0x65,0x76,0x5f,0x6b,0x65,0x79,0x00,0x75,0x70,0x00,0x6d,0x6f,0x76,0x65,0x5f,0x66,0x6f,0x63,
0x75,0x73,0x5f,0x6e,0x65,0x78,0x74,0x5f,0x6b,0x65,0x79,0x00,0x64,0x6f,0x77,0x6e,0x00,0x00,0x64,0x69,
0x61,0x6c,0x6f,0x67,0x5f,0x74,0x69,0x74,0x6c,0x65,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x64,0x00,
0x00,0x00,0x24,0x00,0x00,0x00,0x73,0x65,0x6c,0x66,0x5f,0x6c,0x61,0x79,0x6f,0x75,0x74,0x00,0x64,0x65,
0x66,0x61,0x75,0x6c,0x74,0x28,0x78,0x3d,0x30,0x2c,0x79,0x3d,0x30,0x2c,0x77,0x3d,0x31,0x30,0x30,0x25,
0x2c,0x68,0x3d,0x33,0x36,0x29,0x00,0x74,0x65,0x78,0x74,0x00,0x64,0x69,0x61,0x6c,0x6f,0x67,0x00,0x00,
0x64,0x72,0x61,0x67,0x67,0x61,0x62,0x6c,0x65,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x64,0x00,0x00,0x00,0x24,0x00,0x00,0x00,0x73,0x65,0x6c,0x66,0x5f,0x6c,
0x61,0x79,0x6f,0x75,0x74,0x00,0x64,0x65,0x66,0x61,0x75,0x6c,0x74,0x28,0x78,0x3d,0x30,0x2c,0x79,0x3d,
0x30,0x2c,0x77,0x3d,0x31,0x30,0x30,0x25,0x2c,0x68,0x3d,0x33,0x36,0x29,0x00,0x74,0x65,0x78,0x74,0x00,
0x64,0x69,0x61,0x6c,0x6f,0x67,0x00,0x00,0x64,0x72,0x61,0x67,0x67,0x61,0x62,0x6c,0x65,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x64,0x72,0x61,0x67,0x5f,0x77,0x69,0x6e,0x64,0x6f,0x77,0x00,
0x74,0x72,0x75,0x65,0x00,0x00,0x00,0x62,0x75,0x74,0x74,0x6f,0x6e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x64,0x72,0x61,0x67,
0x5f,0x77,0x69,0x6e,0x64,0x6f,0x77,0x00,0x74,0x72,0x75,0x65,0x00,0x00,0x00,0x62,0x75,0x74,0x74,0x6f,
0x6e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0a,0x00,0x00,0x00,0x14,0x00,0x00,0x00,0x14,
0x00,0x00,0x00,0x73,0x65,0x6c,0x66,0x5f,0x6c,0x61,0x79,0x6f,0x75,0x74,0x00,0x64,0x65,0x66,0x61,0x75,
0x6c,0x74,0x28,0x78,0x3d,0x72,0x3a,0x31,0x30,0x2c,0x79,0x3d,0x31,0x30,0x2c,0x77,0x3d,0x32,0x30,0x2c,
0x68,0x3d,0x32,0x30,0x29,0x00,0x6e,0x61,0x6d,0x65,0x00,0x63,0x6c,0x6f,0x73,0x65,0x28,0x29,0x00,0x74,
0x65,0x78,0x74,0x00,0x58,0x00,0x00,0x00,0x00,0x64,0x69,0x61,0x6c,0x6f,0x67,0x5f,0x63,0x6c,0x69,0x65,
0x6e,0x74,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x64,0x00,0x00,0x00,0xdc,0xff,0xff,0xff,0x73,0x65,0x6c,
0x66,0x5f,0x6c,0x61,0x79,0x6f,0x75,0x74,0x00,0x64,0x65,0x66,0x61,0x75,0x6c,0x74,0x28,0x78,0x3d,0x30,
0x2c,0x79,0x3d,0x62,0x2c,0x77,0x3d,0x31,0x30,0x30,0x25,0x2c,0x68,0x3d,0x2d,0x33,0x36,0x29,0x00,0x00,
0x65,0x64,0x69,0x74,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0a,0x00,0x00,0x00,
0xec,0xff,0xff,0xff,0x24,0x00,0x00,0x00,0x73,0x65,0x6c,0x66,0x5f,0x6c,0x61,0x79,0x6f,0x75,0x74,0x00,
0x64,0x65,0x66,0x61,0x75,0x6c,0x74,0x28,0x78,0x3d,0x63,0x2c,0x79,0x3d,0x31,0x30,0x2c,0x77,0x3d,0x2d,
0x32,0x30,0x2c,0x68,0x3d,0x33,0x36,0x29,0x00,0x6e,0x61,0x6d,0x65,0x00,0x65,0x64,0x69,0x74,0x00,0x74,
0x69,0x70,0x73,0x00,0x74,0x65,0x73,0x74,0x20,0x6b,0x65,0x79,0x62,0x6f,0x61,0x72,0x64,0x20,0x70,0x6f,
0x70,0x75,0x70,0x00,0x61,0x75,0x74,0x6f,0x5f,0x66,0x69,0x78,0x00,0x74,0x72,0x75,0x65,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,};/*746*/
0x00,0x00,0x00,0x0a,0x00,0x00,0x00,0x14,0x00,0x00,0x00,0x14,0x00,0x00,0x00,0x73,0x65,0x6c,0x66,0x5f,
0x6c,0x61,0x79,0x6f,0x75,0x74,0x00,0x64,0x65,0x66,0x61,0x75,0x6c,0x74,0x28,0x78,0x3d,0x72,0x3a,0x31,
0x30,0x2c,0x79,0x3d,0x31,0x30,0x2c,0x77,0x3d,0x32,0x30,0x2c,0x68,0x3d,0x32,0x30,0x29,0x00,0x6e,0x61,
0x6d,0x65,0x00,0x63,0x6c,0x6f,0x73,0x65,0x28,0x29,0x00,0x74,0x65,0x78,0x74,0x00,0x58,0x00,0x00,0x00,
0x00,0x64,0x69,0x61,0x6c,0x6f,0x67,0x5f,0x63,0x6c,0x69,0x65,0x6e,0x74,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x64,0x00,0x00,0x00,0xdc,0xff,0xff,0xff,0x73,0x65,0x6c,0x66,0x5f,0x6c,0x61,0x79,0x6f,0x75,0x74,
0x00,0x64,0x65,0x66,0x61,0x75,0x6c,0x74,0x28,0x78,0x3d,0x30,0x2c,0x79,0x3d,0x62,0x2c,0x77,0x3d,0x31,
0x30,0x30,0x25,0x2c,0x68,0x3d,0x2d,0x33,0x36,0x29,0x00,0x00,0x62,0x75,0x74,0x74,0x6f,0x6e,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x32,0x00,0x00,0x00,0x64,0x00,0x00,0x00,0x24,0x00,0x00,0x00,
0x73,0x65,0x6c,0x66,0x5f,0x6c,0x61,0x79,0x6f,0x75,0x74,0x00,0x64,0x65,0x66,0x61,0x75,0x6c,0x74,0x28,
0x78,0x3d,0x63,0x2c,0x79,0x3d,0x35,0x30,0x2c,0x77,0x3d,0x31,0x30,0x30,0x2c,0x68,0x3d,0x33,0x36,0x29,
0x00,0x6e,0x61,0x6d,0x65,0x00,0x6f,0x70,0x65,0x6e,0x3a,0x63,0x65,0x6e,0x74,0x65,0x72,0x00,0x74,0x65,
0x78,0x74,0x00,0x6f,0x70,0x65,0x6e,0x20,0x64,0x69,0x61,0x6c,0x6f,0x67,0x00,0x00,0x00,0x65,0x64,0x69,
0x74,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0a,0x00,0x00,0x00,0xec,0xff,0xff,
0xff,0x24,0x00,0x00,0x00,0x73,0x65,0x6c,0x66,0x5f,0x6c,0x61,0x79,0x6f,0x75,0x74,0x00,0x64,0x65,0x66,
0x61,0x75,0x6c,0x74,0x28,0x78,0x3d,0x63,0x2c,0x79,0x3d,0x31,0x30,0x2c,0x77,0x3d,0x2d,0x32,0x30,0x2c,
0x68,0x3d,0x33,0x36,0x29,0x00,0x6e,0x61,0x6d,0x65,0x00,0x65,0x64,0x69,0x74,0x00,0x74,0x69,0x70,0x73,
0x00,0x74,0x65,0x73,0x74,0x20,0x6b,0x65,0x79,0x62,0x6f,0x61,0x72,0x64,0x20,0x70,0x6f,0x70,0x75,0x70,
0x00,0x61,0x75,0x74,0x6f,0x5f,0x66,0x69,0x78,0x00,0x74,0x72,0x75,0x65,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,};/*843*/

View File

@ -1,5 +1,5 @@
TK_CONST_DATA_ALIGN(const unsigned char ui_win_anim_window[]) = {
0x04,0x00,0x01,0x01,0x06,0x14,0x00,0x00,0x00,0x00,0x00,0x00,0x77,0x69,0x6e,0x5f,0x61,0x6e,0x69,0x6d,
0x04,0x00,0x01,0x01,0x23,0x15,0x00,0x00,0x00,0x00,0x00,0x00,0x77,0x69,0x6e,0x5f,0x61,0x6e,0x69,0x6d,
0x2f,0x77,0x69,0x6e,0x64,0x6f,0x77,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x12,0x12,0x22,0x11,0x77,0x69,0x6e,0x64,0x6f,0x77,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
@ -114,7 +114,7 @@ TK_CONST_DATA_ALIGN(const unsigned char ui_win_anim_window[]) = {
0x7a,0x65,0x5f,0x6f,0x70,0x74,0x69,0x6f,0x6e,0x73,0x00,0x66,0x61,0x6c,0x73,0x65,0x00,0x76,0x61,0x6c,
0x75,0x65,0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x76,0x69,0x65,0x77,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x8c,0x00,0x00,0x00,0x6e,0x61,0x6d,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xa0,0x00,0x00,0x00,0x6e,0x61,0x6d,
0x65,0x00,0x76,0x69,0x65,0x77,0x5f,0x64,0x69,0x61,0x6c,0x6f,0x67,0x00,0x63,0x68,0x69,0x6c,0x64,0x72,
0x65,0x6e,0x5f,0x6c,0x61,0x79,0x6f,0x75,0x74,0x00,0x64,0x65,0x66,0x61,0x75,0x6c,0x74,0x28,0x72,0x3d,
0x30,0x2c,0x63,0x3d,0x31,0x2c,0x78,0x3d,0x31,0x30,0x2c,0x73,0x3d,0x31,0x30,0x29,0x00,0x00,0x6c,0x61,
@ -139,7 +139,7 @@ TK_CONST_DATA_ALIGN(const unsigned char ui_win_anim_window[]) = {
0x5f,0x68,0x69,0x6e,0x74,0x28,0x64,0x69,0x61,0x6c,0x6f,0x67,0x29,0x00,0x69,0x74,0x65,0x6d,0x5f,0x68,
0x65,0x69,0x67,0x68,0x74,0x00,0x33,0x30,0x00,0x72,0x65,0x61,0x64,0x6f,0x6e,0x6c,0x79,0x00,0x74,0x72,
0x75,0x65,0x00,0x6c,0x6f,0x63,0x61,0x6c,0x69,0x7a,0x65,0x5f,0x6f,0x70,0x74,0x69,0x6f,0x6e,0x73,0x00,
0x66,0x61,0x6c,0x73,0x65,0x00,0x76,0x61,0x6c,0x75,0x65,0x00,0x31,0x00,0x00,0x00,0x00,0x76,0x69,0x65,
0x66,0x61,0x6c,0x73,0x65,0x00,0x76,0x61,0x6c,0x75,0x65,0x00,0x34,0x00,0x00,0x00,0x00,0x76,0x69,0x65,
0x77,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x16,0x00,0x00,0x00,0x6e,0x61,0x6d,0x65,0x00,0x76,0x69,0x65,0x77,0x5f,0x64,0x75,0x72,0x61,0x74,
@ -187,74 +187,88 @@ TK_CONST_DATA_ALIGN(const unsigned char ui_win_anim_window[]) = {
0x64,0x69,0x61,0x6c,0x6f,0x67,0x29,0x3a,0x65,0x61,0x73,0x69,0x6e,0x67,0x00,0x69,0x74,0x65,0x6d,0x5f,
0x68,0x65,0x69,0x67,0x68,0x74,0x00,0x33,0x30,0x00,0x72,0x65,0x61,0x64,0x6f,0x6e,0x6c,0x79,0x00,0x74,
0x72,0x75,0x65,0x00,0x6c,0x6f,0x63,0x61,0x6c,0x69,0x7a,0x65,0x5f,0x6f,0x70,0x74,0x69,0x6f,0x6e,0x73,
0x00,0x66,0x61,0x6c,0x73,0x65,0x00,0x76,0x61,0x6c,0x75,0x65,0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,
0x62,0x75,0x74,0x74,0x6f,0x6e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x66,0x61,0x6c,0x73,0x65,0x00,0x76,0x61,0x6c,0x75,0x65,0x00,0x30,0x00,0x00,0x00,0x00,0x76,0x69,
0x65,0x77,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x64,0x00,0x00,0x00,0x24,0x00,0x00,0x00,0x73,0x65,0x6c,0x66,0x5f,0x6c,0x61,0x79,0x6f,0x75,0x74,0x00,
0x64,0x65,0x66,0x61,0x75,0x6c,0x74,0x28,0x78,0x3d,0x72,0x3a,0x31,0x30,0x2c,0x79,0x3d,0x62,0x3a,0x35,
0x36,0x2c,0x77,0x3d,0x31,0x30,0x30,0x2c,0x68,0x3d,0x33,0x36,0x29,0x00,0x6e,0x61,0x6d,0x65,0x00,0x6f,
0x70,0x65,0x6e,0x3a,0x64,0x69,0x61,0x6c,0x6f,0x67,0x00,0x74,0x65,0x78,0x74,0x00,0x6f,0x70,0x65,0x6e,
0x20,0x64,0x69,0x61,0x6c,0x6f,0x67,0x00,0x00,0x00,0x62,0x75,0x74,0x74,0x6f,0x6e,0x00,0x00,0x00,0x00,
0x00,0x00,0x16,0x00,0x00,0x00,0x6e,0x61,0x6d,0x65,0x00,0x76,0x69,0x65,0x77,0x5f,0x68,0x69,0x67,0x68,
0x6c,0x69,0x67,0x68,0x74,0x00,0x63,0x68,0x69,0x6c,0x64,0x72,0x65,0x6e,0x5f,0x6c,0x61,0x79,0x6f,0x75,
0x74,0x00,0x64,0x65,0x66,0x61,0x75,0x6c,0x74,0x28,0x72,0x3d,0x31,0x2c,0x63,0x3d,0x30,0x2c,0x78,0x3d,
0x30,0x2c,0x79,0x3d,0x30,0x2c,0x73,0x3d,0x30,0x29,0x00,0x00,0x6c,0x61,0x62,0x65,0x6c,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x64,0x00,0x00,0x00,0x24,0x00,0x00,0x00,0x73,0x65,
0x6c,0x66,0x5f,0x6c,0x61,0x79,0x6f,0x75,0x74,0x00,0x64,0x65,0x66,0x61,0x75,0x6c,0x74,0x28,0x78,0x3d,
0x72,0x3a,0x31,0x30,0x2c,0x79,0x3d,0x62,0x3a,0x31,0x30,0x2c,0x77,0x3d,0x31,0x30,0x30,0x2c,0x68,0x3d,
0x33,0x36,0x29,0x00,0x6e,0x61,0x6d,0x65,0x00,0x6f,0x70,0x65,0x6e,0x3a,0x77,0x69,0x6e,0x64,0x6f,0x77,
0x00,0x74,0x65,0x78,0x74,0x00,0x6f,0x70,0x65,0x6e,0x20,0x77,0x69,0x6e,0x64,0x6f,0x77,0x00,0x00,0x00,
0x00,0x76,0x69,0x65,0x77,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x4a,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x6e,0x61,0x6d,0x65,0x00,0x6c,0x62,0x5f,0x74,0x69,0x00,0x74,0x65,0x78,0x74,0x00,0x68,0x69,0x67,0x68,
0x6c,0x69,0x67,0x68,0x74,0x00,0x00,0x00,0x73,0x77,0x69,0x74,0x63,0x68,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x64,0x00,0x00,0x00,0x64,0x00,0x00,0x00,0x73,0x65,0x6c,0x66,0x5f,0x6c,0x61,0x79,0x6f,0x75,0x74,
0x00,0x64,0x65,0x66,0x61,0x75,0x6c,0x74,0x28,0x78,0x3d,0x30,0x2c,0x79,0x3d,0x30,0x2c,0x77,0x3d,0x31,
0x30,0x30,0x25,0x2c,0x68,0x3d,0x31,0x30,0x30,0x25,0x29,0x00,0x6e,0x61,0x6d,0x65,0x00,0x6e,0x65,0x77,
0x00,0x00,0x62,0x75,0x74,0x74,0x6f,0x6e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x2c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x6e,0x61,0x6d,0x65,
0x00,0x61,0x6e,0x69,0x6d,0x5f,0x68,0x69,0x6e,0x74,0x28,0x64,0x69,0x61,0x6c,0x6f,0x67,0x29,0x3a,0x68,
0x69,0x67,0x68,0x6c,0x69,0x67,0x68,0x74,0x00,0x76,0x61,0x6c,0x75,0x65,0x00,0x74,0x72,0x75,0x65,0x00,
0x00,0x00,0x00,0x00,0x00,0x62,0x75,0x74,0x74,0x6f,0x6e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x64,0x00,0x00,0x00,0x24,0x00,0x00,0x00,0x73,0x65,0x6c,0x66,0x5f,0x6c,0x61,0x79,0x6f,0x75,
0x74,0x00,0x64,0x65,0x66,0x61,0x75,0x6c,0x74,0x28,0x78,0x3d,0x72,0x3a,0x31,0x30,0x2c,0x79,0x3d,0x62,
0x3a,0x31,0x30,0x2c,0x77,0x3d,0x31,0x30,0x30,0x2c,0x68,0x3d,0x33,0x36,0x29,0x00,0x6e,0x61,0x6d,0x65,
0x00,0x63,0x6c,0x6f,0x73,0x65,0x28,0x29,0x00,0x74,0x65,0x78,0x74,0x00,0x63,0x6c,0x6f,0x73,0x65,0x00,
0x00,0x00,0x00,0x76,0x69,0x65,0x77,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x40,0x01,0x00,0x00,0xe0,0x01,0x00,0x00,0x6e,0x61,0x6d,0x65,0x00,0x65,0x72,0x72,0x6f,
0x72,0x00,0x00,0x6c,0x61,0x62,0x65,0x6c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x64,0x00,0x00,0x00,0x1c,0x00,0x00,0x00,0x73,0x65,0x6c,0x66,0x5f,0x6c,0x61,0x79,0x6f,
0x75,0x74,0x00,0x64,0x65,0x66,0x61,0x75,0x6c,0x74,0x28,0x78,0x3d,0x63,0x2c,0x79,0x3d,0x6d,0x2c,0x77,
0x3d,0x31,0x30,0x30,0x25,0x2c,0x68,0x3d,0x32,0x38,0x29,0x00,0x6e,0x61,0x6d,0x65,0x00,0x6c,0x61,0x62,
0x65,0x6c,0x00,0x73,0x74,0x79,0x6c,0x65,0x3a,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x3a,0x74,0x65,0x78,0x74,
0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x00,0x23,0x46,0x46,0x30,0x30,0x30,0x30,0x00,0x74,0x65,0x78,0x74,0x00,
0x50,0x6c,0x65,0x61,0x73,0x65,0x20,0x75,0x6e,0x64,0x65,0x66,0x69,0x6e,0x65,0x20,0x57,0x49,0x54,0x48,
0x4f,0x55,0x54,0x5f,0x57,0x49,0x4e,0x44,0x4f,0x57,0x5f,0x41,0x4e,0x49,0x4d,0x41,0x54,0x4f,0x52,0x53,
0x00,0x00,0x00,0x00,0x00,0x64,0x69,0x67,0x69,0x74,0x5f,0x63,0x6c,0x6f,0x63,0x6b,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x0a,0x00,0x00,0x00,0x3c,0x00,0x00,0x00,0x1c,0x00,0x00,0x00,0x73,0x65,0x6c,0x66,0x5f,0x6c,0x61,
0x00,0x00,0x00,0x00,0x00,0x64,0x00,0x00,0x00,0x24,0x00,0x00,0x00,0x73,0x65,0x6c,0x66,0x5f,0x6c,0x61,
0x79,0x6f,0x75,0x74,0x00,0x64,0x65,0x66,0x61,0x75,0x6c,0x74,0x28,0x78,0x3d,0x72,0x3a,0x31,0x30,0x2c,
0x79,0x3d,0x31,0x30,0x2c,0x77,0x3d,0x36,0x30,0x2c,0x68,0x3d,0x32,0x38,0x29,0x00,0x6e,0x61,0x6d,0x65,
0x00,0x64,0x69,0x67,0x69,0x74,0x5f,0x63,0x6c,0x6f,0x63,0x6b,0x00,0x66,0x6f,0x72,0x6d,0x61,0x74,0x00,
0x68,0x68,0x3a,0x6d,0x6d,0x3a,0x73,0x73,0x00,0x00,0x00,0x65,0x64,0x69,0x74,0x00,0x00,0x00,0x00,0x00,
0x79,0x3d,0x62,0x3a,0x35,0x36,0x2c,0x77,0x3d,0x31,0x30,0x30,0x2c,0x68,0x3d,0x33,0x36,0x29,0x00,0x6e,
0x61,0x6d,0x65,0x00,0x6f,0x70,0x65,0x6e,0x3a,0x64,0x69,0x61,0x6c,0x6f,0x67,0x00,0x74,0x65,0x78,0x74,
0x00,0x6f,0x70,0x65,0x6e,0x20,0x64,0x69,0x61,0x6c,0x6f,0x67,0x00,0x00,0x00,0x62,0x75,0x74,0x74,0x6f,
0x6e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x64,0x00,0x00,0x00,0x24,
0x00,0x00,0x00,0x73,0x65,0x6c,0x66,0x5f,0x6c,0x61,0x79,0x6f,0x75,0x74,0x00,0x64,0x65,0x66,0x61,0x75,
0x6c,0x74,0x28,0x78,0x3d,0x72,0x3a,0x31,0x30,0x2c,0x79,0x3d,0x62,0x3a,0x31,0x30,0x2c,0x77,0x3d,0x31,
0x30,0x30,0x2c,0x68,0x3d,0x33,0x36,0x29,0x00,0x6e,0x61,0x6d,0x65,0x00,0x6f,0x70,0x65,0x6e,0x3a,0x77,
0x69,0x6e,0x64,0x6f,0x77,0x00,0x74,0x65,0x78,0x74,0x00,0x6f,0x70,0x65,0x6e,0x20,0x77,0x69,0x6e,0x64,
0x6f,0x77,0x00,0x00,0x00,0x00,0x76,0x69,0x65,0x77,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x0a,0x00,0x00,0x00,0x0a,0x00,0x00,0x00,0xa0,0x00,0x00,0x00,0x1c,0x00,0x00,0x00,0x6e,
0x61,0x6d,0x65,0x00,0x65,0x64,0x69,0x74,0x00,0x74,0x69,0x70,0x73,0x00,0x74,0x65,0x73,0x74,0x20,0x6b,
0x65,0x79,0x62,0x6f,0x61,0x72,0x64,0x20,0x70,0x6f,0x70,0x75,0x70,0x00,0x61,0x75,0x74,0x6f,0x5f,0x66,
0x69,0x78,0x00,0x74,0x72,0x75,0x65,0x00,0x00,0x00,0x76,0x69,0x65,0x77,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x64,0x00,0x00,0x00,0x64,0x00,0x00,0x00,0x73,0x65,0x6c,0x66,0x5f,0x6c,
0x61,0x79,0x6f,0x75,0x74,0x00,0x64,0x65,0x66,0x61,0x75,0x6c,0x74,0x28,0x78,0x3d,0x30,0x2c,0x79,0x3d,
0x30,0x2c,0x77,0x3d,0x31,0x30,0x30,0x25,0x2c,0x68,0x3d,0x31,0x30,0x30,0x25,0x29,0x00,0x6e,0x61,0x6d,
0x65,0x00,0x6e,0x65,0x77,0x00,0x00,0x62,0x75,0x74,0x74,0x6f,0x6e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x00,0x00,0x00,0x78,0x00,0x00,0x00,0x16,0x00,0x00,0x00,0x73,0x65,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x64,0x00,0x00,0x00,0x24,0x00,0x00,0x00,0x73,0x65,0x6c,0x66,0x5f,
0x6c,0x61,0x79,0x6f,0x75,0x74,0x00,0x64,0x65,0x66,0x61,0x75,0x6c,0x74,0x28,0x78,0x3d,0x72,0x3a,0x31,
0x30,0x2c,0x79,0x3d,0x62,0x3a,0x31,0x30,0x2c,0x77,0x3d,0x31,0x30,0x30,0x2c,0x68,0x3d,0x33,0x36,0x29,
0x00,0x6e,0x61,0x6d,0x65,0x00,0x63,0x6c,0x6f,0x73,0x65,0x28,0x29,0x00,0x74,0x65,0x78,0x74,0x00,0x63,
0x6c,0x6f,0x73,0x65,0x00,0x00,0x00,0x00,0x76,0x69,0x65,0x77,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x01,0x00,0x00,0xe0,0x01,0x00,0x00,0x6e,0x61,0x6d,0x65,
0x00,0x65,0x72,0x72,0x6f,0x72,0x00,0x00,0x6c,0x61,0x62,0x65,0x6c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x64,0x00,0x00,0x00,0x1c,0x00,0x00,0x00,0x73,0x65,0x6c,0x66,
0x5f,0x6c,0x61,0x79,0x6f,0x75,0x74,0x00,0x64,0x65,0x66,0x61,0x75,0x6c,0x74,0x28,0x78,0x3d,0x63,0x2c,
0x79,0x3d,0x6d,0x2c,0x77,0x3d,0x31,0x30,0x30,0x25,0x2c,0x68,0x3d,0x32,0x38,0x29,0x00,0x6e,0x61,0x6d,
0x65,0x00,0x6c,0x61,0x62,0x65,0x6c,0x00,0x73,0x74,0x79,0x6c,0x65,0x3a,0x6e,0x6f,0x72,0x6d,0x61,0x6c,
0x3a,0x74,0x65,0x78,0x74,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x00,0x23,0x46,0x46,0x30,0x30,0x30,0x30,0x00,
0x74,0x65,0x78,0x74,0x00,0x50,0x6c,0x65,0x61,0x73,0x65,0x20,0x75,0x6e,0x64,0x65,0x66,0x69,0x6e,0x65,
0x20,0x57,0x49,0x54,0x48,0x4f,0x55,0x54,0x5f,0x57,0x49,0x4e,0x44,0x4f,0x57,0x5f,0x41,0x4e,0x49,0x4d,
0x41,0x54,0x4f,0x52,0x53,0x00,0x00,0x00,0x00,0x00,0x64,0x69,0x67,0x69,0x74,0x5f,0x63,0x6c,0x6f,0x63,
0x6b,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x0a,0x00,0x00,0x00,0x3c,0x00,0x00,0x00,0x1c,0x00,0x00,0x00,0x73,0x65,
0x6c,0x66,0x5f,0x6c,0x61,0x79,0x6f,0x75,0x74,0x00,0x64,0x65,0x66,0x61,0x75,0x6c,0x74,0x28,0x78,0x3d,
0x72,0x3a,0x31,0x30,0x2c,0x79,0x3d,0x34,0x38,0x2c,0x77,0x3d,0x31,0x32,0x30,0x2c,0x68,0x3d,0x32,0x32,
0x29,0x00,0x63,0x68,0x69,0x6c,0x64,0x72,0x65,0x6e,0x5f,0x6c,0x61,0x79,0x6f,0x75,0x74,0x00,0x64,0x65,
0x66,0x61,0x75,0x6c,0x74,0x28,0x72,0x3d,0x31,0x2c,0x63,0x3d,0x30,0x2c,0x78,0x3d,0x30,0x2c,0x79,0x3d,
0x30,0x2c,0x73,0x3d,0x30,0x29,0x00,0x00,0x6c,0x61,0x62,0x65,0x6c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x72,0x3a,0x31,0x30,0x2c,0x79,0x3d,0x31,0x30,0x2c,0x77,0x3d,0x36,0x30,0x2c,0x68,0x3d,0x32,0x38,0x29,
0x00,0x6e,0x61,0x6d,0x65,0x00,0x64,0x69,0x67,0x69,0x74,0x5f,0x63,0x6c,0x6f,0x63,0x6b,0x00,0x66,0x6f,
0x72,0x6d,0x61,0x74,0x00,0x68,0x68,0x3a,0x6d,0x6d,0x3a,0x73,0x73,0x00,0x00,0x00,0x65,0x64,0x69,0x74,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x4a,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x6e,0x61,0x6d,0x65,
0x00,0x6c,0x62,0x5f,0x74,0x69,0x00,0x74,0x65,0x78,0x74,0x00,0x66,0x75,0x6c,0x6c,0x73,0x63,0x72,0x65,
0x65,0x6e,0x00,0x00,0x00,0x73,0x77,0x69,0x74,0x63,0x68,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0a,0x00,0x00,0x00,0x0a,0x00,0x00,0x00,0xa0,0x00,0x00,0x00,
0x1c,0x00,0x00,0x00,0x6e,0x61,0x6d,0x65,0x00,0x65,0x64,0x69,0x74,0x00,0x74,0x69,0x70,0x73,0x00,0x74,
0x65,0x73,0x74,0x20,0x6b,0x65,0x79,0x62,0x6f,0x61,0x72,0x64,0x20,0x70,0x6f,0x70,0x75,0x70,0x00,0x61,
0x75,0x74,0x6f,0x5f,0x66,0x69,0x78,0x00,0x74,0x72,0x75,0x65,0x00,0x00,0x00,0x76,0x69,0x65,0x77,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x2c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x6e,0x61,0x6d,0x65,0x00,0x66,0x75,
0x6c,0x6c,0x73,0x63,0x72,0x65,0x65,0x6e,0x28,0x29,0x00,0x76,0x61,0x6c,0x75,0x65,0x00,0x66,0x61,0x6c,
0x73,0x65,0x00,0x00,0x00,0x00,0x65,0x64,0x69,0x74,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0a,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0xa0,0x00,0x00,0x00,0x1c,0x00,0x00,0x00,0x73,0x65,0x6c,0x66,0x5f,0x6c,
0x61,0x79,0x6f,0x75,0x74,0x00,0x64,0x65,0x66,0x61,0x75,0x6c,0x74,0x28,0x78,0x3d,0x31,0x30,0x2c,0x79,
0x3d,0x62,0x3a,0x31,0x30,0x2c,0x77,0x3d,0x31,0x36,0x30,0x2c,0x68,0x3d,0x32,0x38,0x29,0x00,0x6e,0x61,
0x6d,0x65,0x00,0x65,0x64,0x69,0x74,0x00,0x74,0x69,0x70,0x73,0x00,0x74,0x65,0x73,0x74,0x20,0x6b,0x65,
0x79,0x62,0x6f,0x61,0x72,0x64,0x20,0x70,0x6f,0x70,0x75,0x70,0x00,0x61,0x75,0x74,0x6f,0x5f,0x66,0x69,
0x78,0x00,0x74,0x72,0x75,0x65,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,};/*5174*/
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x00,0x00,0x00,0x78,0x00,0x00,0x00,0x16,
0x00,0x00,0x00,0x73,0x65,0x6c,0x66,0x5f,0x6c,0x61,0x79,0x6f,0x75,0x74,0x00,0x64,0x65,0x66,0x61,0x75,
0x6c,0x74,0x28,0x78,0x3d,0x72,0x3a,0x31,0x30,0x2c,0x79,0x3d,0x34,0x38,0x2c,0x77,0x3d,0x31,0x32,0x30,
0x2c,0x68,0x3d,0x32,0x32,0x29,0x00,0x63,0x68,0x69,0x6c,0x64,0x72,0x65,0x6e,0x5f,0x6c,0x61,0x79,0x6f,
0x75,0x74,0x00,0x64,0x65,0x66,0x61,0x75,0x6c,0x74,0x28,0x72,0x3d,0x31,0x2c,0x63,0x3d,0x30,0x2c,0x78,
0x3d,0x30,0x2c,0x79,0x3d,0x30,0x2c,0x73,0x3d,0x30,0x29,0x00,0x00,0x6c,0x61,0x62,0x65,0x6c,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x4a,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x6e,0x61,0x6d,0x65,0x00,0x6c,0x62,0x5f,0x74,0x69,0x00,0x74,0x65,0x78,0x74,0x00,0x66,0x75,0x6c,
0x6c,0x73,0x63,0x72,0x65,0x65,0x6e,0x00,0x00,0x00,0x73,0x77,0x69,0x74,0x63,0x68,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x2c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x6e,0x61,
0x6d,0x65,0x00,0x66,0x75,0x6c,0x6c,0x73,0x63,0x72,0x65,0x65,0x6e,0x28,0x29,0x00,0x76,0x61,0x6c,0x75,
0x65,0x00,0x66,0x61,0x6c,0x73,0x65,0x00,0x00,0x00,0x00,0x65,0x64,0x69,0x74,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x0a,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xa0,0x00,0x00,0x00,0x1c,0x00,0x00,0x00,0x73,
0x65,0x6c,0x66,0x5f,0x6c,0x61,0x79,0x6f,0x75,0x74,0x00,0x64,0x65,0x66,0x61,0x75,0x6c,0x74,0x28,0x78,
0x3d,0x31,0x30,0x2c,0x79,0x3d,0x62,0x3a,0x31,0x30,0x2c,0x77,0x3d,0x31,0x36,0x30,0x2c,0x68,0x3d,0x32,
0x38,0x29,0x00,0x6e,0x61,0x6d,0x65,0x00,0x65,0x64,0x69,0x74,0x00,0x74,0x69,0x70,0x73,0x00,0x74,0x65,
0x73,0x74,0x20,0x6b,0x65,0x79,0x62,0x6f,0x61,0x72,0x64,0x20,0x70,0x6f,0x70,0x75,0x70,0x00,0x61,0x75,
0x74,0x6f,0x5f,0x66,0x69,0x78,0x00,0x74,0x72,0x75,0x65,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,};/*5459*/

Binary file not shown.

View File

@ -254,6 +254,7 @@
#include "assets/default/inc/ui/uiex/page_label.data"
#include "assets/default/inc/ui/uiex/kb_uint.data"
#include "assets/default/inc/ui/win_anim/window.data"
#include "assets/default/inc/ui/win_anim/center.data"
#include "assets/default/inc/ui/win_anim/dialog.data"
#include "assets/default/inc/xml/test.data"
#include "assets/default/inc/data/com_zlg_app_json.data"
@ -1171,6 +1172,7 @@ ret_t assets_init(void) {
assets_manager_add(am, ui_uiex_page_label);
assets_manager_add(am, ui_uiex_kb_uint);
assets_manager_add(am, ui_win_anim_window);
assets_manager_add(am, ui_win_anim_center);
assets_manager_add(am, ui_win_anim_dialog);
assets_manager_add(am, xml_test);
assets_manager_add(am, data_com_zlg_app_json);

View File

@ -254,6 +254,7 @@
#include "assets/default/inc/ui/uiex/page_label.data"
#include "assets/default/inc/ui/uiex/kb_uint.data"
#include "assets/default/inc/ui/win_anim/window.data"
#include "assets/default/inc/ui/win_anim/center.data"
#include "assets/default/inc/ui/win_anim/dialog.data"
#include "assets/default/inc/xml/test.data"
#include "assets/default/inc/data/com_zlg_app_json.data"
@ -1171,6 +1172,7 @@ ret_t assets_init(void) {
assets_manager_add(am, ui_uiex_page_label);
assets_manager_add(am, ui_uiex_kb_uint);
assets_manager_add(am, ui_win_anim_window);
assets_manager_add(am, ui_win_anim_center);
assets_manager_add(am, ui_win_anim_dialog);
assets_manager_add(am, xml_test);
assets_manager_add(am, data_com_zlg_app_json);

View File

@ -207,6 +207,7 @@
#include "assets/default/inc/ui/scroll_view_v.data"
#include "assets/default/inc/ui/slide_view_animating_time.data"
#include "assets/default/inc/ui/win_anim/window.data"
#include "assets/default/inc/ui/win_anim/center.data"
#include "assets/default/inc/ui/win_anim/dialog.data"
#include "assets/default/inc/xml/test.data"
#include "assets/default/inc/data/com_zlg_app_json.data"
@ -745,6 +746,7 @@ ret_t assets_init(void) {
assets_manager_add(am, ui_scroll_view_v);
assets_manager_add(am, ui_slide_view_animating_time);
assets_manager_add(am, ui_win_anim_window);
assets_manager_add(am, ui_win_anim_center);
assets_manager_add(am, ui_win_anim_dialog);
assets_manager_add(am, xml_test);
assets_manager_add(am, data_com_zlg_app_json);

View File

@ -207,6 +207,7 @@
#include "assets/default/inc/ui/scroll_view_v.data"
#include "assets/default/inc/ui/slide_view_animating_time.data"
#include "assets/default/inc/ui/win_anim/window.data"
#include "assets/default/inc/ui/win_anim/center.data"
#include "assets/default/inc/ui/win_anim/dialog.data"
#include "assets/default/inc/xml/test.data"
#include "assets/default/inc/data/com_zlg_app_json.data"
@ -745,6 +746,7 @@ ret_t assets_init(void) {
assets_manager_add(am, ui_scroll_view_v);
assets_manager_add(am, ui_slide_view_animating_time);
assets_manager_add(am, ui_win_anim_window);
assets_manager_add(am, ui_win_anim_center);
assets_manager_add(am, ui_win_anim_dialog);
assets_manager_add(am, xml_test);
assets_manager_add(am, data_com_zlg_app_json);

View File

@ -84,10 +84,33 @@ ret_t dialog_highlighter_set_bg_clip_rect(dialog_highlighter_t* h, rect_t* clip_
return_value_if_fail(h != NULL && h->vt != NULL, RET_BAD_PARAMS);
h->clip_rect = rect_init(clip_rect->x, clip_rect->y, clip_rect->w, clip_rect->h);
if (h->vt->set_bg_clip_rect != NULL) {
return h->vt->set_bg_clip_rect(h, clip_rect);
}
return RET_OK;
}
ret_t dialog_highlighter_system_bar_top_append_clip_rect(dialog_highlighter_t* h, rect_t* rect) {
return_value_if_fail(h != NULL && h->vt != NULL, RET_BAD_PARAMS);
if (h->vt->system_bar_top_append_clip_rect != NULL) {
return h->vt->system_bar_top_append_clip_rect(h, rect);
}
return RET_NOT_IMPL;
}
ret_t dialog_highlighter_system_bar_bottom_append_clip_rect(dialog_highlighter_t* h, rect_t* rect) {
return_value_if_fail(h != NULL && h->vt != NULL, RET_BAD_PARAMS);
if (h->vt->system_bar_bottom_append_clip_rect != NULL) {
return h->vt->system_bar_bottom_append_clip_rect(h, rect);
}
return RET_NOT_IMPL;
}
ret_t dialog_highlighter_set_system_bar_alpha(dialog_highlighter_t* h, uint8_t alpha) {
return_value_if_fail(h != NULL && h->vt != NULL, RET_BAD_PARAMS);

View File

@ -29,6 +29,8 @@ BEGIN_C_DECLS
struct _dialog_highlighter_t;
typedef struct _dialog_highlighter_t dialog_highlighter_t;
typedef ret_t (*dialog_highlighter_set_clip_rect_t)(dialog_highlighter_t* h, rect_t* rect);
typedef ret_t (*dialog_highlighter_system_bar_append_clip_rect_t)(dialog_highlighter_t* h, rect_t* rect);
typedef ret_t (*dialog_highlighter_set_system_bar_alpha_t)(dialog_highlighter_t* h, uint8_t alpha);
typedef uint8_t (*dialog_highlighter_get_alpha_t)(dialog_highlighter_t* h, float_t percent);
typedef ret_t (*dialog_highlighter_draw_mask_t)(dialog_highlighter_t* h, canvas_t* c,
@ -50,7 +52,10 @@ typedef struct _dialog_highlighter_vtable_t {
dialog_highlighter_get_alpha_t get_alpha;
dialog_highlighter_is_dynamic_t is_dynamic;
dialog_highlighter_on_destroy_t on_destroy;
dialog_highlighter_set_clip_rect_t set_bg_clip_rect;
dialog_highlighter_set_system_bar_alpha_t set_system_bar_alpha;
dialog_highlighter_system_bar_append_clip_rect_t system_bar_top_append_clip_rect;
dialog_highlighter_system_bar_append_clip_rect_t system_bar_bottom_append_clip_rect;
} dialog_highlighter_vtable_t;
/**
@ -187,6 +192,28 @@ ret_t dialog_highlighter_prepare_ex(dialog_highlighter_t* h, canvas_t* c, canvas
*/
ret_t dialog_highlighter_set_system_bar_alpha(dialog_highlighter_t* h, uint8_t alpha);
/**
* @method dialog_highlighter_system_bar_top_append_clip_rect
* system_bar
* @param {dialog_highlighter_t*} h
* @param {bool_t} paint_system_bar_top system_bar
* @param {bool_t} paint_system_bar_bottom system_bar
*
* @return {ret_t} RET_OK表示成功
*/
ret_t dialog_highlighter_system_bar_top_append_clip_rect(dialog_highlighter_t* h, rect_t* rect);
/**
* @method dialog_highlighter_system_bar_bottom_append_clip_rect
* system_bar
* @param {dialog_highlighter_t*} h
* @param {bool_t} paint_system_bar_top system_bar
* @param {bool_t} paint_system_bar_bottom system_bar
*
* @return {ret_t} RET_OK表示成功
*/
ret_t dialog_highlighter_system_bar_bottom_append_clip_rect(dialog_highlighter_t* h, rect_t* rect);
/**
* @method dialog_highlighter_get_alpha
*

View File

@ -4693,6 +4693,12 @@ bool_t widget_is_normal_window(widget_t* widget) {
return widget->vt->is_window && tk_str_eq(widget->vt->type, WIDGET_TYPE_NORMAL_WINDOW);
}
bool_t widget_is_fullscreen_window(widget_t* widget) {
return_value_if_fail(widget != NULL && widget->vt != NULL, FALSE);
return widget->vt->is_window && widget_get_prop_bool(widget, WIDGET_PROP_FULLSCREEN, FALSE);
}
bool_t widget_is_dialog(widget_t* widget) {
return_value_if_fail(widget != NULL && widget->vt != NULL, FALSE);

View File

@ -2141,6 +2141,16 @@ bool_t widget_is_system_bar(widget_t* widget);
*/
bool_t widget_is_normal_window(widget_t* widget);
/**
* @method widget_is_fullscreen_window
*
*
* @annotation ["scriptable"]
* @param {widget_t*} widget widget对象
* @return {bool_t} FALSE表示不是
*/
bool_t widget_is_fullscreen_window(widget_t* widget);
/**
* @method widget_is_dialog
*

View File

@ -138,6 +138,9 @@ struct _window_animator_t {
bitmap_t curr_img;
#endif /*WITHOUT_WINDOW_ANIMATOR_CACHE*/
bool_t open;
bool_t is_paint_system_bar_top;
bool_t is_paint_system_bar_bottom;
float_t ratio;
float_t percent;
canvas_t* canvas;

View File

@ -19,6 +19,7 @@
*
*/
#include "base/widget_vtable.h"
#include "base/dialog_highlighter.h"
#include "dialog_highlighters/dialog_highlighter_default.h"
#include "window_manager/window_manager_default.h"
@ -36,18 +37,137 @@ static ret_t dialog_highlighter_default_draw_mask(canvas_t* c, uint8_t alpha) {
return RET_OK;
}
static ret_t dialog_highlighter_default_draw_mask_system_bar(canvas_t* c, uint8_t alpha) {
static ret_t dialog_highlighter_default_get_window_rect_diff_on_visit(void* ctx, const void* data) {
rect_t diff_rects[4];
void** arges = (void**)ctx;
rect_t* rect = (rect_t*)data;
rect_t* r = (rect_t*)arges[1];
slist_t* diff_rect_list = (slist_t*)arges[0];
/* 显示裁剪区和 system_bar 差集,如果存在差集的话,就意味着相交了,把相交部分排除,留下差集部分 */
if (rect_diff(rect, r, &diff_rects[0], &diff_rects[1], &diff_rects[2], &diff_rects[3])) {
for (uint32_t i = 0; i < ARRAY_SIZE(diff_rects); i++) {
if (diff_rects[i].w != 0 && diff_rects[i].h != 0) {
rect_t* data = TKMEM_ZALLOC(rect_t);
break_if_fail(data != NULL);
memcpy(data, &diff_rects[i], sizeof(rect_t));
slist_append(diff_rect_list, data);
}
}
return RET_REMOVE;
}
return RET_OK;
}
static ret_t dialog_highlighter_default_get_window_rect_diff(slist_t* rect_list, rect_t* r) {
void* arges[2];
void* iter = NULL;
slist_t diff_rect_list;
slist_init(&diff_rect_list, NULL, NULL);
arges[0] = &diff_rect_list;
arges[1] = r;
slist_foreach(rect_list, dialog_highlighter_default_get_window_rect_diff_on_visit, arges);
if (!slist_is_empty(&diff_rect_list)) {
while ((iter = slist_head_pop(&diff_rect_list)) != NULL) {
slist_append(rect_list, iter);
}
}
slist_deinit(&diff_rect_list);
return RET_OK;
}
static ret_t dialog_highlighter_default_draw_window_rect_diff_on_visit(void* ctx, const void* data) {
void** arges = (void**)ctx;
canvas_t* c = arges[0];
rect_t* window_rect = (rect_t*)data;
uint8_t alpha = (uint8_t)tk_pointer_to_int(arges[1]);
color_t mask = color_init(0, 0, 0, alpha);
canvas_set_fill_color(c, mask);
canvas_fill_rect(c, window_rect->x, window_rect->y, window_rect->w, window_rect->h);
return RET_OK;
}
static ret_t dialog_highlighter_default_draw_mask_window(dialog_highlighter_t* h, canvas_t* c, uint8_t alpha) {
if (alpha > 1) {
uint32_t i = 0;
void* arges[2];
widget_t* widget = window_manager();
dialog_highlighter_default_t* dh = (dialog_highlighter_default_t*)h;
if (slist_is_empty(&dh->win_mask_rect_list)) {
/* 排除掉显示裁剪区中的包括的 system_bar 的区域 */
slist_append(&dh->win_mask_rect_list, rect_create(h->clip_rect.x, h->clip_rect.y, h->clip_rect.w, h->clip_rect.h));
for (i = 0; i < dh->system_bar_top_clip_rects.size; i++) {
rect_t* r = (rect_t*)darray_get(&dh->system_bar_top_clip_rects, i);
dialog_highlighter_default_get_window_rect_diff(&dh->win_mask_rect_list, r);
}
for (i = 0; i < dh->system_bar_bottom_clip_rects.size; i++) {
rect_t* r = (rect_t*)darray_get(&dh->system_bar_bottom_clip_rects, i);
dialog_highlighter_default_get_window_rect_diff(&dh->win_mask_rect_list, r);
}
}
arges[0] = c;
arges[1] = tk_pointer_from_int(alpha);
slist_foreach(&dh->win_mask_rect_list, dialog_highlighter_default_draw_window_rect_diff_on_visit, arges);
}
return RET_OK;
}
static ret_t dialog_highlighter_default_draw_mask_system_bar(dialog_highlighter_t* h, canvas_t* c, uint8_t alpha, bool_t is_clip_rect) {
if (alpha > 1) {
uint32_t i = 0;
widget_t* widget = window_manager();
color_t mask = color_init(0, 0, 0, alpha);
WIDGET_FOR_EACH_CHILD_BEGIN_R(widget, iter, i)
if (widget_is_system_bar(iter)) {
dialog_highlighter_default_t* dh = (dialog_highlighter_default_t*)h;
for (i = 0; i < dh->system_bar_top_clip_rects.size; i++) {
rect_t* r = (rect_t*)darray_get(&dh->system_bar_top_clip_rects, i);
if (is_clip_rect) {
/* 因为显示裁剪区是会包括一些 system_bar 的区域的,只要重叠了就意味着这个区域被画到显示裁剪区中了,所以就跳过绘图 */
rect_t in = rect_intersect(r, &h->clip_rect);
if (in.w != 0 && in.h != 0) {
continue;
}
}
canvas_set_fill_color(c, mask);
canvas_fill_rect(c, iter->x, iter->y, iter->w, iter->h);
canvas_fill_rect(c, r->x, r->y, r->w, r->h);
}
for (i = 0; i < dh->system_bar_bottom_clip_rects.size; i++) {
rect_t* r = (rect_t*)darray_get(&dh->system_bar_bottom_clip_rects, i);
if (is_clip_rect) {
/* 因为显示裁剪区是会包括一些 system_bar 的区域的,只要重叠了就意味着这个区域被画到显示裁剪区中了,所以就跳过绘图 */
rect_t in = rect_intersect(r, &h->clip_rect);
if (in.w != 0 && in.h != 0) {
continue;
}
}
canvas_set_fill_color(c, mask);
canvas_fill_rect(c, r->x, r->y, r->w, r->h);
}
}
return RET_OK;
}
static ret_t dialog_highlighter_default_draw_system_bar(dialog_highlighter_t* h, canvas_t* c) {
uint32_t i = 0;
widget_t* widget = window_manager();
dialog_highlighter_default_t* dh = (dialog_highlighter_default_t*)h;
WIDGET_FOR_EACH_CHILD_BEGIN_R(widget, iter, index)
if (iter->vt->is_window) {
if (tk_str_eq(iter->vt->type, WIDGET_TYPE_SYSTEM_BAR)) {
for (i = 0; i < dh->system_bar_top_clip_rects.size; i++) {
rect_t* r = (rect_t*)darray_get(&dh->system_bar_top_clip_rects, i);
widget_paint_with_clip(iter, r, c, widget_paint);
}
} else if(tk_str_eq(iter->vt->type, WIDGET_TYPE_SYSTEM_BAR_BOTTOM)) {
for (i = 0; i < dh->system_bar_bottom_clip_rects.size; i++) {
rect_t* r = (rect_t*)darray_get(&dh->system_bar_bottom_clip_rects, i);
widget_paint_with_clip(iter, r, c, widget_paint);
}
}
}
WIDGET_FOR_EACH_CHILD_END()
}
return RET_OK;
}
@ -69,9 +189,7 @@ static ret_t dialog_highlighter_default_draw_mask_from_percent(dialog_highlighte
ret_t dialog_highlighter_default_set_system_bar_alpha(dialog_highlighter_t* h, uint8_t alpha) {
dialog_highlighter_default_t* dh = (dialog_highlighter_default_t*)h;
return_value_if_fail(dh != NULL, RET_BAD_PARAMS);
/* 计算叠加的 system_bar 的高亮透明度 */
dh->system_bar_alpha = (dh->system_bar_alpha * (0xff - alpha)) >> 8;
dh->system_bar_alpha = 0xff - alpha;
return RET_OK;
}
@ -95,11 +213,9 @@ static ret_t dialog_highlighter_default_prepare(dialog_highlighter_t* h, canvas_
* if dh->start_alpha == dh->end_alpha, we draw mask layer only at the first time.
*/
if (dh->start_alpha == dh->end_alpha) {
if (!window_is_fullscreen(h->win)) {
window_manager_paint_system_bar(window_manager(), c);
}
dialog_highlighter_default_draw_mask(c, dh->start_alpha);
}
dialog_highlighter_default_draw_system_bar(h, c);
return RET_OK;
}
@ -111,6 +227,7 @@ static ret_t dialog_highlighter_default_draw(dialog_highlighter_t* h, float_t pe
rect_t save_r;
canvas_t* c;
bitmap_t* img;
bool_t is_window_animator = FALSE;
dialog_highlighter_default_t* dh = (dialog_highlighter_default_t*)h;
if (percent == 1 && dh->update_background) {
@ -130,30 +247,32 @@ static ret_t dialog_highlighter_default_draw(dialog_highlighter_t* h, float_t pe
if (percent == 1) {
/* if window is open, enable clip and draw system bar */
is_window_animator = FALSE;
canvas_draw_image(c, img, &src, &dst);
if (!window_is_fullscreen(h->win)) {
window_manager_paint_system_bar(window_manager(), c);
}
dialog_highlighter_default_draw_system_bar(h, c);
} else {
is_window_animator = TRUE;
canvas_get_clip_rect(c, &save_r);
r = rect_intersect(&save_r, &h->clip_rect);
canvas_save(c);
canvas_set_clip_rect(c, &r);
canvas_draw_image(c, img, &src, &dst);
canvas_set_clip_rect(c, &save_r);
canvas_restore(c);
}
/*
* only if dh->start_alpha != dh->end_alpha, we draw mask layer very time.
*/
if (dh->start_alpha != dh->end_alpha) {
uint8_t a = ((dh->end_alpha - dh->start_alpha) * percent) + dh->start_alpha;
dialog_highlighter_default_draw_mask(c, a);
uint8_t alpha = ((dh->end_alpha - dh->start_alpha) * percent) + dh->start_alpha;
uint8_t a = 0xff - ((dh->system_bar_alpha * (0xff - alpha)) >> 8);
dialog_highlighter_default_draw_mask_window(h, c, alpha);
dialog_highlighter_default_draw_mask_system_bar(h, c, a, h->used_by_others && is_window_animator);
} else {
if (!window_is_fullscreen(h->win)) {
/* 解决黑色色块绘制到贴图导致 system_bar 的颜色不同步的问题 */
uint8_t a = 0xff - ((dh->system_bar_alpha * (0xff - dh->end_alpha)) >> 8);
dialog_highlighter_default_draw_mask_system_bar(c, a);
}
dialog_highlighter_default_draw_mask_system_bar(h, c, a, h->used_by_others && is_window_animator);
}
return RET_OK;
@ -165,6 +284,45 @@ static bool_t dialog_highlighter_default_is_dynamic(dialog_highlighter_t* h) {
return (dh->start_alpha != dh->end_alpha);
}
static ret_t dialog_highlighter_default_system_bar_top_append_clip_rect(dialog_highlighter_t* h, rect_t* rect) {
ret_t ret = RET_OK;
dialog_highlighter_default_t* dh = (dialog_highlighter_default_t*)h;
if (rect->w != 0 && rect->h != 0) {
rect_t* r = TKMEM_ZALLOC(rect_t);
memcpy(r, rect, sizeof(rect_t));
ret = darray_push(&dh->system_bar_top_clip_rects, r);
}
return ret;
}
static ret_t dialog_highlighter_default_system_bar_bottom_append_clip_rect(dialog_highlighter_t* h, rect_t* rect) {
ret_t ret = RET_OK;
dialog_highlighter_default_t* dh = (dialog_highlighter_default_t*)h;
if (rect->w != 0 && rect->h != 0) {
rect_t* r = TKMEM_ZALLOC(rect_t);
memcpy(r, rect, sizeof(rect_t));
ret = darray_push(&dh->system_bar_bottom_clip_rects, r);
}
return ret;
}
static ret_t dialog_highlighter_default_on_destroy(dialog_highlighter_t* h) {
dialog_highlighter_default_t* dh = (dialog_highlighter_default_t*)h;
slist_deinit(&dh->win_mask_rect_list);
darray_deinit(&dh->system_bar_top_clip_rects);
darray_deinit(&dh->system_bar_bottom_clip_rects);
return RET_OK;
}
static ret_t dialog_highlighter_default_set_bg_clip_rect(dialog_highlighter_t* h, rect_t* rect) {
dialog_highlighter_default_t* dh = (dialog_highlighter_default_t*)h;
darray_clear(&dh->system_bar_top_clip_rects);
darray_clear(&dh->system_bar_bottom_clip_rects);
slist_remove_all(&dh->win_mask_rect_list);
h->clip_rect = rect_init(rect->x, rect->y, rect->w, rect->h);
return RET_OK;
}
static const dialog_highlighter_vtable_t s_dialog_highlighter_default_vt = {
.type = "dialog_highlighter_default_t",
.desc = "dialog_highlighter_default_t",
@ -172,6 +330,10 @@ static const dialog_highlighter_vtable_t s_dialog_highlighter_default_vt = {
.prepare = dialog_highlighter_default_prepare,
.draw_mask = dialog_highlighter_default_draw_mask_from_percent,
.set_system_bar_alpha = dialog_highlighter_default_set_system_bar_alpha,
.set_bg_clip_rect = dialog_highlighter_default_set_bg_clip_rect,
.on_destroy = dialog_highlighter_default_on_destroy,
.system_bar_bottom_append_clip_rect = dialog_highlighter_default_system_bar_bottom_append_clip_rect,
.system_bar_top_append_clip_rect = dialog_highlighter_default_system_bar_top_append_clip_rect,
.get_alpha = dialog_highlighter_default_get_alpha,
.is_dynamic = dialog_highlighter_default_is_dynamic,
.draw = dialog_highlighter_default_draw};
@ -187,6 +349,10 @@ dialog_highlighter_t* dialog_highlighter_default_create(tk_object_t* args) {
dh->system_bar_alpha = 0xff;
dh->update_background = FALSE;
slist_init(&dh->win_mask_rect_list, default_destroy, NULL);
darray_init(&dh->system_bar_top_clip_rects, 4, default_destroy, NULL);
darray_init(&dh->system_bar_bottom_clip_rects, 4, default_destroy, NULL);
if (tk_object_get_prop(args, DIALOG_HIGHLIGHTER_DEFAULT_ARG_ALPHA, &v) == RET_OK) {
dh->start_alpha = value_int(&v);
dh->end_alpha = value_int(&v);

View File

@ -63,6 +63,24 @@ struct _dialog_highlighter_default_t {
*
*/
bool_t update_background;
/**
* @property {darray_t} system_bar_top_clip_rects
* system_bar
*/
darray_t system_bar_top_clip_rects;
/**
* @property {darray_t} system_bar_bottom_clip_rects
* system_bar
*/
darray_t system_bar_bottom_clip_rects;
/**
* @property {slist_t} win_mask_rect_list
* mask
*/
slist_t win_mask_rect_list;
};
/**

View File

@ -123,6 +123,42 @@ rect_t rect_init(xy_t x, xy_t y, wh_t w, wh_t h) {
return r;
}
bool_t rect_diff(const rect_t* r1, const rect_t* r2, rect_t* out_r1, rect_t* out_r2, rect_t* out_r3, rect_t* out_r4) {
#define RECT_DIFF_INIT(r, r_x, r_y, r_w, r_h) { \
(r)->x = (r_x); \
(r)->y = (r_y); \
(r)->w = (r_w); \
(r)->h = (r_h); \
}
rect_t in;
return_value_if_fail(r1 != NULL && r2 != NULL && out_r1 != NULL && out_r2 != NULL && out_r3 != NULL && out_r4 != NULL, FALSE);
memset(out_r1, 0x0, sizeof(rect_t));
memset(out_r2, 0x0, sizeof(rect_t));
memset(out_r3, 0x0, sizeof(rect_t));
memset(out_r4, 0x0, sizeof(rect_t));
in = rect_intersect(r1, r2);
if (in.w == 0 || in.h == 0) {
memcpy(out_r1, r1, sizeof(rect_t));
return TRUE;
} else {
if (memcmp(&in, r1, sizeof(rect_t)) == 0) {
return FALSE;
} else {
int32_t right1 = r1->x + r1->w - 1;
int32_t right2 = r2->x + r2->w - 1;
int32_t bottom1 = r1->y + r1->h - 1;
int32_t bottom2 = r2->y + r2->h - 1;
RECT_DIFF_INIT(out_r1, r1->x, r1->y, r1->w, tk_max(in.y - r1->y, 0));
RECT_DIFF_INIT(out_r2, r1->x, in.y, tk_max(in.x - r1->x, 0), in.h);
RECT_DIFF_INIT(out_r3, in.x + in.w, in.y, tk_max(right1 - right2, 0), in.h);
RECT_DIFF_INIT(out_r4, r1->x, in.y + in.h, r1->w, tk_max(bottom1 - bottom2, 0));
return TRUE;
}
}
}
rect_t rect_intersect(const rect_t* r1, const rect_t* r2) {
int32_t top = 0;
int32_t left = 0;

View File

@ -308,6 +308,23 @@ rect_t rect_intersect(const rect_t* r1, const rect_t* r2);
*/
bool_t rect_has_intersect(const rect_t* r1, const rect_t* r2);
/**
* @method rect_intersect
*
*
*
*
* @param {const rect_t*} r1
* @param {const rect_t*} r2
* @param {rect_t*} out_r1
* @param {rect_t*} out_r2
* @param {rect_t*} out_r3
* @param {rect_t*} out_r4
*
* @return {bool_t} TRUE表示存在差集
*/
bool_t rect_diff(const rect_t* r1, const rect_t* r2, rect_t* out_r1, rect_t* out_r2, rect_t* out_r3, rect_t* out_r4);
/**
* @method rectf_scale
* rectf对象

View File

@ -148,15 +148,26 @@ ret_t slist_prepend(slist_t* slist, void* data) {
ret_t slist_foreach(slist_t* slist, tk_visit_t visit, void* ctx) {
ret_t ret = RET_OK;
slist_node_t* iter = NULL;
slist_node_t* prev_iter = NULL;
return_value_if_fail(slist != NULL && visit != NULL, RET_BAD_PARAMS);
iter = slist->first;
while (iter != NULL) {
ret = visit(ctx, iter->data);
if (ret != RET_OK) {
if (ret == RET_REMOVE) {
slist_node_t* next = iter->next;
if (prev_iter == NULL) {
slist->first = next;
} else {
prev_iter->next = next;
}
slist_node_destroy(iter, slist->destroy);
iter = next;
continue;
} else if (ret != RET_OK) {
break;
}
prev_iter = iter;
iter = iter->next;
}
@ -195,7 +206,9 @@ void* slist_head_pop(slist_t* slist) {
return_value_if_fail(slist != NULL, NULL);
iter = slist->first;
return_value_if_fail(iter != NULL, NULL);
if (iter == NULL) {
return NULL;
}
slist->first = iter->next;
@ -205,6 +218,11 @@ void* slist_head_pop(slist_t* slist) {
return data;
}
bool_t slist_is_empty(slist_t* slist) {
return_value_if_fail(slist != NULL, TRUE);
return slist->first == NULL;
}
int32_t slist_size(slist_t* slist) {
int32_t size = 0;
slist_node_t* iter = NULL;

View File

@ -204,6 +204,15 @@ void* slist_tail_pop(slist_t* slist);
*/
void* slist_head_pop(slist_t* slist);
/**
* @method slist_is_empty
*
* @param {slist_t*} slist
*
* @return {bool_t} TRUE FALSE
*/
bool_t slist_is_empty(slist_t* slist);
/**
* @method slist_size
*

View File

@ -130,7 +130,6 @@ ret_t window_animator_to_right_draw_curr(window_animator_t* wa) {
#endif /*WITHOUT_WINDOW_ANIMATOR_CACHE*/
}
static ret_t window_animator_paint_system_bar(window_animator_t* wa);
static ret_t window_animator_update_percent(window_animator_t* wa);
static ret_t window_animator_draw_prev_window(window_animator_t* wa);
static ret_t window_animator_draw_curr_window(window_animator_t* wa);
@ -187,26 +186,6 @@ ret_t window_animator_destroy(window_animator_t* wa) {
/******************helper******************/
static ret_t window_animator_paint_system_bar(window_animator_t* wa) {
widget_t* wm = wa->curr_win->parent;
widget_t* system_bar = widget_lookup_by_type(wm, WIDGET_TYPE_SYSTEM_BAR, TRUE);
if (system_bar == NULL) {
system_bar = widget_lookup_by_type(wm, WIDGET_TYPE_SYSTEM_BAR_BOTTOM, TRUE);
}
if (system_bar != NULL) {
#ifdef AWTK_WEB
rect_t src = rect_init(system_bar->x, system_bar->y, system_bar->w, system_bar->h);
rect_t dst = rect_init(system_bar->x, system_bar->y, system_bar->w, system_bar->h);
canvas_draw_image(wa->canvas, &(wa->prev_img), rect_scale(&src, wa->ratio), &dst);
#else
window_manager_paint_system_bar(wm, wa->canvas);
#endif /*AWTK_WEB*/
}
return RET_OK;
}
#ifndef WITHOUT_WINDOW_ANIMATORS
static ret_t window_animator_init(window_animator_t* wa) {
ret_t ret = RET_NOT_IMPL;
@ -323,33 +302,18 @@ ret_t window_animator_begin_frame(window_animator_t* wa) {
return_value_if_fail(wa != NULL && wa->vt != NULL, RET_OK);
ENSURE(canvas_begin_frame(wa->canvas, NULL, LCD_DRAW_ANIMATION) == RET_OK);
if (!widget_is_normal_window(wa->curr_win) && wa->dialog_highlighter == NULL) {
paint_system_bar = FALSE;
} else if (tk_str_eq(wa->vt->type, WINDOW_ANIMATOR_VTRANSLATE)) {
paint_system_bar = FALSE;
/* 把 system_bar 绘制到底部,然后再被截图覆盖在上面,应该截图中的对话框等窗口有可能叠在 system_bar 上面 */
if (wa->is_paint_system_bar_top) {
window_manager_paint_system_bar_top(wa->curr_win->parent, wa->canvas);
}
if (paint_system_bar) {
window_animator_paint_system_bar(wa);
if (wa->is_paint_system_bar_bottom) {
window_manager_paint_system_bar_bottom(wa->curr_win->parent, wa->canvas);
}
return RET_OK;
}
ret_t window_animator_end_frame(window_animator_t* wa) {
bool_t paint_system_bar = TRUE;
return_value_if_fail(wa != NULL && wa->vt != NULL, RET_OK);
if (!widget_is_normal_window(wa->curr_win) && wa->dialog_highlighter == NULL) {
paint_system_bar = FALSE;
} else if (!tk_str_eq(wa->vt->type, WINDOW_ANIMATOR_VTRANSLATE)) {
paint_system_bar = FALSE;
}
if (paint_system_bar) {
window_animator_paint_system_bar(wa);
}
return canvas_end_frame(wa->canvas);
}

View File

@ -51,14 +51,6 @@ static ret_t window_manager_default_create_dialog_highlighter(widget_t* widget,
static ret_t window_manager_default_layout_not_system_bar(widget_t* widget, widget_t* window,
rect_t client_r);
bool_t window_is_fullscreen(widget_t* widget) {
value_t v;
value_set_bool(&v, FALSE);
widget_get_prop(widget, WIDGET_PROP_FULLSCREEN, &v);
return value_bool(&v);
}
static bool_t window_is_opened(widget_t* widget) {
int32_t stage = widget_get_prop_int(widget, WIDGET_PROP_STAGE, WINDOW_STAGE_NONE);
@ -126,6 +118,34 @@ static widget_t* window_manager_find_prev_normal_window(widget_t* widget) {
return NULL;
}
static ret_t window_manager_default_set_paint_system_bar_by_window_animator(widget_t* widget, rect_t* rect) {
window_manager_default_t* wm = WINDOW_MANAGER_DEFAULT(widget);
WIDGET_FOR_EACH_CHILD_BEGIN_R(widget, iter, i)
if (tk_str_eq(iter->vt->type, WIDGET_TYPE_SYSTEM_BAR) && !wm->is_animator_paint_system_bar_top) {
rect_t r = rect_init(iter->x, iter->y, iter->w, iter->h);
rect_t dr = rect_intersect(rect, &r);
if (dr.w == 0 || dr.h == 0) {
wm->is_animator_paint_system_bar_top = TRUE;
} else if (dr.w == r.w && dr.h == r.h) {
wm->is_animator_paint_system_bar_top = FALSE;
} else {
wm->is_animator_paint_system_bar_top = TRUE;
}
} else if (tk_str_eq(iter->vt->type, WIDGET_TYPE_SYSTEM_BAR_BOTTOM) && !wm->is_animator_paint_system_bar_bottom) {
rect_t r = rect_init(iter->x, iter->y, iter->w, iter->h);
rect_t dr = rect_intersect(rect, &r);
if (dr.w == 0 || dr.h == 0) {
wm->is_animator_paint_system_bar_bottom = TRUE;
} else if (dr.w == r.w && dr.h == r.h) {
wm->is_animator_paint_system_bar_bottom = FALSE;
} else {
wm->is_animator_paint_system_bar_bottom = TRUE;
}
}
WIDGET_FOR_EACH_CHILD_END()
return RET_OK;
}
ret_t window_manager_default_snap_curr_window(widget_t* widget, widget_t* curr_win, bitmap_t* img) {
#ifndef WITHOUT_WINDOW_ANIMATORS
canvas_t* c = NULL;
@ -151,6 +171,7 @@ ret_t window_manager_default_snap_curr_window(widget_t* widget, widget_t* curr_w
canvas_offline_end_draw(canvas);
ENSURE(canvas_offline_bitmap_move_to_new_bitmap(canvas, img) == RET_OK);
ENSURE(canvas_offline_destroy(canvas) == RET_OK);
window_manager_default_set_paint_system_bar_by_window_animator(widget, &r);
img->flags |= BITMAP_FLAG_OPAQUE;
canvas_restore(c);
/* 清除在线画布的缓存确保绘制完窗口动画后lcd对象的数据能和在线画布同步 */
@ -183,16 +204,102 @@ static ret_t window_manager_default_snap_prev_window_draw_dialog_highlighter_and
}
return RET_FAIL;
}
static ret_t window_manager_default_snap_prev_window_get_system_bar_rect(widget_t* widget, slist_t* system_bar_top_list, slist_t* system_bar_bottom_list) {
WIDGET_FOR_EACH_CHILD_BEGIN_R(widget, iter, i)
if (iter->vt->is_window) {
if (tk_str_eq(iter->vt->type, WIDGET_TYPE_SYSTEM_BAR)) {
rect_t* r = rect_create(iter->x, iter->y, iter->w, iter->h);
slist_append(system_bar_top_list, r);
} else if (tk_str_eq(iter->vt->type, WIDGET_TYPE_SYSTEM_BAR_BOTTOM)) {
rect_t* r = rect_create(iter->x, iter->y, iter->w, iter->h);
slist_append(system_bar_bottom_list, r);
}
}
WIDGET_FOR_EACH_CHILD_END()
return RET_OK;
}
static bool_t window_manager_default_snap_prev_window_check_paint_system_bar(slist_t* diff_rect_list) {
bool_t su = FALSE;
rect_t* rect = NULL;
slist_node_t* iter = NULL;
iter = diff_rect_list->first;
while (iter != NULL) {
rect = (rect_t*)iter->data;
if (rect->w != 0 && rect->h != 0) {
su = TRUE;
break;
}
iter = iter->next;
}
return su;
}
static ret_t window_manager_default_snap_prev_window_get_system_bar_rect_diff_on_visit(void* ctx, const void* data) {
rect_t diff_rects[4];
void** arges = (void**)ctx;
rect_t* rect = (rect_t*)data;
rect_t* r = (rect_t*)arges[1];
slist_t* diff_rect_list = (slist_t*)arges[0];
if (rect_diff(rect, r, &diff_rects[0], &diff_rects[1], &diff_rects[2], &diff_rects[3])) {
for (uint32_t i = 0; i < ARRAY_SIZE(diff_rects); i++) {
if (diff_rects[i].w != 0 && diff_rects[i].h != 0) {
rect_t* data = TKMEM_ZALLOC(rect_t);
break_if_fail(data != NULL);
memcpy(data, &diff_rects[i], sizeof(rect_t));
slist_append(diff_rect_list, data);
}
}
return RET_REMOVE;
}
return RET_OK;
}
static ret_t window_manager_default_snap_prev_window_get_system_bar_rect_diff(slist_t* rect_list, rect_t* r) {
void* arges[2];
void* iter = NULL;
slist_t diff_rect_list;
slist_init(&diff_rect_list, NULL, NULL);
arges[0] = &diff_rect_list;
arges[1] = r;
slist_foreach(rect_list, window_manager_default_snap_prev_window_get_system_bar_rect_diff_on_visit, arges);
if (!slist_is_empty(&diff_rect_list)) {
while ((iter = slist_head_pop(&diff_rect_list)) != NULL) {
slist_append(rect_list, iter);
}
}
slist_deinit(&diff_rect_list);
return RET_OK;
}
static ret_t window_manager_default_snap_prev_window_system_bar_top_push_clip_rect(void* ctx, const void* data) {
rect_t* r = (rect_t*)data;
dialog_highlighter_t* dialog_highlighter = (dialog_highlighter_t*)ctx;
dialog_highlighter_system_bar_top_append_clip_rect(dialog_highlighter, r);
return RET_OK;
}
static ret_t window_manager_default_snap_prev_window_system_bar_bottom_push_clip_rect(void* ctx, const void* data) {
rect_t* r = (rect_t*)data;
dialog_highlighter_t* dialog_highlighter = (dialog_highlighter_t*)ctx;
dialog_highlighter_system_bar_bottom_append_clip_rect(dialog_highlighter, r);
return RET_OK;
}
#endif
ret_t window_manager_default_snap_prev_window(widget_t* widget, widget_t* prev_win, bitmap_t* img) {
#ifndef WITHOUT_WINDOW_ANIMATORS
rect_t r = {0};
uint8_t alpha = 0xFF;
canvas_t* c = NULL;
canvas_t* canvas = NULL;
window_manager_default_t* wm = WINDOW_MANAGER_DEFAULT(widget);
dialog_highlighter_t* dialog_highlighter = NULL;
int32_t end = -1, start = -1;
bool_t is_fullscreen_window = FALSE;
dialog_highlighter_t* dialog_highlighter = NULL;
slist_t system_bar_top_rect_list, system_bar_bottom_rect_list;
window_manager_default_t* wm = WINDOW_MANAGER_DEFAULT(widget);
const char* curr_highlight = widget_get_prop_str(wm->curr_win, WIDGET_PROP_HIGHLIGHT, NULL);
return_value_if_fail(img != NULL && wm != NULL && prev_win != NULL, RET_BAD_PARAMS);
@ -210,6 +317,7 @@ ret_t window_manager_default_snap_prev_window(widget_t* widget, widget_t* prev_w
}
WIDGET_FOR_EACH_CHILD_END()
is_fullscreen_window = widget_is_fullscreen_window(prev_win);
r = rect_init(prev_win->x, prev_win->y, prev_win->w, prev_win->h);
canvas_save(c);
@ -217,37 +325,60 @@ ret_t window_manager_default_snap_prev_window(widget_t* widget, widget_t* prev_w
lcd_get_desired_bitmap_format(c->lcd));
canvas_offline_begin_draw(canvas);
canvas_set_clip_rect(canvas, &r);
canvas_set_clip_rect(canvas, NULL);
ENSURE(widget_on_paint_background(widget, canvas) == RET_OK);
if (!window_is_fullscreen(prev_win)) {
if (!is_fullscreen_window) {
window_manager_paint_system_bar(widget, canvas);
}
{
widget_t** children = (widget_t**)(widget->children->elms);
slist_init(&system_bar_top_rect_list, default_destroy, NULL);
slist_init(&system_bar_bottom_rect_list, default_destroy, NULL);
if (!is_fullscreen_window) {
window_manager_default_snap_prev_window_get_system_bar_rect(widget, &system_bar_top_rect_list, &system_bar_bottom_rect_list);
}
for (; start <= end; ++start) {
widget_t* iter = children[start];
if (widget_is_system_bar(iter) || !iter->visible) continue;
/* 过滤 curr_win 的对象 */
if (iter != wm->curr_win) {
rect_t iter_rect = rect_init(iter->x, iter->y, iter->w, iter->h);
/* 给前面的高亮对话框叠加黑色色块 */
if (widget_is_dialog(iter)) {
uint8_t a = 0x0;
window_manager_default_snap_prev_window_draw_dialog_highlighter_and_get_alpha(iter,
canvas, &a);
if (dialog_highlighter != NULL && curr_highlight != NULL) {
dialog_highlighter_set_system_bar_alpha(dialog_highlighter, a);
if (window_manager_default_snap_prev_window_draw_dialog_highlighter_and_get_alpha(iter, canvas, &a) == RET_OK) {
/* 计算最终叠加后的透明度值 */
alpha = alpha * (1 - a / 255.0f);
}
}
/* 如果不是全屏的话,就削减 system_bar 的显示裁剪区 */
if (!is_fullscreen_window && !widget_is_normal_window(iter)) {
window_manager_default_snap_prev_window_get_system_bar_rect_diff(&system_bar_top_rect_list, &iter_rect);
window_manager_default_snap_prev_window_get_system_bar_rect_diff(&system_bar_bottom_rect_list, &iter_rect);
}
rect_merge(&r, &iter_rect);
ENSURE(widget_paint(iter, canvas) == RET_OK);
}
}
/* 检查是否还有 system_bar 的显示区域,如果有则让其绘图 */
wm->is_animator_paint_system_bar_top = window_manager_default_snap_prev_window_check_paint_system_bar(&system_bar_top_rect_list);
wm->is_animator_paint_system_bar_bottom = window_manager_default_snap_prev_window_check_paint_system_bar(&system_bar_bottom_rect_list);
}
if (dialog_highlighter != NULL && curr_highlight != NULL) {
if (dialog_highlighter != NULL) {
dialog_highlighter_set_bg_clip_rect(dialog_highlighter, &r);
if (!is_fullscreen_window) {
/* 把 system_bar 的显示裁剪区域追加到高亮对象中 */
slist_foreach(&system_bar_top_rect_list, window_manager_default_snap_prev_window_system_bar_top_push_clip_rect, dialog_highlighter);
slist_foreach(&system_bar_bottom_rect_list, window_manager_default_snap_prev_window_system_bar_bottom_push_clip_rect, dialog_highlighter);
}
if (curr_highlight != NULL) {
dialog_highlighter_set_system_bar_alpha(dialog_highlighter, 0xFF - alpha);
dialog_highlighter_set_win(dialog_highlighter, prev_win);
/* 把没有遮罩的 system_bar 绘制到离线画布上 */
dialog_highlighter_prepare_ex(dialog_highlighter, c, canvas);
}
}
canvas_offline_end_draw(canvas);
ENSURE(canvas_offline_bitmap_move_to_new_bitmap(canvas, img) == RET_OK);
ENSURE(canvas_offline_destroy(canvas) == RET_OK);
@ -256,8 +387,9 @@ ret_t window_manager_default_snap_prev_window(widget_t* widget, widget_t* prev_w
if (dialog_highlighter != NULL) {
dialog_highlighter_set_bg(dialog_highlighter, img);
dialog_highlighter_set_bg_clip_rect(dialog_highlighter, &r);
}
slist_deinit(&system_bar_top_rect_list);
slist_deinit(&system_bar_bottom_rect_list);
wm->last_curr_win = wm->curr_win;
wm->curr_win = NULL;
#endif
@ -385,6 +517,8 @@ static ret_t window_manager_create_animator(window_manager_default_t* wm, widget
}
}
wm->is_animator_paint_system_bar_top = FALSE;
wm->is_animator_paint_system_bar_bottom = FALSE;
if (anim_hint && *anim_hint) {
canvas_t* c = native_window_get_canvas(wm->native_window);
window_manager_default_create_dialog_highlighter(WIDGET(wm), curr_win);
@ -398,6 +532,9 @@ static ret_t window_manager_create_animator(window_manager_default_t* wm, widget
wm->animating = wm->animator != NULL;
if (wm->animating) {
wm->animator->is_paint_system_bar_top = wm->is_animator_paint_system_bar_top;
wm->animator->is_paint_system_bar_bottom = wm->is_animator_paint_system_bar_bottom;
wm->ignore_user_input = TRUE;
log_debug("ignore_user_input\n");
}
@ -1064,7 +1201,7 @@ static ret_t window_manager_default_on_paint_children(widget_t* widget, canvas_t
widget_paint(iter, c);
if (!has_fullscreen_win) {
has_fullscreen_win = window_is_fullscreen(iter);
has_fullscreen_win = widget_is_fullscreen_window(iter);
}
start = i + 1;
break;
@ -1324,7 +1461,7 @@ static ret_t window_manager_default_layout_not_system_bar(widget_t* widget, widg
wh_t h = window->h;
if (widget_is_normal_window(window)) {
if (window_is_fullscreen(window)) {
if (widget_is_fullscreen_window(window)) {
x = 0;
y = 0;
w = widget->w;
@ -1502,6 +1639,34 @@ ret_t window_manager_paint_system_bar(widget_t* widget, canvas_t* c) {
return RET_OK;
}
ret_t window_manager_paint_system_bar_top(widget_t* widget, canvas_t* c) {
window_manager_default_t* wm = WINDOW_MANAGER_DEFAULT(widget);
return_value_if_fail(wm != NULL && c != NULL, RET_BAD_PARAMS);
WIDGET_FOR_EACH_CHILD_BEGIN_R(widget, iter, i)
if (iter->vt->is_window && tk_str_eq(iter->vt->type, WIDGET_TYPE_SYSTEM_BAR)) {
widget_paint(iter, c);
break;
}
WIDGET_FOR_EACH_CHILD_END()
return RET_OK;
}
ret_t window_manager_paint_system_bar_bottom(widget_t* widget, canvas_t* c) {
window_manager_default_t* wm = WINDOW_MANAGER_DEFAULT(widget);
return_value_if_fail(wm != NULL && c != NULL, RET_BAD_PARAMS);
WIDGET_FOR_EACH_CHILD_BEGIN_R(widget, iter, i)
if (iter->vt->is_window && tk_str_eq(iter->vt->type, WIDGET_TYPE_SYSTEM_BAR_BOTTOM)) {
widget_paint(iter, c);
break;
}
WIDGET_FOR_EACH_CHILD_END()
return RET_OK;
}
static ret_t window_manager_default_reset_window_animator(widget_t* widget) {
window_manager_default_t* wm = WINDOW_MANAGER_DEFAULT(widget);
#ifndef WITHOUT_WINDOW_ANIMATOR_CACHE

View File

@ -40,6 +40,8 @@ typedef struct _window_manager_default_t {
bool_t animating;
bool_t ready_animator;
bool_t ignore_user_input;
bool_t is_animator_paint_system_bar_top;
bool_t is_animator_paint_system_bar_bottom;
window_animator_t* animator;
fps_t fps;
@ -84,7 +86,8 @@ widget_t* window_manager_create(void);
/* private */
ret_t window_manager_paint_system_bar(widget_t* widget, canvas_t* c);
bool_t window_is_fullscreen(widget_t* widget);
ret_t window_manager_paint_system_bar_top(widget_t* widget, canvas_t* c);
ret_t window_manager_paint_system_bar_bottom(widget_t* widget, canvas_t* c);
END_C_DECLS

View File

@ -37,14 +37,6 @@ static ret_t window_manager_simple_invalidate(widget_t* widget, const rect_t* r)
static ret_t window_manager_simple_do_open_window(widget_t* wm, widget_t* window);
static ret_t window_manager_simple_layout_child(widget_t* widget, widget_t* window);
static bool_t window_is_fullscreen(widget_t* widget) {
value_t v;
value_set_bool(&v, FALSE);
widget_get_prop(widget, WIDGET_PROP_FULLSCREEN, &v);
return value_bool(&v);
}
static bool_t window_is_opened(widget_t* widget) {
int32_t stage = widget_get_prop_int(widget, WIDGET_PROP_STAGE, WINDOW_STAGE_NONE);
@ -268,7 +260,7 @@ static ret_t window_manager_simple_on_paint_children(widget_t* widget, canvas_t*
widget_paint(iter, c);
if (!has_fullscreen_win) {
has_fullscreen_win = window_is_fullscreen(iter);
has_fullscreen_win = widget_is_fullscreen_window(iter);
}
start = i + 1;
break;
@ -400,7 +392,7 @@ static ret_t window_manager_simple_layout_child(widget_t* widget, widget_t* wind
}
if (widget_is_normal_window(window)) {
if (window_is_fullscreen(window)) {
if (widget_is_fullscreen_window(window)) {
x = 0;
y = 0;
w = widget->w;

View File

@ -35,6 +35,391 @@ TEST(Rect, contains) {
ASSERT_EQ(rect_contains(&r, 5, 240), FALSE);
}
static bool test_rect_eq(rect_t& r, int32_t x, int32_t y, int32_t w, int32_t h) {
return r.x == x && r.y == y && r.w == w && r.h == h;
}
TEST(Rect, diff) {
rect_t r1, r2, out_r1, out_r2, out_r3, out_r4;
r1 = rect_init(100, 100, 100, 100);
r2 = rect_init(125, 125, 50, 50);
ASSERT_EQ(rect_diff(&r1, &r2, &out_r1, &out_r2, &out_r3, &out_r4), TRUE);
ASSERT_EQ(test_rect_eq(out_r1, 100, 100, 100, 25), true);
ASSERT_EQ(test_rect_eq(out_r2, 100, 125, 25, 50), true);
ASSERT_EQ(test_rect_eq(out_r3, 175, 125, 25, 50), true);
ASSERT_EQ(test_rect_eq(out_r4, 100, 175, 100, 25), true);
r1 = rect_init(125, 125, 50, 50);
r2 = rect_init(100, 100, 100, 100);
ASSERT_EQ(rect_diff(&r1, &r2, &out_r1, &out_r2, &out_r3, &out_r4), FALSE);
ASSERT_EQ(test_rect_eq(out_r1, 0, 0, 0, 0), true);
ASSERT_EQ(test_rect_eq(out_r2, 0, 0, 0, 0), true);
ASSERT_EQ(test_rect_eq(out_r3, 0, 0, 0, 0), true);
ASSERT_EQ(test_rect_eq(out_r4, 0, 0, 0, 0), true);
r1 = rect_init(100, 100, 100, 100);
r2 = rect_init(100, 100, 100, 100);
ASSERT_EQ(rect_diff(&r1, &r2, &out_r1, &out_r2, &out_r3, &out_r4), FALSE);
ASSERT_EQ(test_rect_eq(out_r1, 0, 0, 0, 0), true);
ASSERT_EQ(test_rect_eq(out_r2, 0, 0, 0, 0), true);
ASSERT_EQ(test_rect_eq(out_r3, 0, 0, 0, 0), true);
ASSERT_EQ(test_rect_eq(out_r4, 0, 0, 0, 0), true);
r1 = rect_init(100, 100, 100, 100);
r2 = rect_init(50, 50, 50, 100);
ASSERT_EQ(rect_diff(&r1, &r2, &out_r1, &out_r2, &out_r3, &out_r4), TRUE);
ASSERT_EQ(test_rect_eq(out_r1, 100, 100, 100, 100), true);
ASSERT_EQ(test_rect_eq(out_r2, 0, 0, 0, 0), true);
ASSERT_EQ(test_rect_eq(out_r3, 0, 0, 0, 0), true);
ASSERT_EQ(test_rect_eq(out_r4, 0, 0, 0, 0), true);
r1 = rect_init(100, 100, 100, 100);
r2 = rect_init(50, 200, 50, 50);
ASSERT_EQ(rect_diff(&r1, &r2, &out_r1, &out_r2, &out_r3, &out_r4), TRUE);
ASSERT_EQ(test_rect_eq(out_r1, 100, 100, 100, 100), true);
ASSERT_EQ(test_rect_eq(out_r2, 0, 0, 0, 0), true);
ASSERT_EQ(test_rect_eq(out_r3, 0, 0, 0, 0), true);
ASSERT_EQ(test_rect_eq(out_r4, 0, 0, 0, 0), true);
r1 = rect_init(100, 100, 100, 100);
r2 = rect_init(200, 50, 50, 50);
ASSERT_EQ(rect_diff(&r1, &r2, &out_r1, &out_r2, &out_r3, &out_r4), TRUE);
ASSERT_EQ(test_rect_eq(out_r1, 100, 100, 100, 100), true);
ASSERT_EQ(test_rect_eq(out_r2, 0, 0, 0, 0), true);
ASSERT_EQ(test_rect_eq(out_r3, 0, 0, 0, 0), true);
ASSERT_EQ(test_rect_eq(out_r4, 0, 0, 0, 0), true);
r1 = rect_init(100, 100, 100, 100);
r2 = rect_init(50, 50, 100, 50);
ASSERT_EQ(rect_diff(&r1, &r2, &out_r1, &out_r2, &out_r3, &out_r4), TRUE);
ASSERT_EQ(test_rect_eq(out_r1, 100, 100, 100, 100), true);
ASSERT_EQ(test_rect_eq(out_r2, 0, 0, 0, 0), true);
ASSERT_EQ(test_rect_eq(out_r3, 0, 0, 0, 0), true);
ASSERT_EQ(test_rect_eq(out_r4, 0, 0, 0, 0), true);
/* r2 叠在 r1 的左上角 */
r1 = rect_init(100, 100, 100, 100);
r2 = rect_init(50, 50, 100, 100);
ASSERT_EQ(rect_diff(&r1, &r2, &out_r1, &out_r2, &out_r3, &out_r4), TRUE);
ASSERT_EQ(test_rect_eq(out_r1, 100, 100, 100, 0), true);
ASSERT_EQ(test_rect_eq(out_r2, 100, 100, 0, 50), true);
ASSERT_EQ(test_rect_eq(out_r3, 150, 100, 50, 50), true);
ASSERT_EQ(test_rect_eq(out_r4, 100, 150, 100, 50), true);
r1 = rect_init(100, 100, 100, 100);
r2 = rect_init(50, 50, 100, 210);
ASSERT_EQ(rect_diff(&r1, &r2, &out_r1, &out_r2, &out_r3, &out_r4), TRUE);
ASSERT_EQ(test_rect_eq(out_r1, 100, 100, 100, 0), true);
ASSERT_EQ(test_rect_eq(out_r2, 100, 100, 0, 100), true);
ASSERT_EQ(test_rect_eq(out_r3, 150, 100, 50, 100), true);
ASSERT_EQ(test_rect_eq(out_r4, 100, 200, 100, 0), true);
r1 = rect_init(100, 100, 100, 100);
r2 = rect_init(50, 50, 210, 100);
ASSERT_EQ(rect_diff(&r1, &r2, &out_r1, &out_r2, &out_r3, &out_r4), TRUE);
ASSERT_EQ(test_rect_eq(out_r1, 100, 100, 100, 0), true);
ASSERT_EQ(test_rect_eq(out_r2, 100, 100, 0, 50), true);
ASSERT_EQ(test_rect_eq(out_r3, 200, 100, 0, 50), true);
ASSERT_EQ(test_rect_eq(out_r4, 100, 150, 100, 50), true);
/* r2 叠在 r1 的左下角 */
r1 = rect_init(100, 100, 100, 100);
r2 = rect_init(50, 150, 100, 100);
ASSERT_EQ(rect_diff(&r1, &r2, &out_r1, &out_r2, &out_r3, &out_r4), TRUE);
ASSERT_EQ(test_rect_eq(out_r1, 100, 100, 100, 50), true);
ASSERT_EQ(test_rect_eq(out_r2, 100, 150, 0, 50), true);
ASSERT_EQ(test_rect_eq(out_r3, 150, 150, 50, 50), true);
ASSERT_EQ(test_rect_eq(out_r4, 100, 200, 100, 0), true);
r1 = rect_init(100, 100, 100, 100);
r2 = rect_init(50, 150, 100, 210);
ASSERT_EQ(rect_diff(&r1, &r2, &out_r1, &out_r2, &out_r3, &out_r4), TRUE);
ASSERT_EQ(test_rect_eq(out_r1, 100, 100, 100, 50), true);
ASSERT_EQ(test_rect_eq(out_r2, 100, 150, 0, 50), true);
ASSERT_EQ(test_rect_eq(out_r3, 150, 150, 50, 50), true);
ASSERT_EQ(test_rect_eq(out_r4, 100, 200, 100, 0), true);
r1 = rect_init(100, 100, 100, 100);
r2 = rect_init(50, 150, 210, 100);
ASSERT_EQ(rect_diff(&r1, &r2, &out_r1, &out_r2, &out_r3, &out_r4), TRUE);
ASSERT_EQ(test_rect_eq(out_r1, 100, 100, 100, 50), true);
ASSERT_EQ(test_rect_eq(out_r2, 100, 150, 0, 50), true);
ASSERT_EQ(test_rect_eq(out_r3, 200, 150, 0, 50), true);
ASSERT_EQ(test_rect_eq(out_r4, 100, 200, 100, 0), true);
/* r2 叠在 r1 的左中区域 */
r1 = rect_init(100, 100, 100, 100);
r2 = rect_init(50, 150, 100, 25);
ASSERT_EQ(rect_diff(&r1, &r2, &out_r1, &out_r2, &out_r3, &out_r4), TRUE);
ASSERT_EQ(test_rect_eq(out_r1, 100, 100, 100, 50), true);
ASSERT_EQ(test_rect_eq(out_r2, 100, 150, 0, 25), true);
ASSERT_EQ(test_rect_eq(out_r3, 150, 150, 50, 25), true);
ASSERT_EQ(test_rect_eq(out_r4, 100, 175, 100, 25), true);
r1 = rect_init(100, 100, 100, 100);
r2 = rect_init(50, 150, 300, 25);
ASSERT_EQ(rect_diff(&r1, &r2, &out_r1, &out_r2, &out_r3, &out_r4), TRUE);
ASSERT_EQ(test_rect_eq(out_r1, 100, 100, 100, 50), true);
ASSERT_EQ(test_rect_eq(out_r2, 100, 150, 0, 25), true);
ASSERT_EQ(test_rect_eq(out_r3, 200, 150, 0, 25), true);
ASSERT_EQ(test_rect_eq(out_r4, 100, 175, 100, 25), true);
r1 = rect_init(100, 100, 100, 100);
r2 = rect_init(50, 100, 100, 25);
ASSERT_EQ(rect_diff(&r1, &r2, &out_r1, &out_r2, &out_r3, &out_r4), TRUE);
ASSERT_EQ(test_rect_eq(out_r1, 100, 100, 100, 0), true);
ASSERT_EQ(test_rect_eq(out_r2, 100, 100, 0, 25), true);
ASSERT_EQ(test_rect_eq(out_r3, 150, 100, 50, 25), true);
ASSERT_EQ(test_rect_eq(out_r4, 100, 125, 100, 75), true);
r1 = rect_init(100, 100, 100, 100);
r2 = rect_init(50, 100, 200, 25);
ASSERT_EQ(rect_diff(&r1, &r2, &out_r1, &out_r2, &out_r3, &out_r4), TRUE);
ASSERT_EQ(test_rect_eq(out_r1, 100, 100, 100, 0), true);
ASSERT_EQ(test_rect_eq(out_r2, 100, 100, 0, 25), true);
ASSERT_EQ(test_rect_eq(out_r3, 200, 100, 0, 25), true);
ASSERT_EQ(test_rect_eq(out_r4, 100, 125, 100, 75), true);
r1 = rect_init(100, 100, 100, 100);
r2 = rect_init(50, 175, 100, 25);
ASSERT_EQ(rect_diff(&r1, &r2, &out_r1, &out_r2, &out_r3, &out_r4), TRUE);
ASSERT_EQ(test_rect_eq(out_r1, 100, 100, 100, 75), true);
ASSERT_EQ(test_rect_eq(out_r2, 100, 175, 0, 25), true);
ASSERT_EQ(test_rect_eq(out_r3, 150, 175, 50, 25), true);
ASSERT_EQ(test_rect_eq(out_r4, 100, 200, 100, 0), true);
r1 = rect_init(100, 100, 100, 100);
r2 = rect_init(50, 175, 200, 25);
ASSERT_EQ(rect_diff(&r1, &r2, &out_r1, &out_r2, &out_r3, &out_r4), TRUE);
ASSERT_EQ(test_rect_eq(out_r1, 100, 100, 100, 75), true);
ASSERT_EQ(test_rect_eq(out_r2, 100, 175, 0, 25), true);
ASSERT_EQ(test_rect_eq(out_r3, 200, 175, 0, 25), true);
ASSERT_EQ(test_rect_eq(out_r4, 100, 200, 100, 0), true);
/* r2 叠在 r1 的右上角 */
r1 = rect_init(100, 100, 100, 100);
r2 = rect_init(150, 50, 100, 100);
ASSERT_EQ(rect_diff(&r1, &r2, &out_r1, &out_r2, &out_r3, &out_r4), TRUE);
ASSERT_EQ(test_rect_eq(out_r1, 100, 100, 100, 0), true);
ASSERT_EQ(test_rect_eq(out_r2, 100, 100, 50, 50), true);
ASSERT_EQ(test_rect_eq(out_r3, 200, 100, 0, 50), true);
ASSERT_EQ(test_rect_eq(out_r4, 100, 150, 100, 50), true);
r1 = rect_init(100, 100, 100, 100);
r2 = rect_init(150, 50, 100, 210);
ASSERT_EQ(rect_diff(&r1, &r2, &out_r1, &out_r2, &out_r3, &out_r4), TRUE);
ASSERT_EQ(test_rect_eq(out_r1, 100, 100, 100, 0), true);
ASSERT_EQ(test_rect_eq(out_r2, 100, 100, 50, 100), true);
ASSERT_EQ(test_rect_eq(out_r3, 200, 100, 0, 100), true);
ASSERT_EQ(test_rect_eq(out_r4, 100, 200, 100, 0), true);
r1 = rect_init(100, 100, 100, 100);
r2 = rect_init(150, 50, 210, 100);
ASSERT_EQ(rect_diff(&r1, &r2, &out_r1, &out_r2, &out_r3, &out_r4), TRUE);
ASSERT_EQ(test_rect_eq(out_r1, 100, 100, 100, 0), true);
ASSERT_EQ(test_rect_eq(out_r2, 100, 100, 50, 50), true);
ASSERT_EQ(test_rect_eq(out_r3, 200, 100, 0, 50), true);
ASSERT_EQ(test_rect_eq(out_r4, 100, 150, 100, 50), true);
/* r2 叠在 r1 的上中区域 */
r1 = rect_init(100, 100, 100, 100);
r2 = rect_init(150, 50, 25, 100);
ASSERT_EQ(rect_diff(&r1, &r2, &out_r1, &out_r2, &out_r3, &out_r4), TRUE);
ASSERT_EQ(test_rect_eq(out_r1, 100, 100, 100, 0), true);
ASSERT_EQ(test_rect_eq(out_r2, 100, 100, 50, 50), true);
ASSERT_EQ(test_rect_eq(out_r3, 175, 100, 25, 50), true);
ASSERT_EQ(test_rect_eq(out_r4, 100, 150, 100, 50), true);
r1 = rect_init(100, 100, 100, 100);
r2 = rect_init(150, 50, 25, 300);
ASSERT_EQ(rect_diff(&r1, &r2, &out_r1, &out_r2, &out_r3, &out_r4), TRUE);
ASSERT_EQ(test_rect_eq(out_r1, 100, 100, 100, 0), true);
ASSERT_EQ(test_rect_eq(out_r2, 100, 100, 50, 100), true);
ASSERT_EQ(test_rect_eq(out_r3, 175, 100, 25, 100), true);
ASSERT_EQ(test_rect_eq(out_r4, 100, 200, 100, 0), true);
r1 = rect_init(100, 100, 100, 100);
r2 = rect_init(100, 50, 25, 100);
ASSERT_EQ(rect_diff(&r1, &r2, &out_r1, &out_r2, &out_r3, &out_r4), TRUE);
ASSERT_EQ(test_rect_eq(out_r1, 100, 100, 100, 0), true);
ASSERT_EQ(test_rect_eq(out_r2, 100, 100, 0, 50), true);
ASSERT_EQ(test_rect_eq(out_r3, 125, 100, 75, 50), true);
ASSERT_EQ(test_rect_eq(out_r4, 100, 150, 100, 50), true);
r1 = rect_init(100, 100, 100, 100);
r2 = rect_init(100, 50, 25, 300);
ASSERT_EQ(rect_diff(&r1, &r2, &out_r1, &out_r2, &out_r3, &out_r4), TRUE);
ASSERT_EQ(test_rect_eq(out_r1, 100, 100, 100, 0), true);
ASSERT_EQ(test_rect_eq(out_r2, 100, 100, 0, 100), true);
ASSERT_EQ(test_rect_eq(out_r3, 125, 100, 75, 100), true);
ASSERT_EQ(test_rect_eq(out_r4, 100, 200, 100, 0), true);
r1 = rect_init(100, 100, 100, 100);
r2 = rect_init(175, 50, 25, 100);
ASSERT_EQ(rect_diff(&r1, &r2, &out_r1, &out_r2, &out_r3, &out_r4), TRUE);
ASSERT_EQ(test_rect_eq(out_r1, 100, 100, 100, 0), true);
ASSERT_EQ(test_rect_eq(out_r2, 100, 100, 75, 50), true);
ASSERT_EQ(test_rect_eq(out_r3, 200, 100, 0, 50), true);
ASSERT_EQ(test_rect_eq(out_r4, 100, 150, 100, 50), true);
r1 = rect_init(100, 100, 100, 100);
r2 = rect_init(175, 50, 25, 300);
ASSERT_EQ(rect_diff(&r1, &r2, &out_r1, &out_r2, &out_r3, &out_r4), TRUE);
ASSERT_EQ(test_rect_eq(out_r1, 100, 100, 100, 0), true);
ASSERT_EQ(test_rect_eq(out_r2, 100, 100, 75, 100), true);
ASSERT_EQ(test_rect_eq(out_r3, 200, 100, 0, 100), true);
ASSERT_EQ(test_rect_eq(out_r4, 100, 200, 100, 0), true);
/* r2 叠在 r1 的右下角 */
r1 = rect_init(100, 100, 100, 100);
r2 = rect_init(150, 150, 100, 100);
ASSERT_EQ(rect_diff(&r1, &r2, &out_r1, &out_r2, &out_r3, &out_r4), TRUE);
ASSERT_EQ(test_rect_eq(out_r1, 100, 100, 100, 50), true);
ASSERT_EQ(test_rect_eq(out_r2, 100, 150, 50, 50), true);
ASSERT_EQ(test_rect_eq(out_r3, 200, 150, 0, 50), true);
ASSERT_EQ(test_rect_eq(out_r4, 100, 200, 100, 0), true);
r1 = rect_init(100, 100, 100, 100);
r2 = rect_init(150, 150, 100, 210);
ASSERT_EQ(rect_diff(&r1, &r2, &out_r1, &out_r2, &out_r3, &out_r4), TRUE);
ASSERT_EQ(test_rect_eq(out_r1, 100, 100, 100, 50), true);
ASSERT_EQ(test_rect_eq(out_r2, 100, 150, 50, 50), true);
ASSERT_EQ(test_rect_eq(out_r3, 200, 150, 0, 50), true);
ASSERT_EQ(test_rect_eq(out_r4, 100, 200, 100, 0), true);
r1 = rect_init(100, 100, 100, 100);
r2 = rect_init(150, 150, 210, 100);
ASSERT_EQ(rect_diff(&r1, &r2, &out_r1, &out_r2, &out_r3, &out_r4), TRUE);
ASSERT_EQ(test_rect_eq(out_r1, 100, 100, 100, 50), true);
ASSERT_EQ(test_rect_eq(out_r2, 100, 150, 50, 50), true);
ASSERT_EQ(test_rect_eq(out_r3, 200, 150, 0, 50), true);
ASSERT_EQ(test_rect_eq(out_r4, 100, 200, 100, 0), true);
/* r2 叠在 r1 的下中区域 */
r1 = rect_init(100, 100, 100, 100);
r2 = rect_init(150, 150, 25, 100);
ASSERT_EQ(rect_diff(&r1, &r2, &out_r1, &out_r2, &out_r3, &out_r4), TRUE);
ASSERT_EQ(test_rect_eq(out_r1, 100, 100, 100, 50), true);
ASSERT_EQ(test_rect_eq(out_r2, 100, 150, 50, 50), true);
ASSERT_EQ(test_rect_eq(out_r3, 175, 150, 25, 50), true);
ASSERT_EQ(test_rect_eq(out_r4, 100, 200, 100, 0), true);
r1 = rect_init(100, 100, 100, 100);
r2 = rect_init(150, 150, 25, 300);
ASSERT_EQ(rect_diff(&r1, &r2, &out_r1, &out_r2, &out_r3, &out_r4), TRUE);
ASSERT_EQ(test_rect_eq(out_r1, 100, 100, 100, 50), true);
ASSERT_EQ(test_rect_eq(out_r2, 100, 150, 50, 50), true);
ASSERT_EQ(test_rect_eq(out_r3, 175, 150, 25, 50), true);
ASSERT_EQ(test_rect_eq(out_r4, 100, 200, 100, 0), true);
r1 = rect_init(100, 100, 100, 100);
r2 = rect_init(100, 150, 25, 100);
ASSERT_EQ(rect_diff(&r1, &r2, &out_r1, &out_r2, &out_r3, &out_r4), TRUE);
ASSERT_EQ(test_rect_eq(out_r1, 100, 100, 100, 50), true);
ASSERT_EQ(test_rect_eq(out_r2, 100, 150, 0, 50), true);
ASSERT_EQ(test_rect_eq(out_r3, 125, 150, 75, 50), true);
ASSERT_EQ(test_rect_eq(out_r4, 100, 200, 100, 0), true);
r1 = rect_init(100, 100, 100, 100);
r2 = rect_init(100, 150, 25, 300);
ASSERT_EQ(rect_diff(&r1, &r2, &out_r1, &out_r2, &out_r3, &out_r4), TRUE);
ASSERT_EQ(test_rect_eq(out_r1, 100, 100, 100, 50), true);
ASSERT_EQ(test_rect_eq(out_r2, 100, 150, 0, 50), true);
ASSERT_EQ(test_rect_eq(out_r3, 125, 150, 75, 50), true);
ASSERT_EQ(test_rect_eq(out_r4, 100, 200, 100, 0), true);
r1 = rect_init(100, 100, 100, 100);
r2 = rect_init(175, 150, 25, 100);
ASSERT_EQ(rect_diff(&r1, &r2, &out_r1, &out_r2, &out_r3, &out_r4), TRUE);
ASSERT_EQ(test_rect_eq(out_r1, 100, 100, 100, 50), true);
ASSERT_EQ(test_rect_eq(out_r2, 100, 150, 75, 50), true);
ASSERT_EQ(test_rect_eq(out_r3, 200, 150, 0, 50), true);
ASSERT_EQ(test_rect_eq(out_r4, 100, 200, 100, 0), true);
r1 = rect_init(100, 100, 100, 100);
r2 = rect_init(175, 150, 25, 300);
ASSERT_EQ(rect_diff(&r1, &r2, &out_r1, &out_r2, &out_r3, &out_r4), TRUE);
ASSERT_EQ(test_rect_eq(out_r1, 100, 100, 100, 50), true);
ASSERT_EQ(test_rect_eq(out_r2, 100, 150, 75, 50), true);
ASSERT_EQ(test_rect_eq(out_r3, 200, 150, 0, 50), true);
ASSERT_EQ(test_rect_eq(out_r4, 100, 200, 100, 0), true);
/* r2 叠在 r1 的右中区域 */
r1 = rect_init(100, 100, 100, 100);
r2 = rect_init(150, 150, 100, 25);
ASSERT_EQ(rect_diff(&r1, &r2, &out_r1, &out_r2, &out_r3, &out_r4), TRUE);
ASSERT_EQ(test_rect_eq(out_r1, 100, 100, 100, 50), true);
ASSERT_EQ(test_rect_eq(out_r2, 100, 150, 50, 25), true);
ASSERT_EQ(test_rect_eq(out_r3, 200, 150, 0, 25), true);
ASSERT_EQ(test_rect_eq(out_r4, 100, 175, 100, 25), true);
r1 = rect_init(100, 100, 100, 100);
r2 = rect_init(150, 150, 300, 25);
ASSERT_EQ(rect_diff(&r1, &r2, &out_r1, &out_r2, &out_r3, &out_r4), TRUE);
ASSERT_EQ(test_rect_eq(out_r1, 100, 100, 100, 50), true);
ASSERT_EQ(test_rect_eq(out_r2, 100, 150, 50, 25), true);
ASSERT_EQ(test_rect_eq(out_r3, 200, 150, 0, 25), true);
ASSERT_EQ(test_rect_eq(out_r4, 100, 175, 100, 25), true);
r1 = rect_init(100, 100, 100, 100);
r2 = rect_init(150, 100, 100, 25);
ASSERT_EQ(rect_diff(&r1, &r2, &out_r1, &out_r2, &out_r3, &out_r4), TRUE);
ASSERT_EQ(test_rect_eq(out_r1, 100, 100, 100, 0), true);
ASSERT_EQ(test_rect_eq(out_r2, 100, 100, 50, 25), true);
ASSERT_EQ(test_rect_eq(out_r3, 200, 100, 0, 25), true);
ASSERT_EQ(test_rect_eq(out_r4, 100, 125, 100, 75), true);
r1 = rect_init(100, 100, 100, 100);
r2 = rect_init(150, 100, 300, 25);
ASSERT_EQ(rect_diff(&r1, &r2, &out_r1, &out_r2, &out_r3, &out_r4), TRUE);
ASSERT_EQ(test_rect_eq(out_r1, 100, 100, 100, 0), true);
ASSERT_EQ(test_rect_eq(out_r2, 100, 100, 50, 25), true);
ASSERT_EQ(test_rect_eq(out_r3, 200, 100, 0, 25), true);
ASSERT_EQ(test_rect_eq(out_r4, 100, 125, 100, 75), true);
}
TEST(Rect, intersect) {
rect_t r;
rect_t r1;

View File

@ -102,8 +102,8 @@ TEST(SList, tail_pop) {
ASSERT_EQ(TO_INT(slist_head_pop(s)), 0);
ASSERT_EQ(TO_INT(slist_tail_pop(s)), 3);
ASSERT_EQ(slist_head_pop(s) == NULL, TRUE);
ASSERT_EQ(slist_tail_pop(s) == NULL, TRUE);
ASSERT_EQ(slist_head_pop(s) == NULL, true);
ASSERT_EQ(slist_tail_pop(s) == NULL, true);
slist_deinit(s);
}
@ -114,20 +114,25 @@ TEST(SList, remove) {
slist_init(s, NULL, NULL);
ASSERT_EQ(slist_is_empty(s), TRUE);
ASSERT_EQ(slist_size(s), 0);
ASSERT_EQ(slist_append(s, TO_POINTER(1)), RET_OK);
ASSERT_EQ(slist_is_empty(s), FALSE);
ASSERT_EQ(TO_INT(slist_find(s, TO_POINTER(1))), 1);
ASSERT_EQ(slist_remove(s, TO_POINTER(1)), RET_OK);
ASSERT_EQ(slist_count(s, TO_POINTER(1)), 0);
ASSERT_EQ(slist_is_empty(s), TRUE);
ASSERT_EQ(slist_append(s, TO_POINTER(2)), RET_OK);
ASSERT_EQ(TO_INT(slist_find(s, TO_POINTER(2))), 2);
ASSERT_EQ(slist_is_empty(s), FALSE);
ASSERT_EQ(slist_remove(s, TO_POINTER(2)), RET_OK);
ASSERT_EQ(slist_count(s, TO_POINTER(2)), 0);
ASSERT_EQ(slist_is_empty(s), TRUE);
slist_deinit(s);
}
@ -161,6 +166,41 @@ TEST(SList, foreach) {
slist_deinit(s);
}
static ret_t remove_data(void* ctx, const void* data) {
char text[32];
string& str = *(string*)ctx;
int32_t n = (const char*)data - (const char*)NULL;
tk_snprintf(text, sizeof(text), "%d:", n);
str += text;
if (n % 2 == 0) {
return RET_OK;
} else {
return RET_REMOVE;
}
}
TEST(SList, foreach_ex) {
string log;
slist_t slist;
slist_t* s = &slist;
slist_init(s, NULL, NULL);
ASSERT_EQ(slist_size(s), 0);
ASSERT_EQ(slist_append(s, TO_POINTER(1)), RET_OK);
ASSERT_EQ(slist_append(s, TO_POINTER(2)), RET_OK);
ASSERT_EQ(slist_append(s, TO_POINTER(3)), RET_OK);
ASSERT_EQ(slist_append(s, TO_POINTER(4)), RET_OK);
log = "";
slist_foreach(s, remove_data, &log);
ASSERT_EQ(log, "1:2:3:4:");
log = "";
slist_foreach(s, visit_dump, &log);
ASSERT_EQ(log, "2:4:");
}
TEST(SList, insert) {
string log;
slist_t slist;