awtk-web support multi theme

This commit is contained in:
lixianjing 2021-09-29 17:42:33 +08:00
parent 8160ec3860
commit ebe68841df
9 changed files with 250 additions and 164 deletions

View File

@ -1,6 +1,6 @@
#include "awtk.h"
#ifdef AWTK_WEB
#include "assets.inc"
#include "assets_web.inc"
#else /*AWTK_WEB*/
#include "../res/assets.inc"
#endif /*AWTK_WEB*/

View File

@ -1,6 +1,6 @@
#include "awtk.h"
#ifdef AWTK_WEB
#include "assets.inc"
#include "assets_web.inc"
#else /*AWTK_WEB*/
#include "../res/assets_all.inc"
#endif /*AWTK_WEB*/

View File

@ -1,6 +1,6 @@
#include "awtk.h"
#ifdef AWTK_WEB
#include "assets.inc"
#include "assets_web.inc"
#else /*AWTK_WEB*/
#include "../res/assets_old.inc"
#endif /*AWTK_WEB*/

View File

@ -2,6 +2,7 @@
2021/09/29
* 修改OpenGL宏感谢智明提供补丁
* AWTK-WEB支持多主题感谢兆坤提供补丁
2021/09/28
* 修复控件使用圆角矩形后半透明的问题(感谢智明提供补丁)

View File

