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 #include "gx_widget.h"
8 
9 TEST_PARAM test_parameter = {
10     "guix_widget_scroll_shift", /* Test name */
11     0, 0, 639, 479  /* Define the coordinates of the capture area.
12                          In this test, we only need to capture the line
13                          drawing area.  */
14 };
15 
16 static VOID      control_thread_entry(ULONG);
main(int argc,char ** argv)17 int main(int argc, char ** argv)
18 {
19     /* Parse the command line argument. */
20     gx_validation_setup(argc, argv);
21 
22     /* Start ThreadX system */
23     tx_kernel_enter();
24     return(0);
25 }
26 
tx_application_define(void * first_unused_memory)27 VOID tx_application_define(void *first_unused_memory)
28 {
29 
30     /* Create a dedicated thread to perform various operations
31        on the line drawing example. These operations simulate
32        user input. */
33     gx_validation_control_thread_create(control_thread_entry);
34 
35     /* Termiante the test if it runs for more than 100 ticks */
36     /* This function is not implemented yet. */
37     gx_validation_watchdog_create(100);
38 
39     /* Call the actual line example routine. */
40     gx_validation_application_define(first_unused_memory);
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_widget_find.c"
59 
control_thread_entry(ULONG input)60 static VOID control_thread_entry(ULONG input)
61 {
62 int frame_id = 1;
63 
64     _gx_widget_scroll_shift((GX_WIDGET *)&main_screen.main_screen_window_1, 100, 100, GX_FALSE);
65     gx_validation_set_frame_id(frame_id++);
66     gx_validation_set_frame_comment("xshift = 100, yshift = 100, clip = GX_FALSE");
67     gx_validation_screen_refresh();
68 
69     _gx_widget_scroll_shift((GX_WIDGET *)&main_screen.main_screen_window_1, 100, 100, GX_TRUE);
70     gx_validation_set_frame_id(frame_id++);
71     gx_validation_set_frame_comment("xshift = 100, yshift = 100, clip = GX_TRUE");
72     gx_validation_screen_refresh();
73 
74     /* Signal the end of the test case.  Verify the output. */
75     gx_validation_end();
76 
77     exit(0);
78 }
79