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.1.1 */
9 /* Date (dd.mm.yyyy): 20. 4.2023 Time (hh:mm): 14:42 */
10 /*******************************************************************************/
11
12
13 #define GUIX_STUDIO_GENERATED_FILE
14 #include <stddef.h>
15 #include "jpeg_draw_32bpp_resources.h"
16 #include "jpeg_draw_32bpp_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[384000];
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 jpeg_draw_32bpp_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 800, /* 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 1536000, /* canvas memory size in bytes */
45 0 /* rotation angle */
46 }
47 };
48
49
gx_studio_icon_create(GX_CONST GX_STUDIO_WIDGET * info,GX_WIDGET * control_block,GX_WIDGET * parent)50 UINT gx_studio_icon_create(GX_CONST GX_STUDIO_WIDGET *info, GX_WIDGET *control_block, GX_WIDGET *parent)
51 {
52 UINT status;
53 GX_ICON *icon = (GX_ICON *) control_block;
54 GX_ICON_PROPERTIES *props = (GX_ICON_PROPERTIES *) info->properties;
55 status = gx_icon_create(icon, info->widget_name, parent, props->normal_pixelmap_id, info->style, info->widget_id, info->size.gx_rectangle_left, info->size.gx_rectangle_top);
56 if (props->selected_pixelmap_id)
57 {
58 gx_icon_pixelmap_set(icon, props->normal_pixelmap_id, props->selected_pixelmap_id);
59 }
60 else
61 {
62 gx_widget_resize((GX_WIDGET *)icon, (GX_RECTANGLE *)&info->size);
63 }
64 return status;
65 }
66
gx_studio_prompt_create(GX_CONST GX_STUDIO_WIDGET * info,GX_WIDGET * control_block,GX_WIDGET * parent)67 UINT gx_studio_prompt_create(GX_CONST GX_STUDIO_WIDGET *info, GX_WIDGET *control_block, GX_WIDGET *parent)
68 {
69 UINT status;
70 GX_PROMPT *prompt = (GX_PROMPT *) control_block;
71 GX_PROMPT_PROPERTIES *props = (GX_PROMPT_PROPERTIES *) info->properties;
72 status = gx_prompt_create(prompt, info->widget_name, parent, props->string_id, info->style, info->widget_id, &info->size);
73 if (status == GX_SUCCESS)
74 {
75 gx_prompt_font_set(prompt, props->font_id);
76 #if defined(GUIX_5_4_0_COMPATIBILITY)
77 gx_prompt_text_color_set(prompt, props->normal_text_color_id, props->selected_text_color_id);
78 #else
79 gx_prompt_text_color_set(prompt, props->normal_text_color_id, props->selected_text_color_id, props->disabled_text_color_id);
80 #endif
81 }
82 return status;
83 }
84
gx_studio_window_create(GX_CONST GX_STUDIO_WIDGET * info,GX_WIDGET * control_block,GX_WIDGET * parent)85 UINT gx_studio_window_create(GX_CONST GX_STUDIO_WIDGET *info, GX_WIDGET *control_block, GX_WIDGET *parent)
86 {
87 UINT status;
88 GX_WINDOW *window = (GX_WINDOW *) control_block;
89 GX_WINDOW_PROPERTIES *props = (GX_WINDOW_PROPERTIES *) info->properties;
90 status = gx_window_create(window, info->widget_name, parent, info->style, info->widget_id, &info->size);
91 if (status == GX_SUCCESS)
92 {
93 if (props->wallpaper_id)
94 {
95 gx_window_wallpaper_set(window, props->wallpaper_id, info->style & GX_STYLE_TILE_WALLPAPER);
96 }
97 }
98 return status;
99 }
100 GX_WINDOW_PROPERTIES main_window_properties =
101 {
102 0 /* wallpaper pixelmap id */
103 };
104 GX_WINDOW_PROPERTIES main_window_pic_window_properties =
105 {
106 GX_PIXELMAP_ID_RED_APPLE /* wallpaper pixelmap id */
107 };
108 GX_WINDOW_PROPERTIES main_window_window_1_properties =
109 {
110 GX_PIXELMAP_ID_FISH /* wallpaper pixelmap id */
111 };
112 GX_WINDOW_PROPERTIES main_window_window_2_properties =
113 {
114 GX_PIXELMAP_ID_RED_APPLE /* wallpaper pixelmap id */
115 };
116 GX_ICON_PROPERTIES main_window_icon_properties =
117 {
118 GX_PIXELMAP_ID_BASN3P02_CORRECT, /* normal pixelmap id */
119 0 /* selected pixelmap id */
120 };
121 GX_ICON_PROPERTIES main_window_icon_1_properties =
122 {
123 GX_PIXELMAP_ID_BASN3P02_INVALID_AC_TABLE, /* normal pixelmap id */
124 0 /* selected pixelmap id */
125 };
126 GX_ICON_PROPERTIES main_window_icon_2_properties =
127 {
128 GX_PIXELMAP_ID_BASN3P02_INVALID_DC_TABLE, /* normal pixelmap id */
129 0 /* selected pixelmap id */
130 };
131 GX_ICON_PROPERTIES main_window_icon_3_properties =
132 {
133 GX_PIXELMAP_ID_BASN3P02_INVALID_AC_TABLE_1, /* normal pixelmap id */
134 0 /* selected pixelmap id */
135 };
136 GX_ICON_PROPERTIES main_window_icon_4_properties =
137 {
138 GX_PIXELMAP_ID_BASN3P02_INVALID_SIZE, /* normal pixelmap id */
139 0 /* selected pixelmap id */
140 };
141 GX_PROMPT_PROPERTIES main_window_prompt_properties =
142 {
143 GX_STRING_ID_STRING_8, /* string id */
144 GX_FONT_ID_PROMPT, /* font id */
145 GX_COLOR_ID_TEXT, /* normal text color */
146 GX_COLOR_ID_SELECTED_TEXT, /* selected text color */
147 GX_COLOR_ID_TEXT /* disabled text color */
148 };
149 GX_PROMPT_PROPERTIES main_window_prompt_1_properties =
150 {
151 GX_STRING_ID_STRING_9, /* 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_10, /* 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_PROMPT_PROPERTIES main_window_prompt_3_properties =
166 {
167 GX_STRING_ID_STRING_11, /* string id */
168 GX_FONT_ID_PROMPT, /* font id */
169 GX_COLOR_ID_TEXT, /* normal text color */
170 GX_COLOR_ID_SELECTED_TEXT, /* selected text color */
171 GX_COLOR_ID_TEXT /* disabled text color */
172 };
173
174 GX_CONST GX_STUDIO_WIDGET main_window_prompt_3_define =
175 {
176 "prompt_3",
177 GX_TYPE_PROMPT, /* widget type */
178 GX_ID_NONE, /* widget id */
179 #if defined(GX_WIDGET_USER_DATA)
180 0, /* user data */
181 #endif
182 GX_STYLE_BORDER_NONE|GX_STYLE_TRANSPARENT|GX_STYLE_TEXT_CENTER, /* style flags */
183 GX_STATUS_ACCEPTS_FOCUS, /* status flags */
184 sizeof(GX_PROMPT), /* control block size */
185 GX_COLOR_ID_WIDGET_FILL, /* normal color id */
186 GX_COLOR_ID_SELECTED_FILL, /* selected color id */
187 GX_COLOR_ID_WINDOW_FILL, /* disabled color id */
188 gx_studio_prompt_create, /* create function */
189 GX_NULL, /* drawing function override */
190 GX_NULL, /* event function override */
191 {266, 451, 322, 468}, /* widget size */
192 GX_NULL, /* no next widget */
193 GX_NULL, /* no child widgets */
194 offsetof(MAIN_WINDOW_CONTROL_BLOCK, main_window_prompt_3), /* control block */
195 (void *) &main_window_prompt_3_properties /* extended properties */
196 };
197
198 GX_CONST GX_STUDIO_WIDGET main_window_prompt_2_define =
199 {
200 "prompt_2",
201 GX_TYPE_PROMPT, /* widget type */
202 GX_ID_NONE, /* widget id */
203 #if defined(GX_WIDGET_USER_DATA)
204 0, /* user data */
205 #endif
206 GX_STYLE_BORDER_NONE|GX_STYLE_TRANSPARENT|GX_STYLE_TEXT_CENTER, /* style flags */
207 GX_STATUS_ACCEPTS_FOCUS, /* status flags */
208 sizeof(GX_PROMPT), /* control block size */
209 GX_COLOR_ID_WIDGET_FILL, /* normal color id */
210 GX_COLOR_ID_SELECTED_FILL, /* selected color id */
211 GX_COLOR_ID_WINDOW_FILL, /* disabled color id */
212 gx_studio_prompt_create, /* create function */
213 GX_NULL, /* drawing function override */
214 GX_NULL, /* event function override */
215 {21, 445, 142, 462}, /* widget size */
216 &main_window_prompt_3_define, /* next widget definition */
217 GX_NULL, /* no child widgets */
218 offsetof(MAIN_WINDOW_CONTROL_BLOCK, main_window_prompt_2), /* control block */
219 (void *) &main_window_prompt_2_properties /* extended properties */
220 };
221
222 GX_CONST GX_STUDIO_WIDGET main_window_prompt_1_define =
223 {
224 "prompt_1",
225 GX_TYPE_PROMPT, /* widget type */
226 GX_ID_NONE, /* widget id */
227 #if defined(GX_WIDGET_USER_DATA)
228 0, /* user data */
229 #endif
230 GX_STYLE_BORDER_NONE|GX_STYLE_TRANSPARENT|GX_STYLE_TEXT_CENTER, /* style flags */
231 GX_STATUS_ACCEPTS_FOCUS, /* status flags */
232 sizeof(GX_PROMPT), /* control block size */
233 GX_COLOR_ID_WIDGET_FILL, /* normal color id */
234 GX_COLOR_ID_SELECTED_FILL, /* selected color id */
235 GX_COLOR_ID_WINDOW_FILL, /* disabled color id */
236 gx_studio_prompt_create, /* create function */
237 GX_NULL, /* drawing function override */
238 GX_NULL, /* event function override */
239 {21, 406, 141, 423}, /* widget size */
240 &main_window_prompt_2_define, /* next widget definition */
241 GX_NULL, /* no child widgets */
242 offsetof(MAIN_WINDOW_CONTROL_BLOCK, main_window_prompt_1), /* control block */
243 (void *) &main_window_prompt_1_properties /* extended properties */
244 };
245
246 GX_CONST GX_STUDIO_WIDGET main_window_prompt_define =
247 {
248 "prompt",
249 GX_TYPE_PROMPT, /* widget type */
250 GX_ID_NONE, /* widget id */
251 #if defined(GX_WIDGET_USER_DATA)
252 0, /* user data */
253 #endif
254 GX_STYLE_BORDER_NONE|GX_STYLE_TRANSPARENT|GX_STYLE_TEXT_CENTER, /* style flags */
255 GX_STATUS_ACCEPTS_FOCUS, /* status flags */
256 sizeof(GX_PROMPT), /* control block size */
257 GX_COLOR_ID_WIDGET_FILL, /* normal color id */
258 GX_COLOR_ID_SELECTED_FILL, /* selected color id */
259 GX_COLOR_ID_WINDOW_FILL, /* disabled color id */
260 gx_studio_prompt_create, /* create function */
261 GX_NULL, /* drawing function override */
262 GX_NULL, /* event function override */
263 {21, 363, 111, 384}, /* widget size */
264 &main_window_prompt_1_define, /* next widget definition */
265 GX_NULL, /* no child widgets */
266 offsetof(MAIN_WINDOW_CONTROL_BLOCK, main_window_prompt), /* control block */
267 (void *) &main_window_prompt_properties /* extended properties */
268 };
269
270 GX_CONST GX_STUDIO_WIDGET main_window_icon_4_define =
271 {
272 "icon_4",
273 GX_TYPE_ICON, /* widget type */
274 GX_ID_NONE, /* widget id */
275 #if defined(GX_WIDGET_USER_DATA)
276 0, /* user data */
277 #endif
278 GX_STYLE_BORDER_NONE|GX_STYLE_ENABLED|GX_STYLE_HALIGN_LEFT|GX_STYLE_VALIGN_TOP, /* style flags */
279 GX_STATUS_ACCEPTS_FOCUS, /* status flags */
280 sizeof(GX_ICON), /* control block size */
281 GX_COLOR_ID_WIDGET_FILL, /* normal color id */
282 GX_COLOR_ID_SELECTED_FILL, /* selected color id */
283 GX_COLOR_ID_DISABLED_FILL, /* disabled color id */
284 gx_studio_icon_create, /* create function */
285 GX_NULL, /* drawing function override */
286 GX_NULL, /* event function override */
287 {169, 362, 200, 393}, /* widget size */
288 &main_window_prompt_define, /* next widget definition */
289 GX_NULL, /* no child widgets */
290 offsetof(MAIN_WINDOW_CONTROL_BLOCK, main_window_icon_4), /* control block */
291 (void *) &main_window_icon_4_properties /* extended properties */
292 };
293
294 GX_CONST GX_STUDIO_WIDGET main_window_icon_3_define =
295 {
296 "icon_3",
297 GX_TYPE_ICON, /* widget type */
298 GX_ID_NONE, /* widget id */
299 #if defined(GX_WIDGET_USER_DATA)
300 0, /* user data */
301 #endif
302 GX_STYLE_BORDER_NONE|GX_STYLE_ENABLED|GX_STYLE_HALIGN_LEFT|GX_STYLE_VALIGN_TOP, /* style flags */
303 GX_STATUS_ACCEPTS_FOCUS, /* status flags */
304 sizeof(GX_ICON), /* control block size */
305 GX_COLOR_ID_WIDGET_FILL, /* normal color id */
306 GX_COLOR_ID_SELECTED_FILL, /* selected color id */
307 GX_COLOR_ID_DISABLED_FILL, /* disabled color id */
308 gx_studio_icon_create, /* create function */
309 GX_NULL, /* drawing function override */
310 GX_NULL, /* event function override */
311 {211, 404, 242, 435}, /* widget size */
312 &main_window_icon_4_define, /* next widget definition */
313 GX_NULL, /* no child widgets */
314 offsetof(MAIN_WINDOW_CONTROL_BLOCK, main_window_icon_3), /* control block */
315 (void *) &main_window_icon_3_properties /* extended properties */
316 };
317
318 GX_CONST GX_STUDIO_WIDGET main_window_icon_2_define =
319 {
320 "icon_2",
321 GX_TYPE_ICON, /* widget type */
322 GX_ID_NONE, /* widget id */
323 #if defined(GX_WIDGET_USER_DATA)
324 0, /* user data */
325 #endif
326 GX_STYLE_BORDER_NONE|GX_STYLE_ENABLED|GX_STYLE_HALIGN_LEFT|GX_STYLE_VALIGN_TOP, /* style flags */
327 GX_STATUS_ACCEPTS_FOCUS, /* status flags */
328 sizeof(GX_ICON), /* control block size */
329 GX_COLOR_ID_WIDGET_FILL, /* normal color id */
330 GX_COLOR_ID_SELECTED_FILL, /* selected color id */
331 GX_COLOR_ID_DISABLED_FILL, /* disabled color id */
332 gx_studio_icon_create, /* create function */
333 GX_NULL, /* drawing function override */
334 GX_NULL, /* event function override */
335 {169, 441, 200, 472}, /* widget size */
336 &main_window_icon_3_define, /* next widget definition */
337 GX_NULL, /* no child widgets */
338 offsetof(MAIN_WINDOW_CONTROL_BLOCK, main_window_icon_2), /* control block */
339 (void *) &main_window_icon_2_properties /* extended properties */
340 };
341
342 GX_CONST GX_STUDIO_WIDGET main_window_icon_1_define =
343 {
344 "icon_1",
345 GX_TYPE_ICON, /* widget type */
346 GX_ID_NONE, /* widget id */
347 #if defined(GX_WIDGET_USER_DATA)
348 0, /* user data */
349 #endif
350 GX_STYLE_BORDER_NONE|GX_STYLE_ENABLED|GX_STYLE_HALIGN_LEFT|GX_STYLE_VALIGN_TOP, /* style flags */
351 GX_STATUS_ACCEPTS_FOCUS, /* status flags */
352 sizeof(GX_ICON), /* control block size */
353 GX_COLOR_ID_WIDGET_FILL, /* normal color id */
354 GX_COLOR_ID_SELECTED_FILL, /* selected color id */
355 GX_COLOR_ID_DISABLED_FILL, /* disabled color id */
356 gx_studio_icon_create, /* create function */
357 GX_NULL, /* drawing function override */
358 GX_NULL, /* event function override */
359 {170, 403, 201, 434}, /* widget size */
360 &main_window_icon_2_define, /* next widget definition */
361 GX_NULL, /* no child widgets */
362 offsetof(MAIN_WINDOW_CONTROL_BLOCK, main_window_icon_1), /* control block */
363 (void *) &main_window_icon_1_properties /* extended properties */
364 };
365
366 GX_CONST GX_STUDIO_WIDGET main_window_icon_define =
367 {
368 "icon",
369 GX_TYPE_ICON, /* widget type */
370 GX_ID_NONE, /* widget id */
371 #if defined(GX_WIDGET_USER_DATA)
372 0, /* user data */
373 #endif
374 GX_STYLE_BORDER_NONE|GX_STYLE_ENABLED|GX_STYLE_HALIGN_LEFT|GX_STYLE_VALIGN_TOP, /* style flags */
375 GX_STATUS_ACCEPTS_FOCUS, /* status flags */
376 sizeof(GX_ICON), /* control block size */
377 GX_COLOR_ID_WIDGET_FILL, /* normal color id */
378 GX_COLOR_ID_SELECTED_FILL, /* selected color id */
379 GX_COLOR_ID_DISABLED_FILL, /* disabled color id */
380 gx_studio_icon_create, /* create function */
381 GX_NULL, /* drawing function override */
382 GX_NULL, /* event function override */
383 {332, 443, 363, 474}, /* widget size */
384 &main_window_icon_1_define, /* next widget definition */
385 GX_NULL, /* no child widgets */
386 offsetof(MAIN_WINDOW_CONTROL_BLOCK, main_window_icon), /* control block */
387 (void *) &main_window_icon_properties /* extended properties */
388 };
389
390 GX_CONST GX_STUDIO_WIDGET main_window_window_2_define =
391 {
392 "window_2",
393 GX_TYPE_WINDOW, /* widget type */
394 GX_ID_NONE, /* widget id */
395 #if defined(GX_WIDGET_USER_DATA)
396 0, /* user data */
397 #endif
398 GX_STYLE_BORDER_THIN, /* style flags */
399 GX_STATUS_ACCEPTS_FOCUS, /* status flags */
400 sizeof(GX_WINDOW), /* control block size */
401 GX_COLOR_ID_WINDOW_FILL, /* normal color id */
402 GX_COLOR_ID_WINDOW_FILL, /* selected color id */
403 GX_COLOR_ID_WINDOW_FILL, /* disabled color id */
404 gx_studio_window_create, /* create function */
405 GX_NULL, /* drawing function override */
406 GX_NULL, /* event function override */
407 {506, 134, 683, 336}, /* widget size */
408 &main_window_icon_define, /* next widget definition */
409 GX_NULL, /* no child widgets */
410 offsetof(MAIN_WINDOW_CONTROL_BLOCK, main_window_window_2), /* control block */
411 (void *) &main_window_window_2_properties /* extended properties */
412 };
413
414 GX_CONST GX_STUDIO_WIDGET main_window_window_1_define =
415 {
416 "window_1",
417 GX_TYPE_WINDOW, /* widget type */
418 GX_ID_NONE, /* widget id */
419 #if defined(GX_WIDGET_USER_DATA)
420 0, /* user data */
421 #endif
422 GX_STYLE_BORDER_THIN, /* style flags */
423 GX_STATUS_ACCEPTS_FOCUS, /* status flags */
424 sizeof(GX_WINDOW), /* control block size */
425 GX_COLOR_ID_WINDOW_FILL, /* normal color id */
426 GX_COLOR_ID_WINDOW_FILL, /* selected color id */
427 GX_COLOR_ID_WINDOW_FILL, /* disabled color id */
428 gx_studio_window_create, /* create function */
429 GX_NULL, /* drawing function override */
430 GX_NULL, /* event function override */
431 {383, 56, 768, 405}, /* widget size */
432 &main_window_window_2_define, /* next widget definition */
433 GX_NULL, /* no child widgets */
434 offsetof(MAIN_WINDOW_CONTROL_BLOCK, main_window_window_1), /* control block */
435 (void *) &main_window_window_1_properties /* extended properties */
436 };
437
438 GX_CONST GX_STUDIO_WIDGET main_window_pic_window_define =
439 {
440 "pic_window",
441 GX_TYPE_WINDOW, /* widget type */
442 GX_ID_NONE, /* widget id */
443 #if defined(GX_WIDGET_USER_DATA)
444 0, /* user data */
445 #endif
446 GX_STYLE_BORDER_THIN|GX_STYLE_TRANSPARENT, /* style flags */
447 GX_STATUS_ACCEPTS_FOCUS, /* status flags */
448 sizeof(GX_WINDOW), /* control block size */
449 GX_COLOR_ID_WINDOW_FILL, /* normal color id */
450 GX_COLOR_ID_WINDOW_FILL, /* selected color id */
451 GX_COLOR_ID_WINDOW_FILL, /* disabled color id */
452 gx_studio_window_create, /* create function */
453 GX_NULL, /* drawing function override */
454 GX_NULL, /* event function override */
455 {80, 85, 275, 353}, /* widget size */
456 &main_window_window_1_define, /* next widget definition */
457 GX_NULL, /* no child widgets */
458 offsetof(MAIN_WINDOW_CONTROL_BLOCK, main_window_pic_window), /* control block */
459 (void *) &main_window_pic_window_properties /* extended properties */
460 };
461
462 GX_CONST GX_STUDIO_WIDGET main_window_define =
463 {
464 "main_window",
465 GX_TYPE_WINDOW, /* widget type */
466 GX_ID_NONE, /* widget id */
467 #if defined(GX_WIDGET_USER_DATA)
468 0, /* user data */
469 #endif
470 GX_STYLE_BORDER_THIN, /* style flags */
471 GX_STATUS_ACCEPTS_FOCUS, /* status flags */
472 sizeof(MAIN_WINDOW_CONTROL_BLOCK), /* control block size */
473 GX_COLOR_ID_BTN_LOWER, /* normal color id */
474 GX_COLOR_ID_BTN_LOWER, /* selected color id */
475 GX_COLOR_ID_BTN_LOWER, /* disabled color id */
476 gx_studio_window_create, /* create function */
477 (VOID (*)(GX_WIDGET *)) main_window_draw, /* drawing function override */
478 GX_NULL, /* event function override */
479 {0, 0, 799, 479}, /* widget size */
480 GX_NULL, /* next widget */
481 &main_window_pic_window_define, /* child widget */
482 0, /* control block */
483 (void *) &main_window_properties /* extended properties */
484 };
485 GX_CONST GX_STUDIO_WIDGET_ENTRY jpeg_draw_32bpp_widget_table[] =
486 {
487 { &main_window_define, (GX_WIDGET *) &main_window },
488 {GX_NULL, GX_NULL}
489 };
490
gx_studio_nested_widget_create(GX_BYTE * control,GX_CONST GX_STUDIO_WIDGET * definition,GX_WIDGET * parent)491 static GX_WIDGET *gx_studio_nested_widget_create(GX_BYTE *control, GX_CONST GX_STUDIO_WIDGET *definition, GX_WIDGET *parent)
492 {
493 UINT status = GX_SUCCESS;
494 GX_WIDGET *widget = GX_NULL;
495 GX_VALUE list_count = 0;
496 GX_VALUE list_total_count = 0;
497
498 if(parent && (parent->gx_widget_type == GX_TYPE_MENU))
499 {
500 list_total_count = ((GX_MENU *)parent)->gx_menu_list_total_count;
501 }
502
503 while(definition && status == GX_SUCCESS)
504 {
505 if (definition->create_function)
506 {
507 if (definition->style & GX_STYLE_DYNAMICALLY_ALLOCATED)
508 {
509 status = gx_widget_allocate(&widget, definition->control_block_size);
510 if (status != GX_SUCCESS)
511 {
512 return GX_NULL;
513 }
514 }
515 else
516 {
517 if (control == GX_NULL)
518 {
519 return GX_NULL;
520 }
521 widget = (GX_WIDGET *) (control + definition->control_block_offset);
522 }
523
524 status = definition->create_function(definition, widget, parent);
525
526 if(list_count < list_total_count)
527 {
528 gx_menu_insert((GX_MENU *)parent, widget);
529 ((GX_MENU *)parent)->gx_menu_list_total_count--;
530 list_count++;
531 }
532
533 if (status == GX_SUCCESS)
534 {
535 if (definition->widget_type != GX_TYPE_TEMPLATE)
536 {
537 #if defined(GUIX_5_4_0_COMPATIBILITY)
538 gx_widget_fill_color_set(widget, definition->normal_fill_color_id, definition->selected_fill_color_id);
539 #else
540 gx_widget_fill_color_set(widget, definition->normal_fill_color_id, definition->selected_fill_color_id, definition->disabled_fill_color_id);
541 #endif
542 }
543
544 if (!(definition->status & GX_STATUS_ACCEPTS_FOCUS))
545 {
546 gx_widget_status_remove(widget, GX_STATUS_ACCEPTS_FOCUS);
547 }
548
549 if (definition->draw_function)
550 {
551 gx_widget_draw_set(widget, definition->draw_function);
552 }
553 if (definition->event_function)
554 {
555 gx_widget_event_process_set(widget, definition->event_function);
556 }
557
558 #if defined(GX_WIDGET_USER_DATA)
559 widget->gx_widget_user_data = definition->user_data;
560 #endif
561
562 if (definition->child_widget)
563 {
564 gx_studio_nested_widget_create(control, definition->child_widget, widget);
565 }
566 }
567 definition = definition->next_widget;
568 }
569 }
570 return widget;
571 }
572
gx_studio_widget_create(GX_BYTE * control,GX_CONST GX_STUDIO_WIDGET * definition,GX_WIDGET * parent)573 GX_WIDGET *gx_studio_widget_create(GX_BYTE *control, GX_CONST GX_STUDIO_WIDGET *definition, GX_WIDGET *parent)
574 {
575 GX_WIDGET *widget;
576 widget = gx_studio_nested_widget_create(control, definition, GX_NULL);
577
578 if (parent && widget)
579 {
580 gx_widget_attach(parent, widget);
581 }
582 return widget;
583 }
584
gx_studio_named_widget_create(char * name,GX_WIDGET * parent,GX_WIDGET ** new_widget)585 UINT gx_studio_named_widget_create(char *name, GX_WIDGET *parent, GX_WIDGET **new_widget)
586 {
587 UINT status = GX_FAILURE;
588 GX_CONST GX_STUDIO_WIDGET_ENTRY *entry = jpeg_draw_32bpp_widget_table;
589 GX_WIDGET *widget = GX_NULL;
590
591 while(entry->widget_information)
592 {
593 if (!strcmp(name, entry->widget_information->widget_name))
594 {
595 widget = gx_studio_widget_create((GX_BYTE *) entry->widget, entry->widget_information, parent);
596 if (widget)
597 {
598 status = GX_SUCCESS;
599 }
600 break;
601 }
602 entry++;
603 }
604
605 if (new_widget)
606 {
607 *new_widget = widget;
608 }
609 return status;
610 }
611
612
gx_studio_display_configure(USHORT display,UINT (* driver)(GX_DISPLAY *),GX_UBYTE language,USHORT theme,GX_WINDOW_ROOT ** return_root)613 UINT gx_studio_display_configure(USHORT display, UINT (*driver)(GX_DISPLAY *),
614 GX_UBYTE language, USHORT theme, GX_WINDOW_ROOT **return_root)
615 {
616 GX_CONST GX_THEME *theme_ptr;
617 GX_RECTANGLE size;
618
619 GX_STUDIO_DISPLAY_INFO *display_info = &jpeg_draw_32bpp_display_table[display];
620
621
622 /* create the requested display */
623
624 gx_display_create(display_info->display,
625 display_info->name,
626 driver,
627 (GX_VALUE) display_info->x_resolution,
628 (GX_VALUE) display_info->y_resolution);
629
630
631 /* install the request theme */
632
633 if(display_info->theme_table)
634 {
635 theme_ptr = display_info->theme_table[theme];
636 if(theme_ptr)
637 {
638 gx_display_color_table_set(display_info->display, theme_ptr->theme_color_table, theme_ptr->theme_color_table_size);
639
640 /* install the color palette if required */
641 if (display_info->display->gx_display_driver_palette_set &&
642 theme_ptr->theme_palette != NULL)
643 {
644 display_info->display->gx_display_driver_palette_set(display_info->display, theme_ptr->theme_palette, theme_ptr->theme_palette_size);
645 }
646
647 gx_display_font_table_set(display_info->display, theme_ptr->theme_font_table, theme_ptr->theme_font_table_size);
648 gx_display_pixelmap_table_set(display_info->display, theme_ptr->theme_pixelmap_table, theme_ptr->theme_pixelmap_table_size);
649 gx_system_scroll_appearance_set(theme_ptr->theme_vertical_scroll_style, (GX_SCROLLBAR_APPEARANCE *) &theme_ptr->theme_vertical_scrollbar_appearance);
650 gx_system_scroll_appearance_set(theme_ptr->theme_horizontal_scroll_style, (GX_SCROLLBAR_APPEARANCE *) &theme_ptr->theme_horizontal_scrollbar_appearance);
651 }
652 }
653
654 /* Install the language table. */
655
656 if(display_info->language_table)
657 {
658 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);
659 gx_display_active_language_set(display_info->display, language);
660 }
661
662 /* Set screen rotation angle. */
663
664 display_info->display->gx_display_rotation_angle = display_info->rotation_angle;
665
666 /* create the canvas for this display */
667
668 gx_canvas_create(display_info->canvas,
669 display_info->canvas_name,
670 display_info->display,
671 GX_CANVAS_MANAGED | GX_CANVAS_VISIBLE,
672 display_info->x_resolution,
673 display_info->y_resolution,
674 display_info->canvas_memory,
675 display_info->canvas_memory_size);
676
677 /* Create the root window for this canvas */
678
679 gx_utility_rectangle_define(&size,
680 0, 0,
681 (GX_VALUE) (display_info->x_resolution - 1),
682 (GX_VALUE) (display_info->y_resolution - 1));
683
684 gx_window_root_create(display_info->root_window,
685 display_info->name,
686 display_info->canvas, GX_STYLE_NONE, 0, &size);
687 if (return_root)
688 {
689 *return_root = display_info->root_window;
690 }
691 return GX_SUCCESS;
692 }
693 #undef GUIX_STUDIO_GENERATED_FILE
694