@ -1,5 +1,5 @@
TK_CONST_DATA_ALIGN(const unsigned char ui_test_fscript[]) = {
0x04,0x00,0x01,0x01,0xd7,0x13,0x00,0x00,0x00,0x00,0x00,0x00,0x74,0x65,0x73,0x74,0x5f,0x66,0x73,0x63,
0x04,0x00,0x01,0x01,0x8d,0x13,0x00,0x00,0x00,0x00,0x00,0x00,0x74,0x65,0x73,0x74,0x5f,0x66,0x73,0x63,
0x72,0x69,0x70,0x74,0x00,0x00,0x00,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,
@ -127,132 +127,128 @@ TK_CONST_DATA_ALIGN(const unsigned char ui_test_fscript[]) = {
0x62,0x6c,0x65,0x00,0x74,0x72,0x75,0x65,0x00,0x74,0x65,0x78,0x74,0x00,0x49,0x6e,0x63,0x00,0x6f,0x6e,
0x3a,0x63,0x6c,0x69,0x63,0x6b,0x00,0x61,0x20,0x3d,0x20,0x77,0x69,0x64,0x67,0x65,0x74,0x5f,0x6c,0x6f,
0x6f,0x6b,0x75,0x70,0x28,0x27,0x77,0x69,0x6e,0x64,0x6f,0x77,0x27,0x2c,0x20,0x27,0x62,0x61,0x72,0x27,
0x2c,0x20,0x74,0x72,0x75,0x65,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x62,0x20,0x3d,0x20,
0x77,0x69,0x64,0x67,0x65,0x74,0x5f,0x67,0x65,0x74,0x28,0x61,0x2c,0x20,0x27,0x76,0x61,0x6c,0x75,0x65,
0x27,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x28,0x62,0x20,0x3c,0x3d,0x20,0x39,
0x30,0x29,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x77,0x69,0x64,0x67,0x65,
0x74,0x5f,0x73,0x65,0x74,0x28,0x61,0x2c,0x20,0x27,0x76,0x61,0x6c,0x75,0x65,0x27,0x2c,0x20,0x62,0x20,
0x2b,0x20,0x31,0x30,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,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,0x66,0x6f,0x63,0x75,0x73,0x61,0x62,0x6c,0x65,0x00,0x74,0x72,0x75,0x65,
0x00,0x74,0x65,0x78,0x74,0x00,0x44,0x65,0x63,0x00,0x6f,0x6e,0x3a,0x63,0x6c,0x69,0x63,0x6b,0x00,0x61,
0x20,0x3d,0x20,0x77,0x69,0x64,0x67,0x65,0x74,0x5f,0x6c,0x6f,0x6f,0x6b,0x75,0x70,0x28,0x27,0x77,0x69,
0x6e,0x64,0x6f,0x77,0x27,0x2c,0x20,0x27,0x62,0x61,0x72,0x27,0x2c,0x20,0x74,0x72,0x75,0x65,0x29,0x0a,
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x62,0x20,0x3d,0x20,0x77,0x69,0x64,0x67,0x65,0x74,0x5f,0x67,
0x65,0x74,0x28,0x61,0x2c,0x20,0x27,0x76,0x61,0x6c,0x75,0x65,0x27,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,
0x20,0x20,0x20,0x69,0x66,0x28,0x62,0x20,0x3e,0x3d,0x20,0x31,0x30,0x29,0x20,0x7b,0x0a,0x20,0x20,0x20,
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x77,0x69,0x64,0x67,0x65,0x74,0x5f,0x73,0x65,0x74,0x28,0x61,0x2c,
0x20,0x27,0x76,0x61,0x6c,0x75,0x65,0x27,0x2c,0x20,0x62,0x20,0x2d,0x20,0x31,0x30,0x29,0x0a,0x20,0x20,
0x20,0x20,0x20,0x20,0x20,0x20,0x7d,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,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,0x76,0x69,0x65,0x77,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,0x63,0x3d,0x32,0x2c,
0x72,0x3d,0x31,0x2c,0x6d,0x3d,0x32,0x2c,0x73,0x3d,0x32,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,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x66,0x6f,0x63,0x75,0x73,0x61,0x62,0x6c,0x65,0x00,0x74,0x72,0x75,0x65,0x00,0x74,0x65,0x78,
0x74,0x00,0x43,0x72,0x65,0x61,0x74,0x65,0x00,0x6f,0x6e,0x3a,0x63,0x6c,0x69,0x63,0x6b,0x00,0x61,0x20,
0x3d,0x20,0x77,0x69,0x64,0x67,0x65,0x74,0x5f,0x6c,0x6f,0x6f,0x6b,0x75,0x70,0x28,0x27,0x77,0x69,0x6e,
0x64,0x6f,0x77,0x27,0x2c,0x20,0x27,0x66,0x6f,0x6f,0x62,0x61,0x72,0x27,0x2c,0x20,0x74,0x72,0x75,0x65,
0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x28,0x76,0x61,0x6c,0x75,0x65,0x5f,0x69,
0x73,0x5f,0x6e,0x75,0x6c,0x6c,0x28,0x61,0x29,0x29,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
0x20,0x20,0x20,0x61,0x20,0x3d,0x20,0x77,0x69,0x64,0x67,0x65,0x74,0x5f,0x63,0x72,0x65,0x61,0x74,0x65,
0x28,0x27,0x6c,0x61,0x62,0x65,0x6c,0x27,0x2c,0x20,0x27,0x77,0x69,0x6e,0x64,0x6f,0x77,0x2e,0x76,0x69,
0x65,0x77,0x27,0x2c,0x20,0x30,0x2c,0x20,0x30,0x2c,0x20,0x30,0x2c,0x20,0x30,0x29,0x0a,0x20,0x20,0x20,
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x61,0x73,0x73,0x65,0x72,0x74,0x28,0x21,0x76,0x61,0x6c,0x75,0x65,
0x5f,0x69,0x73,0x5f,0x6e,0x75,0x6c,0x6c,0x28,0x61,0x29,0x29,0x0a,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,
0x20,0x20,0x20,0x20,0x77,0x69,0x64,0x67,0x65,0x74,0x5f,0x73,0x65,0x74,0x28,0x61,0x2c,0x20,0x27,0x74,
0x65,0x78,0x74,0x27,0x2c,0x20,0x27,0x44,0x79,0x6e,0x61,0x6d,0x69,0x63,0x20,0x63,0x72,0x65,0x61,0x74,
0x65,0x64,0x27,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x61,0x73,0x73,0x65,0x72,
0x74,0x28,0x77,0x69,0x64,0x67,0x65,0x74,0x5f,0x67,0x65,0x74,0x28,0x61,0x2c,0x20,0x27,0x74,0x65,0x78,
0x74,0x27,0x29,0x20,0x3d,0x3d,0x20,0x27,0x44,0x79,0x6e,0x61,0x6d,0x69,0x63,0x20,0x63,0x72,0x65,0x61,
0x74,0x65,0x64,0x27,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x77,0x69,0x64,0x67,
0x65,0x74,0x5f,0x73,0x65,0x74,0x28,0x61,0x2c,0x20,0x27,0x6e,0x61,0x6d,0x65,0x27,0x2c,0x20,0x27,0x66,
0x6f,0x6f,0x62,0x61,0x72,0x27,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x61,0x73,
0x73,0x65,0x72,0x74,0x28,0x77,0x69,0x64,0x67,0x65,0x74,0x5f,0x67,0x65,0x74,0x28,0x61,0x2c,0x20,0x27,
0x6e,0x61,0x6d,0x65,0x27,0x29,0x20,0x3d,0x3d,0x20,0x27,0x66,0x6f,0x6f,0x62,0x61,0x72,0x27,0x29,0x0a,
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x20,0x65,0x6c,0x73,0x65,0x20,0x7b,0x0a,0x20,0x20,0x20,
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x70,0x72,0x69,0x6e,0x74,0x28,0x22,0x66,0x6f,0x6f,0x62,0x61,0x72,
0x20,0x65,0x78,0x69,0x73,0x74,0x22,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,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,0x66,0x6f,0x63,0x75,0x73,0x61,0x62,0x6c,0x65,0x00,
0x74,0x72,0x75,0x65,0x00,0x74,0x65,0x78,0x74,0x00,0x44,0x65,0x73,0x74,0x72,0x6f,0x79,0x00,0x6f,0x6e,
0x3a,0x63,0x6c,0x69,0x63,0x6b,0x00,0x61,0x20,0x3d,0x20,0x77,0x69,0x64,0x67,0x65,0x74,0x5f,0x6c,0x6f,
0x6f,0x6b,0x75,0x70,0x28,0x27,0x77,0x69,0x6e,0x64,0x6f,0x77,0x27,0x2c,0x20,0x27,0x66,0x6f,0x6f,0x62,
0x61,0x72,0x27,0x2c,0x20,0x74,0x72,0x75,0x65,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,
0x66,0x28,0x21,0x76,0x61,0x6c,0x75,0x65,0x5f,0x69,0x73,0x5f,0x6e,0x75,0x6c,0x6c,0x28,0x61,0x29,0x29,
0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x77,0x69,0x64,0x67,0x65,0x74,0x5f,
0x64,0x65,0x73,0x74,0x72,0x6f,0x79,0x28,0x61,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,
0x20,0x65,0x6c,0x73,0x65,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x70,0x72,
0x69,0x6e,0x74,0x28,0x27,0x6e,0x6f,0x74,0x20,0x66,0x6f,0x75,0x6e,0x64,0x20,0x66,0x6f,0x6f,0x62,0x61,
0x72,0x27,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,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,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,0x76,0x69,0x65,0x77,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,0x63,0x3d,0x32,0x2c,0x72,0x3d,0x31,0x2c,0x6d,0x3d,0x32,0x2c,0x73,0x3d,0x32,0x29,0x00,
0x2c,0x20,0x74,0x72,0x75,0x65,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x28,0x61,
0x2e,0x76,0x61,0x6c,0x75,0x65,0x20,0x3c,0x3d,0x20,0x39,0x30,0x29,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,
0x20,0x20,0x20,0x20,0x20,0x20,0x61,0x2e,0x76,0x61,0x6c,0x75,0x65,0x20,0x3d,0x20,0x61,0x2e,0x76,0x61,
0x6c,0x75,0x65,0x20,0x2b,0x20,0x31,0x30,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,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,0x66,0x6f,0x63,0x75,0x73,0x61,0x62,0x6c,0x65,0x00,0x74,
0x72,0x75,0x65,0x00,0x6f,0x6e,0x3a,0x63,0x6c,0x69,0x63,0x6b,0x00,0x63,0x6c,0x6f,0x73,0x65,0x28,0x29,
0x00,0x74,0x65,0x78,0x74,0x00,0x43,0x6c,0x6f,0x73,0x65,0x00,0x00,0x00,0x62,0x75,0x74,0x74,0x6f,0x6e,
0x72,0x75,0x65,0x00,0x74,0x65,0x78,0x74,0x00,0x44,0x65,0x63,0x00,0x6f,0x6e,0x3a,0x63,0x6c,0x69,0x63,
0x6b,0x00,0x61,0x20,0x3d,0x20,0x77,0x69,0x64,0x67,0x65,0x74,0x5f,0x6c,0x6f,0x6f,0x6b,0x75,0x70,0x28,
0x27,0x77,0x69,0x6e,0x64,0x6f,0x77,0x27,0x2c,0x20,0x27,0x62,0x61,0x72,0x27,0x2c,0x20,0x74,0x72,0x75,
0x65,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x28,0x61,0x2e,0x76,0x61,0x6c,0x75,
0x65,0x20,0x3e,0x3d,0x20,0x31,0x30,0x29,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
0x20,0x61,0x2e,0x76,0x61,0x6c,0x75,0x65,0x20,0x3d,0x20,0x61,0x2e,0x76,0x61,0x6c,0x75,0x65,0x20,0x2d,
0x20,0x31,0x30,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,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,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,0x76,0x69,0x65,0x77,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,0x63,0x3d,0x32,0x2c,0x72,0x3d,0x31,0x2c,0x6d,0x3d,0x32,0x2c,0x73,0x3d,0x32,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,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x66,0x6f,0x63,0x75,0x73,0x61,0x62,0x6c,0x65,0x00,0x74,0x72,
0x75,0x65,0x00,0x74,0x65,0x78,0x74,0x00,0x43,0x72,0x65,0x61,0x74,0x65,0x00,0x6f,0x6e,0x3a,0x63,0x6c,
0x69,0x63,0x6b,0x00,0x61,0x20,0x3d,0x20,0x77,0x69,0x64,0x67,0x65,0x74,0x5f,0x6c,0x6f,0x6f,0x6b,0x75,
0x70,0x28,0x27,0x77,0x69,0x6e,0x64,0x6f,0x77,0x27,0x2c,0x20,0x27,0x66,0x6f,0x6f,0x62,0x61,0x72,0x27,
0x2c,0x20,0x74,0x72,0x75,0x65,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x28,0x76,
0x61,0x6c,0x75,0x65,0x5f,0x69,0x73,0x5f,0x6e,0x75,0x6c,0x6c,0x28,0x61,0x29,0x29,0x20,0x7b,0x0a,0x20,
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x61,0x20,0x3d,0x20,0x77,0x69,0x64,0x67,0x65,0x74,0x5f,
0x63,0x72,0x65,0x61,0x74,0x65,0x28,0x27,0x6c,0x61,0x62,0x65,0x6c,0x27,0x2c,0x20,0x27,0x77,0x69,0x6e,
0x64,0x6f,0x77,0x2e,0x76,0x69,0x65,0x77,0x27,0x2c,0x20,0x30,0x2c,0x20,0x30,0x2c,0x20,0x30,0x2c,0x20,
0x30,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x61,0x73,0x73,0x65,0x72,0x74,0x28,
0x21,0x76,0x61,0x6c,0x75,0x65,0x5f,0x69,0x73,0x5f,0x6e,0x75,0x6c,0x6c,0x28,0x61,0x29,0x29,0x0a,0x0a,
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x77,0x69,0x64,0x67,0x65,0x74,0x5f,0x73,0x65,0x74,
0x28,0x61,0x2c,0x20,0x27,0x74,0x65,0x78,0x74,0x27,0x2c,0x20,0x27,0x44,0x79,0x6e,0x61,0x6d,0x69,0x63,
0x20,0x63,0x72,0x65,0x61,0x74,0x65,0x64,0x27,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
0x20,0x61,0x73,0x73,0x65,0x72,0x74,0x28,0x77,0x69,0x64,0x67,0x65,0x74,0x5f,0x67,0x65,0x74,0x28,0x61,
0x2c,0x20,0x27,0x74,0x65,0x78,0x74,0x27,0x29,0x20,0x3d,0x3d,0x20,0x27,0x44,0x79,0x6e,0x61,0x6d,0x69,
0x63,0x20,0x63,0x72,0x65,0x61,0x74,0x65,0x64,0x27,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
0x20,0x20,0x77,0x69,0x64,0x67,0x65,0x74,0x5f,0x73,0x65,0x74,0x28,0x61,0x2c,0x20,0x27,0x6e,0x61,0x6d,
0x65,0x27,0x2c,0x20,0x27,0x66,0x6f,0x6f,0x62,0x61,0x72,0x27,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,
0x20,0x20,0x20,0x20,0x61,0x73,0x73,0x65,0x72,0x74,0x28,0x77,0x69,0x64,0x67,0x65,0x74,0x5f,0x67,0x65,
0x74,0x28,0x61,0x2c,0x20,0x27,0x6e,0x61,0x6d,0x65,0x27,0x29,0x20,0x3d,0x3d,0x20,0x27,0x66,0x6f,0x6f,
0x62,0x61,0x72,0x27,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x20,0x65,0x6c,0x73,0x65,
0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x70,0x72,0x69,0x6e,0x74,0x28,0x22,
0x66,0x6f,0x6f,0x62,0x61,0x72,0x20,0x65,0x78,0x69,0x73,0x74,0x22,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,
0x20,0x20,0x20,0x20,0x7d,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,0x66,0x6f,0x63,0x75,0x73,0x61,0x62,0x6c,0x65,0x00,0x74,0x72,0x75,0x65,0x00,0x6f,0x6e,0x3a,
0x63,0x6c,0x69,0x63,0x6b,0x00,0x71,0x75,0x69,0x74,0x28,0x29,0x00,0x74,0x65,0x78,0x74,0x00,0x51,0x75,
0x69,0x74,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,0x66,0x6f,0x63,0x75,
0x73,0x61,0x62,0x6c,0x65,0x00,0x74,0x72,0x75,0x65,0x00,0x74,0x65,0x78,0x74,0x00,0x44,0x65,0x73,0x74,
0x72,0x6f,0x79,0x00,0x6f,0x6e,0x3a,0x63,0x6c,0x69,0x63,0x6b,0x00,0x61,0x20,0x3d,0x20,0x77,0x69,0x64,
0x67,0x65,0x74,0x5f,0x6c,0x6f,0x6f,0x6b,0x75,0x70,0x28,0x27,0x77,0x69,0x6e,0x64,0x6f,0x77,0x27,0x2c,
0x20,0x27,0x66,0x6f,0x6f,0x62,0x61,0x72,0x27,0x2c,0x20,0x74,0x72,0x75,0x65,0x29,0x0a,0x20,0x20,0x20,
0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x28,0x21,0x76,0x61,0x6c,0x75,0x65,0x5f,0x69,0x73,0x5f,0x6e,0x75,
0x6c,0x6c,0x28,0x61,0x29,0x29,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x77,
0x69,0x64,0x67,0x65,0x74,0x5f,0x64,0x65,0x73,0x74,0x72,0x6f,0x79,0x28,0x61,0x29,0x0a,0x20,0x20,0x20,
0x20,0x20,0x20,0x20,0x20,0x7d,0x20,0x65,0x6c,0x73,0x65,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,
0x20,0x20,0x20,0x20,0x70,0x72,0x69,0x6e,0x74,0x28,0x27,0x6e,0x6f,0x74,0x20,0x66,0x6f,0x75,0x6e,0x64,
0x20,0x66,0x6f,0x6f,0x62,0x61,0x72,0x27,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,
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,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,0x76,0x69,0x65,0x77,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,0x63,0x3d,0x32,0x2c,0x72,0x3d,0x31,0x2c,0x6d,
0x3d,0x32,0x2c,0x73,0x3d,0x32,0x29,0x00,0x00,0x62,0x75,0x74,0x74,0x6f,0x6e,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,
0x76,0x69,0x65,0x77,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,0x63,0x3d,0x32,0x2c,0x72,0x3d,0x31,0x2c,0x6d,0x3d,0x32,
0x2c,0x73,0x3d,0x32,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,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x6e,0x61,0x6d,
0x65,0x00,0x74,0x69,0x6d,0x65,0x72,0x00,0x66,0x6f,0x63,0x75,0x73,0x61,0x62,0x6c,0x65,0x00,0x74,0x72,
0x75,0x65,0x00,0x6f,0x6e,0x3a,0x63,0x6c,0x69,0x63,0x6b,0x00,0x73,0x74,0x61,0x72,0x74,0x5f,0x74,0x69,
0x6d,0x65,0x72,0x28,0x31,0x30,0x30,0x29,0x00,0x74,0x65,0x78,0x74,0x00,0x53,0x74,0x61,0x72,0x74,0x20,
0x54,0x69,0x6d,0x65,0x72,0x00,0x6f,0x6e,0x3a,0x74,0x69,0x6d,0x65,0x72,0x00,0x61,0x20,0x3d,0x20,0x77,
0x69,0x64,0x67,0x65,0x74,0x5f,0x6c,0x6f,0x6f,0x6b,0x75,0x70,0x28,0x27,0x77,0x69,0x6e,0x64,0x6f,0x77,
0x27,0x2c,0x20,0x27,0x62,0x61,0x72,0x27,0x2c,0x20,0x74,0x72,0x75,0x65,0x29,0x0a,0x20,0x20,0x20,0x20,
0x20,0x20,0x20,0x20,0x62,0x20,0x3d,0x20,0x77,0x69,0x64,0x67,0x65,0x74,0x5f,0x67,0x65,0x74,0x28,0x61,
0x2c,0x20,0x27,0x76,0x61,0x6c,0x75,0x65,0x27,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,
0x66,0x28,0x62,0x20,0x3c,0x20,0x31,0x30,0x30,0x29,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
0x20,0x20,0x20,0x77,0x69,0x64,0x67,0x65,0x74,0x5f,0x73,0x65,0x74,0x28,0x61,0x2c,0x20,0x27,0x76,0x61,
0x6c,0x75,0x65,0x27,0x2c,0x20,0x62,0x20,0x2b,0x20,0x31,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
0x20,0x7d,0x20,0x65,0x6c,0x73,0x65,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
0x77,0x69,0x64,0x67,0x65,0x74,0x5f,0x73,0x65,0x74,0x28,0x61,0x2c,0x20,0x27,0x76,0x61,0x6c,0x75,0x65,
0x27,0x2c,0x20,0x30,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x73,0x74,0x6f,0x70,
0x5f,0x74,0x69,0x6d,0x65,0x72,0x28,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,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,0x66,0x6f,0x63,0x75,0x73,
0x61,0x62,0x6c,0x65,0x00,0x74,0x72,0x75,0x65,0x00,0x6f,0x6e,0x3a,0x63,0x6c,0x69,0x63,0x6b,0x00,0x63,
0x6c,0x6f,0x73,0x65,0x28,0x29,0x00,0x74,0x65,0x78,0x74,0x00,0x43,0x6c,0x6f,0x73,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,0x66,0x6f,0x63,0x75,0x73,0x61,0x62,0x6c,0x65,0x00,0x74,
0x72,0x75,0x65,0x00,0x6f,0x6e,0x3a,0x63,0x6c,0x69,0x63,0x6b,0x00,0x73,0x74,0x6f,0x70,0x5f,0x74,0x69,
0x6d,0x65,0x72,0x28,0x27,0x70,0x61,0x72,0x65,0x6e,0x74,0x2e,0x74,0x69,0x6d,0x65,0x72,0x27,0x29,0x00,
0x74,0x65,0x78,0x74,0x00,0x53,0x74,0x6f,0x70,0x20,0x54,0x69,0x6d,0x65,0x72,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,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,0x76,0x69,0x65,0x77,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,0x63,0x3d,0x32,0x2c,0x72,0x3d,0x31,0x2c,0x6d,0x3d,0x32,0x2c,0x73,0x3d,0x32,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,0x66,0x6f,0x63,0x75,0x73,0x61,0x62,0x6c,0x65,0x00,0x74,0x72,
0x75,0x65,0x00,0x6f,0x6e,0x3a,0x63,0x6c,0x69,0x63,0x6b,0x00,0x71,0x75,0x69,0x74,0x28,0x29,0x00,0x74,
0x65,0x78,0x74,0x00,0x51,0x75,0x69,0x74,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,0x66,0x6f,0x63,0x75,0x73,0x61,0x62,0x6c,0x65,0x00,
0x74,0x72,0x75,0x65,0x00,0x6f,0x6e,0x3a,0x63,0x6c,0x69,0x63,0x6b,0x00,0x62,0x61,0x63,0x6b,0x28,0x29,
0x00,0x74,0x65,0x78,0x74,0x00,0x42,0x61,0x63,0x6b,0x00,0x00,0x00,0x62,0x75,0x74,0x74,0x6f,0x6e,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,0x76,0x69,0x65,0x77,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,0x63,0x3d,0x32,
0x2c,0x72,0x3d,0x31,0x2c,0x6d,0x3d,0x32,0x2c,0x73,0x3d,0x32,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,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x6e,0x61,0x6d,0x65,0x00,0x74,0x69,0x6d,0x65,0x72,0x00,0x66,0x6f,0x63,0x75,0x73,0x61,
0x62,0x6c,0x65,0x00,0x74,0x72,0x75,0x65,0x00,0x6f,0x6e,0x3a,0x63,0x6c,0x69,0x63,0x6b,0x00,0x73,0x74,
0x61,0x72,0x74,0x5f,0x74,0x69,0x6d,0x65,0x72,0x28,0x31,0x30,0x30,0x29,0x00,0x74,0x65,0x78,0x74,0x00,
0x53,0x74,0x61,0x72,0x74,0x20,0x54,0x69,0x6d,0x65,0x72,0x00,0x6f,0x6e,0x3a,0x74,0x69,0x6d,0x65,0x72,
0x00,0x61,0x20,0x3d,0x20,0x77,0x69,0x64,0x67,0x65,0x74,0x5f,0x6c,0x6f,0x6f,0x6b,0x75,0x70,0x28,0x27,
0x77,0x69,0x6e,0x64,0x6f,0x77,0x27,0x2c,0x20,0x27,0x62,0x61,0x72,0x27,0x2c,0x20,0x74,0x72,0x75,0x65,
0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x62,0x20,0x3d,0x20,0x77,0x69,0x64,0x67,0x65,0x74,
0x5f,0x67,0x65,0x74,0x28,0x61,0x2c,0x20,0x27,0x76,0x61,0x6c,0x75,0x65,0x27,0x29,0x0a,0x20,0x20,0x20,
0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x28,0x62,0x20,0x3c,0x20,0x31,0x30,0x30,0x29,0x20,0x7b,0x0a,0x20,
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x77,0x69,0x64,0x67,0x65,0x74,0x5f,0x73,0x65,0x74,0x28,
0x61,0x2c,0x20,0x27,0x76,0x61,0x6c,0x75,0x65,0x27,0x2c,0x20,0x62,0x20,0x2b,0x20,0x31,0x29,0x0a,0x20,
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x20,0x65,0x6c,0x73,0x65,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,
0x20,0x20,0x20,0x20,0x20,0x20,0x77,0x69,0x64,0x67,0x65,0x74,0x5f,0x73,0x65,0x74,0x28,0x61,0x2c,0x20,
0x27,0x76,0x61,0x6c,0x75,0x65,0x27,0x2c,0x20,0x30,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
0x20,0x20,0x73,0x74,0x6f,0x70,0x5f,0x74,0x69,0x6d,0x65,0x72,0x28,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,
0x20,0x20,0x20,0x7d,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,0x66,0x6f,0x63,0x75,0x73,0x61,0x62,0x6c,0x65,0x00,0x74,0x72,0x75,0x65,0x00,0x6f,0x6e,0x3a,0x63,
0x6c,0x69,0x63,0x6b,0x00,0x62,0x61,0x63,0x6b,0x5f,0x74,0x6f,0x5f,0x68,0x6f,0x6d,0x65,0x28,0x29,0x00,
0x74,0x65,0x78,0x74,0x00,0x42,0x61,0x63,0x6b,0x20,0x54,0x6f,0x20,0x48,0x6f,0x6d,0x65,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,};/*5127*/
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x66,0x6f,0x63,0x75,0x73,
0x61,0x62,0x6c,0x65,0x00,0x74,0x72,0x75,0x65,0x00,0x6f,0x6e,0x3a,0x63,0x6c,0x69,0x63,0x6b,0x00,0x73,
0x74,0x6f,0x70,0x5f,0x74,0x69,0x6d,0x65,0x72,0x28,0x27,0x70,0x61,0x72,0x65,0x6e,0x74,0x2e,0x74,0x69,
0x6d,0x65,0x72,0x27,0x29,0x00,0x74,0x65,0x78,0x74,0x00,0x53,0x74,0x6f,0x70,0x20,0x54,0x69,0x6d,0x65,
0x72,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,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,0x76,0x69,0x65,0x77,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,0x63,0x3d,0x32,0x2c,0x72,0x3d,0x31,0x2c,0x6d,0x3d,
0x32,0x2c,0x73,0x3d,0x32,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,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x66,0x6f,0x63,0x75,
0x73,0x61,0x62,0x6c,0x65,0x00,0x74,0x72,0x75,0x65,0x00,0x6f,0x6e,0x3a,0x63,0x6c,0x69,0x63,0x6b,0x00,
0x62,0x61,0x63,0x6b,0x28,0x29,0x00,0x74,0x65,0x78,0x74,0x00,0x42,0x61,0x63,0x6b,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,0x66,0x6f,0x63,0x75,0x73,0x61,0x62,0x6c,0x65,0x00,0x74,0x72,0x75,
0x65,0x00,0x6f,0x6e,0x3a,0x63,0x6c,0x69,0x63,0x6b,0x00,0x62,0x61,0x63,0x6b,0x5f,0x74,0x6f,0x5f,0x68,
0x6f,0x6d,0x65,0x28,0x29,0x00,0x74,0x65,0x78,0x74,0x00,0x42,0x61,0x63,0x6b,0x20,0x54,0x6f,0x20,0x48,
0x6f,0x6d,0x65,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,};/*5053*/

