1 /*******************************************************************************/
2 /*  This file is auto-generated by Azure RTOS GUIX Studio. Do not edit this    */
3 /*  file by hand. Modifications to this file should only be made by running    */
4 /*  the Azure RTOS GUIX Studio application and re-generating the application   */
5 /*  specification file(s). For more information please refer to the Azure RTOS */
6 /*  GUIX Studio User Guide, or visit our web site at azure.com/rtos            */
7 /*                                                                             */
8 /*  GUIX Studio Revision 6.2.0.1                                               */
9 /*  Date (dd.mm.yyyy): 31.10.2022   Time (hh:mm): 14:11                        */
10 /*******************************************************************************/
11 
12 
13 #define GUIX_STUDIO_GENERATED_FILE
14 #include <stddef.h>
15 #include "pixelmap_clip_16bpp_resources.h"
16 #include "pixelmap_clip_16bpp_specifications.h"
17 
18 static GX_WIDGET *gx_studio_nested_widget_create(GX_BYTE *control, GX_CONST GX_STUDIO_WIDGET *definition, GX_WIDGET *parent);
19 WINDOW_CONTROL_BLOCK window;
20 GX_DISPLAY main_display_control_block;
21 GX_WINDOW_ROOT main_display_root_window;
22 GX_CANVAS  main_display_canvas_control_block;
23 ULONG      main_display_canvas_memory[38400];
24 
25 extern GX_CONST GX_THEME *main_display_theme_table[];
26 extern GX_CONST GX_STRING *main_display_language_table[];
27 
28 GX_STUDIO_DISPLAY_INFO pixelmap_clip_16bpp_display_table[1] =
29 {
30     {
31     "main_display",
32     "main_display_canvas",
33     main_display_theme_table,
34     main_display_language_table,
35     MAIN_DISPLAY_THEME_TABLE_SIZE,
36     MAIN_DISPLAY_LANGUAGE_TABLE_SIZE,
37     MAIN_DISPLAY_STRING_TABLE_SIZE,
38     320,                                     /* x resolution                   */
39     240,                                     /* y resolution                   */
40     &main_display_control_block,
41     &main_display_canvas_control_block,
42     &main_display_root_window,
43     main_display_canvas_memory,              /* canvas memory area             */
44     153600,                                  /* canvas memory size in bytes    */
45     0                                        /* rotation angle                 */
46     }
47 };
48 
49 
gx_studio_checkbox_create(GX_CONST GX_STUDIO_WIDGET * info,GX_WIDGET * control_block,GX_WIDGET * parent)50 UINT gx_studio_checkbox_create(GX_CONST GX_STUDIO_WIDGET *info, GX_WIDGET *control_block, GX_WIDGET *parent)
51 {
52     UINT status;
53     GX_CHECKBOX *button = (GX_CHECKBOX *) control_block;
54     GX_TEXT_BUTTON *text_button = (GX_TEXT_BUTTON *) button;
55     GX_CHECKBOX_PROPERTIES *props = (GX_CHECKBOX_PROPERTIES *) info->properties;
56     status = gx_checkbox_create(button, info->widget_name, parent, props->string_id, info->style, info->widget_id, &info->size);
57     if (status == GX_SUCCESS)
58     {
59         gx_text_button_font_set(text_button, props->font_id);
60 #if defined(GUIX_5_4_0_COMPATIBILITY)
61         gx_text_button_text_color_set(text_button, props->normal_text_color_id, props->selected_text_color_id);
62  #else
63         gx_text_button_text_color_set(text_button, props->normal_text_color_id, props->selected_text_color_id, props->disabled_text_color_id);
64 #endif
65 
66         if (props->unchecked_pixelmap_id ||
67             props->checked_pixelmap_id ||
68             props->unchecked_disabled_pixelmap_id ||
69             props->checked_disabled_pixelmap_id)
70         {
71             gx_checkbox_pixelmap_set(button,
72                                      props->unchecked_pixelmap_id,
73                                      props->checked_pixelmap_id,
74                                      props->unchecked_disabled_pixelmap_id,
75                                      props->checked_disabled_pixelmap_id);
76         }
77     }
78     return status;
79 }
80 
gx_studio_prompt_create(GX_CONST GX_STUDIO_WIDGET * info,GX_WIDGET * control_block,GX_WIDGET * parent)81 UINT gx_studio_prompt_create(GX_CONST GX_STUDIO_WIDGET *info, GX_WIDGET *control_block, GX_WIDGET *parent)
82 {
83     UINT status;
84     GX_PROMPT *prompt = (GX_PROMPT *) control_block;
85     GX_PROMPT_PROPERTIES *props = (GX_PROMPT_PROPERTIES *) info->properties;
86     status = gx_prompt_create(prompt, info->widget_name, parent, props->string_id, info->style, info->widget_id, &info->size);
87     if (status == GX_SUCCESS)
88     {
89         gx_prompt_font_set(prompt, props->font_id);
90 #if defined(GUIX_5_4_0_COMPATIBILITY)
91         gx_prompt_text_color_set(prompt, props->normal_text_color_id, props->selected_text_color_id);
92 #else
93         gx_prompt_text_color_set(prompt, props->normal_text_color_id, props->selected_text_color_id, props->disabled_text_color_id);
94 #endif
95     }
96     return status;
97 }
98 
gx_studio_window_create(GX_CONST GX_STUDIO_WIDGET * info,GX_WIDGET * control_block,GX_WIDGET * parent)99 UINT gx_studio_window_create(GX_CONST GX_STUDIO_WIDGET *info, GX_WIDGET *control_block, GX_WIDGET *parent)
100 {
101     UINT status;
102     GX_WINDOW *window = (GX_WINDOW *) control_block;
103     GX_WINDOW_PROPERTIES *props = (GX_WINDOW_PROPERTIES *) info->properties;
104     status = gx_window_create(window, info->widget_name, parent, info->style, info->widget_id, &info->size);
105     if (status == GX_SUCCESS)
106     {
107         if (props->wallpaper_id)
108         {
109             gx_window_wallpaper_set(window, props->wallpaper_id, info->style & GX_STYLE_TILE_WALLPAPER);
110         }
111     }
112     return status;
113 }
114 GX_WINDOW_PROPERTIES window_properties =
115 {
116     GX_PIXELMAP_ID_CAL_POPPY_200             /* wallpaper pixelmap id          */
117 };
118 GX_WINDOW_PROPERTIES window_pixelmap_window_properties =
119 {
120     GX_PIXELMAP_ID_RAINBOW200_ALPHA0_COMPRESS  /* wallpaper pixelmap id        */
121 };
122 GX_PROMPT_PROPERTIES window_prompt_5_properties =
123 {
124     GX_STRING_ID_STRING_24,                  /* string id                      */
125     GX_FONT_ID_PROMPT,                       /* font id                        */
126     GX_COLOR_ID_TEXT,                        /* normal text color              */
127     GX_COLOR_ID_SELECTED_TEXT,               /* selected text color            */
128     GX_COLOR_ID_TEXT                         /* disabled text color            */
129 };
130 GX_PROMPT_PROPERTIES window_prompt_6_properties =
131 {
132     GX_STRING_ID_STRING_26,                  /* string id                      */
133     GX_FONT_ID_PROMPT,                       /* font id                        */
134     GX_COLOR_ID_TEXT,                        /* normal text color              */
135     GX_COLOR_ID_SELECTED_TEXT,               /* selected text color            */
136     GX_COLOR_ID_TEXT                         /* disabled text color            */
137 };
138 GX_PROMPT_PROPERTIES window_prompt_7_properties =
139 {
140     GX_STRING_ID_STRING_27,                  /* string id                      */
141     GX_FONT_ID_PROMPT,                       /* font id                        */
142     GX_COLOR_ID_TEXT,                        /* normal text color              */
143     GX_COLOR_ID_SELECTED_TEXT,               /* selected text color            */
144     GX_COLOR_ID_TEXT                         /* disabled text color            */
145 };
146 GX_PROMPT_PROPERTIES window_prompt_8_properties =
147 {
148     GX_STRING_ID_STRING_25,                  /* string id                      */
149     GX_FONT_ID_PROMPT,                       /* font id                        */
150     GX_COLOR_ID_TEXT,                        /* normal text color              */
151     GX_COLOR_ID_SELECTED_TEXT,               /* selected text color            */
152     GX_COLOR_ID_TEXT                         /* disabled text color            */
153 };
154 GX_PROMPT_PROPERTIES window_prompt_1_properties =
155 {
156     GX_STRING_ID_STRING_23,                  /* string id                      */
157     GX_FONT_ID_PROMPT,                       /* font id                        */
158     GX_COLOR_ID_TEXT,                        /* normal text color              */
159     GX_COLOR_ID_SELECTED_TEXT,               /* selected text color            */
160     GX_COLOR_ID_TEXT                         /* disabled text color            */
161 };
162 GX_CHECKBOX_PROPERTIES window_checkbox_alpha_properties =
163 {
164     GX_STRING_ID_STRING_13,                  /* string id                      */
165     GX_FONT_ID_BUTTON,                       /* font id                        */
166     GX_COLOR_ID_BTN_TEXT,                    /* normal text color              */
167     GX_COLOR_ID_BTN_TEXT,                    /* selected text color            */
168     GX_COLOR_ID_BTN_TEXT,                    /* disabled text color            */
169     0,                                       /* unchecked pixelmap id          */
170     0,                                       /* checked pixelmap id            */
171     0,                                       /* unchecked disabled pixelmap id */
172     0                                        /* checked disabled pixelmap id   */
173 };
174 GX_CHECKBOX_PROPERTIES window_checkbox_compressed_properties =
175 {
176     GX_STRING_ID_STRING_9,                   /* string id                      */
177     GX_FONT_ID_BUTTON,                       /* font id                        */
178     GX_COLOR_ID_BTN_TEXT,                    /* normal text color              */
179     GX_COLOR_ID_BTN_TEXT,                    /* selected text color            */
180     GX_COLOR_ID_BTN_TEXT,                    /* disabled text color            */
181     0,                                       /* unchecked pixelmap id          */
182     0,                                       /* checked pixelmap id            */
183     0,                                       /* unchecked disabled pixelmap id */
184     0                                        /* checked disabled pixelmap id   */
185 };
186 
187 GX_CONST GX_STUDIO_WIDGET window_prompt_1_define =
188 {
189     "prompt_1",
190     GX_TYPE_PROMPT,                          /* widget type                    */
191     GX_ID_NONE,                              /* widget id                      */
192     #if defined(GX_WIDGET_USER_DATA)
193     0,                                       /* user data                      */
194     #endif
195     GX_STYLE_BORDER_THIN|GX_STYLE_ENABLED|GX_STYLE_TEXT_CENTER,   /* style flags */
196     GX_STATUS_ACCEPTS_FOCUS,                 /* status flags                   */
197     sizeof(GX_PROMPT),                       /* control block size             */
198     GX_COLOR_ID_LIGHT_YELLOW,                /* normal color id                */
199     GX_COLOR_ID_SELECTED_FILL,               /* selected color id              */
200     GX_COLOR_ID_LIGHT_YELLOW,                /* disabled color id              */
201     gx_studio_prompt_create,                 /* create function                */
202     GX_NULL,                                 /* drawing function override      */
203     GX_NULL,                                 /* event function override        */
204     {55, 28, 255, 51},                       /* widget size                    */
205     GX_NULL,                                 /* no next widget                 */
206     GX_NULL,                                 /* no child widgets               */
207     offsetof(WINDOW_CONTROL_BLOCK, window_prompt_1), /* control block          */
208     (void *) &window_prompt_1_properties     /* extended properties            */
209 };
210 
211 GX_CONST GX_STUDIO_WIDGET window_prompt_8_define =
212 {
213     "prompt_8",
214     GX_TYPE_PROMPT,                          /* widget type                    */
215     GX_ID_NONE,                              /* widget id                      */
216     #if defined(GX_WIDGET_USER_DATA)
217     0,                                       /* user data                      */
218     #endif
219     GX_STYLE_BORDER_THIN|GX_STYLE_ENABLED|GX_STYLE_TEXT_CENTER,   /* style flags */
220     GX_STATUS_ACCEPTS_FOCUS,                 /* status flags                   */
221     sizeof(GX_PROMPT),                       /* control block size             */
222     GX_COLOR_ID_LIGHT_YELLOW,                /* normal color id                */
223     GX_COLOR_ID_SELECTED_FILL,               /* selected color id              */
224     GX_COLOR_ID_LIGHT_YELLOW,                /* disabled color id              */
225     gx_studio_prompt_create,                 /* create function                */
226     GX_NULL,                                 /* drawing function override      */
227     GX_NULL,                                 /* event function override        */
228     {153, 60, 232, 83},                      /* widget size                    */
229     &window_prompt_1_define,                 /* next widget definition         */
230     GX_NULL,                                 /* no child widgets               */
231     offsetof(WINDOW_CONTROL_BLOCK, window_prompt_8), /* control block          */
232     (void *) &window_prompt_8_properties     /* extended properties            */
233 };
234 
235 GX_CONST GX_STUDIO_WIDGET window_prompt_7_define =
236 {
237     "prompt_7",
238     GX_TYPE_PROMPT,                          /* widget type                    */
239     GX_ID_NONE,                              /* widget id                      */
240     #if defined(GX_WIDGET_USER_DATA)
241     0,                                       /* user data                      */
242     #endif
243     GX_STYLE_BORDER_THIN|GX_STYLE_ENABLED|GX_STYLE_TEXT_CENTER,   /* style flags */
244     GX_STATUS_ACCEPTS_FOCUS,                 /* status flags                   */
245     sizeof(GX_PROMPT),                       /* control block size             */
246     GX_COLOR_ID_LIGHT_YELLOW,                /* normal color id                */
247     GX_COLOR_ID_SELECTED_FILL,               /* selected color id              */
248     GX_COLOR_ID_LIGHT_YELLOW,                /* disabled color id              */
249     gx_studio_prompt_create,                 /* create function                */
250     GX_NULL,                                 /* drawing function override      */
251     GX_NULL,                                 /* event function override        */
252     {132, 129, 195, 152},                    /* widget size                    */
253     &window_prompt_8_define,                 /* next widget definition         */
254     GX_NULL,                                 /* no child widgets               */
255     offsetof(WINDOW_CONTROL_BLOCK, window_prompt_7), /* control block          */
256     (void *) &window_prompt_7_properties     /* extended properties            */
257 };
258 
259 GX_CONST GX_STUDIO_WIDGET window_prompt_6_define =
260 {
261     "prompt_6",
262     GX_TYPE_PROMPT,                          /* widget type                    */
263     GX_ID_NONE,                              /* widget id                      */
264     #if defined(GX_WIDGET_USER_DATA)
265     0,                                       /* user data                      */
266     #endif
267     GX_STYLE_BORDER_THIN|GX_STYLE_ENABLED|GX_STYLE_TEXT_CENTER,   /* style flags */
268     GX_STATUS_ACCEPTS_FOCUS,                 /* status flags                   */
269     sizeof(GX_PROMPT),                       /* control block size             */
270     GX_COLOR_ID_LIGHT_YELLOW,                /* normal color id                */
271     GX_COLOR_ID_SELECTED_FILL,               /* selected color id              */
272     GX_COLOR_ID_LIGHT_YELLOW,                /* disabled color id              */
273     gx_studio_prompt_create,                 /* create function                */
274     GX_NULL,                                 /* drawing function override      */
275     GX_NULL,                                 /* event function override        */
276     {70, 94, 198, 117},                      /* widget size                    */
277     &window_prompt_7_define,                 /* next widget definition         */
278     GX_NULL,                                 /* no child widgets               */
279     offsetof(WINDOW_CONTROL_BLOCK, window_prompt_6), /* control block          */
280     (void *) &window_prompt_6_properties     /* extended properties            */
281 };
282 
283 GX_CONST GX_STUDIO_WIDGET window_prompt_5_define =
284 {
285     "prompt_5",
286     GX_TYPE_PROMPT,                          /* widget type                    */
287     GX_ID_NONE,                              /* widget id                      */
288     #if defined(GX_WIDGET_USER_DATA)
289     0,                                       /* user data                      */
290     #endif
291     GX_STYLE_BORDER_THIN|GX_STYLE_ENABLED|GX_STYLE_TEXT_CENTER,   /* style flags */
292     GX_STATUS_ACCEPTS_FOCUS,                 /* status flags                   */
293     sizeof(GX_PROMPT),                       /* control block size             */
294     GX_COLOR_ID_LIGHT_YELLOW,                /* normal color id                */
295     GX_COLOR_ID_SELECTED_FILL,               /* selected color id              */
296     GX_COLOR_ID_LIGHT_YELLOW,                /* disabled color id              */
297     gx_studio_prompt_create,                 /* create function                */
298     GX_NULL,                                 /* drawing function override      */
299     GX_NULL,                                 /* event function override        */
300     {73, 60, 132, 83},                       /* widget size                    */
301     &window_prompt_6_define,                 /* next widget definition         */
302     GX_NULL,                                 /* no child widgets               */
303     offsetof(WINDOW_CONTROL_BLOCK, window_prompt_5), /* control block          */
304     (void *) &window_prompt_5_properties     /* extended properties            */
305 };
306 
307 GX_CONST GX_STUDIO_WIDGET window_checkbox_compressed_define =
308 {
309     "checkbox_compressed",
310     GX_TYPE_CHECKBOX,                        /* widget type                    */
311     ID_CHECKBOX_COMPRESSED,                  /* widget id                      */
312     #if defined(GX_WIDGET_USER_DATA)
313     0,                                       /* user data                      */
314     #endif
315     GX_STYLE_BORDER_NONE|GX_STYLE_TRANSPARENT|GX_STYLE_ENABLED|GX_STYLE_BUTTON_TOGGLE|GX_STYLE_TEXT_LEFT,   /* style flags */
316     GX_STATUS_ACCEPTS_FOCUS,                 /* status flags                   */
317     sizeof(GX_CHECKBOX),                     /* control block size             */
318     GX_COLOR_ID_BTN_LOWER,                   /* normal color id                */
319     GX_COLOR_ID_BTN_UPPER,                   /* selected color id              */
320     GX_COLOR_ID_BTN_LOWER,                   /* disabled color id              */
321     gx_studio_checkbox_create,               /* create function                */
322     GX_NULL,                                 /* drawing function override      */
323     GX_NULL,                                 /* event function override        */
324     {184, 204, 307, 227},                    /* widget size                    */
325     GX_NULL,                                 /* no next widget                 */
326     GX_NULL,                                 /* no child widgets               */
327     offsetof(WINDOW_CONTROL_BLOCK, window_checkbox_compressed), /* control block */
328     (void *) &window_checkbox_compressed_properties /* extended properties     */
329 };
330 
331 GX_CONST GX_STUDIO_WIDGET window_checkbox_alpha_define =
332 {
333     "checkbox_alpha",
334     GX_TYPE_CHECKBOX,                        /* widget type                    */
335     ID_CHECKBOX_ALPHA,                       /* widget id                      */
336     #if defined(GX_WIDGET_USER_DATA)
337     0,                                       /* user data                      */
338     #endif
339     GX_STYLE_BORDER_NONE|GX_STYLE_TRANSPARENT|GX_STYLE_ENABLED|GX_STYLE_BUTTON_TOGGLE|GX_STYLE_TEXT_LEFT,   /* style flags */
340     GX_STATUS_ACCEPTS_FOCUS,                 /* status flags                   */
341     sizeof(GX_CHECKBOX),                     /* control block size             */
342     GX_COLOR_ID_BTN_LOWER,                   /* normal color id                */
343     GX_COLOR_ID_BTN_UPPER,                   /* selected color id              */
344     GX_COLOR_ID_BTN_LOWER,                   /* disabled color id              */
345     gx_studio_checkbox_create,               /* create function                */
346     GX_NULL,                                 /* drawing function override      */
347     GX_NULL,                                 /* event function override        */
348     {184, 176, 263, 199},                    /* widget size                    */
349     &window_checkbox_compressed_define,      /* next widget definition         */
350     GX_NULL,                                 /* no child widgets               */
351     offsetof(WINDOW_CONTROL_BLOCK, window_checkbox_alpha), /* control block    */
352     (void *) &window_checkbox_alpha_properties /* extended properties          */
353 };
354 
355 GX_CONST GX_STUDIO_WIDGET window_pixelmap_window_define =
356 {
357     "pixelmap_window",
358     GX_TYPE_WINDOW,                          /* widget type                    */
359     GX_ID_NONE,                              /* widget id                      */
360     #if defined(GX_WIDGET_USER_DATA)
361     0,                                       /* user data                      */
362     #endif
363     GX_STYLE_BORDER_THIN|GX_STYLE_TRANSPARENT,   /* style flags                */
364     GX_STATUS_ACCEPTS_FOCUS,                 /* status flags                   */
365     sizeof(GX_WINDOW),                       /* control block size             */
366     GX_COLOR_ID_WINDOW_FILL,                 /* normal color id                */
367     GX_COLOR_ID_WINDOW_FILL,                 /* selected color id              */
368     GX_COLOR_ID_WINDOW_FILL,                 /* disabled color id              */
369     gx_studio_window_create,                 /* create function                */
370     GX_NULL,                                 /* drawing function override      */
371     GX_NULL,                                 /* event function override        */
372     {55, 30, 254, 162},                      /* widget size                    */
373     &window_checkbox_alpha_define,           /* next widget definition         */
374     &window_prompt_5_define,                 /* child widget definition        */
375     offsetof(WINDOW_CONTROL_BLOCK, window_pixelmap_window), /* control block   */
376     (void *) &window_pixelmap_window_properties /* extended properties         */
377 };
378 
379 GX_CONST GX_STUDIO_WIDGET window_define =
380 {
381     "window",
382     GX_TYPE_WINDOW,                          /* widget type                    */
383     GX_ID_NONE,                              /* widget id                      */
384     #if defined(GX_WIDGET_USER_DATA)
385     0,                                       /* user data                      */
386     #endif
387     GX_STYLE_BORDER_THIN|GX_STYLE_TILE_WALLPAPER,   /* style flags             */
388     GX_STATUS_ACCEPTS_FOCUS,                 /* status flags                   */
389     sizeof(WINDOW_CONTROL_BLOCK),            /* control block size             */
390     GX_COLOR_ID_BTN_LOWER,                   /* normal color id                */
391     GX_COLOR_ID_BTN_LOWER,                   /* selected color id              */
392     GX_COLOR_ID_BTN_LOWER,                   /* disabled color id              */
393     gx_studio_window_create,                 /* create function                */
394     GX_NULL,                                 /* drawing function override      */
395     (UINT (*)(GX_WIDGET *, GX_EVENT *)) main_event_handler, /* event function override */
396     {0, 0, 319, 239},                        /* widget size                    */
397     GX_NULL,                                 /* next widget                    */
398     &window_pixelmap_window_define,          /* child widget                   */
399     0,                                       /* control block                  */
400     (void *) &window_properties              /* extended properties            */
401 };
402 GX_CONST GX_STUDIO_WIDGET_ENTRY pixelmap_clip_16bpp_widget_table[] =
403 {
404     { &window_define, (GX_WIDGET *) &window },
405     {GX_NULL, GX_NULL}
406 };
407 
gx_studio_nested_widget_create(GX_BYTE * control,GX_CONST GX_STUDIO_WIDGET * definition,GX_WIDGET * parent)408 static GX_WIDGET *gx_studio_nested_widget_create(GX_BYTE *control, GX_CONST GX_STUDIO_WIDGET *definition, GX_WIDGET *parent)
409 {
410     UINT status = GX_SUCCESS;
411     GX_WIDGET *widget = GX_NULL;
412     GX_VALUE   list_count = 0;
413     GX_VALUE   list_total_count = 0;
414 
415     if(parent && (parent->gx_widget_type == GX_TYPE_MENU))
416     {
417         list_total_count = ((GX_MENU *)parent)->gx_menu_list_total_count;
418     }
419 
420     while(definition && status == GX_SUCCESS)
421     {
422         if (definition->create_function)
423         {
424             if (definition->style & GX_STYLE_DYNAMICALLY_ALLOCATED)
425             {
426                 status = gx_widget_allocate(&widget, definition->control_block_size);
427                 if (status != GX_SUCCESS)
428                 {
429                     return GX_NULL;
430                 }
431             }
432             else
433             {
434                 if (control == GX_NULL)
435                 {
436                     return GX_NULL;
437                 }
438                 widget = (GX_WIDGET *) (control + definition->control_block_offset);
439             }
440 
441             status = definition->create_function(definition, widget, parent);
442 
443             if(list_count < list_total_count)
444             {
445                 gx_menu_insert((GX_MENU *)parent, widget);
446                 ((GX_MENU *)parent)->gx_menu_list_total_count--;
447                 list_count++;
448             }
449 
450             if (status == GX_SUCCESS)
451             {
452                 if (definition->widget_type != GX_TYPE_TEMPLATE)
453                 {
454 #if defined(GUIX_5_4_0_COMPATIBILITY)
455                     gx_widget_fill_color_set(widget, definition->normal_fill_color_id, definition->selected_fill_color_id);
456 #else
457                     gx_widget_fill_color_set(widget, definition->normal_fill_color_id, definition->selected_fill_color_id, definition->disabled_fill_color_id);
458 #endif
459                 }
460 
461                 if (!(definition->status & GX_STATUS_ACCEPTS_FOCUS))
462                 {
463                     gx_widget_status_remove(widget, GX_STATUS_ACCEPTS_FOCUS);
464                 }
465 
466                 if (definition->draw_function)
467                 {
468                     gx_widget_draw_set(widget, definition->draw_function);
469                 }
470                 if (definition->event_function)
471                 {
472                     gx_widget_event_process_set(widget, definition->event_function);
473                 }
474 
475                 #if defined(GX_WIDGET_USER_DATA)
476                 widget->gx_widget_user_data = definition->user_data;
477                 #endif
478 
479                 if (definition->child_widget)
480                 {
481                     gx_studio_nested_widget_create(control, definition->child_widget, widget);
482                 }
483             }
484             definition = definition->next_widget;
485         }
486     }
487     return widget;
488 }
489 
gx_studio_widget_create(GX_BYTE * control,GX_CONST GX_STUDIO_WIDGET * definition,GX_WIDGET * parent)490 GX_WIDGET *gx_studio_widget_create(GX_BYTE *control, GX_CONST GX_STUDIO_WIDGET *definition, GX_WIDGET *parent)
491 {
492     GX_WIDGET *widget;
493     widget = gx_studio_nested_widget_create(control, definition, GX_NULL);
494 
495     if (parent && widget)
496     {
497         gx_widget_attach(parent, widget);
498     }
499     return widget;
500 }
501 
gx_studio_named_widget_create(char * name,GX_WIDGET * parent,GX_WIDGET ** new_widget)502 UINT gx_studio_named_widget_create(char *name, GX_WIDGET *parent, GX_WIDGET **new_widget)
503 {
504     UINT status = GX_FAILURE;
505     GX_CONST GX_STUDIO_WIDGET_ENTRY *entry = pixelmap_clip_16bpp_widget_table;
506     GX_WIDGET *widget = GX_NULL;
507 
508     while(entry->widget_information)
509     {
510         if (!strcmp(name, entry->widget_information->widget_name))
511         {
512             widget = gx_studio_widget_create((GX_BYTE *) entry->widget, entry->widget_information, parent);
513             if (widget)
514             {
515                 status = GX_SUCCESS;
516             }
517             break;
518         }
519         entry++;
520     }
521 
522     if (new_widget)
523     {
524         *new_widget = widget;
525     }
526     return status;
527 }
528 
529 
gx_studio_display_configure(USHORT display,UINT (* driver)(GX_DISPLAY *),GX_UBYTE language,USHORT theme,GX_WINDOW_ROOT ** return_root)530 UINT gx_studio_display_configure(USHORT display, UINT (*driver)(GX_DISPLAY *),
531     GX_UBYTE language, USHORT theme, GX_WINDOW_ROOT **return_root)
532 {
533     GX_CONST GX_THEME *theme_ptr;
534     GX_RECTANGLE size;
535 
536     GX_STUDIO_DISPLAY_INFO *display_info = &pixelmap_clip_16bpp_display_table[display];
537 
538 
539 /* create the requested display                                                */
540 
541     gx_display_create(display_info->display,
542                       display_info->name,
543                       driver,
544                       (GX_VALUE) display_info->x_resolution,
545                       (GX_VALUE) display_info->y_resolution);
546 
547 
548 /* install the request theme                                                   */
549 
550     if(display_info->theme_table)
551     {
552         theme_ptr = display_info->theme_table[theme];
553         if(theme_ptr)
554         {
555             gx_display_color_table_set(display_info->display, theme_ptr->theme_color_table, theme_ptr->theme_color_table_size);
556 
557 /* install the color palette if required                                       */
558             if (display_info->display->gx_display_driver_palette_set &&
559                 theme_ptr->theme_palette != NULL)
560             {
561                 display_info->display->gx_display_driver_palette_set(display_info->display, theme_ptr->theme_palette, theme_ptr->theme_palette_size);
562             }
563 
564             gx_display_font_table_set(display_info->display, theme_ptr->theme_font_table, theme_ptr->theme_font_table_size);
565             gx_display_pixelmap_table_set(display_info->display, theme_ptr->theme_pixelmap_table, theme_ptr->theme_pixelmap_table_size);
566             gx_system_scroll_appearance_set(theme_ptr->theme_vertical_scroll_style, (GX_SCROLLBAR_APPEARANCE *) &theme_ptr->theme_vertical_scrollbar_appearance);
567             gx_system_scroll_appearance_set(theme_ptr->theme_horizontal_scroll_style, (GX_SCROLLBAR_APPEARANCE *) &theme_ptr->theme_horizontal_scrollbar_appearance);
568         }
569     }
570 
571 /* Install the language table.                                                 */
572 
573     if(display_info->language_table)
574     {
575         gx_display_language_table_set_ext(display_info->display, display_info->language_table, (GX_UBYTE) display_info->language_table_size, display_info->string_table_size);
576         gx_display_active_language_set(display_info->display, language);
577     }
578 
579 /* Set screen rotation angle.                                                  */
580 
581     display_info->display->gx_display_rotation_angle = display_info->rotation_angle;
582 
583 /* create the canvas for this display                                          */
584 
585     gx_canvas_create(display_info->canvas,
586                      display_info->canvas_name,
587                      display_info->display,
588                      GX_CANVAS_MANAGED | GX_CANVAS_VISIBLE,
589                      display_info->x_resolution,
590                      display_info->y_resolution,
591                      display_info->canvas_memory,
592                      display_info->canvas_memory_size);
593 
594 /* Create the root window for this canvas                                      */
595 
596     gx_utility_rectangle_define(&size,
597                                 0, 0,
598                                 (GX_VALUE) (display_info->x_resolution - 1),
599                                 (GX_VALUE) (display_info->y_resolution - 1));
600 
601     gx_window_root_create(display_info->root_window,
602                           display_info->name,
603                           display_info->canvas, GX_STYLE_NONE, 0, &size);
604     if (return_root)
605     {
606         *return_root = display_info->root_window;
607     }
608     return GX_SUCCESS;
609 }
610 #undef GUIX_STUDIO_GENERATED_FILE
611