From c40bd8866ecc33d307fe0e183eb87d4f64b441b8 Mon Sep 17 00:00:00 2001 From: lixianjing Date: Sun, 16 Aug 2020 08:51:05 +0800 Subject: [PATCH] restruct dir for designer --- res/assets.inc | 8 +- res/assets/__assets_default.inc | 119 ++++++++++++++-------------- res/assets/default/raw/images/x2/0 | Bin 0 -> 718 bytes res/assets/default/raw/images/x3/0 | Bin 0 -> 718 bytes res/assets_default.inc | 120 +++++++++++++++-------------- 5 files changed, 128 insertions(+), 119 deletions(-) create mode 100644 res/assets/default/raw/images/x2/0 create mode 100644 res/assets/default/raw/images/x3/0 diff --git a/res/assets.inc b/res/assets.inc index 18026ffed..70c339acf 100644 --- a/res/assets.inc +++ b/res/assets.inc @@ -22,9 +22,9 @@ static ret_t assets_init_internal(const char* theme) { assets_manager_set_theme(am, theme); - if (tk_str_eq(theme, "default")) { + if (tk_str_eq(theme, "default")) { return assets_init_default(); - } else { + } else { log_debug("%s not support.\n", theme); return RET_NOT_IMPL; } @@ -42,11 +42,11 @@ static ret_t widget_set_theme_without_file_system(widget_t* widget, const char* font_manager_t* fm = widget_get_font_manager(widget); image_manager_t* imm = widget_get_image_manager(widget); assets_manager_t* am = widget_get_assets_manager(widget); + locale_info_t* locale_info = widget_get_locale_info(widget); return_value_if_fail(am != NULL && name != NULL, RET_BAD_PARAMS); return_value_if_fail(assets_has_theme(name), RET_BAD_PARAMS); - locale_info_t* locale_info = widget_get_locale_info(widget); font_manager_unload_all(fm); image_manager_unload_all(imm); assets_manager_clear_all(am); @@ -65,7 +65,7 @@ static ret_t widget_set_theme_without_file_system(widget_t* widget, const char* log_debug("theme changed: %s\n", name); return RET_OK; -#else /*WITH_FS_RES*/ +#else /*WITH_FS_RES*/ return RET_NOT_IMPL; #endif /*WITH_FS_RES*/ } diff --git a/res/assets/__assets_default.inc b/res/assets/__assets_default.inc index d3f28524e..f9f8dacc2 100644 --- a/res/assets/__assets_default.inc +++ b/res/assets/__assets_default.inc @@ -1,6 +1,32 @@ #include "awtk.h" #include "base/assets_manager.h" #ifndef WITH_FS_RES +#include "default/inc/strings/en_US.data" +#include "default/inc/strings/zh_CN.data" +#include "default/inc/styles/big_font.data" +#include "default/inc/styles/button.data" +#include "default/inc/styles/calibration.data" +#include "default/inc/styles/color.data" +#include "default/inc/styles/default.data" +#include "default/inc/styles/dialog.data" +#include "default/inc/styles/dialog_confirm.data" +#include "default/inc/styles/dialog_info.data" +#include "default/inc/styles/dialog_toast.data" +#include "default/inc/styles/dialog_warn.data" +#include "default/inc/styles/digit_clock.data" +#include "default/inc/styles/edit.data" +#include "default/inc/styles/file_browser.data" +#include "default/inc/styles/guage.data" +#include "default/inc/styles/keyboard.data" +#include "default/inc/styles/list_view_dynamic.data" +#include "default/inc/styles/slide_menu.data" +#include "default/inc/styles/system_bar.data" +#include "default/inc/styles/system_bar_bottom.data" +#include "default/inc/styles/tab_bottom.data" +#include "default/inc/styles/tab_bottom_compact.data" +#include "default/inc/styles/tab_list.data" +#include "default/inc/styles/tab_top.data" +#include "default/inc/styles/tab_top_compact.data" #include "default/inc/ui/animation.data" #include "default/inc/ui/animator.data" #include "default/inc/ui/auto_play.data" @@ -134,32 +160,6 @@ #include "default/inc/ui/time_clock.data" #include "default/inc/ui/vgcanvas.data" #include "default/inc/ui/vtranslate.data" -#include "default/inc/strings/en_US.data" -#include "default/inc/strings/zh_CN.data" -#include "default/inc/styles/big_font.data" -#include "default/inc/styles/button.data" -#include "default/inc/styles/calibration.data" -#include "default/inc/styles/color.data" -#include "default/inc/styles/default.data" -#include "default/inc/styles/dialog.data" -#include "default/inc/styles/dialog_confirm.data" -#include "default/inc/styles/dialog_info.data" -#include "default/inc/styles/dialog_toast.data" -#include "default/inc/styles/dialog_warn.data" -#include "default/inc/styles/digit_clock.data" -#include "default/inc/styles/edit.data" -#include "default/inc/styles/file_browser.data" -#include "default/inc/styles/guage.data" -#include "default/inc/styles/keyboard.data" -#include "default/inc/styles/list_view_dynamic.data" -#include "default/inc/styles/slide_menu.data" -#include "default/inc/styles/system_bar.data" -#include "default/inc/styles/system_bar_bottom.data" -#include "default/inc/styles/tab_bottom.data" -#include "default/inc/styles/tab_bottom_compact.data" -#include "default/inc/styles/tab_list.data" -#include "default/inc/styles/tab_top.data" -#include "default/inc/styles/tab_top_compact.data" #include "default/inc/xml/test.data" #include "default/inc/data/a_b_c_any.data" #include "default/inc/data/com_zlg_app_json.data" @@ -314,13 +314,14 @@ #include "default/inc/images/pointer_1.bsvg" #include "default/inc/images/pointer_4.bsvg" #endif /*WITH_VGCANVAS*/ -#if defined(WITH_TRUETYPE_FONT) +#ifdef WITH_TRUETYPE_FONT #include "default/inc/fonts/ap.res" #include "default/inc/fonts/default.res" #include "default/inc/fonts/default_full.res" #include "default/inc/fonts/trado.res" #else /*WITH_TRUETYPE_FONT*/ #endif /*WITH_TRUETYPE_FONT*/ +#include "default/inc/scripts/dummy.res" #endif /*WITH_FS_RES*/ ret_t assets_init_default(void) { @@ -330,6 +331,32 @@ ret_t assets_init_default(void) { assets_manager_preload(am, ASSET_TYPE_FONT, "default"); assets_manager_preload(am, ASSET_TYPE_STYLE, "default"); #else + assets_manager_add(am, strings_en_US); + assets_manager_add(am, strings_zh_CN); + assets_manager_add(am, style_big_font); + assets_manager_add(am, style_button); + assets_manager_add(am, style_calibration); + assets_manager_add(am, style_color); + assets_manager_add(am, style_default); + assets_manager_add(am, style_dialog); + assets_manager_add(am, style_dialog_confirm); + assets_manager_add(am, style_dialog_info); + assets_manager_add(am, style_dialog_toast); + assets_manager_add(am, style_dialog_warn); + assets_manager_add(am, style_digit_clock); + assets_manager_add(am, style_edit); + assets_manager_add(am, style_file_browser); + assets_manager_add(am, style_guage); + assets_manager_add(am, style_keyboard); + assets_manager_add(am, style_list_view_dynamic); + assets_manager_add(am, style_slide_menu); + assets_manager_add(am, style_system_bar); + assets_manager_add(am, style_system_bar_bottom); + assets_manager_add(am, style_tab_bottom); + assets_manager_add(am, style_tab_bottom_compact); + assets_manager_add(am, style_tab_list); + assets_manager_add(am, style_tab_top); + assets_manager_add(am, style_tab_top_compact); assets_manager_add(am, ui_animation); assets_manager_add(am, ui_animator); assets_manager_add(am, ui_auto_play); @@ -463,32 +490,6 @@ ret_t assets_init_default(void) { assets_manager_add(am, ui_time_clock); assets_manager_add(am, ui_vgcanvas); assets_manager_add(am, ui_vtranslate); - assets_manager_add(am, strings_en_US); - assets_manager_add(am, strings_zh_CN); - assets_manager_add(am, style_big_font); - assets_manager_add(am, style_button); - assets_manager_add(am, style_calibration); - assets_manager_add(am, style_color); - assets_manager_add(am, style_default); - assets_manager_add(am, style_dialog); - assets_manager_add(am, style_dialog_confirm); - assets_manager_add(am, style_dialog_info); - assets_manager_add(am, style_dialog_toast); - assets_manager_add(am, style_dialog_warn); - assets_manager_add(am, style_digit_clock); - assets_manager_add(am, style_edit); - assets_manager_add(am, style_file_browser); - assets_manager_add(am, style_guage); - assets_manager_add(am, style_keyboard); - assets_manager_add(am, style_list_view_dynamic); - assets_manager_add(am, style_slide_menu); - assets_manager_add(am, style_system_bar); - assets_manager_add(am, style_system_bar_bottom); - assets_manager_add(am, style_tab_bottom); - assets_manager_add(am, style_tab_bottom_compact); - assets_manager_add(am, style_tab_list); - assets_manager_add(am, style_tab_top); - assets_manager_add(am, style_tab_top_compact); assets_manager_add(am, xml_test); assets_manager_add(am, data_a_b_c_any); assets_manager_add(am, data_com_zlg_app_json); @@ -631,10 +632,6 @@ ret_t assets_init_default(void) { assets_manager_add(am, image_visible); assets_manager_add(am, image_warn); assets_manager_add(am, image_zh); - assets_manager_add(am, font_ap); - assets_manager_add(am, font_default); - assets_manager_add(am, font_default_full); - assets_manager_add(am, font_trado); #ifdef WITH_VGCANVAS assets_manager_add(am, image_ball); assets_manager_add(am, image_china); @@ -644,6 +641,14 @@ ret_t assets_init_default(void) { assets_manager_add(am, image_pointer_1); assets_manager_add(am, image_pointer_4); #endif /*WITH_VGCANVAS*/ +#ifdef WITH_TRUETYPE_FONT + assets_manager_add(am, font_ap); + assets_manager_add(am, font_default); + assets_manager_add(am, font_default_full); + assets_manager_add(am, font_trado); +#else /*WITH_TRUETYPE_FONT*/ +#endif /*WITH_TRUETYPE_FONT*/ + assets_manager_add(am, script_dummy); #endif tk_init_assets(); diff --git a/res/assets/default/raw/images/x2/0 b/res/assets/default/raw/images/x2/0 new file mode 100644 index 0000000000000000000000000000000000000000..132d9ca5ecde2bd3ccfe5579edd2032d3e57d825 GIT binary patch literal 718 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM3?#3wJbMaAv7|ftIx;Y9?C1WI$O_~uBzpw; zGB8xBF)%c=FfjZA3N^f7U???UV0e|lz+g3lfkC`r&aOZkpv2VxpAc6d&8qFl?v}yG zFTrB$&EI`mVCEwx`$R?~Z{F@RLNo7kr%Yz#6=76!wH0`dyglmG+?+SLEVl(n!;uYp_OJ~(_`2YX^ zO@5DeK##eV1o;I6X)1uDX^t*HV;GaX-Cf+ocl~?|vL>4nJa0`PlBg3pYpx9wA z@$_|Nf5a{+q99aS-IWCt>i2YU4AD5BoFJjqFtJl|wFS4fw6$3wpPycyoX(>?H8Fpf zB95@O?r2GTq_ilhppdapkJD4a-7Cs1j8E&_S=IFn;Y(L6S+j^sI6T5(PwnG{LopuCO5}0X634+^!EwLZHng<)V0?r68jUBZHX?_fh}HA$NgJQ!R0gC`m~yNwrEYN(E93Mh1o!x(4RDMy4T#Mpni~ rR)!YZ1{PKZ2DMkLolrF7=BH$)RpQpb)7ktFsDZ)L)z4*}Q$iB}a0tLw literal 0 HcmV?d00001 diff --git a/res/assets/default/raw/images/x3/0 b/res/assets/default/raw/images/x3/0 new file mode 100644 index 0000000000000000000000000000000000000000..132d9ca5ecde2bd3ccfe5579edd2032d3e57d825 GIT binary patch literal 718 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM3?#3wJbMaAv7|ftIx;Y9?C1WI$O_~uBzpw; zGB8xBF)%c=FfjZA3N^f7U???UV0e|lz+g3lfkC`r&aOZkpv2VxpAc6d&8qFl?v}yG zFTrB$&EI`mVCEwx`$R?~Z{F@RLNo7kr%Yz#6=76!wH0`dyglmG+?+SLEVl(n!;uYp_OJ~(_`2YX^ zO@5DeK##eV1o;I6X)1uDX^t*HV;GaX-Cf+ocl~?|vL>4nJa0`PlBg3pYpx9wA z@$_|Nf5a{+q99aS-IWCt>i2YU4AD5BoFJjqFtJl|wFS4fw6$3wpPycyoX(>?H8Fpf zB95@O?r2GTq_ilhppdapkJD4a-7Cs1j8E&_S=IFn;Y(L6S+j^sI6T5(PwnG{LopuCO5}0X634+^!EwLZHng<)V0?r68jUBZHX?_fh}HA$NgJQ!R0gC`m~yNwrEYN(E93Mh1o!x(4RDMy4T#Mpni~ rR)!YZ1{PKZ2DMkLolrF7=BH$)RpQpb)7ktFsDZ)L)z4*}Q$iB}a0tLw literal 0 HcmV?d00001 diff --git a/res/assets_default.inc b/res/assets_default.inc index aba8aefe9..c04aab1b1 100644 --- a/res/assets_default.inc +++ b/res/assets_default.inc @@ -1,6 +1,32 @@ #include "awtk.h" #include "base/assets_manager.h" #ifndef WITH_FS_RES +#include "assets/default/inc/strings/en_US.data" +#include "assets/default/inc/strings/zh_CN.data" +#include "assets/default/inc/styles/big_font.data" +#include "assets/default/inc/styles/button.data" +#include "assets/default/inc/styles/calibration.data" +#include "assets/default/inc/styles/color.data" +#include "assets/default/inc/styles/default.data" +#include "assets/default/inc/styles/dialog.data" +#include "assets/default/inc/styles/dialog_confirm.data" +#include "assets/default/inc/styles/dialog_info.data" +#include "assets/default/inc/styles/dialog_toast.data" +#include "assets/default/inc/styles/dialog_warn.data" +#include "assets/default/inc/styles/digit_clock.data" +#include "assets/default/inc/styles/edit.data" +#include "assets/default/inc/styles/file_browser.data" +#include "assets/default/inc/styles/guage.data" +#include "assets/default/inc/styles/keyboard.data" +#include "assets/default/inc/styles/list_view_dynamic.data" +#include "assets/default/inc/styles/slide_menu.data" +#include "assets/default/inc/styles/system_bar.data" +#include "assets/default/inc/styles/system_bar_bottom.data" +#include "assets/default/inc/styles/tab_bottom.data" +#include "assets/default/inc/styles/tab_bottom_compact.data" +#include "assets/default/inc/styles/tab_list.data" +#include "assets/default/inc/styles/tab_top.data" +#include "assets/default/inc/styles/tab_top_compact.data" #include "assets/default/inc/ui/animation.data" #include "assets/default/inc/ui/animator.data" #include "assets/default/inc/ui/auto_play.data" @@ -134,32 +160,6 @@ #include "assets/default/inc/ui/time_clock.data" #include "assets/default/inc/ui/vgcanvas.data" #include "assets/default/inc/ui/vtranslate.data" -#include "assets/default/inc/strings/en_US.data" -#include "assets/default/inc/strings/zh_CN.data" -#include "assets/default/inc/styles/big_font.data" -#include "assets/default/inc/styles/button.data" -#include "assets/default/inc/styles/calibration.data" -#include "assets/default/inc/styles/color.data" -#include "assets/default/inc/styles/default.data" -#include "assets/default/inc/styles/dialog.data" -#include "assets/default/inc/styles/dialog_confirm.data" -#include "assets/default/inc/styles/dialog_info.data" -#include "assets/default/inc/styles/dialog_toast.data" -#include "assets/default/inc/styles/dialog_warn.data" -#include "assets/default/inc/styles/digit_clock.data" -#include "assets/default/inc/styles/edit.data" -#include "assets/default/inc/styles/file_browser.data" -#include "assets/default/inc/styles/guage.data" -#include "assets/default/inc/styles/keyboard.data" -#include "assets/default/inc/styles/list_view_dynamic.data" -#include "assets/default/inc/styles/slide_menu.data" -#include "assets/default/inc/styles/system_bar.data" -#include "assets/default/inc/styles/system_bar_bottom.data" -#include "assets/default/inc/styles/tab_bottom.data" -#include "assets/default/inc/styles/tab_bottom_compact.data" -#include "assets/default/inc/styles/tab_list.data" -#include "assets/default/inc/styles/tab_top.data" -#include "assets/default/inc/styles/tab_top_compact.data" #include "assets/default/inc/xml/test.data" #include "assets/default/inc/data/a_b_c_any.data" #include "assets/default/inc/data/com_zlg_app_json.data" @@ -314,23 +314,49 @@ #include "assets/default/inc/images/pointer_1.bsvg" #include "assets/default/inc/images/pointer_4.bsvg" #endif /*WITH_VGCANVAS*/ -#if defined(WITH_TRUETYPE_FONT) +#ifdef WITH_TRUETYPE_FONT #include "assets/default/inc/fonts/ap.res" #include "assets/default/inc/fonts/default.res" #include "assets/default/inc/fonts/default_full.res" #include "assets/default/inc/fonts/trado.res" #else /*WITH_TRUETYPE_FONT*/ #endif /*WITH_TRUETYPE_FONT*/ +#include "assets/default/inc/scripts/dummy.res" #endif /*WITH_FS_RES*/ ret_t assets_init(void) { assets_manager_t* am = assets_manager(); - assets_manager_set_theme(am, "default"); #ifdef WITH_FS_RES assets_manager_preload(am, ASSET_TYPE_FONT, "default"); assets_manager_preload(am, ASSET_TYPE_STYLE, "default"); #else + assets_manager_add(am, strings_en_US); + assets_manager_add(am, strings_zh_CN); + assets_manager_add(am, style_big_font); + assets_manager_add(am, style_button); + assets_manager_add(am, style_calibration); + assets_manager_add(am, style_color); + assets_manager_add(am, style_default); + assets_manager_add(am, style_dialog); + assets_manager_add(am, style_dialog_confirm); + assets_manager_add(am, style_dialog_info); + assets_manager_add(am, style_dialog_toast); + assets_manager_add(am, style_dialog_warn); + assets_manager_add(am, style_digit_clock); + assets_manager_add(am, style_edit); + assets_manager_add(am, style_file_browser); + assets_manager_add(am, style_guage); + assets_manager_add(am, style_keyboard); + assets_manager_add(am, style_list_view_dynamic); + assets_manager_add(am, style_slide_menu); + assets_manager_add(am, style_system_bar); + assets_manager_add(am, style_system_bar_bottom); + assets_manager_add(am, style_tab_bottom); + assets_manager_add(am, style_tab_bottom_compact); + assets_manager_add(am, style_tab_list); + assets_manager_add(am, style_tab_top); + assets_manager_add(am, style_tab_top_compact); assets_manager_add(am, ui_animation); assets_manager_add(am, ui_animator); assets_manager_add(am, ui_auto_play); @@ -464,32 +490,6 @@ ret_t assets_init(void) { assets_manager_add(am, ui_time_clock); assets_manager_add(am, ui_vgcanvas); assets_manager_add(am, ui_vtranslate); - assets_manager_add(am, strings_en_US); - assets_manager_add(am, strings_zh_CN); - assets_manager_add(am, style_big_font); - assets_manager_add(am, style_button); - assets_manager_add(am, style_calibration); - assets_manager_add(am, style_color); - assets_manager_add(am, style_default); - assets_manager_add(am, style_dialog); - assets_manager_add(am, style_dialog_confirm); - assets_manager_add(am, style_dialog_info); - assets_manager_add(am, style_dialog_toast); - assets_manager_add(am, style_dialog_warn); - assets_manager_add(am, style_digit_clock); - assets_manager_add(am, style_edit); - assets_manager_add(am, style_file_browser); - assets_manager_add(am, style_guage); - assets_manager_add(am, style_keyboard); - assets_manager_add(am, style_list_view_dynamic); - assets_manager_add(am, style_slide_menu); - assets_manager_add(am, style_system_bar); - assets_manager_add(am, style_system_bar_bottom); - assets_manager_add(am, style_tab_bottom); - assets_manager_add(am, style_tab_bottom_compact); - assets_manager_add(am, style_tab_list); - assets_manager_add(am, style_tab_top); - assets_manager_add(am, style_tab_top_compact); assets_manager_add(am, xml_test); assets_manager_add(am, data_a_b_c_any); assets_manager_add(am, data_com_zlg_app_json); @@ -632,10 +632,6 @@ ret_t assets_init(void) { assets_manager_add(am, image_visible); assets_manager_add(am, image_warn); assets_manager_add(am, image_zh); - assets_manager_add(am, font_ap); - assets_manager_add(am, font_default); - assets_manager_add(am, font_default_full); - assets_manager_add(am, font_trado); #ifdef WITH_VGCANVAS assets_manager_add(am, image_ball); assets_manager_add(am, image_china); @@ -645,6 +641,14 @@ ret_t assets_init(void) { assets_manager_add(am, image_pointer_1); assets_manager_add(am, image_pointer_4); #endif /*WITH_VGCANVAS*/ +#ifdef WITH_TRUETYPE_FONT + assets_manager_add(am, font_ap); + assets_manager_add(am, font_default); + assets_manager_add(am, font_default_full); + assets_manager_add(am, font_trado); +#else /*WITH_TRUETYPE_FONT*/ +#endif /*WITH_TRUETYPE_FONT*/ + assets_manager_add(am, script_dummy); #endif tk_init_assets();