This commit is contained in:
xianjimli 2018-11-15 14:11:06 +08:00
commit 9ab6ee87ae
14 changed files with 647 additions and 648 deletions

View File

@ -37,7 +37,7 @@ else:
NANOVG_BACKEND_LIBS=[];
NANOVG_BACKEND_PROJS=[];
COMMON_CCFLAGS=' -DTK_ROOT=\\\"'+TK_ROOT+'\\\" -DHAS_STD_MALLOC -DWITH_SDL -DWITH_FS_RES -DHAS_STDIO -DWITH_DESKTOP_STYLE '
COMMON_CCFLAGS=' -DTK_ROOT=\\\"'+TK_ROOT+'\\\" -DSDL2 -DHAS_STD_MALLOC -DWITH_SDL -DWITH_FS_RES -DHAS_STDIO -DWITH_DESKTOP_STYLE '
COMMON_CCFLAGS=COMMON_CCFLAGS+' -DSTBTT_STATIC -DSTB_IMAGE_STATIC -DWITH_STB_IMAGE -DWITH_STB_FONT -DWITH_VGCANVAS -DWITH_UNICODE_BREAK '
if LCD == 'SDL_GPU':

File diff suppressed because it is too large Load Diff

View File

@ -1,29 +1,28 @@
const unsigned char ui_dialog1[] = {
0x04,0x00,0x01,0x01,0xf4,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x64,0x69,0x61,0x6c,0x6f,0x67,0x31,0x00,
0x04,0x00,0x01,0x01,0xe7,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x64,0x69,0x61,0x6c,0x6f,0x67,0x31,0x00,
0x64,0x61,0x74,0x61,0x00,0x00,0x00,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,
0x02,0x02,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x50,0x00,0x00,0x00,0xa0,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x6e,0x61,0x6d,0x65,0x00,0x64,0x69,0x61,0x6c,0x6f,0x67,0x31,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,0x74,0x65,0x78,0x74,0x00,0x44,
0x69,0x61,0x6c,0x6f,0x67,0x00,0x00,0x64,0x69,0x61,0x6c,0x6f,0x67,0x5f,0x74,0x69,0x74,0x6c,0x65,0x00,
0x00,0x00,0x00,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,0x74,0x65,0x78,0x74,0x00,0x44,0x69,0x61,0x6c,0x6f,0x67,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,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x64,0x00,
0x00,0x00,0x1e,0x00,0x00,0x00,0x00,0x00,0x00,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,0x03,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x64,0x00,0x00,0x00,0xe2,0xff,0xff,0xff,
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,0x02,0x02,0x00,
0x00,0x00,0x00,0x00,0x00,0xec,0xff,0xff,0xff,0xc8,0x00,0x00,0x00,0x1e,0x00,0x00,0x00,0x00,0x00,0x00,
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,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x64,0x00,0x00,0x00,0x1e,0x00,0x00,0x00,0x00,
0x00,0x00,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,0x03,0x01,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x64,0x00,0x00,0x00,0xe2,0xff,0xff,0xff,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,0x02,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0xec,0xff,
0xff,0xff,0xc8,0x00,0x00,0x00,0x1e,0x00,0x00,0x00,0x00,0x00,0x00,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,0x00,0x03,0x01,0x00,0x0a,0x00,
0x00,0x00,0x0a,0x00,0x00,0x00,0x28,0x00,0x00,0x00,0x1e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x6e,0x61,
0x6d,0x65,0x00,0x71,0x75,0x69,0x74,0x00,0x74,0x65,0x78,0x74,0x00,0xe7,0xa1,0xae,0xe5,0xae,0x9a,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,0x03,0x03,0x01,0x00,0x0a,0x00,
0x00,0x00,0x0a,0x00,0x00,0x00,0x28,0x00,0x00,0x00,0x1e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x6e,0x61,
0x6d,0x65,0x00,0x71,0x75,0x69,0x74,0x00,0x74,0x65,0x78,0x74,0x00,0xe5,0x8f,0x96,0xe6,0xb6,0x88,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,};/*548*/
0x00,0x00,0x03,0x01,0x00,0x0a,0x00,0x00,0x00,0x0a,0x00,0x00,0x00,0x28,0x00,0x00,0x00,0x1e,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x6e,0x61,0x6d,0x65,0x00,0x71,0x75,0x69,0x74,0x00,0x74,0x65,0x78,0x74,0x00,
0xe7,0xa1,0xae,0xe5,0xae,0x9a,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,0x03,0x03,0x01,0x00,0x0a,0x00,0x00,0x00,0x0a,0x00,0x00,0x00,0x28,0x00,0x00,0x00,0x1e,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x6e,0x61,0x6d,0x65,0x00,0x71,0x75,0x69,0x74,0x00,0x74,0x65,0x78,0x74,0x00,
0xe5,0x8f,0x96,0xe6,0xb6,0x88,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,};/*535*/

