1 /* This is a small demo of the high-performance GUIX graphics framework. */
2
3
4 #include <stdio.h>
5 #include "tx_api.h"
6 #include "gx_api.h"
7 #include "gx_system.h"
8 #include "gx_validation_utility.h"
9
10 TEST_PARAM test_parameter = {
11 "guix_widget_back_link", /* Test name */
12 31, 69, 613, 400 /* Define the coordinates of the capture area.
13 In this test, we only need to capture the pixelmap
14 drawing area. */
15 };
16
17 static VOID control_thread_entry(ULONG);
main(int argc,char ** argv)18 int main(int argc, char ** argv)
19 {
20 /* Parse the command line argument. */
21 gx_validation_setup(argc, argv);
22
23 /* Start ThreadX system */
24 tx_kernel_enter();
25 return(0);
26 }
27
tx_application_define(void * first_unused_memory)28 VOID tx_application_define(void *first_unused_memory)
29 {
30 /* Call the actual line example routine. */
31 gx_validation_application_define(first_unused_memory);
32
33 /* Termiante the test if it runs for more than 100 ticks */
34 /* This function is not implemented yet. */
35 gx_validation_watchdog_create(100);
36
37
38 /* Create a dedicated thread to perform various operations
39 on the pixelmap drawing example. These operations simulate
40 user input. */
41 gx_validation_control_thread_create(control_thread_entry);
42
43 }
44
45
46 /* Replace the default graphics driver with the validation driver. */
47 #ifdef win32_graphics_driver_setup_24xrgb
48 #undef win32_graphics_driver_setup_24xrgb
49 #endif
50 #define win32_graphics_driver_setup_24xrgb gx_validation_graphics_driver_setup_24xrgb
51
52
53 #ifdef WIN32
54 #undef WIN32
55 #endif
56
57 #include "gx_validation_wrapper.h"
58
59 #include "demo_guix_all_widgets.c"
60
61
62 char test_comment[256];
63
64 GX_WIDGET *list[] =
65 {
66 (GX_WIDGET *)&button_screen,
67 (GX_WIDGET *)&rotate_screen,
68 (GX_WIDGET *)&sprite_screen,
69 (GX_WIDGET *)&text_screen,
70 (GX_WIDGET *)&window_screen,
71 (GX_WIDGET *)&indicator_screen
72 };
73
74 /* This thread simulates user input. Its priority is lower
75 than the GUIX thread, so that GUIX finishes an operation
76 before this thread is able to issue the next command. */
control_thread_entry(ULONG input)77 static VOID control_thread_entry(ULONG input)
78 {
79 int frame_id = 1;
80
81 int index;
82
83 for(index = 0; index < (int)(sizeof(list)/sizeof(GX_WIDGET *));index++)
84 {
85 gx_widget_detach(list[index]);
86 gx_widget_status_add(list[index], GX_STATUS_ACCEPTS_FOCUS);
87 while (list[index]->gx_widget_first_child)
88 {
89 gx_widget_detach(list[index]->gx_widget_first_child);
90 }
91
92 gx_widget_back_attach((GX_WIDGET *) root, list[index]);
93 }
94
95
96 gx_validation_set_frame_id(frame_id++);
97 sprintf(test_comment, "Call back link function to link function to root.");
98 gx_validation_set_frame_comment(test_comment);
99 /* Force a screen refresh. */
100 gx_validation_screen_refresh();
101
102
103 /* Signal the end of the test case. Verify the output. */
104 gx_validation_end();
105
106 exit(0);
107 }
108
109
110
111
112
113