/* This is a small demo of the high-performance GUIX graphics framework. */ #include #include "gx_api.h" #include "gx_canvas.h" #include "png_draw_32bpp_resources.h" #include "png_draw_32bpp_specifications.h" WINDOW_CONTROL_BLOCK *pMainWin; /* Define the ThreadX demo thread control block and stack. */ TX_THREAD demo_thread; UCHAR demo_thread_stack[4096]; TX_BYTE_POOL decode_pool; #define SCRATCHPAD_PIXELS (DISPLAY_1_X_RESOLUTION * DISPLAY_1_Y_RESOLUTION * 4) GX_COLOR scratchpad[SCRATCHPAD_PIXELS]; GX_WINDOW_ROOT *root; /* Define prototypes. */ VOID guix_setup(void); extern UINT win32_graphics_driver_setup_24xrgb(GX_DISPLAY *display); int main(int argc, char ** argv) { tx_kernel_enter(); return(0); } VOID *decode_memory_allocate(ULONG size) { VOID *memptr; if (tx_byte_allocate(&decode_pool, &memptr, size, TX_NO_WAIT) == TX_SUCCESS) { return memptr; } return NULL; } void decode_memory_free(VOID *mem) { tx_byte_release(mem); } VOID tx_application_define(void *first_unused_memory) { /* create byte pool for decode to use */ tx_byte_pool_create(&decode_pool, "scratchpad", scratchpad, SCRATCHPAD_PIXELS * sizeof(GX_COLOR)); guix_setup(); /* install our memory allocator and de-allocator */ gx_system_memory_allocator_set(decode_memory_allocate, decode_memory_free); } VOID guix_setup() { /* Initialize GUIX. */ gx_system_initialize(); gx_studio_display_configure(DISPLAY_1, win32_graphics_driver_setup_24xrgb, LANGUAGE_ENGLISH, DISPLAY_1_THEME_1, &root); /* create the main screen */ gx_studio_named_widget_create("window", (GX_WIDGET *) root, (GX_WIDGET **) &pMainWin); /* Show the root window to make it and patients screen visible. */ gx_widget_show(root); /* let GUIX run */ gx_system_start(); }