View File

@ -1,27 +1,21 @@
const unsigned char ui_fade[] = {
0x04,0x00,0x01,0x01,0xd8,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x66,0x61,0x64,0x65,0x00,0x64,0x61,0x74,
0x04,0x00,0x01,0x01,0x56,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x66,0x61,0x64,0x65,0x00,0x64,0x61,0x74,
0x61,0x00,0x00,0x00,0x00,0x00,0x00,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,
0x02,0x02,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x50,0x00,0x00,0x00,0xa0,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x6e,0x61,0x6d,0x65,0x00,0x64,0x69,0x61,0x6c,0x6f,0x67,0x00,0x61,0x6e,0x69,0x6d,
0x5f,0x68,0x69,0x6e,0x74,0x00,0x66,0x61,0x64,0x65,0x28,0x64,0x75,0x72,0x61,0x74,0x69,0x6f,0x6e,0x3d,
0x33,0x30,0x30,0x29,0x00,0x00,0x64,0x69,0x61,0x6c,0x6f,0x67,0x5f,0x74,0x69,0x74,0x6c,0x65,0x00,0x00,
0x00,0x00,0x00,0x00,0x73,0x74,0x79,0x6c,0x65,0x00,0x6e,0x6f,0x74,0x69,0x74,0x6c,0x65,0x00,0x61,0x6e,
0x69,0x6d,0x5f,0x68,0x69,0x6e,0x74,0x00,0x66,0x61,0x64,0x65,0x28,0x64,0x75,0x72,0x61,0x74,0x69,0x6f,
0x6e,0x3d,0x33,0x30,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,
0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x64,0x00,0x00,0x00,0x1e,0x00,0x00,0x00,0x00,0x00,
0x00,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,0x03,0x01,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x64,0x00,0x00,0x00,0xe2,0xff,0xff,0xff,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,0x02,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0xec,0xff,0xff,
0xff,0xc8,0x00,0x00,0x00,0x1e,0x00,0x00,0x00,0x00,0x00,0x00,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,0x00,0x03,0x01,0x00,0x0a,0x00,0x00,
0x00,0x0a,0x00,0x00,0x00,0x28,0x00,0x00,0x00,0x1e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x6e,0x61,0x6d,
0x65,0x00,0x71,0x75,0x69,0x74,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,0x03,0x03,0x01,0x00,0x0a,0x00,0x00,0x00,0x0a,0x00,
0x00,0x00,0x28,0x00,0x00,0x00,0x1e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x6e,0x61,0x6d,0x65,0x00,0x71,
0x75,0x69,0x74,0x00,0x74,0x65,0x78,0x74,0x00,0x4e,0x6f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,};/*520*/
0x02,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0xec,0xff,0xff,0xff,0xc8,0x00,0x00,0x00,0x1e,0x00,0x00,0x00,
0x00,0x00,0x00,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,0x00,0x03,0x01,0x00,0x0a,0x00,0x00,0x00,0x0a,0x00,0x00,0x00,0x28,0x00,0x00,0x00,
0x1e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x6e,0x61,0x6d,0x65,0x00,0x71,0x75,0x69,0x74,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,0x03,0x03,0x01,0x00,0x0a,0x00,0x00,0x00,0x0a,0x00,0x00,0x00,0x28,0x00,0x00,0x00,0x1e,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x6e,0x61,0x6d,0x65,0x00,0x71,0x75,0x69,0x74,0x00,0x74,0x65,0x78,0x74,0x00,
0x4e,0x6f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,};/*390*/

Binary file not shown.

View File

@ -317,6 +317,9 @@
<style name="default">
<normal border_color="#606060" />
</style>
<style name="notitle">
<normal border_color="#606060" bg_color="#ededed"/>
</style>
</dialog>
<dialog_title icon="info" text_color="black">