View File

@ -83,7 +83,7 @@ def gen_res(name = 'assets', is_excluded_file_func = default_is_excluded_file_fu
common.gen_res_web_c()
elif action == 'json':
common.gen_res_json()
elif action != 'pinyin':
elif action != 'pinyin' and action != 'res':
common.gen_res_c()
if isinstance(updater.get_theme(0), dict):
common.gen_res_c(False)

View File

@ -212,5 +212,5 @@ def run(awtk_root, is_excluded_file_handler = None):
common.update_res()
if isinstance(THEMES[0], dict):
if action != 'clean' and action != 'web' and action != 'json' and action != 'pinyin':
if action != 'clean' and action != 'web' and action != 'json' and action != 'pinyin' and action != 'res':
common.gen_res_c(False)

View File

@ -970,61 +970,138 @@ def gen_asset_c_entry_with_multi_theme():
write_file(ASSET_C, result)
def gen_res_c(with_multi_theme = True):
theme_foreach(gen_assets_c_of_one_theme, with_multi_theme)
if with_multi_theme:
gen_asset_c_entry_with_multi_theme()
def gen_assets_web_c_of_one_theme(with_multi_theme = True):
if not THEME_PACKAGED:
return
if with_multi_theme:
filename = join_path(OUTPUT_ROOT, ASSETS_SUBNAME+THEME+'.inc')
else:
filename, extname = os.path.splitext(ASSET_C.replace('.inc', '_web.inc'))
filename = filename + '_' + THEME + extname
func_name = 'assets_init'
if with_multi_theme:
func_name = 'assets_init_'+THEME
def gen_res_web_c():
result = '#include "awtk.h"\n'
result += '#include "base/assets_manager.h"\n'
result += gen_assets_includes(join_path(OUTPUT_DIR, 'inc/images/*.bsvg'), None, False)
result += gen_assets_includes(join_path(OUTPUT_DIR, 'inc/strings/*.data'), None, False)
result += gen_assets_includes(join_path(OUTPUT_DIR, 'inc/styles/*.data'), None, False)
result += gen_assets_includes(join_path(OUTPUT_DIR, 'inc/ui/*.data'), None, False)
result += gen_assets_includes(join_path(OUTPUT_DIR, 'inc/xml/*.data'), None, False)
result += gen_assets_includes(join_path(OUTPUT_DIR, 'inc/data/*.data'), None, False)
result += gen_assets_includes(join_path(OUTPUT_DIR, 'inc/images/*.bsvg'), join_path(OUTPUT_ROOT, 'default/inc/images/*.bsvg'), with_multi_theme)
result += gen_assets_includes(join_path(OUTPUT_DIR, 'inc/strings/*.data'), join_path(OUTPUT_ROOT, 'default/inc/strings/*.data'), with_multi_theme)
result += gen_assets_includes(join_path(OUTPUT_DIR, 'inc/styles/*.data'), join_path(OUTPUT_ROOT, 'default/inc/styles/*.data'), with_multi_theme)
result += gen_assets_includes(join_path(OUTPUT_DIR, 'inc/ui/*.data'), join_path(OUTPUT_ROOT, 'default/inc/ui/*.data'), with_multi_theme)
result += gen_assets_includes(join_path(OUTPUT_DIR, 'inc/xml/*.data'), join_path(OUTPUT_ROOT, 'default/inc/xml/*.data'), with_multi_theme)
result += gen_assets_includes(join_path(OUTPUT_DIR, 'inc/data/*.data'), join_path(OUTPUT_ROOT, 'default/inc/data/*.data'), with_multi_theme)
result += '\n'
result += 'ret_t assets_init(void) {\n'
result += ' assets_manager_t* am = assets_manager();\n\n'
result += ''
result += gen_assets_adds(join_path(OUTPUT_DIR, 'inc/images/*.bsvg'))
result += gen_assets_adds(join_path(OUTPUT_DIR, 'inc/strings/*.data'))
result += gen_assets_adds(join_path(OUTPUT_DIR, 'inc/styles/*.data'))
result += gen_assets_adds(join_path(OUTPUT_DIR, 'inc/ui/*.data'))
result += gen_assets_adds(join_path(OUTPUT_DIR, 'inc/xml/*.data'))
result += gen_assets_adds(join_path(OUTPUT_DIR, 'inc/data/*.data'))
result += 'ret_t ' + func_name + '(void) {\n'
result += ' assets_manager_t* am = assets_manager();\n'
result += ' assets_manager_set_theme(am, "' + THEME + '");\n'
result += '\n'
result += gen_assets_adds(join_path(OUTPUT_DIR, 'inc/images/*.bsvg'), join_path(OUTPUT_ROOT, 'default/inc/images/*.bsvg'))
result += gen_assets_adds(join_path(OUTPUT_DIR, 'inc/strings/*.data'), join_path(OUTPUT_ROOT, 'default/inc/strings/*.data'))
result += gen_assets_adds(join_path(OUTPUT_DIR, 'inc/styles/*.data'), join_path(OUTPUT_ROOT, 'default/inc/styles/*.data'))
result += gen_assets_adds(join_path(OUTPUT_DIR, 'inc/ui/*.data'), join_path(OUTPUT_ROOT, 'default/inc/ui/*.data'))
result += gen_assets_adds(join_path(OUTPUT_DIR, 'inc/xml/*.data'), join_path(OUTPUT_ROOT, 'default/inc/xml/*.data'))
result += gen_assets_adds(join_path(OUTPUT_DIR, 'inc/data/*.data'), join_path(OUTPUT_ROOT, 'default/inc/data/*.data'))
result += ' tk_init_assets();\n'
result += ' return RET_OK;\n'
result += '}\n\n'
result += '}\n'
write_file(filename.replace('.inc', '_web.inc'), result)
def gen_asset_web_c_entry_with_multi_theme():
result = '#include "awtk.h"\n'
result += '#include "base/assets_manager.h"\n'
assets_root = os.path.relpath(OUTPUT_ROOT, os.path.dirname(ASSET_C)).replace('\\', '/')
for i in range(len(THEMES)):
set_current_theme(i)
if THEME_PACKAGED:
result += '#include "'+assets_root+'/'+ASSETS_SUBNAME+THEME+'_web.inc"\n'
result += '\n'
result += '#ifndef APP_THEME\n'
result += '#define APP_THEME "' + APP_THEME + '"\n'
result += '#endif /*APP_THEME*/\n\n'
result += 'bool_t assets_has_theme(const char* name) {\n'
result += ' return_value_if_fail(name != NULL, FALSE);\n\n'
result += ' if (tk_str_eq(name, "default")) {\n'
result += ' return TRUE;\n'
result += ' } else {\n'
result += ' return FALSE;\n'
result += ' }\n}\n\n'
result += ' '
for i in range(len(THEMES)):
set_current_theme(i)
if THEME_PACKAGED:
result += 'if (tk_str_eq(name, "'+THEME+'")) {\n'
result += ' return TRUE;\n'
result += ' } else '
result += '{\n'
result += ' return FALSE;\n }\n}\n\n'
result += 'static ret_t assets_init_internal(const char* theme) {\n'
result += ' assets_manager_t* am = assets_manager();\n'
result += ' return_value_if_fail(theme != NULL && am != NULL, RET_BAD_PARAMS);\n\n'
result += ' assets_manager_set_theme(am, theme);\n\n'
result += ' '
for i in range(len(THEMES)):
set_current_theme(i)
if THEME_PACKAGED:
result += 'if (tk_str_eq(theme, "'+THEME+'")) {\n'
result += ' return assets_init_'+THEME+'();\n'
result += ' } else '
result += '{\n'
result += ' log_debug(\"%s not support.\\n\", theme);\n'
result += ' return RET_NOT_IMPL;\n }\n}\n\n'
result += 'ret_t assets_init(void) {\n'
result += ' return assets_init_internal(APP_THEME);\n}\n\n'
result += 'static ret_t widget_set_theme_web(widget_t* widget, const char* name) {\n'
result += ' const asset_info_t* info = NULL;\n'
result += ' event_t e = event_init(EVT_THEME_CHANGED, NULL);\n'
result += ' widget_t* wm = widget_get_window_manager(widget);\n'
result += ' font_manager_t* fm = widget_get_font_manager(widget);\n'
result += ' image_manager_t* imm = widget_get_image_manager(widget);\n'
result += ' assets_manager_t* am = widget_get_assets_manager(widget);\n'
result += ' locale_info_t* locale_info = widget_get_locale_info(widget);\n\n'
result += ' return_value_if_fail(am != NULL && name != NULL, RET_BAD_PARAMS);\n'
result += ' return_value_if_fail(assets_has_theme(name), RET_BAD_PARAMS);\n\n'
result += ' font_manager_unload_all(fm);\n'
result += ' image_manager_unload_all(imm);\n'
result += ' assets_manager_clear_all(am);\n'
result += ' widget_reset_canvas(widget);\n\n'
result += ' assets_init_internal(name);\n'
result += ' locale_info_reload(locale_info);\n\n'
result += ' info = assets_manager_ref(am, ASSET_TYPE_STYLE, "default");\n'
result += ' theme_set_theme_data(theme(), info->data);\n'
result += ' assets_manager_unref(assets_manager(), info);\n\n'
result += ' widget_dispatch(wm, &e);\n'
result += ' widget_invalidate_force(wm, NULL);\n\n'
result += ' log_debug("theme changed: %s\\n", name);\n\n'
result += ' return RET_OK;\n'
result += '}\n\n'
result += 'ret_t assets_set_global_theme(const char* name) {\n'
result += ' log_debug(\"not support to change theme.\\n\");\n'
result += ' return RET_NOT_IMPL;\n'
result += '}\n'
result += ' return widget_set_theme_web(window_manager(), name);\n}\n'
write_file(ASSET_C.replace('.c', '_web.c'), result)
write_file(ASSET_C.replace('.inc', '_web.inc'), result)
def gen_res_web_c(with_multi_theme = True):
theme_foreach(gen_assets_web_c_of_one_theme, with_multi_theme)
if with_multi_theme:
gen_asset_web_c_entry_with_multi_theme()
def gen_res_json_one(res_type, files):
from PIL import Image
result = "\n " + res_type + ': [\n'
result = ''
for f in files:
uri = f.replace(os.getcwd(), "")[1:]
uri = uri.replace('\\', '/')
@ -1032,26 +1109,35 @@ def gen_res_json_one(res_type, files):
basename = os.path.basename(filename)
result = result + ' {name:"' + basename + '\", uri:"' + uri
if res_type == 'image' and extname != '.svg' and extname != '.bsvg':
from PIL import Image
img = Image.open(f)
w, h = img.size
result = result + '", w:' + str(w) + ', h:' + str(h) + '},\n'
else:
result = result + '"},\n'
result = result + ' ],'
return result
def gen_res_json_all_theme(res_type, sub_filepath):
result = "\n " + res_type + ': [\n'
for i in range(len(THEMES)):
set_current_theme(i)
files = glob.glob(join_path(INPUT_DIR, sub_filepath))
result += gen_res_json_one(res_type, files)
result += ' ],'
return result
def gen_res_json():
result = 'const g_awtk_assets = {'
result += gen_res_json_one("image", glob.glob(join_path(INPUT_DIR, 'images/*/*.*')))
result += gen_res_json_one("ui", glob.glob(join_path(INPUT_DIR, 'ui/*.bin')))
result += gen_res_json_one("style", glob.glob(join_path(INPUT_DIR, 'styles/*.bin')))
result += gen_res_json_one("string", glob.glob(join_path(INPUT_DIR, 'strings/*.bin')))
result += gen_res_json_one("xml", glob.glob(join_path(INPUT_DIR, 'xml/*.xml')))
result += gen_res_json_one("data", glob.glob(join_path(INPUT_DIR, 'data/*.*')))
result += gen_res_json_one("script", glob.glob(join_path(INPUT_DIR, 'scripts/*.*')))
result += gen_res_json_one("font", glob.glob(join_path(INPUT_DIR, 'fonts/*.ttf')))
result += gen_res_json_all_theme("image", 'images/*/*.*')
result += gen_res_json_all_theme("ui", 'ui/*.bin')
result += gen_res_json_all_theme("style",'styles/*.bin')
result += gen_res_json_all_theme("string", 'strings/*.bin')
result += gen_res_json_all_theme("xml", 'xml/*.xml')
result += gen_res_json_all_theme("data", 'data/*.*')
result += gen_res_json_all_theme("script", 'scripts/*.*')
result += gen_res_json_all_theme("font", 'fonts/*.ttf')
result += '\n};\n'
write_file(ASSET_C.replace('.c', '_web.js'), result)
@ -1100,6 +1186,9 @@ def update_res():
clean_res()
theme_foreach(gen_res_all)
gen_res_c()
elif ACTION == 'res':
clean_res()
theme_foreach(gen_res_all)
elif ACTION == 'clean':
clean_res()
elif ACTION == 'web':