1 /* This is a small demo of the high-performance GUIX graphics framework. */
2
3 #include <stdio.h>
4 #include "gx_api.h"
5 #include "demo_guix_menu_resources.h"
6 #include "demo_guix_menu_specifications.h"
7
8 /* Define the ThreadX demo thread control block and stack. */
9
10 #define SYSTEM_SCREEN_STACK_SIZE 20
11
12 TX_THREAD demo_thread;
13 UCHAR demo_thread_stack[4096];
14 GX_WINDOW_ROOT *root;
15 GX_WIDGET *system_screen_stack_memory[SYSTEM_SCREEN_STACK_SIZE];
16
17 /* Define prototypes. */
18 VOID start_guix(VOID);
19 extern UINT win32_graphics_driver_setup_24xrgb(GX_DISPLAY *display);
20
21 /******************************************************************************************/
22 /* Application entry. */
23 /******************************************************************************************/
main(int argc,char ** argv)24 int main(int argc, char ** argv)
25 {
26 tx_kernel_enter();
27 return(0);
28 }
29
30 /******************************************************************************************/
31 /* Define tx_application_define function. */
32 /******************************************************************************************/
tx_application_define(void * first_unused_memory)33 VOID tx_application_define(void *first_unused_memory)
34 {
35 /* Create the main demo thread. */
36 start_guix();
37 }
38
39 /******************************************************************************************/
40 /* Initiate and run GUIX. */
41 /******************************************************************************************/
start_guix(VOID)42 VOID start_guix(VOID)
43 {
44 /* Initialize GUIX. */
45 gx_system_initialize();
46
47 /* Configure display. */
48 gx_studio_display_configure(MAIN_DISPLAY, win32_graphics_driver_setup_24xrgb,
49 LANGUAGE_ENGLISH, MAIN_DISPLAY_THEME_1, &root);
50
51 /* Create main screen */
52 gx_studio_named_widget_create("main_screen", (GX_WIDGET *) root, GX_NULL);
53
54 /* Create screen a. */
55 gx_studio_named_widget_create("screen_a", GX_NULL, GX_NULL);
56
57 /* Create screen b. */
58 gx_studio_named_widget_create("screen_b", GX_NULL, GX_NULL);
59
60 /* Create setting_screen. */
61 gx_studio_named_widget_create("setting_screen", GX_NULL, GX_NULL);
62
63 /* Create system screen stack that needed for studio auto animation. */
64 gx_system_screen_stack_create(system_screen_stack_memory, sizeof(GX_WIDGET *)* SYSTEM_SCREEN_STACK_SIZE);
65
66 /* Show the root window to make it and child screen visible. */
67 gx_widget_show(root);
68
69 /* let GUIX run */
70 gx_system_start();
71 }