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:12                        */
10 /*******************************************************************************/
11 
12 
13 #define GUIX_STUDIO_GENERATED_FILE
14 #include <stddef.h>
15 #include "overlap_resources.h"
16 #include "overlap_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 W_POPUP_CONTROL_BLOCK w_popup;
20 W_MAIN_CONTROL_BLOCK w_main;
21 GX_DISPLAY display_1_control_block;
22 GX_WINDOW_ROOT display_1_root_window;
23 GX_CANVAS  display_1_canvas_control_block;
24 ULONG      display_1_canvas_memory[65280];
25 
26 extern GX_CONST GX_THEME *display_1_theme_table[];
27 extern GX_CONST GX_STRING *display_1_language_table[];
28 
29 GX_STUDIO_DISPLAY_INFO overlap_display_table[1] =
30 {
31     {
32     "display_1",
33     "display_1_canvas",
34     display_1_theme_table,
35     display_1_language_table,
36     DISPLAY_1_THEME_TABLE_SIZE,
37     DISPLAY_1_LANGUAGE_TABLE_SIZE,
38     DISPLAY_1_STRING_TABLE_SIZE,
39     480,                                     /* x resolution                   */
40     272,                                     /* y resolution                   */
41     &display_1_control_block,
42     &display_1_canvas_control_block,
43     &display_1_root_window,
44     display_1_canvas_memory,                 /* canvas memory area             */
45     261120,                                  /* canvas memory size in bytes    */
46     0                                        /* rotation angle                 */
47     }
48 };
49 
50 
gx_studio_button_create(GX_CONST GX_STUDIO_WIDGET * info,GX_WIDGET * control_block,GX_WIDGET * parent)51 UINT gx_studio_button_create(GX_CONST GX_STUDIO_WIDGET *info, GX_WIDGET *control_block, GX_WIDGET *parent)
52 {
53     UINT status;
54     GX_BUTTON *button = (GX_BUTTON *) control_block;
55     status = gx_button_create(button, info->widget_name, parent, info->style, info->widget_id, &info->size);
56     return status;
57 }
58 
gx_studio_icon_button_create(GX_CONST GX_STUDIO_WIDGET * info,GX_WIDGET * control_block,GX_WIDGET * parent)59 UINT gx_studio_icon_button_create(GX_CONST GX_STUDIO_WIDGET *info, GX_WIDGET *control_block, GX_WIDGET *parent)
60 {
61     UINT status;
62     GX_ICON_BUTTON *button = (GX_ICON_BUTTON *) control_block;
63     GX_ICON_BUTTON_PROPERTIES *props = (GX_ICON_BUTTON_PROPERTIES *) info->properties;
64     status = gx_icon_button_create(button, info->widget_name, parent, props->pixelmap_id, info->style, info->widget_id, &info->size);
65     return status;
66 }
67 
gx_studio_prompt_create(GX_CONST GX_STUDIO_WIDGET * info,GX_WIDGET * control_block,GX_WIDGET * parent)68 UINT gx_studio_prompt_create(GX_CONST GX_STUDIO_WIDGET *info, GX_WIDGET *control_block, GX_WIDGET *parent)
69 {
70     UINT status;
71     GX_PROMPT *prompt = (GX_PROMPT *) control_block;
72     GX_PROMPT_PROPERTIES *props = (GX_PROMPT_PROPERTIES *) info->properties;
73     status = gx_prompt_create(prompt, info->widget_name, parent, props->string_id, info->style, info->widget_id, &info->size);
74     if (status == GX_SUCCESS)
75     {
76         gx_prompt_font_set(prompt, props->font_id);
77 #if defined(GUIX_5_4_0_COMPATIBILITY)
78         gx_prompt_text_color_set(prompt, props->normal_text_color_id, props->selected_text_color_id);
79 #else
80         gx_prompt_text_color_set(prompt, props->normal_text_color_id, props->selected_text_color_id, props->disabled_text_color_id);
81 #endif
82     }
83     return status;
84 }
85 
gx_studio_window_create(GX_CONST GX_STUDIO_WIDGET * info,GX_WIDGET * control_block,GX_WIDGET * parent)86 UINT gx_studio_window_create(GX_CONST GX_STUDIO_WIDGET *info, GX_WIDGET *control_block, GX_WIDGET *parent)
87 {
88     UINT status;
89     GX_WINDOW *window = (GX_WINDOW *) control_block;
90     GX_WINDOW_PROPERTIES *props = (GX_WINDOW_PROPERTIES *) info->properties;
91     status = gx_window_create(window, info->widget_name, parent, info->style, info->widget_id, &info->size);
92     if (status == GX_SUCCESS)
93     {
94         if (props->wallpaper_id)
95         {
96             gx_window_wallpaper_set(window, props->wallpaper_id, info->style & GX_STYLE_TILE_WALLPAPER);
97         }
98     }
99     return status;
100 }
101 GX_WINDOW_PROPERTIES w_popup_properties =
102 {
103     0                                        /* wallpaper pixelmap id          */
104 };
105 GX_PROMPT_PROPERTIES w_popup_prompt_properties =
106 {
107     GX_STRING_ID_STRING_4,                   /* string id                      */
108     GX_FONT_ID_PROMPT,                       /* font id                        */
109     GX_COLOR_ID_CANVAS,                      /* normal text color              */
110     GX_COLOR_ID_CANVAS,                      /* selected text color            */
111     GX_COLOR_ID_CANVAS                       /* disabled text color            */
112 };
113 GX_ICON_BUTTON_PROPERTIES w_popup_icon_button_properties =
114 {
115     GX_PIXELMAP_ID_BTN_NO_SEL                /* pixelmap id                    */
116 };
117 
118 GX_CONST GX_STUDIO_WIDGET w_popup_icon_button_define =
119 {
120     "icon_button",
121     GX_TYPE_ICON_BUTTON,                     /* widget type                    */
122     IDB_CLOSE,                               /* widget id                      */
123     #if defined(GX_WIDGET_USER_DATA)
124     0,                                       /* user data                      */
125     #endif
126     GX_STYLE_BORDER_RAISED|GX_STYLE_ENABLED|GX_STYLE_HALIGN_CENTER|GX_STYLE_VALIGN_CENTER,   /* style flags */
127     0,                                       /* status flags                   */
128     sizeof(GX_ICON_BUTTON),                  /* control block size             */
129     GX_COLOR_ID_BTN_LOWER,                   /* normal color id                */
130     GX_COLOR_ID_BTN_UPPER,                   /* selected color id              */
131     GX_COLOR_ID_BTN_LOWER,                   /* disabled color id              */
132     gx_studio_icon_button_create,            /* create function                */
133     GX_NULL,                                 /* drawing function override      */
134     GX_NULL,                                 /* event function override        */
135     {308, 151, 367, 210},                    /* widget size                    */
136     GX_NULL,                                 /* no next widget                 */
137     GX_NULL,                                 /* no child widgets               */
138     offsetof(W_POPUP_CONTROL_BLOCK, w_popup_icon_button), /* control block     */
139     (void *) &w_popup_icon_button_properties /* extended properties            */
140 };
141 
142 GX_CONST GX_STUDIO_WIDGET w_popup_prompt_define =
143 {
144     "prompt",
145     GX_TYPE_PROMPT,                          /* widget type                    */
146     GX_ID_NONE,                              /* widget id                      */
147     #if defined(GX_WIDGET_USER_DATA)
148     0,                                       /* user data                      */
149     #endif
150     GX_STYLE_BORDER_NONE|GX_STYLE_TRANSPARENT|GX_STYLE_TEXT_CENTER,   /* style flags */
151     0,                                       /* status flags                   */
152     sizeof(GX_PROMPT),                       /* control block size             */
153     GX_COLOR_ID_WIDGET_FILL,                 /* normal color id                */
154     GX_COLOR_ID_SELECTED_FILL,               /* selected color id              */
155     GX_COLOR_ID_WIDGET_FILL,                 /* disabled color id              */
156     gx_studio_prompt_create,                 /* create function                */
157     GX_NULL,                                 /* drawing function override      */
158     GX_NULL,                                 /* event function override        */
159     {200, 124, 279, 147},                    /* widget size                    */
160     &w_popup_icon_button_define,             /* next widget definition         */
161     GX_NULL,                                 /* no child widgets               */
162     offsetof(W_POPUP_CONTROL_BLOCK, w_popup_prompt), /* control block          */
163     (void *) &w_popup_prompt_properties      /* extended properties            */
164 };
165 
166 GX_CONST GX_STUDIO_WIDGET w_popup_define =
167 {
168     "w_popup",
169     GX_TYPE_WINDOW,                          /* widget type                    */
170     ID_W_POPUP,                              /* widget id                      */
171     #if defined(GX_WIDGET_USER_DATA)
172     0,                                       /* user data                      */
173     #endif
174     GX_STYLE_BORDER_THIN|GX_STYLE_ENABLED,   /* style flags                    */
175     0,                                       /* status flags                   */
176     sizeof(W_POPUP_CONTROL_BLOCK),           /* control block size             */
177     GX_COLOR_ID_WINDOW_FILL,                 /* normal color id                */
178     GX_COLOR_ID_WINDOW_FILL,                 /* selected color id              */
179     GX_COLOR_ID_WINDOW_FILL,                 /* disabled color id              */
180     gx_studio_window_create,                 /* create function                */
181     GX_NULL,                                 /* drawing function override      */
182     (UINT (*)(GX_WIDGET *, GX_EVENT *)) popup_events, /* event function override */
183     {120, 68, 374, 215},                     /* widget size                    */
184     GX_NULL,                                 /* next widget                    */
185     &w_popup_prompt_define,                  /* child widget                   */
186     0,                                       /* control block                  */
187     (void *) &w_popup_properties             /* extended properties            */
188 };
189 GX_WINDOW_PROPERTIES w_main_properties =
190 {
191     0                                        /* wallpaper pixelmap id          */
192 };
193 GX_WINDOW_PROPERTIES w_main_window_properties =
194 {
195     0                                        /* wallpaper pixelmap id          */
196 };
197 GX_PROMPT_PROPERTIES w_main_counter_properties =
198 {
199     0,                                       /* string id                      */
200     GX_FONT_ID_NEWFONT,                      /* font id                        */
201     GX_COLOR_ID_TEXT,                        /* normal text color              */
202     GX_COLOR_ID_SELECTED_TEXT,               /* selected text color            */
203     GX_COLOR_ID_TEXT                         /* disabled text color            */
204 };
205 GX_WINDOW_PROPERTIES w_main_window_1_properties =
206 {
207     0                                        /* wallpaper pixelmap id          */
208 };
209 GX_PROMPT_PROPERTIES w_main_counter2_properties =
210 {
211     0,                                       /* string id                      */
212     GX_FONT_ID_NEWFONT,                      /* font id                        */
213     GX_COLOR_ID_TEXT,                        /* normal text color              */
214     GX_COLOR_ID_SELECTED_TEXT,               /* selected text color            */
215     GX_COLOR_ID_TEXT                         /* disabled text color            */
216 };
217 
218 GX_CONST GX_STUDIO_WIDGET w_main_counter_define =
219 {
220     "counter",
221     GX_TYPE_PROMPT,                          /* widget type                    */
222     GX_ID_NONE,                              /* widget id                      */
223     #if defined(GX_WIDGET_USER_DATA)
224     0,                                       /* user data                      */
225     #endif
226     GX_STYLE_BORDER_THIN|GX_STYLE_ENABLED|GX_STYLE_TEXT_CENTER,   /* style flags */
227     GX_STATUS_ACCEPTS_FOCUS,                 /* status flags                   */
228     sizeof(GX_PROMPT),                       /* control block size             */
229     GX_COLOR_ID_WIDGET_FILL,                 /* normal color id                */
230     GX_COLOR_ID_SELECTED_FILL,               /* selected color id              */
231     GX_COLOR_ID_WIDGET_FILL,                 /* disabled color id              */
232     gx_studio_prompt_create,                 /* create function                */
233     GX_NULL,                                 /* drawing function override      */
234     GX_NULL,                                 /* event function override        */
235     {58, 64, 237, 117},                      /* widget size                    */
236     GX_NULL,                                 /* no next widget                 */
237     GX_NULL,                                 /* no child widgets               */
238     offsetof(W_MAIN_CONTROL_BLOCK, w_main_counter), /* control block           */
239     (void *) &w_main_counter_properties      /* extended properties            */
240 };
241 
242 GX_CONST GX_STUDIO_WIDGET w_main_btn_2_define =
243 {
244     "btn_2",
245     GX_TYPE_BUTTON,                          /* widget type                    */
246     ID_BTN_9,                                /* widget id                      */
247     #if defined(GX_WIDGET_USER_DATA)
248     0,                                       /* user data                      */
249     #endif
250     GX_STYLE_BORDER_RAISED|GX_STYLE_ENABLED,   /* style flags                  */
251     0,                                       /* status flags                   */
252     sizeof(GX_BUTTON),                       /* control block size             */
253     GX_COLOR_ID_BTN_LOWER,                   /* normal color id                */
254     GX_COLOR_ID_BTN_UPPER,                   /* selected color id              */
255     GX_COLOR_ID_BTN_LOWER,                   /* disabled color id              */
256     gx_studio_button_create,                 /* create function                */
257     GX_NULL,                                 /* drawing function override      */
258     GX_NULL,                                 /* event function override        */
259     {191, 96, 274, 179},                     /* widget size                    */
260     &w_main_counter_define,                  /* next widget definition         */
261     GX_NULL,                                 /* no child widgets               */
262     offsetof(W_MAIN_CONTROL_BLOCK, w_main_btn_2), /* control block             */
263     (void *) GX_NULL                         /* no extended properties         */
264 };
265 
266 GX_CONST GX_STUDIO_WIDGET w_main_btn_3_define =
267 {
268     "btn_3",
269     GX_TYPE_BUTTON,                          /* widget type                    */
270     ID_BTN_3,                                /* widget id                      */
271     #if defined(GX_WIDGET_USER_DATA)
272     0,                                       /* user data                      */
273     #endif
274     GX_STYLE_BORDER_RAISED|GX_STYLE_ENABLED,   /* style flags                  */
275     0,                                       /* status flags                   */
276     sizeof(GX_BUTTON),                       /* control block size             */
277     GX_COLOR_ID_BTN_LOWER,                   /* normal color id                */
278     GX_COLOR_ID_BTN_UPPER,                   /* selected color id              */
279     GX_COLOR_ID_BTN_LOWER,                   /* disabled color id              */
280     gx_studio_button_create,                 /* create function                */
281     GX_NULL,                                 /* drawing function override      */
282     GX_NULL,                                 /* event function override        */
283     {106, 95, 189, 178},                     /* widget size                    */
284     &w_main_btn_2_define,                    /* next widget definition         */
285     GX_NULL,                                 /* no child widgets               */
286     offsetof(W_MAIN_CONTROL_BLOCK, w_main_btn_3), /* control block             */
287     (void *) GX_NULL                         /* no extended properties         */
288 };
289 
290 GX_CONST GX_STUDIO_WIDGET w_main_btn_define =
291 {
292     "btn",
293     GX_TYPE_BUTTON,                          /* widget type                    */
294     ID_BTN_8,                                /* widget id                      */
295     #if defined(GX_WIDGET_USER_DATA)
296     0,                                       /* user data                      */
297     #endif
298     GX_STYLE_BORDER_RAISED|GX_STYLE_ENABLED,   /* style flags                  */
299     0,                                       /* status flags                   */
300     sizeof(GX_BUTTON),                       /* control block size             */
301     GX_COLOR_ID_BTN_LOWER,                   /* normal color id                */
302     GX_COLOR_ID_BTN_UPPER,                   /* selected color id              */
303     GX_COLOR_ID_BTN_LOWER,                   /* disabled color id              */
304     gx_studio_button_create,                 /* create function                */
305     GX_NULL,                                 /* drawing function override      */
306     GX_NULL,                                 /* event function override        */
307     {20, 95, 103, 178},                      /* widget size                    */
308     &w_main_btn_3_define,                    /* next widget definition         */
309     GX_NULL,                                 /* no child widgets               */
310     offsetof(W_MAIN_CONTROL_BLOCK, w_main_btn), /* control block               */
311     (void *) GX_NULL                         /* no extended properties         */
312 };
313 
314 GX_CONST GX_STUDIO_WIDGET w_main_btn_9_define =
315 {
316     "btn_9",
317     GX_TYPE_BUTTON,                          /* widget type                    */
318     ID_BTN_9,                                /* widget id                      */
319     #if defined(GX_WIDGET_USER_DATA)
320     0,                                       /* user data                      */
321     #endif
322     GX_STYLE_BORDER_RAISED|GX_STYLE_ENABLED,   /* style flags                  */
323     0,                                       /* status flags                   */
324     sizeof(GX_BUTTON),                       /* control block size             */
325     GX_COLOR_ID_BTN_LOWER,                   /* normal color id                */
326     GX_COLOR_ID_BTN_UPPER,                   /* selected color id              */
327     GX_COLOR_ID_BTN_LOWER,                   /* disabled color id              */
328     gx_studio_button_create,                 /* create function                */
329     GX_NULL,                                 /* drawing function override      */
330     GX_NULL,                                 /* event function override        */
331     {191, 16, 274, 99},                      /* widget size                    */
332     &w_main_btn_define,                      /* next widget definition         */
333     GX_NULL,                                 /* no child widgets               */
334     offsetof(W_MAIN_CONTROL_BLOCK, w_main_btn_9), /* control block             */
335     (void *) GX_NULL                         /* no extended properties         */
336 };
337 
338 GX_CONST GX_STUDIO_WIDGET w_main_btn_4_define =
339 {
340     "btn_4",
341     GX_TYPE_BUTTON,                          /* widget type                    */
342     ID_BTN_4,                                /* widget id                      */
343     #if defined(GX_WIDGET_USER_DATA)
344     0,                                       /* user data                      */
345     #endif
346     GX_STYLE_BORDER_RAISED|GX_STYLE_ENABLED,   /* style flags                  */
347     0,                                       /* status flags                   */
348     sizeof(GX_BUTTON),                       /* control block size             */
349     GX_COLOR_ID_BTN_LOWER,                   /* normal color id                */
350     GX_COLOR_ID_BTN_UPPER,                   /* selected color id              */
351     GX_COLOR_ID_BTN_LOWER,                   /* disabled color id              */
352     gx_studio_button_create,                 /* create function                */
353     GX_NULL,                                 /* drawing function override      */
354     GX_NULL,                                 /* event function override        */
355     {106, 15, 189, 98},                      /* widget size                    */
356     &w_main_btn_9_define,                    /* next widget definition         */
357     GX_NULL,                                 /* no child widgets               */
358     offsetof(W_MAIN_CONTROL_BLOCK, w_main_btn_4), /* control block             */
359     (void *) GX_NULL                         /* no extended properties         */
360 };
361 
362 GX_CONST GX_STUDIO_WIDGET w_main_btn_1_define =
363 {
364     "btn_1",
365     GX_TYPE_BUTTON,                          /* widget type                    */
366     ID_BTN_1,                                /* widget id                      */
367     #if defined(GX_WIDGET_USER_DATA)
368     0,                                       /* user data                      */
369     #endif
370     GX_STYLE_BORDER_RAISED|GX_STYLE_ENABLED,   /* style flags                  */
371     0,                                       /* status flags                   */
372     sizeof(GX_BUTTON),                       /* control block size             */
373     GX_COLOR_ID_BTN_LOWER,                   /* normal color id                */
374     GX_COLOR_ID_BTN_UPPER,                   /* selected color id              */
375     GX_COLOR_ID_BTN_LOWER,                   /* disabled color id              */
376     gx_studio_button_create,                 /* create function                */
377     GX_NULL,                                 /* drawing function override      */
378     GX_NULL,                                 /* event function override        */
379     {20, 15, 103, 98},                       /* widget size                    */
380     &w_main_btn_4_define,                    /* next widget definition         */
381     GX_NULL,                                 /* no child widgets               */
382     offsetof(W_MAIN_CONTROL_BLOCK, w_main_btn_1), /* control block             */
383     (void *) GX_NULL                         /* no extended properties         */
384 };
385 
386 GX_CONST GX_STUDIO_WIDGET w_main_counter2_define =
387 {
388     "counter2",
389     GX_TYPE_PROMPT,                          /* widget type                    */
390     GX_ID_NONE,                              /* widget id                      */
391     #if defined(GX_WIDGET_USER_DATA)
392     0,                                       /* user data                      */
393     #endif
394     GX_STYLE_BORDER_THIN|GX_STYLE_ENABLED|GX_STYLE_TEXT_CENTER,   /* style flags */
395     GX_STATUS_ACCEPTS_FOCUS,                 /* status flags                   */
396     sizeof(GX_PROMPT),                       /* control block size             */
397     GX_COLOR_ID_WIDGET_FILL,                 /* normal color id                */
398     GX_COLOR_ID_SELECTED_FILL,               /* selected color id              */
399     GX_COLOR_ID_WIDGET_FILL,                 /* disabled color id              */
400     gx_studio_prompt_create,                 /* create function                */
401     GX_NULL,                                 /* drawing function override      */
402     GX_NULL,                                 /* event function override        */
403     {250, 66, 429, 119},                     /* widget size                    */
404     GX_NULL,                                 /* no next widget                 */
405     GX_NULL,                                 /* no child widgets               */
406     offsetof(W_MAIN_CONTROL_BLOCK, w_main_counter2), /* control block          */
407     (void *) &w_main_counter2_properties     /* extended properties            */
408 };
409 
410 GX_CONST GX_STUDIO_WIDGET w_main_btn_13_define =
411 {
412     "btn_13",
413     GX_TYPE_BUTTON,                          /* widget type                    */
414     ID_BTN_13,                               /* widget id                      */
415     #if defined(GX_WIDGET_USER_DATA)
416     0,                                       /* user data                      */
417     #endif
418     GX_STYLE_BORDER_RAISED|GX_STYLE_ENABLED,   /* style flags                  */
419     0,                                       /* status flags                   */
420     sizeof(GX_BUTTON),                       /* control block size             */
421     GX_COLOR_ID_BTN_LOWER,                   /* normal color id                */
422     GX_COLOR_ID_BTN_UPPER,                   /* selected color id              */
423     GX_COLOR_ID_BTN_LOWER,                   /* disabled color id              */
424     gx_studio_button_create,                 /* create function                */
425     GX_NULL,                                 /* drawing function override      */
426     GX_NULL,                                 /* event function override        */
427     {235, 54, 318, 137},                     /* widget size                    */
428     &w_main_counter2_define,                 /* next widget definition         */
429     GX_NULL,                                 /* no child widgets               */
430     offsetof(W_MAIN_CONTROL_BLOCK, w_main_btn_13), /* control block            */
431     (void *) GX_NULL                         /* no extended properties         */
432 };
433 
434 GX_CONST GX_STUDIO_WIDGET w_main_btn_14_define =
435 {
436     "btn_14",
437     GX_TYPE_BUTTON,                          /* widget type                    */
438     ID_BTN_14,                               /* widget id                      */
439     #if defined(GX_WIDGET_USER_DATA)
440     0,                                       /* user data                      */
441     #endif
442     GX_STYLE_BORDER_RAISED|GX_STYLE_ENABLED,   /* style flags                  */
443     0,                                       /* status flags                   */
444     sizeof(GX_BUTTON),                       /* control block size             */
445     GX_COLOR_ID_BTN_LOWER,                   /* normal color id                */
446     GX_COLOR_ID_BTN_UPPER,                   /* selected color id              */
447     GX_COLOR_ID_BTN_LOWER,                   /* disabled color id              */
448     gx_studio_button_create,                 /* create function                */
449     GX_NULL,                                 /* drawing function override      */
450     GX_NULL,                                 /* event function override        */
451     {360, 53, 443, 136},                     /* widget size                    */
452     &w_main_btn_13_define,                   /* next widget definition         */
453     GX_NULL,                                 /* no child widgets               */
454     offsetof(W_MAIN_CONTROL_BLOCK, w_main_btn_14), /* control block            */
455     (void *) GX_NULL                         /* no extended properties         */
456 };
457 
458 GX_CONST GX_STUDIO_WIDGET w_main_window_1_define =
459 {
460     "window_1",
461     GX_TYPE_WINDOW,                          /* widget type                    */
462     GX_ID_NONE,                              /* widget id                      */
463     #if defined(GX_WIDGET_USER_DATA)
464     0,                                       /* user data                      */
465     #endif
466     GX_STYLE_BORDER_THIN,                    /* style flags                    */
467     0,                                       /* status flags                   */
468     sizeof(GX_WINDOW),                       /* control block size             */
469     GX_COLOR_ID_WINDOW_FILL,                 /* normal color id                */
470     GX_COLOR_ID_WINDOW_FILL,                 /* selected color id              */
471     GX_COLOR_ID_WINDOW_FILL,                 /* disabled color id              */
472     gx_studio_window_create,                 /* create function                */
473     GX_NULL,                                 /* drawing function override      */
474     GX_NULL,                                 /* event function override        */
475     {220, 29, 459, 164},                     /* widget size                    */
476     GX_NULL,                                 /* no next widget                 */
477     &w_main_btn_14_define,                   /* child widget definition        */
478     offsetof(W_MAIN_CONTROL_BLOCK, w_main_window_1), /* control block          */
479     (void *) &w_main_window_1_properties     /* extended properties            */
480 };
481 
482 GX_CONST GX_STUDIO_WIDGET w_main_window_define =
483 {
484     "window",
485     GX_TYPE_WINDOW,                          /* widget type                    */
486     GX_ID_NONE,                              /* widget id                      */
487     #if defined(GX_WIDGET_USER_DATA)
488     0,                                       /* user data                      */
489     #endif
490     GX_STYLE_BORDER_THIN,                    /* style flags                    */
491     0,                                       /* status flags                   */
492     sizeof(GX_WINDOW),                       /* control block size             */
493     GX_COLOR_ID_WINDOW_FILL,                 /* normal color id                */
494     GX_COLOR_ID_WINDOW_FILL,                 /* selected color id              */
495     GX_COLOR_ID_WINDOW_FILL,                 /* disabled color id              */
496     gx_studio_window_create,                 /* create function                */
497     GX_NULL,                                 /* drawing function override      */
498     GX_NULL,                                 /* event function override        */
499     {14, 11, 281, 182},                      /* widget size                    */
500     &w_main_window_1_define,                 /* next widget definition         */
501     &w_main_btn_1_define,                    /* child widget definition        */
502     offsetof(W_MAIN_CONTROL_BLOCK, w_main_window), /* control block            */
503     (void *) &w_main_window_properties       /* extended properties            */
504 };
505 
506 GX_CONST GX_STUDIO_WIDGET w_main_btn_12_define =
507 {
508     "btn_12",
509     GX_TYPE_BUTTON,                          /* widget type                    */
510     ID_BTN_12,                               /* widget id                      */
511     #if defined(GX_WIDGET_USER_DATA)
512     0,                                       /* user data                      */
513     #endif
514     GX_STYLE_BORDER_RAISED|GX_STYLE_ENABLED,   /* style flags                  */
515     0,                                       /* status flags                   */
516     sizeof(GX_BUTTON),                       /* control block size             */
517     GX_COLOR_ID_BTN_LOWER,                   /* normal color id                */
518     GX_COLOR_ID_BTN_UPPER,                   /* selected color id              */
519     GX_COLOR_ID_BTN_LOWER,                   /* disabled color id              */
520     gx_studio_button_create,                 /* create function                */
521     GX_NULL,                                 /* drawing function override      */
522     GX_NULL,                                 /* event function override        */
523     {381, 183, 464, 266},                    /* widget size                    */
524     &w_main_window_define,                   /* next widget definition         */
525     GX_NULL,                                 /* no child widgets               */
526     offsetof(W_MAIN_CONTROL_BLOCK, w_main_btn_12), /* control block            */
527     (void *) GX_NULL                         /* no extended properties         */
528 };
529 
530 GX_CONST GX_STUDIO_WIDGET w_main_btn_11_define =
531 {
532     "btn_11",
533     GX_TYPE_BUTTON,                          /* widget type                    */
534     ID_BTN_11,                               /* widget id                      */
535     #if defined(GX_WIDGET_USER_DATA)
536     0,                                       /* user data                      */
537     #endif
538     GX_STYLE_BORDER_RAISED|GX_STYLE_ENABLED,   /* style flags                  */
539     0,                                       /* status flags                   */
540     sizeof(GX_BUTTON),                       /* control block size             */
541     GX_COLOR_ID_BTN_LOWER,                   /* normal color id                */
542     GX_COLOR_ID_BTN_UPPER,                   /* selected color id              */
543     GX_COLOR_ID_BTN_LOWER,                   /* disabled color id              */
544     gx_studio_button_create,                 /* create function                */
545     GX_NULL,                                 /* drawing function override      */
546     GX_NULL,                                 /* event function override        */
547     {287, 183, 370, 266},                    /* widget size                    */
548     &w_main_btn_12_define,                   /* next widget definition         */
549     GX_NULL,                                 /* no child widgets               */
550     offsetof(W_MAIN_CONTROL_BLOCK, w_main_btn_11), /* control block            */
551     (void *) GX_NULL                         /* no extended properties         */
552 };
553 
554 GX_CONST GX_STUDIO_WIDGET w_main_define =
555 {
556     "w_main",
557     GX_TYPE_WINDOW,                          /* widget type                    */
558     ID_W_MAIN,                               /* widget id                      */
559     #if defined(GX_WIDGET_USER_DATA)
560     0,                                       /* user data                      */
561     #endif
562     GX_STYLE_BORDER_NONE|GX_STYLE_ENABLED,   /* style flags                    */
563     GX_STATUS_ACCEPTS_FOCUS,                 /* status flags                   */
564     sizeof(W_MAIN_CONTROL_BLOCK),            /* control block size             */
565     GX_COLOR_ID_SELECTED_FILL,               /* normal color id                */
566     GX_COLOR_ID_SELECTED_FILL,               /* selected color id              */
567     GX_COLOR_ID_SELECTED_FILL,               /* disabled color id              */
568     gx_studio_window_create,                 /* create function                */
569     GX_NULL,                                 /* drawing function override      */
570     (UINT (*)(GX_WIDGET *, GX_EVENT *)) w_main_event, /* event function override */
571     {0, 0, 479, 271},                        /* widget size                    */
572     GX_NULL,                                 /* next widget                    */
573     &w_main_btn_11_define,                   /* child widget                   */
574     0,                                       /* control block                  */
575     (void *) &w_main_properties              /* extended properties            */
576 };
577 GX_CONST GX_STUDIO_WIDGET_ENTRY overlap_widget_table[] =
578 {
579     { &w_popup_define, (GX_WIDGET *) &w_popup },
580     { &w_main_define, (GX_WIDGET *) &w_main },
581     {GX_NULL, GX_NULL}
582 };
583 
gx_studio_nested_widget_create(GX_BYTE * control,GX_CONST GX_STUDIO_WIDGET * definition,GX_WIDGET * parent)584 static GX_WIDGET *gx_studio_nested_widget_create(GX_BYTE *control, GX_CONST GX_STUDIO_WIDGET *definition, GX_WIDGET *parent)
585 {
586     UINT status = GX_SUCCESS;
587     GX_WIDGET *widget = GX_NULL;
588     GX_VALUE   list_count = 0;
589     GX_VALUE   list_total_count = 0;
590 
591     if(parent && (parent->gx_widget_type == GX_TYPE_MENU))
592     {
593         list_total_count = ((GX_MENU *)parent)->gx_menu_list_total_count;
594     }
595 
596     while(definition && status == GX_SUCCESS)
597     {
598         if (definition->create_function)
599         {
600             if (definition->style & GX_STYLE_DYNAMICALLY_ALLOCATED)
601             {
602                 status = gx_widget_allocate(&widget, definition->control_block_size);
603                 if (status != GX_SUCCESS)
604                 {
605                     return GX_NULL;
606                 }
607             }
608             else
609             {
610                 if (control == GX_NULL)
611                 {
612                     return GX_NULL;
613                 }
614                 widget = (GX_WIDGET *) (control + definition->control_block_offset);
615             }
616 
617             status = definition->create_function(definition, widget, parent);
618 
619             if(list_count < list_total_count)
620             {
621                 gx_menu_insert((GX_MENU *)parent, widget);
622                 ((GX_MENU *)parent)->gx_menu_list_total_count--;
623                 list_count++;
624             }
625 
626             if (status == GX_SUCCESS)
627             {
628                 if (definition->widget_type != GX_TYPE_TEMPLATE)
629                 {
630 #if defined(GUIX_5_4_0_COMPATIBILITY)
631                     gx_widget_fill_color_set(widget, definition->normal_fill_color_id, definition->selected_fill_color_id);
632 #else
633                     gx_widget_fill_color_set(widget, definition->normal_fill_color_id, definition->selected_fill_color_id, definition->disabled_fill_color_id);
634 #endif
635                 }
636 
637                 if (!(definition->status & GX_STATUS_ACCEPTS_FOCUS))
638                 {
639                     gx_widget_status_remove(widget, GX_STATUS_ACCEPTS_FOCUS);
640                 }
641 
642                 if (definition->draw_function)
643                 {
644                     gx_widget_draw_set(widget, definition->draw_function);
645                 }
646                 if (definition->event_function)
647                 {
648                     gx_widget_event_process_set(widget, definition->event_function);
649                 }
650 
651                 #if defined(GX_WIDGET_USER_DATA)
652                 widget->gx_widget_user_data = definition->user_data;
653                 #endif
654 
655                 if (definition->child_widget)
656                 {
657                     gx_studio_nested_widget_create(control, definition->child_widget, widget);
658                 }
659             }
660             definition = definition->next_widget;
661         }
662     }
663     return widget;
664 }
665 
gx_studio_widget_create(GX_BYTE * control,GX_CONST GX_STUDIO_WIDGET * definition,GX_WIDGET * parent)666 GX_WIDGET *gx_studio_widget_create(GX_BYTE *control, GX_CONST GX_STUDIO_WIDGET *definition, GX_WIDGET *parent)
667 {
668     GX_WIDGET *widget;
669     widget = gx_studio_nested_widget_create(control, definition, GX_NULL);
670 
671     if (parent && widget)
672     {
673         gx_widget_attach(parent, widget);
674     }
675     return widget;
676 }
677 
gx_studio_named_widget_create(char * name,GX_WIDGET * parent,GX_WIDGET ** new_widget)678 UINT gx_studio_named_widget_create(char *name, GX_WIDGET *parent, GX_WIDGET **new_widget)
679 {
680     UINT status = GX_FAILURE;
681     GX_CONST GX_STUDIO_WIDGET_ENTRY *entry = overlap_widget_table;
682     GX_WIDGET *widget = GX_NULL;
683 
684     while(entry->widget_information)
685     {
686         if (!strcmp(name, entry->widget_information->widget_name))
687         {
688             widget = gx_studio_widget_create((GX_BYTE *) entry->widget, entry->widget_information, parent);
689             if (widget)
690             {
691                 status = GX_SUCCESS;
692             }
693             break;
694         }
695         entry++;
696     }
697 
698     if (new_widget)
699     {
700         *new_widget = widget;
701     }
702     return status;
703 }
704 
705 
gx_studio_display_configure(USHORT display,UINT (* driver)(GX_DISPLAY *),GX_UBYTE language,USHORT theme,GX_WINDOW_ROOT ** return_root)706 UINT gx_studio_display_configure(USHORT display, UINT (*driver)(GX_DISPLAY *),
707     GX_UBYTE language, USHORT theme, GX_WINDOW_ROOT **return_root)
708 {
709     GX_CONST GX_THEME *theme_ptr;
710     GX_RECTANGLE size;
711 
712     GX_STUDIO_DISPLAY_INFO *display_info = &overlap_display_table[display];
713 
714 
715 /* create the requested display                                                */
716 
717     gx_display_create(display_info->display,
718                       display_info->name,
719                       driver,
720                       (GX_VALUE) display_info->x_resolution,
721                       (GX_VALUE) display_info->y_resolution);
722 
723 
724 /* install the request theme                                                   */
725 
726     if(display_info->theme_table)
727     {
728         theme_ptr = display_info->theme_table[theme];
729         if(theme_ptr)
730         {
731             gx_display_color_table_set(display_info->display, theme_ptr->theme_color_table, theme_ptr->theme_color_table_size);
732 
733 /* install the color palette if required                                       */
734             if (display_info->display->gx_display_driver_palette_set &&
735                 theme_ptr->theme_palette != NULL)
736             {
737                 display_info->display->gx_display_driver_palette_set(display_info->display, theme_ptr->theme_palette, theme_ptr->theme_palette_size);
738             }
739 
740             gx_display_font_table_set(display_info->display, theme_ptr->theme_font_table, theme_ptr->theme_font_table_size);
741             gx_display_pixelmap_table_set(display_info->display, theme_ptr->theme_pixelmap_table, theme_ptr->theme_pixelmap_table_size);
742             gx_system_scroll_appearance_set(theme_ptr->theme_vertical_scroll_style, (GX_SCROLLBAR_APPEARANCE *) &theme_ptr->theme_vertical_scrollbar_appearance);
743             gx_system_scroll_appearance_set(theme_ptr->theme_horizontal_scroll_style, (GX_SCROLLBAR_APPEARANCE *) &theme_ptr->theme_horizontal_scrollbar_appearance);
744         }
745     }
746 
747 /* Install the language table.                                                 */
748 
749     if(display_info->language_table)
750     {
751         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);
752         gx_display_active_language_set(display_info->display, language);
753     }
754 
755 /* Set screen rotation angle.                                                  */
756 
757     display_info->display->gx_display_rotation_angle = display_info->rotation_angle;
758 
759 /* create the canvas for this display                                          */
760 
761     gx_canvas_create(display_info->canvas,
762                      display_info->canvas_name,
763                      display_info->display,
764                      GX_CANVAS_MANAGED | GX_CANVAS_VISIBLE,
765                      display_info->x_resolution,
766                      display_info->y_resolution,
767                      display_info->canvas_memory,
768                      display_info->canvas_memory_size);
769 
770 /* Create the root window for this canvas                                      */
771 
772     gx_utility_rectangle_define(&size,
773                                 0, 0,
774                                 (GX_VALUE) (display_info->x_resolution - 1),
775                                 (GX_VALUE) (display_info->y_resolution - 1));
776 
777     gx_window_root_create(display_info->root_window,
778                           display_info->name,
779                           display_info->canvas, GX_STYLE_NONE, 0, &size);
780     if (return_root)
781     {
782         *return_root = display_info->root_window;
783     }
784     return GX_SUCCESS;
785 }
786 #undef GUIX_STUDIO_GENERATED_FILE
787