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:08                        */
10 /*******************************************************************************/
11 
12 
13 #define GUIX_STUDIO_GENERATED_FILE
14 #include <stddef.h>
15 #include "alphamap_16bpp_resources.h"
16 #include "alphamap_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 MAIN_WINDOW_CONTROL_BLOCK main_window;
20 GX_DISPLAY display_1_control_block;
21 GX_WINDOW_ROOT display_1_root_window;
22 GX_CANVAS  display_1_canvas_control_block;
23 ULONG      display_1_canvas_memory[153600];
24 
25 extern GX_CONST GX_THEME *display_1_theme_table[];
26 extern GX_CONST GX_STRING *display_1_language_table[];
27 
28 GX_STUDIO_DISPLAY_INFO alphamap_16bpp_display_table[1] =
29 {
30     {
31     "display_1",
32     "display_1_canvas",
33     display_1_theme_table,
34     display_1_language_table,
35     DISPLAY_1_THEME_TABLE_SIZE,
36     DISPLAY_1_LANGUAGE_TABLE_SIZE,
37     DISPLAY_1_STRING_TABLE_SIZE,
38     640,                                     /* x resolution                   */
39     480,                                     /* y resolution                   */
40     &display_1_control_block,
41     &display_1_canvas_control_block,
42     &display_1_root_window,
43     display_1_canvas_memory,                 /* canvas memory area             */
44     614400,                                  /* canvas memory size in bytes    */
45     0                                        /* rotation angle                 */
46     }
47 };
48 
49 
gx_studio_radio_button_create(GX_CONST GX_STUDIO_WIDGET * info,GX_WIDGET * control_block,GX_WIDGET * parent)50 UINT gx_studio_radio_button_create(GX_CONST GX_STUDIO_WIDGET *info, GX_WIDGET *control_block, GX_WIDGET *parent)
51 {
52     UINT status;
53     GX_RADIO_BUTTON *button = (GX_RADIO_BUTTON *) control_block;
54     GX_TEXT_BUTTON *text_button = (GX_TEXT_BUTTON *) button;
55     GX_RADIO_BUTTON_PROPERTIES *props = (GX_RADIO_BUTTON_PROPERTIES *) info->properties;
56     status = gx_radio_button_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->off_pixelmap_id ||
67             props->on_pixelmap_id ||
68             props->off_disabled_pixelmap_id ||
69             props->on_disabled_pixelmap_id)
70         {
71             gx_radio_button_pixelmap_set(button,
72                                      props->off_pixelmap_id,
73                                      props->on_pixelmap_id,
74                                      props->off_disabled_pixelmap_id,
75                                      props->on_disabled_pixelmap_id);
76         }
77     }
78     return status;
79 }
80 
gx_studio_slider_create(GX_CONST GX_STUDIO_WIDGET * info,GX_WIDGET * control_block,GX_WIDGET * parent)81 UINT gx_studio_slider_create(GX_CONST GX_STUDIO_WIDGET *info, GX_WIDGET *control_block, GX_WIDGET *parent)
82 {
83     UINT status;
84     GX_SLIDER *slider = (GX_SLIDER *) control_block;
85     GX_SLIDER_PROPERTIES *props = (GX_SLIDER_PROPERTIES *) info->properties;
86     GX_SLIDER_INFO slider_info;
87     slider_info.gx_slider_info_min_val = props->minval;
88     slider_info.gx_slider_info_max_val = props->maxval;
89     slider_info.gx_slider_info_current_val = props->current_val;
90     slider_info.gx_slider_info_increment = props->increment;
91     slider_info.gx_slider_info_min_travel = props->min_travel;
92     slider_info.gx_slider_info_max_travel = props->max_travel;
93     slider_info.gx_slider_info_needle_width = props->needle_width;
94     slider_info.gx_slider_info_needle_height = props->needle_height;
95     slider_info.gx_slider_info_needle_inset = props->needle_inset;
96     slider_info.gx_slider_info_needle_hotspot_offset = props->needle_hotspot;
97     status = gx_slider_create(slider,
98                     info->widget_name,
99                     parent,
100                     props->tickmark_count,
101                     &slider_info,
102                     info->style,
103                     info->widget_id,
104                     &info->size);
105     return status;
106 }
107 
gx_studio_prompt_create(GX_CONST GX_STUDIO_WIDGET * info,GX_WIDGET * control_block,GX_WIDGET * parent)108 UINT gx_studio_prompt_create(GX_CONST GX_STUDIO_WIDGET *info, GX_WIDGET *control_block, GX_WIDGET *parent)
109 {
110     UINT status;
111     GX_PROMPT *prompt = (GX_PROMPT *) control_block;
112     GX_PROMPT_PROPERTIES *props = (GX_PROMPT_PROPERTIES *) info->properties;
113     status = gx_prompt_create(prompt, info->widget_name, parent, props->string_id, info->style, info->widget_id, &info->size);
114     if (status == GX_SUCCESS)
115     {
116         gx_prompt_font_set(prompt, props->font_id);
117 #if defined(GUIX_5_4_0_COMPATIBILITY)
118         gx_prompt_text_color_set(prompt, props->normal_text_color_id, props->selected_text_color_id);
119 #else
120         gx_prompt_text_color_set(prompt, props->normal_text_color_id, props->selected_text_color_id, props->disabled_text_color_id);
121 #endif
122     }
123     return status;
124 }
125 
gx_studio_window_create(GX_CONST GX_STUDIO_WIDGET * info,GX_WIDGET * control_block,GX_WIDGET * parent)126 UINT gx_studio_window_create(GX_CONST GX_STUDIO_WIDGET *info, GX_WIDGET *control_block, GX_WIDGET *parent)
127 {
128     UINT status;
129     GX_WINDOW *window = (GX_WINDOW *) control_block;
130     GX_WINDOW_PROPERTIES *props = (GX_WINDOW_PROPERTIES *) info->properties;
131     status = gx_window_create(window, info->widget_name, parent, info->style, info->widget_id, &info->size);
132     if (status == GX_SUCCESS)
133     {
134         if (props->wallpaper_id)
135         {
136             gx_window_wallpaper_set(window, props->wallpaper_id, info->style & GX_STYLE_TILE_WALLPAPER);
137         }
138     }
139     return status;
140 }
141 GX_WINDOW_PROPERTIES main_window_properties =
142 {
143     0                                        /* wallpaper pixelmap id          */
144 };
145 GX_WINDOW_PROPERTIES main_window_window_1_properties =
146 {
147     GX_PIXELMAP_ID_RED_APPLE_RAW             /* wallpaper pixelmap id          */
148 };
149 GX_PROMPT_PROPERTIES main_window_prompt_1_properties =
150 {
151     GX_STRING_ID_STRING_7,                   /* string id                      */
152     GX_FONT_ID_PROMPT,                       /* font id                        */
153     GX_COLOR_ID_TEXT,                        /* normal text color              */
154     GX_COLOR_ID_SELECTED_TEXT,               /* selected text color            */
155     GX_COLOR_ID_TEXT                         /* disabled text color            */
156 };
157 GX_PROMPT_PROPERTIES main_window_prompt_2_properties =
158 {
159     GX_STRING_ID_STRING_4,                   /* string id                      */
160     GX_FONT_ID_PROMPT,                       /* font id                        */
161     GX_COLOR_ID_TEXT,                        /* normal text color              */
162     GX_COLOR_ID_SELECTED_TEXT,               /* selected text color            */
163     GX_COLOR_ID_TEXT                         /* disabled text color            */
164 };
165 GX_RADIO_BUTTON_PROPERTIES main_window_radio_button_1_properties =
166 {
167     GX_STRING_ID_STRING_10,                  /* string id                      */
168     GX_FONT_ID_BUTTON,                       /* font id                        */
169     GX_COLOR_ID_BTN_TEXT,                    /* normal text color              */
170     GX_COLOR_ID_BTN_TEXT,                    /* selected text color            */
171     GX_COLOR_ID_BTN_TEXT,                    /* disabled text color            */
172     0,                                       /* off pixelmap id                */
173     0,                                       /* on pixelmap id                 */
174     0,                                       /* off disabled pixelmap id       */
175     0                                        /* on disabled pixelmap id        */
176 };
177 GX_RADIO_BUTTON_PROPERTIES main_window_radio_button_2_properties =
178 {
179     GX_STRING_ID_STRING_11,                  /* string id                      */
180     GX_FONT_ID_BUTTON,                       /* font id                        */
181     GX_COLOR_ID_BTN_TEXT,                    /* normal text color              */
182     GX_COLOR_ID_BTN_TEXT,                    /* selected text color            */
183     GX_COLOR_ID_BTN_TEXT,                    /* disabled text color            */
184     0,                                       /* off pixelmap id                */
185     0,                                       /* on pixelmap id                 */
186     0,                                       /* off disabled pixelmap id       */
187     0                                        /* on disabled pixelmap id        */
188 };
189 GX_RADIO_BUTTON_PROPERTIES main_window_radio_button_4_properties =
190 {
191     GX_STRING_ID_STRING_12,                  /* string id                      */
192     GX_FONT_ID_BUTTON,                       /* font id                        */
193     GX_COLOR_ID_BTN_TEXT,                    /* normal text color              */
194     GX_COLOR_ID_BTN_TEXT,                    /* selected text color            */
195     GX_COLOR_ID_BTN_TEXT,                    /* disabled text color            */
196     0,                                       /* off pixelmap id                */
197     0,                                       /* on pixelmap id                 */
198     0,                                       /* off disabled pixelmap id       */
199     0                                        /* on disabled pixelmap id        */
200 };
201 GX_WINDOW_PROPERTIES main_window_window_2_properties =
202 {
203     GX_PIXELMAP_ID_FOOT_COMPRESSED           /* wallpaper pixelmap id          */
204 };
205 GX_PROMPT_PROPERTIES main_window_prompt_properties =
206 {
207     GX_STRING_ID_STRING_15,                  /* string id                      */
208     GX_FONT_ID_PROMPT,                       /* font id                        */
209     GX_COLOR_ID_TEXT,                        /* normal text color              */
210     GX_COLOR_ID_SELECTED_TEXT,               /* selected text color            */
211     GX_COLOR_ID_TEXT                         /* disabled text color            */
212 };
213 GX_SLIDER_PROPERTIES main_window_slider_alpha_properties =
214 {
215     10,                                      /* tickmark count                 */
216     0,                                       /* mimimun value                  */
217     255,                                     /* maximum value                  */
218     255,                                     /* current value                  */
219     1,                                       /* increment                      */
220     10,                                      /* minimum travel                 */
221     10,                                      /* maximum travel                 */
222     5,                                       /* needle width                   */
223     15,                                      /* needle height                  */
224     5,                                       /* needle inset                   */
225     2                                        /* needle hotspot                 */
226 };
227 GX_PROMPT_PROPERTIES main_window_prompt_alpha_properties =
228 {
229     GX_STRING_ID_STRING_16,                  /* string id                      */
230     GX_FONT_ID_PROMPT,                       /* font id                        */
231     GX_COLOR_ID_WHITE,                       /* normal text color              */
232     GX_COLOR_ID_WHITE,                       /* selected text color            */
233     GX_COLOR_ID_WHITE                        /* disabled text color            */
234 };
235 
236 GX_CONST GX_STUDIO_WIDGET main_window_prompt_alpha_define =
237 {
238     "prompt_alpha",
239     GX_TYPE_PROMPT,                          /* widget type                    */
240     ID_ALPHA_PROMPT,                         /* widget id                      */
241     #if defined(GX_WIDGET_USER_DATA)
242     0,                                       /* user data                      */
243     #endif
244     GX_STYLE_BORDER_THIN|GX_STYLE_ENABLED|GX_STYLE_TEXT_RIGHT,   /* style flags */
245     GX_STATUS_ACCEPTS_FOCUS,                 /* status flags                   */
246     sizeof(GX_PROMPT),                       /* control block size             */
247     GX_COLOR_ID_BLACK,                       /* normal color id                */
248     GX_COLOR_ID_SELECTED_FILL,               /* selected color id              */
249     GX_COLOR_ID_BLACK,                       /* disabled color id              */
250     gx_studio_prompt_create,                 /* create function                */
251     GX_NULL,                                 /* drawing function override      */
252     GX_NULL,                                 /* event function override        */
253     {469, 448, 504, 471},                    /* widget size                    */
254     GX_NULL,                                 /* no next widget                 */
255     GX_NULL,                                 /* no child widgets               */
256     offsetof(MAIN_WINDOW_CONTROL_BLOCK, main_window_prompt_alpha), /* control block */
257     (void *) &main_window_prompt_alpha_properties /* extended properties       */
258 };
259 
260 GX_CONST GX_STUDIO_WIDGET main_window_slider_alpha_define =
261 {
262     "slider_alpha",
263     GX_TYPE_SLIDER,                          /* widget type                    */
264     ID_SLIDER_ALPHA,                         /* widget id                      */
265     #if defined(GX_WIDGET_USER_DATA)
266     0,                                       /* user data                      */
267     #endif
268     GX_STYLE_BORDER_NONE|GX_STYLE_ENABLED|GX_STYLE_SHOW_NEEDLE|GX_STYLE_SHOW_TICKMARKS,   /* style flags */
269     GX_STATUS_ACCEPTS_FOCUS,                 /* status flags                   */
270     sizeof(GX_SLIDER),                       /* control block size             */
271     GX_COLOR_ID_BTN_UPPER,                   /* normal color id                */
272     GX_COLOR_ID_BTN_UPPER,                   /* selected color id              */
273     GX_COLOR_ID_BTN_UPPER,                   /* disabled color id              */
274     gx_studio_slider_create,                 /* create function                */
275     GX_NULL,                                 /* drawing function override      */
276     GX_NULL,                                 /* event function override        */
277     {273, 447, 459, 470},                    /* widget size                    */
278     &main_window_prompt_alpha_define,        /* next widget definition         */
279     GX_NULL,                                 /* no child widgets               */
280     offsetof(MAIN_WINDOW_CONTROL_BLOCK, main_window_slider_alpha), /* control block */
281     (void *) &main_window_slider_alpha_properties /* extended properties       */
282 };
283 
284 GX_CONST GX_STUDIO_WIDGET main_window_prompt_define =
285 {
286     "prompt",
287     GX_TYPE_PROMPT,                          /* widget type                    */
288     GX_ID_NONE,                              /* widget id                      */
289     #if defined(GX_WIDGET_USER_DATA)
290     0,                                       /* user data                      */
291     #endif
292     GX_STYLE_BORDER_NONE|GX_STYLE_TRANSPARENT|GX_STYLE_ENABLED|GX_STYLE_TEXT_CENTER,   /* style flags */
293     GX_STATUS_ACCEPTS_FOCUS,                 /* status flags                   */
294     sizeof(GX_PROMPT),                       /* control block size             */
295     GX_COLOR_ID_WIDGET_FILL,                 /* normal color id                */
296     GX_COLOR_ID_SELECTED_FILL,               /* selected color id              */
297     GX_COLOR_ID_WIDGET_FILL,                 /* disabled color id              */
298     gx_studio_prompt_create,                 /* create function                */
299     GX_NULL,                                 /* drawing function override      */
300     GX_NULL,                                 /* event function override        */
301     {119, 449, 267, 472},                    /* widget size                    */
302     &main_window_slider_alpha_define,        /* next widget definition         */
303     GX_NULL,                                 /* no child widgets               */
304     offsetof(MAIN_WINDOW_CONTROL_BLOCK, main_window_prompt), /* control block  */
305     (void *) &main_window_prompt_properties  /* extended properties            */
306 };
307 
308 GX_CONST GX_STUDIO_WIDGET main_window_window_2_define =
309 {
310     "window_2",
311     GX_TYPE_WINDOW,                          /* widget type                    */
312     GX_ID_NONE,                              /* widget id                      */
313     #if defined(GX_WIDGET_USER_DATA)
314     0,                                       /* user data                      */
315     #endif
316     GX_STYLE_BORDER_NONE|GX_STYLE_TRANSPARENT,   /* style flags                */
317     GX_STATUS_ACCEPTS_FOCUS,                 /* status flags                   */
318     sizeof(GX_WINDOW),                       /* control block size             */
319     GX_COLOR_ID_SELECTED_FILL,               /* normal color id                */
320     GX_COLOR_ID_SELECTED_FILL,               /* selected color id              */
321     GX_COLOR_ID_SELECTED_FILL,               /* disabled color id              */
322     gx_studio_window_create,                 /* create function                */
323     (VOID (*)(GX_WIDGET *)) pixelmap_wnd_draw, /* drawing function override    */
324     GX_NULL,                                 /* event function override        */
325     {382, 139, 578, 287},                    /* widget size                    */
326     &main_window_prompt_define,              /* next widget definition         */
327     GX_NULL,                                 /* no child widgets               */
328     offsetof(MAIN_WINDOW_CONTROL_BLOCK, main_window_window_2), /* control block */
329     (void *) &main_window_window_2_properties /* extended properties           */
330 };
331 
332 GX_CONST GX_STUDIO_WIDGET main_window_radio_button_4_define =
333 {
334     "radio_button_4",
335     GX_TYPE_RADIO_BUTTON,                    /* widget type                    */
336     ID_RADIO_BUTTON_GREEN,                   /* widget id                      */
337     #if defined(GX_WIDGET_USER_DATA)
338     0,                                       /* user data                      */
339     #endif
340     GX_STYLE_BORDER_NONE|GX_STYLE_TRANSPARENT|GX_STYLE_ENABLED|GX_STYLE_BUTTON_RADIO|GX_STYLE_TEXT_LEFT,   /* style flags */
341     GX_STATUS_ACCEPTS_FOCUS,                 /* status flags                   */
342     sizeof(GX_RADIO_BUTTON),                 /* control block size             */
343     GX_COLOR_ID_BTN_LOWER,                   /* normal color id                */
344     GX_COLOR_ID_BTN_UPPER,                   /* selected color id              */
345     GX_COLOR_ID_BTN_LOWER,                   /* disabled color id              */
346     gx_studio_radio_button_create,           /* create function                */
347     GX_NULL,                                 /* drawing function override      */
348     GX_NULL,                                 /* event function override        */
349     {430, 410, 509, 433},                    /* widget size                    */
350     &main_window_window_2_define,            /* next widget definition         */
351     GX_NULL,                                 /* no child widgets               */
352     offsetof(MAIN_WINDOW_CONTROL_BLOCK, main_window_radio_button_4), /* control block */
353     (void *) &main_window_radio_button_4_properties /* extended properties     */
354 };
355 
356 GX_CONST GX_STUDIO_WIDGET main_window_radio_button_2_define =
357 {
358     "radio_button_2",
359     GX_TYPE_RADIO_BUTTON,                    /* widget type                    */
360     ID_RADIO_BUTTON_RED,                     /* widget id                      */
361     #if defined(GX_WIDGET_USER_DATA)
362     0,                                       /* user data                      */
363     #endif
364     GX_STYLE_BORDER_NONE|GX_STYLE_TRANSPARENT|GX_STYLE_ENABLED|GX_STYLE_BUTTON_RADIO|GX_STYLE_TEXT_LEFT,   /* style flags */
365     GX_STATUS_ACCEPTS_FOCUS,                 /* status flags                   */
366     sizeof(GX_RADIO_BUTTON),                 /* control block size             */
367     GX_COLOR_ID_BTN_LOWER,                   /* normal color id                */
368     GX_COLOR_ID_BTN_UPPER,                   /* selected color id              */
369     GX_COLOR_ID_BTN_LOWER,                   /* disabled color id              */
370     gx_studio_radio_button_create,           /* create function                */
371     GX_NULL,                                 /* drawing function override      */
372     GX_NULL,                                 /* event function override        */
373     {279, 412, 358, 435},                    /* widget size                    */
374     &main_window_radio_button_4_define,      /* next widget definition         */
375     GX_NULL,                                 /* no child widgets               */
376     offsetof(MAIN_WINDOW_CONTROL_BLOCK, main_window_radio_button_2), /* control block */
377     (void *) &main_window_radio_button_2_properties /* extended properties     */
378 };
379 
380 GX_CONST GX_STUDIO_WIDGET main_window_radio_button_1_define =
381 {
382     "radio_button_1",
383     GX_TYPE_RADIO_BUTTON,                    /* widget type                    */
384     ID_RADIO_BUTTON_BLUE,                    /* widget id                      */
385     #if defined(GX_WIDGET_USER_DATA)
386     0,                                       /* user data                      */
387     #endif
388     GX_STYLE_BORDER_NONE|GX_STYLE_TRANSPARENT|GX_STYLE_ENABLED|GX_STYLE_BUTTON_PUSHED|GX_STYLE_BUTTON_RADIO|GX_STYLE_TEXT_LEFT,   /* style flags */
389     GX_STATUS_ACCEPTS_FOCUS,                 /* status flags                   */
390     sizeof(GX_RADIO_BUTTON),                 /* control block size             */
391     GX_COLOR_ID_BTN_LOWER,                   /* normal color id                */
392     GX_COLOR_ID_BTN_UPPER,                   /* selected color id              */
393     GX_COLOR_ID_BTN_LOWER,                   /* disabled color id              */
394     gx_studio_radio_button_create,           /* create function                */
395     GX_NULL,                                 /* drawing function override      */
396     GX_NULL,                                 /* event function override        */
397     {128, 412, 207, 435},                    /* widget size                    */
398     &main_window_radio_button_2_define,      /* next widget definition         */
399     GX_NULL,                                 /* no child widgets               */
400     offsetof(MAIN_WINDOW_CONTROL_BLOCK, main_window_radio_button_1), /* control block */
401     (void *) &main_window_radio_button_1_properties /* extended properties     */
402 };
403 
404 GX_CONST GX_STUDIO_WIDGET main_window_prompt_2_define =
405 {
406     "prompt_2",
407     GX_TYPE_PROMPT,                          /* widget type                    */
408     GX_ID_NONE,                              /* widget id                      */
409     #if defined(GX_WIDGET_USER_DATA)
410     0,                                       /* user data                      */
411     #endif
412     GX_STYLE_BORDER_NONE|GX_STYLE_TRANSPARENT|GX_STYLE_TEXT_CENTER,   /* style flags */
413     0,                                       /* status flags                   */
414     sizeof(GX_PROMPT),                       /* control block size             */
415     GX_COLOR_ID_WIDGET_FILL,                 /* normal color id                */
416     GX_COLOR_ID_SELECTED_FILL,               /* selected color id              */
417     GX_COLOR_ID_WIDGET_FILL,                 /* disabled color id              */
418     gx_studio_prompt_create,                 /* create function                */
419     GX_NULL,                                 /* drawing function override      */
420     GX_NULL,                                 /* event function override        */
421     {406, 40, 519, 63},                      /* widget size                    */
422     &main_window_radio_button_1_define,      /* next widget definition         */
423     GX_NULL,                                 /* no child widgets               */
424     offsetof(MAIN_WINDOW_CONTROL_BLOCK, main_window_prompt_2), /* control block */
425     (void *) &main_window_prompt_2_properties /* extended properties           */
426 };
427 
428 GX_CONST GX_STUDIO_WIDGET main_window_prompt_1_define =
429 {
430     "prompt_1",
431     GX_TYPE_PROMPT,                          /* widget type                    */
432     GX_ID_NONE,                              /* widget id                      */
433     #if defined(GX_WIDGET_USER_DATA)
434     0,                                       /* user data                      */
435     #endif
436     GX_STYLE_BORDER_NONE|GX_STYLE_TRANSPARENT|GX_STYLE_TEXT_CENTER,   /* style flags */
437     0,                                       /* status flags                   */
438     sizeof(GX_PROMPT),                       /* control block size             */
439     GX_COLOR_ID_WIDGET_FILL,                 /* normal color id                */
440     GX_COLOR_ID_SELECTED_FILL,               /* selected color id              */
441     GX_COLOR_ID_WIDGET_FILL,                 /* disabled color id              */
442     gx_studio_prompt_create,                 /* create function                */
443     GX_NULL,                                 /* drawing function override      */
444     GX_NULL,                                 /* event function override        */
445     {127, 40, 206, 63},                      /* widget size                    */
446     &main_window_prompt_2_define,            /* next widget definition         */
447     GX_NULL,                                 /* no child widgets               */
448     offsetof(MAIN_WINDOW_CONTROL_BLOCK, main_window_prompt_1), /* control block */
449     (void *) &main_window_prompt_1_properties /* extended properties           */
450 };
451 
452 GX_CONST GX_STUDIO_WIDGET main_window_window_1_define =
453 {
454     "window_1",
455     GX_TYPE_WINDOW,                          /* widget type                    */
456     GX_ID_NONE,                              /* widget id                      */
457     #if defined(GX_WIDGET_USER_DATA)
458     0,                                       /* user data                      */
459     #endif
460     GX_STYLE_BORDER_NONE|GX_STYLE_TRANSPARENT,   /* style flags                */
461     GX_STATUS_ACCEPTS_FOCUS,                 /* status flags                   */
462     sizeof(GX_WINDOW),                       /* control block size             */
463     GX_COLOR_ID_SLIDER_NEEDLE_FILL,          /* normal color id                */
464     GX_COLOR_ID_SLIDER_NEEDLE_FILL,          /* selected color id              */
465     GX_COLOR_ID_SLIDER_NEEDLE_FILL,          /* disabled color id              */
466     gx_studio_window_create,                 /* create function                */
467     (VOID (*)(GX_WIDGET *)) pixelmap_wnd_draw, /* drawing function override    */
468     GX_NULL,                                 /* event function override        */
469     {83, 80, 279, 351},                      /* widget size                    */
470     &main_window_prompt_1_define,            /* next widget definition         */
471     GX_NULL,                                 /* no child widgets               */
472     offsetof(MAIN_WINDOW_CONTROL_BLOCK, main_window_window_1), /* control block */
473     (void *) &main_window_window_1_properties /* extended properties           */
474 };
475 
476 GX_CONST GX_STUDIO_WIDGET main_window_define =
477 {
478     "main_window",
479     GX_TYPE_WINDOW,                          /* widget type                    */
480     GX_ID_NONE,                              /* widget id                      */
481     #if defined(GX_WIDGET_USER_DATA)
482     0,                                       /* user data                      */
483     #endif
484     GX_STYLE_BORDER_THIN,                    /* style flags                    */
485     GX_STATUS_ACCEPTS_FOCUS,                 /* status flags                   */
486     sizeof(MAIN_WINDOW_CONTROL_BLOCK),       /* control block size             */
487     GX_COLOR_ID_BTN_LOWER,                   /* normal color id                */
488     GX_COLOR_ID_BTN_LOWER,                   /* selected color id              */
489     GX_COLOR_ID_BTN_LOWER,                   /* disabled color id              */
490     gx_studio_window_create,                 /* create function                */
491     GX_NULL,                                 /* drawing function override      */
492     (UINT (*)(GX_WIDGET *, GX_EVENT *)) window_event_handler, /* event function override */
493     {0, 0, 638, 478},                        /* widget size                    */
494     GX_NULL,                                 /* next widget                    */
495     &main_window_window_1_define,            /* child widget                   */
496     0,                                       /* control block                  */
497     (void *) &main_window_properties         /* extended properties            */
498 };
499 GX_CONST GX_STUDIO_WIDGET_ENTRY alphamap_16bpp_widget_table[] =
500 {
501     { &main_window_define, (GX_WIDGET *) &main_window },
502     {GX_NULL, GX_NULL}
503 };
504 
gx_studio_nested_widget_create(GX_BYTE * control,GX_CONST GX_STUDIO_WIDGET * definition,GX_WIDGET * parent)505 static GX_WIDGET *gx_studio_nested_widget_create(GX_BYTE *control, GX_CONST GX_STUDIO_WIDGET *definition, GX_WIDGET *parent)
506 {
507     UINT status = GX_SUCCESS;
508     GX_WIDGET *widget = GX_NULL;
509     GX_VALUE   list_count = 0;
510     GX_VALUE   list_total_count = 0;
511 
512     if(parent && (parent->gx_widget_type == GX_TYPE_MENU))
513     {
514         list_total_count = ((GX_MENU *)parent)->gx_menu_list_total_count;
515     }
516 
517     while(definition && status == GX_SUCCESS)
518     {
519         if (definition->create_function)
520         {
521             if (definition->style & GX_STYLE_DYNAMICALLY_ALLOCATED)
522             {
523                 status = gx_widget_allocate(&widget, definition->control_block_size);
524                 if (status != GX_SUCCESS)
525                 {
526                     return GX_NULL;
527                 }
528             }
529             else
530             {
531                 if (control == GX_NULL)
532                 {
533                     return GX_NULL;
534                 }
535                 widget = (GX_WIDGET *) (control + definition->control_block_offset);
536             }
537 
538             status = definition->create_function(definition, widget, parent);
539 
540             if(list_count < list_total_count)
541             {
542                 gx_menu_insert((GX_MENU *)parent, widget);
543                 ((GX_MENU *)parent)->gx_menu_list_total_count--;
544                 list_count++;
545             }
546 
547             if (status == GX_SUCCESS)
548             {
549                 if (definition->widget_type != GX_TYPE_TEMPLATE)
550                 {
551 #if defined(GUIX_5_4_0_COMPATIBILITY)
552                     gx_widget_fill_color_set(widget, definition->normal_fill_color_id, definition->selected_fill_color_id);
553 #else
554                     gx_widget_fill_color_set(widget, definition->normal_fill_color_id, definition->selected_fill_color_id, definition->disabled_fill_color_id);
555 #endif
556                 }
557 
558                 if (!(definition->status & GX_STATUS_ACCEPTS_FOCUS))
559                 {
560                     gx_widget_status_remove(widget, GX_STATUS_ACCEPTS_FOCUS);
561                 }
562 
563                 if (definition->draw_function)
564                 {
565                     gx_widget_draw_set(widget, definition->draw_function);
566                 }
567                 if (definition->event_function)
568                 {
569                     gx_widget_event_process_set(widget, definition->event_function);
570                 }
571 
572                 #if defined(GX_WIDGET_USER_DATA)
573                 widget->gx_widget_user_data = definition->user_data;
574                 #endif
575 
576                 if (definition->child_widget)
577                 {
578                     gx_studio_nested_widget_create(control, definition->child_widget, widget);
579                 }
580             }
581             definition = definition->next_widget;
582         }
583     }
584     return widget;
585 }
586 
gx_studio_widget_create(GX_BYTE * control,GX_CONST GX_STUDIO_WIDGET * definition,GX_WIDGET * parent)587 GX_WIDGET *gx_studio_widget_create(GX_BYTE *control, GX_CONST GX_STUDIO_WIDGET *definition, GX_WIDGET *parent)
588 {
589     GX_WIDGET *widget;
590     widget = gx_studio_nested_widget_create(control, definition, GX_NULL);
591 
592     if (parent && widget)
593     {
594         gx_widget_attach(parent, widget);
595     }
596     return widget;
597 }
598 
gx_studio_named_widget_create(char * name,GX_WIDGET * parent,GX_WIDGET ** new_widget)599 UINT gx_studio_named_widget_create(char *name, GX_WIDGET *parent, GX_WIDGET **new_widget)
600 {
601     UINT status = GX_FAILURE;
602     GX_CONST GX_STUDIO_WIDGET_ENTRY *entry = alphamap_16bpp_widget_table;
603     GX_WIDGET *widget = GX_NULL;
604 
605     while(entry->widget_information)
606     {
607         if (!strcmp(name, entry->widget_information->widget_name))
608         {
609             widget = gx_studio_widget_create((GX_BYTE *) entry->widget, entry->widget_information, parent);
610             if (widget)
611             {
612                 status = GX_SUCCESS;
613             }
614             break;
615         }
616         entry++;
617     }
618 
619     if (new_widget)
620     {
621         *new_widget = widget;
622     }
623     return status;
624 }
625 
626 
gx_studio_display_configure(USHORT display,UINT (* driver)(GX_DISPLAY *),GX_UBYTE language,USHORT theme,GX_WINDOW_ROOT ** return_root)627 UINT gx_studio_display_configure(USHORT display, UINT (*driver)(GX_DISPLAY *),
628     GX_UBYTE language, USHORT theme, GX_WINDOW_ROOT **return_root)
629 {
630     GX_CONST GX_THEME *theme_ptr;
631     GX_RECTANGLE size;
632 
633     GX_STUDIO_DISPLAY_INFO *display_info = &alphamap_16bpp_display_table[display];
634 
635 
636 /* create the requested display                                                */
637 
638     gx_display_create(display_info->display,
639                       display_info->name,
640                       driver,
641                       (GX_VALUE) display_info->x_resolution,
642                       (GX_VALUE) display_info->y_resolution);
643 
644 
645 /* install the request theme                                                   */
646 
647     if(display_info->theme_table)
648     {
649         theme_ptr = display_info->theme_table[theme];
650         if(theme_ptr)
651         {
652             gx_display_color_table_set(display_info->display, theme_ptr->theme_color_table, theme_ptr->theme_color_table_size);
653 
654 /* install the color palette if required                                       */
655             if (display_info->display->gx_display_driver_palette_set &&
656                 theme_ptr->theme_palette != NULL)
657             {
658                 display_info->display->gx_display_driver_palette_set(display_info->display, theme_ptr->theme_palette, theme_ptr->theme_palette_size);
659             }
660 
661             gx_display_font_table_set(display_info->display, theme_ptr->theme_font_table, theme_ptr->theme_font_table_size);
662             gx_display_pixelmap_table_set(display_info->display, theme_ptr->theme_pixelmap_table, theme_ptr->theme_pixelmap_table_size);
663             gx_system_scroll_appearance_set(theme_ptr->theme_vertical_scroll_style, (GX_SCROLLBAR_APPEARANCE *) &theme_ptr->theme_vertical_scrollbar_appearance);
664             gx_system_scroll_appearance_set(theme_ptr->theme_horizontal_scroll_style, (GX_SCROLLBAR_APPEARANCE *) &theme_ptr->theme_horizontal_scrollbar_appearance);
665         }
666     }
667 
668 /* Install the language table.                                                 */
669 
670     if(display_info->language_table)
671     {
672         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);
673         gx_display_active_language_set(display_info->display, language);
674     }
675 
676 /* Set screen rotation angle.                                                  */
677 
678     display_info->display->gx_display_rotation_angle = display_info->rotation_angle;
679 
680 /* create the canvas for this display                                          */
681 
682     gx_canvas_create(display_info->canvas,
683                      display_info->canvas_name,
684                      display_info->display,
685                      GX_CANVAS_MANAGED | GX_CANVAS_VISIBLE,
686                      display_info->x_resolution,
687                      display_info->y_resolution,
688                      display_info->canvas_memory,
689                      display_info->canvas_memory_size);
690 
691 /* Create the root window for this canvas                                      */
692 
693     gx_utility_rectangle_define(&size,
694                                 0, 0,
695                                 (GX_VALUE) (display_info->x_resolution - 1),
696                                 (GX_VALUE) (display_info->y_resolution - 1));
697 
698     gx_window_root_create(display_info->root_window,
699                           display_info->name,
700                           display_info->canvas, GX_STYLE_NONE, 0, &size);
701     if (return_root)
702     {
703         *return_root = display_info->root_window;
704     }
705     return GX_SUCCESS;
706 }
707 #undef GUIX_STUDIO_GENERATED_FILE
708