1 /* This is a small demo of the high-performance GUIX graphics framework. */
2
3 #include <stdio.h>
4 #include "tx_api.h"
5 #include "gx_api.h"
6 #include "gx_validation_utility.h"
7
8 TEST_PARAM test_parameter = {
9 "guix_widget_back_move", /* Test name */
10 73, 7, 575, 475 /* Define the coordinates of the capture area.
11 In this test, we only need to capture the line
12 drawing area. */
13 };
14
15 static VOID control_thread_entry(ULONG);
main(int argc,char ** argv)16 int main(int argc, char ** argv)
17 {
18 /* Parse the command line argument. */
19 gx_validation_setup(argc, argv);
20
21 /* Start ThreadX system */
22 tx_kernel_enter();
23 return(0);
24 }
25
tx_application_define(void * first_unused_memory)26 VOID tx_application_define(void *first_unused_memory)
27 {
28 /* Call the actual line example routine. */
29 gx_validation_application_define(first_unused_memory);
30
31 /* Termiante the test if it runs for more than 100 ticks */
32 /* This function is not implemented yet. */
33 gx_validation_watchdog_create(100);
34
35 /* Create a dedicated thread to perform various operations
36 on the line drawing example. These operations simulate
37 user input. */
38 gx_validation_control_thread_create(control_thread_entry);
39
40
41
42 }
43
44
45 /* Replace the default graphics driver with the validation driver. */
46 #ifdef win32_graphics_driver_setup_24xrgb
47 #undef win32_graphics_driver_setup_24xrgb
48 #endif
49 #define win32_graphics_driver_setup_24xrgb gx_validation_graphics_driver_setup_24xrgb
50
51
52 #ifdef WIN32
53 #undef WIN32
54 #endif
55
56 #include "gx_validation_wrapper.h"
57
58 #include "demo_guix_all_widgets.c"
59
60 char test_comment[255];
61
control_thread_entry(ULONG input)62 static VOID control_thread_entry(ULONG input)
63 {
64 int frame_id = 1;
65 int index = 0;
66
67
68 GX_RECTANGLE size[] = {{117, 100, 253, 134},
69 {183, 118, 320, 150},
70 {230, 131, 366, 200}};
71
72 GX_WIDGET *list[] = {(GX_WIDGET *)&button_screen.button_screen_base_button_1,
73 (GX_WIDGET *)&button_screen.button_screen_text_button_1,
74 (GX_WIDGET *)&button_screen.button_screen_multi_line_button_1};
75
76
77 for(index = 0; index < (int)(sizeof(size)/sizeof(GX_RECTANGLE)); index++)
78 {
79 gx_widget_resize(list[index], &size[index]);
80 }
81
82 gx_validation_set_frame_id(frame_id++);
83 gx_validation_set_frame_comment("Resize buttons.");
84 /* Force a screen refresh. */
85 gx_validation_screen_refresh(); /* Signal the end of the test case. Verify the output. */
86
87 gx_widget_back_move(list[1], 0);
88 gx_validation_set_frame_id(frame_id++);
89 gx_validation_set_frame_comment("Move text button back.");
90 /* Force a screen refresh. */
91 gx_validation_screen_refresh(); /* Signal the end of the test case. Verify the output. */
92
93 gx_widget_back_move(list[1], 0);
94 gx_validation_set_frame_id(frame_id++);
95 gx_validation_set_frame_comment("Move text button back gain.");
96 /* Force a screen refresh. */
97 gx_validation_screen_refresh(); /* Signal the end of the test case. Verify the output. */
98
99 gx_validation_end();
100
101 exit(0);
102 }
103