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_numeric_pixelmap_prompt", /* Test name */
10     402, 130, 541, 210   /* Define the coordinates of the capture area.
11                          In this test, we only need to capture the promt area. */
12 };
13 
14 static VOID      control_thread_entry(ULONG);
main(int argc,char ** argv)15 int main(int argc, char ** argv)
16 {
17     /* Parse the command line argument. */
18     gx_validation_setup(argc, argv);
19 
20     /* Start ThreadX system */
21     tx_kernel_enter();
22     return(0);
23 }
24 
tx_application_define(void * first_unused_memory)25 VOID tx_application_define(void *first_unused_memory)
26 {
27 
28     /* Create a dedicated thread to perform various operations
29        on the line drawing example. These operations simulate
30        user input. */
31     gx_validation_control_thread_create(control_thread_entry);
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     /* Call the actual line example routine. */
38     gx_validation_application_define(first_unused_memory);
39 
40 }
41 
42 
43 /* Replace the default graphics driver with the validation driver. */
44 #ifdef win32_graphics_driver_setup_24xrgb
45 #undef win32_graphics_driver_setup_24xrgb
46 #endif
47 #define win32_graphics_driver_setup_24xrgb  gx_validation_graphics_driver_setup_24xrgb
48 
49 
50 #ifdef WIN32
51 #undef WIN32
52 #endif
53 
54 #include "gx_validation_wrapper.h"
55 
56 #include "demo_guix_all_widgets.c"
57 
58 
59 char test_comment[255];
60 GX_POINT button_value = {200 , 250};
61 
control_thread_entry(ULONG input)62 static VOID control_thread_entry(ULONG input)
63 {
64 UINT     frame_id = 1;
65 int      value;
66 
67 
68     /* Toggle to text screen. */
69     ToggleScreen(pTextScreen, pButtonScreen);
70 
71     /* Stop number animation timer. */
72     gx_system_timer_stop(pTextScreen, NUMBER_ANIMATION_TIMER);
73 
74     for( value = -10000 ; value< 10000 ; value += 1234)
75     {
76 
77         /* Inform the validation system
78         (1) Frame ID, which identifies a specific test configuration;
79         (2) Start recording frame on the next toggle operation.*/
80         gx_validation_set_frame_id(frame_id);
81 
82         sprintf(test_comment, "Set prompt value: %d", value);
83         gx_validation_set_frame_comment(test_comment);
84 
85         /* Set numeric prompt value. */
86         gx_numeric_pixelmap_prompt_value_set(&text_screen.text_screen_numeric_pixelmap_prompt, value);
87 
88         /* Force a screen refresh. */
89         gx_validation_screen_refresh();
90 
91         /* Increment frame ID */
92         frame_id ++;
93 
94     }
95 
96     /* Signal the end of the test case.  Verify the output. */
97     gx_validation_end();
98 
99     exit(0);
100 }
101