mirror of
https://gitee.com/zlgopen/awtk.git
synced 2024-12-02 03:58:33 +08:00
format code
This commit is contained in:
parent
1b86172f41
commit
78ad8162ab
0
demos/demo_ui_app.c
Executable file → Normal file
0
demos/demo_ui_app.c
Executable file → Normal file
@ -116,4 +116,4 @@ const unsigned char image_info[] = {
|
|||||||
0x12,0x96,0xdb,0xb4,0x11,0x96,0xdb,0xe9,0x12,0x96,0xdb,0xff,0x12,0x96,0xdb,0xff,0x11,0x96,0xdb,0xe9,
|
0x12,0x96,0xdb,0xb4,0x11,0x96,0xdb,0xe9,0x12,0x96,0xdb,0xff,0x12,0x96,0xdb,0xff,0x11,0x96,0xdb,0xe9,
|
||||||
0x12,0x96,0xdb,0xb4,0x11,0x96,0xdb,0x78,0x0d,0x91,0xdb,0x0c,0x00,0x00,0x00,0x00,0x10,0x97,0xdf,0x00,
|
0x12,0x96,0xdb,0xb4,0x11,0x96,0xdb,0x78,0x0d,0x91,0xdb,0x0c,0x00,0x00,0x00,0x00,0x10,0x97,0xdf,0x00,
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,};/*2348*/
|
0x00,0x00,0x00,0x00,0x30,0x21,0xd0,0xe8,};/*2348*/
|
||||||
|
@ -116,4 +116,4 @@ const unsigned char image_left_off[] = {
|
|||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,};/*2348*/
|
0x00,0x00,0x00,0x00,0x50,0x36,0xea,0x7a,};/*2348*/
|
||||||
|
@ -116,4 +116,4 @@ const unsigned char image_muted[] = {
|
|||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,};/*2348*/
|
0x00,0x00,0x00,0x00,0x88,0x2a,0xe9,0x7a,};/*2348*/
|
||||||
|
@ -116,4 +116,4 @@ const unsigned char image_radio_unchecked[] = {
|
|||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
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,0x21,0x60,0x32,};/*2348*/
|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,};/*2348*/
|
||||||
|
@ -116,4 +116,4 @@ const unsigned char image_unmuted[] = {
|
|||||||
0x00,0x00,0x00,0x16,0x00,0x00,0x00,0x14,0x00,0x00,0x00,0x14,0x00,0x00,0x00,0x14,0x00,0x00,0x00,0x14,
|
0x00,0x00,0x00,0x16,0x00,0x00,0x00,0x14,0x00,0x00,0x00,0x14,0x00,0x00,0x00,0x14,0x00,0x00,0x00,0x14,
|
||||||
0x00,0x00,0x00,0x16,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
0x00,0x00,0x00,0x16,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||||
0x00,0x00,0x00,0x00,0x88,0x2a,0xe9,0x7a,};/*2348*/
|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,};/*2348*/
|
||||||
|
@ -11,5 +11,5 @@ const unsigned char ui_bottom[] = {
|
|||||||
0x1e,0x00,0x00,0x00,0x6e,0x61,0x6d,0x65,0x00,0x6f,0x6b,0x00,0x74,0x65,0x78,0x74,0x00,0xe7,0xa1,0xae,
|
0x1e,0x00,0x00,0x00,0x6e,0x61,0x6d,0x65,0x00,0x6f,0x6b,0x00,0x74,0x65,0x78,0x74,0x00,0xe7,0xa1,0xae,
|
||||||
0xe5,0xae,0x9a,0x00,0x00,0x00,0x01,0x00,0x0a,0x00,0x03,0x03,0x01,0x00,0x0a,0x00,0x00,0x00,0x0a,0x00,
|
0xe5,0xae,0x9a,0x00,0x00,0x00,0x01,0x00,0x0a,0x00,0x03,0x03,0x01,0x00,0x0a,0x00,0x00,0x00,0x0a,0x00,
|
||||||
0x00,0x00,0x28,0x00,0x00,0x00,0x1e,0x00,0x00,0x00,0x6e,0x61,0x6d,0x65,0x00,0x63,0x61,0x6e,0x63,0x65,
|
0x00,0x00,0x28,0x00,0x00,0x00,0x1e,0x00,0x00,0x00,0x6e,0x61,0x6d,0x65,0x00,0x63,0x61,0x6e,0x63,0x65,
|
||||||
0x6c,0x00,0x74,0x65,0x78,0x74,0x00,0xe5,0x8f,0x96,0xe6,0xb6,0x88,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
0x6c,0x00,0x74,0x65,0x78,0x74,0x00,0xe5,0x8f,0x96,0xe6,0xb6,0x88,0x00,0x00,0x00,0x00,0xbc,0xc3,0x02,
|
||||||
0x00,};/*261*/
|
0x01,};/*261*/
|
||||||
|
@ -9,12 +9,12 @@ const unsigned char ui_window[] = {
|
|||||||
0x74,0x65,0x73,0x74,0x00,0x74,0x65,0x78,0x74,0x00,0x4d,0x65,0x6d,0x54,0x65,0x73,0x74,0x00,0x00,0x00,
|
0x74,0x65,0x73,0x74,0x00,0x74,0x65,0x78,0x74,0x00,0x4d,0x65,0x6d,0x54,0x65,0x73,0x74,0x00,0x00,0x00,
|
||||||
0x01,0x00,0x0a,0x00,0x03,0x00,0x01,0x00,0x0a,0x00,0x00,0x00,0x05,0x00,0x00,0x00,0x19,0x00,0x00,0x00,
|
0x01,0x00,0x0a,0x00,0x03,0x00,0x01,0x00,0x0a,0x00,0x00,0x00,0x05,0x00,0x00,0x00,0x19,0x00,0x00,0x00,
|
||||||
0x1e,0x00,0x00,0x00,0x6e,0x61,0x6d,0x65,0x00,0x64,0x65,0x63,0x00,0x74,0x65,0x78,0x74,0x00,0x44,0x65,
|
0x1e,0x00,0x00,0x00,0x6e,0x61,0x6d,0x65,0x00,0x64,0x65,0x63,0x00,0x74,0x65,0x78,0x74,0x00,0x44,0x65,
|
||||||
0x63,0x00,0x00,0x00,0x01,0x00,0x09,0x00,0x00,0x00,0x00,0x00,0x0a,0x00,0x00,0x00,0x28,0x00,0x00,0x00,
|
0x63,0x00,0x00,0x00,0x01,0x00,0x09,0x00,0x00,0x00,0x01,0x00,0x0a,0x00,0x00,0x00,0x28,0x00,0x00,0x00,
|
||||||
0x50,0x00,0x00,0x00,0x1e,0x00,0x00,0x00,0x6e,0x61,0x6d,0x65,0x00,0x6c,0x65,0x66,0x74,0x00,0x74,0x65,
|
0x1e,0x00,0x00,0x00,0x1e,0x00,0x00,0x00,0x6e,0x61,0x6d,0x65,0x00,0x6c,0x65,0x66,0x74,0x00,0x74,0x65,
|
||||||
0x78,0x74,0x00,0x4c,0x65,0x66,0x74,0x00,0x00,0x00,0x01,0x00,0x09,0x00,0x00,0x00,0x00,0x00,0x64,0x00,
|
0x78,0x74,0x00,0x4c,0x65,0x66,0x74,0x00,0x00,0x00,0x01,0x00,0x09,0x00,0x02,0x00,0x01,0x00,0x00,0x00,
|
||||||
0x00,0x00,0x28,0x00,0x00,0x00,0x50,0x00,0x00,0x00,0x1e,0x00,0x00,0x00,0x6e,0x61,0x6d,0x65,0x00,0x63,
|
0x00,0x00,0x28,0x00,0x00,0x00,0x19,0x00,0x00,0x00,0x1e,0x00,0x00,0x00,0x6e,0x61,0x6d,0x65,0x00,0x63,
|
||||||
0x65,0x6e,0x74,0x65,0x72,0x00,0x74,0x65,0x78,0x74,0x00,0x43,0x65,0x6e,0x74,0x65,0x72,0x00,0x00,0x00,
|
0x65,0x6e,0x74,0x65,0x72,0x00,0x74,0x65,0x78,0x74,0x00,0x43,0x65,0x6e,0x74,0x65,0x72,0x00,0x00,0x00,
|
||||||
0x01,0x00,0x09,0x00,0x00,0x00,0x00,0x00,0xc8,0x00,0x00,0x00,0x28,0x00,0x00,0x00,0x50,0x00,0x00,0x00,
|
0x01,0x00,0x09,0x00,0x03,0x00,0x01,0x00,0x0a,0x00,0x00,0x00,0x28,0x00,0x00,0x00,0x1e,0x00,0x00,0x00,
|
||||||
0x1e,0x00,0x00,0x00,0x6e,0x61,0x6d,0x65,0x00,0x72,0x69,0x67,0x68,0x74,0x00,0x74,0x65,0x78,0x74,0x00,
|
0x1e,0x00,0x00,0x00,0x6e,0x61,0x6d,0x65,0x00,0x72,0x69,0x67,0x68,0x74,0x00,0x74,0x65,0x78,0x74,0x00,
|
||||||
0x52,0x69,0x67,0x68,0x74,0x00,0x00,0x00,0x01,0x00,0x0d,0x00,0x00,0x00,0x00,0x00,0x0a,0x00,0x00,0x00,
|
0x52,0x69,0x67,0x68,0x74,0x00,0x00,0x00,0x01,0x00,0x0d,0x00,0x00,0x00,0x00,0x00,0x0a,0x00,0x00,0x00,
|
||||||
0x46,0x00,0x00,0x00,0xf0,0x00,0x00,0x00,0x1e,0x00,0x00,0x00,0x6e,0x61,0x6d,0x65,0x00,0x62,0x61,0x72,
|
0x46,0x00,0x00,0x00,0xf0,0x00,0x00,0x00,0x1e,0x00,0x00,0x00,0x6e,0x61,0x6d,0x65,0x00,0x62,0x61,0x72,
|
||||||
|
@ -10,4 +10,4 @@ const unsigned char ui_window2[] = {
|
|||||||
0x6d,0x65,0x00,0x74,0x6f,0x70,0x00,0x74,0x65,0x78,0x74,0x00,0x54,0x6f,0x70,0x00,0x00,0x00,0x01,0x00,
|
0x6d,0x65,0x00,0x74,0x6f,0x70,0x00,0x74,0x65,0x78,0x74,0x00,0x54,0x6f,0x70,0x00,0x00,0x00,0x01,0x00,
|
||||||
0x0a,0x00,0x03,0x02,0x01,0x00,0x0a,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x19,0x00,0x00,0x00,0x1e,0x00,
|
0x0a,0x00,0x03,0x02,0x01,0x00,0x0a,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x19,0x00,0x00,0x00,0x1e,0x00,
|
||||||
0x00,0x00,0x6e,0x61,0x6d,0x65,0x00,0x63,0x6c,0x6f,0x73,0x65,0x00,0x74,0x65,0x78,0x74,0x00,0x43,0x6c,
|
0x00,0x00,0x6e,0x61,0x6d,0x65,0x00,0x63,0x6c,0x6f,0x73,0x65,0x00,0x74,0x65,0x78,0x74,0x00,0x43,0x6c,
|
||||||
0x6f,0x73,0x65,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,};/*231*/
|
0x6f,0x73,0x65,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,};/*231*/
|
||||||
|
Binary file not shown.
@ -2,9 +2,10 @@
|
|||||||
<button name="inc" x="10" y="5" w="25%" h="30" text="Inc"/>
|
<button name="inc" x="10" y="5" w="25%" h="30" text="Inc"/>
|
||||||
<button name="test" x="center" y="5" w="25%" h="30" text="MemTest"/>
|
<button name="test" x="center" y="5" w="25%" h="30" text="MemTest"/>
|
||||||
<button name="dec" x="right:10" y="5" w="25%" h="30" text="Dec"/>
|
<button name="dec" x="right:10" y="5" w="25%" h="30" text="Dec"/>
|
||||||
<label name="left" x="10" y="40" w="80" h="30" text="Left"/>
|
|
||||||
<label name="center" x="100" y="40" w="80" h="30" text="Center"/>
|
<label name="left" x="10" y="40" w="30%" h="30" text="Left"/>
|
||||||
<label name="right" x="200" y="40" w="80" h="30" text="Right"/>
|
<label name="center" x="center" y="40" w="25%" h="30" text="Center"/>
|
||||||
|
<label name="right" x="right:10" y="40" w="30%" h="30" text="Right"/>
|
||||||
|
|
||||||
<progress_bar name="bar1" x="10" y="70" w="240" h="30" value="40"/>
|
<progress_bar name="bar1" x="10" y="70" w="240" h="30" value="40"/>
|
||||||
<progress_bar name="bar2" x="280" y="70" w="30" h="118" value="20" vertical="true"/>
|
<progress_bar name="bar2" x="280" y="70" w="30" h="118" value="20" vertical="true"/>
|
||||||
|
@ -320,7 +320,8 @@ mem_stat_t tk_mem_stat() {
|
|||||||
}
|
}
|
||||||
#endif /*HAS_STD_MALLOC*/
|
#endif /*HAS_STD_MALLOC*/
|
||||||
|
|
||||||
uint32_t tk_mem_speed_test(void* buffer, uint32_t length, uint32_t* pmemcpy_speed, uint32_t* pmemset_speed) {
|
uint32_t tk_mem_speed_test(void* buffer, uint32_t length, uint32_t* pmemcpy_speed,
|
||||||
|
uint32_t* pmemset_speed) {
|
||||||
uint32_t i = 0;
|
uint32_t i = 0;
|
||||||
uint32_t cost = 0;
|
uint32_t cost = 0;
|
||||||
uint32_t total_cost = 0;
|
uint32_t total_cost = 0;
|
||||||
@ -336,7 +337,7 @@ uint32_t tk_mem_speed_test(void* buffer, uint32_t length, uint32_t* pmemcpy_spee
|
|||||||
cost = time_now_ms() - start;
|
cost = time_now_ms() - start;
|
||||||
total_cost = cost;
|
total_cost = cost;
|
||||||
if (cost) {
|
if (cost) {
|
||||||
memset_speed = ((max_size * 1000)/cost)/1024;
|
memset_speed = ((max_size / cost) * 1000) / 1024;
|
||||||
}
|
}
|
||||||
|
|
||||||
start = time_now_ms();
|
start = time_now_ms();
|
||||||
@ -349,7 +350,7 @@ uint32_t tk_mem_speed_test(void* buffer, uint32_t length, uint32_t* pmemcpy_spee
|
|||||||
total_cost += cost;
|
total_cost += cost;
|
||||||
|
|
||||||
if (cost) {
|
if (cost) {
|
||||||
memcpy_speed = ((max_size * 1000)/cost)/1024;
|
memcpy_speed = ((max_size / cost) * 1000) / 1024;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pmemset_speed != NULL) {
|
if (pmemset_speed != NULL) {
|
||||||
@ -362,4 +363,3 @@ uint32_t tk_mem_speed_test(void* buffer, uint32_t length, uint32_t* pmemcpy_spee
|
|||||||
|
|
||||||
return total_cost;
|
return total_cost;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -66,7 +66,8 @@ void* tk_alloc(uint32_t size);
|
|||||||
#define TKMEM_FREE(p) tk_free(p)
|
#define TKMEM_FREE(p) tk_free(p)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
uint32_t tk_mem_speed_test(void* buffer, uint32_t length, uint32_t* pmemcpy_speed, uint32_t* pmemset_speed);
|
uint32_t tk_mem_speed_test(void* buffer, uint32_t length, uint32_t* pmemcpy_speed,
|
||||||
|
uint32_t* pmemset_speed);
|
||||||
|
|
||||||
END_C_DECLS
|
END_C_DECLS
|
||||||
#endif /*TK_TKMEM_MANAGER_H*/
|
#endif /*TK_TKMEM_MANAGER_H*/
|
||||||
|
@ -72,7 +72,6 @@ static ret_t slide_view_on_scroll_event(void* ctx, event_t* e) {
|
|||||||
if (e->type == EVT_ANIM_END) {
|
if (e->type == EVT_ANIM_END) {
|
||||||
slide_view_t* slide_view = SLIDE_VIEW(ctx);
|
slide_view_t* slide_view = SLIDE_VIEW(ctx);
|
||||||
if (slide_view->vertical) {
|
if (slide_view->vertical) {
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
if (slide_view->xoffset > 0) {
|
if (slide_view->xoffset > 0) {
|
||||||
slide_view_activate_prev(slide_view);
|
slide_view_activate_prev(slide_view);
|
||||||
@ -94,7 +93,6 @@ static ret_t slide_view_on_pointer_up(slide_view_t* slide_view, pointer_event_t*
|
|||||||
|
|
||||||
velocity_update(v, e->e.time, e->x, e->y);
|
velocity_update(v, e->e.time, e->x, e->y);
|
||||||
if (slide_view->vertical) {
|
if (slide_view->vertical) {
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
int xoffset = slide_view->xoffset;
|
int xoffset = slide_view->xoffset;
|
||||||
int xoffset_end = xoffset > 0 ? widget->w : -widget->w;
|
int xoffset_end = xoffset > 0 ? widget->w : -widget->w;
|
||||||
|
@ -45,8 +45,8 @@ static ret_t widget_animator_scroll_update(widget_animator_t* animator, float_t
|
|||||||
return RET_OK;
|
return RET_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
widget_animator_t* widget_animator_scroll_create(widget_t* widget, uint32_t duration, uint32_t delay,
|
widget_animator_t* widget_animator_scroll_create(widget_t* widget, uint32_t duration,
|
||||||
easing_type_t easing) {
|
uint32_t delay, easing_type_t easing) {
|
||||||
widget_animator_t* animator = NULL;
|
widget_animator_t* animator = NULL;
|
||||||
return_value_if_fail(widget != NULL && duration > 0, NULL);
|
return_value_if_fail(widget != NULL && duration > 0, NULL);
|
||||||
|
|
||||||
|
@ -49,8 +49,8 @@ typedef struct _widget_animator_scroll_t {
|
|||||||
*
|
*
|
||||||
* @return {widget_animator_t*} 成功返回动画对象,失败返回NULL。
|
* @return {widget_animator_t*} 成功返回动画对象,失败返回NULL。
|
||||||
*/
|
*/
|
||||||
widget_animator_t* widget_animator_scroll_create(widget_t* widget, uint32_t duration, uint32_t delay,
|
widget_animator_t* widget_animator_scroll_create(widget_t* widget, uint32_t duration,
|
||||||
easing_type_t easing);
|
uint32_t delay, easing_type_t easing);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @method widget_animator_scroll_set_params
|
* @method widget_animator_scroll_set_params
|
||||||
|
Loading…
Reference in New Issue
Block a user