Binary file not shown.

View File

@ -1,4 +1,4 @@
<dialog name="dialog1" anim_hint="center_scale(duration=300)" x="c" y="m" w="80%" h="160" text="Dialog">
<dialog anim_hint="center_scale(duration=300)" x="c" y="m" w="80%" h="160" text="Dialog">
<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?"/>

Binary file not shown.

View File

@ -1,8 +1,5 @@
<dialog name="dialog" anim_hint="fade(duration=300)" x="c" y="m" w="80%" 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="quit" x="10" y="bottom:10" w="40%" h="30" text="Yes"/>
<button name="quit" x="right:10" y="bottom:10" w="40%" h="30" text="No"/>
</dialog_client>
<dialog style="notitle" anim_hint="fade(duration=300)" x="c" y="m" w="80%" h="160">
<label name="" x="center" y="middle:-20" w="200" h="30" text="Are you ready?"/>
<button name="quit" x="10" y="bottom:10" w="40%" h="30" text="Yes"/>
<button name="quit" x="right:10" y="bottom:10" w="40%" h="30" text="No"/>
</dialog>

View File

@ -125,10 +125,10 @@ int32_t fs_get_file_size(fs_t* fs, const char* name) {
return fs->get_file_size(fs, name);
}
ret_t fs_get_disk_info(fs_t* fs, int32_t* free_kb, int32_t* total_kb) {
ret_t fs_get_disk_info(fs_t* fs, const char* volume, int32_t* free_kb, int32_t* total_kb) {
return_value_if_fail(fs != NULL && free_kb != NULL && total_kb != NULL, RET_BAD_PARAMS);
return fs->get_disk_info(fs, free_kb, total_kb);
return fs->get_disk_info(fs, volume, free_kb, total_kb);
}
ret_t fs_get_exe(fs_t* fs, char path[MAX_PATH + 1]) {

View File

@ -88,7 +88,8 @@ typedef bool_t (*fs_dir_exist_t)(fs_t* fs, const char* name);
typedef bool_t (*fs_dir_rename_t)(fs_t* fs, const char* name, const char* new_name);
typedef int32_t (*fs_get_file_size_t)(fs_t* fs, const char* name);
typedef ret_t (*fs_get_disk_info_t)(fs_t* fs, int32_t* free_kb, int32_t* total_kb);
typedef ret_t (*fs_get_disk_info_t)(fs_t* fs, const char* volume, int32_t* free_kb,
int32_t* total_kb);
typedef ret_t (*fs_get_exe_t)(fs_t* fs, char path[MAX_PATH + 1]);
typedef ret_t (*fs_get_cwd_t)(fs_t* fs, char path[MAX_PATH + 1]);
@ -120,7 +121,7 @@ bool_t fs_dir_exist(fs_t* fs, const char* name);
bool_t fs_dir_rename(fs_t* fs, const char* name, const char* new_name);
int32_t fs_get_file_size(fs_t* fs, const char* name);
ret_t fs_get_disk_info(fs_t* fs, int32_t* free_kb, int32_t* total_kb);
ret_t fs_get_disk_info(fs_t* fs, const char* volume, int32_t* free_kb, int32_t* total_kb);
ret_t fs_get_exe(fs_t* fs, char path[MAX_PATH + 1]);
ret_t fs_get_cwd(fs_t* fs, char path[MAX_PATH + 1]);

View File

@ -183,8 +183,9 @@ ret_t scroll_view_scroll_to(widget_t* widget, int32_t xoffset_end, int32_t yoffs
wa->y_from = scroll_view->yoffset;
}
}
wa->base.start_time = time_now_ms();
wa->base.now = 0;
wa->base.start_time = 0;
} else {
scroll_view->wa = widget_animator_scroll_create(widget, ANIMATING_TIME, 0, EASING_SIN_INOUT);
return_value_if_fail(scroll_view->wa != NULL, RET_OOM);

View File

@ -178,7 +178,7 @@ int32_t fs_os_get_file_size(fs_t* fs, const char* name) {
return st.st_size;
}
ret_t fs_os_get_disk_info(fs_t* fs, int32_t* free_kb, int32_t* total_kb) {
ret_t fs_os_get_disk_info(fs_t* fs, const char* volume, int32_t* free_kb, int32_t* total_kb) {
/*TODO*/
*free_kb = 0;
*total_kb = 0;