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.2 (Preview Version) */
9 /* Date (dd.mm.yyyy): 31. 3.2023 Time (hh:mm): 10:56 */
10 /*******************************************************************************/
11
12
13 #define GUIX_STUDIO_GENERATED_FILE
14 #include <stddef.h>
15 #include "two_displays_binres_MAIN_DISPLAY_resources.h"
16 #include "two_displays_binres_SECONDARY_resources.h"
17 #include "two_displays_binres_specifications.h"
18
19 static GX_WIDGET *gx_studio_nested_widget_create(GX_BYTE *control, GX_CONST GX_STUDIO_WIDGET *definition, GX_WIDGET *parent);
20 MAIN_DISPLAY_MAIN_WINDOW_CONTROL_BLOCK MAIN_DISPLAY_main_window;
21 SECONDARY_MAIN_WINDOW_CONTROL_BLOCK SECONDARY_main_window;
22 GX_DISPLAY MAIN_DISPLAY_control_block;
23 GX_WINDOW_ROOT MAIN_DISPLAY_root_window;
24 GX_CANVAS MAIN_DISPLAY_canvas_control_block;
25 ULONG MAIN_DISPLAY_canvas_memory[38400];
26
27 GX_DISPLAY SECONDARY_control_block;
28 GX_WINDOW_ROOT SECONDARY_root_window;
29 GX_CANVAS SECONDARY_canvas_control_block;
30 ULONG SECONDARY_canvas_memory[38400];
31
32
33 GX_STUDIO_DISPLAY_INFO two_displays_binres_display_table[2] =
34 {
35 {
36 "MAIN_DISPLAY",
37 "MAIN_DISPLAY_canvas",
38 GX_NULL,
39 GX_NULL,
40 0,
41 0,
42 0,
43 320, /* x resolution */
44 240, /* y resolution */
45 &MAIN_DISPLAY_control_block,
46 &MAIN_DISPLAY_canvas_control_block,
47 &MAIN_DISPLAY_root_window,
48 MAIN_DISPLAY_canvas_memory, /* canvas memory area */
49 153600, /* canvas memory size in bytes */
50 0 /* rotation angle */
51 },
52 {
53 "SECONDARY",
54 "SECONDARY_canvas",
55 GX_NULL,
56 GX_NULL,
57 0,
58 0,
59 0,
60 320, /* x resolution */
61 240, /* y resolution */
62 &SECONDARY_control_block,
63 &SECONDARY_canvas_control_block,
64 &SECONDARY_root_window,
65 SECONDARY_canvas_memory, /* canvas memory area */
66 153600, /* canvas memory size in bytes */
67 0 /* rotation angle */
68 }
69 };
70
71
gx_studio_icon_button_create(GX_CONST GX_STUDIO_WIDGET * info,GX_WIDGET * control_block,GX_WIDGET * parent)72 UINT gx_studio_icon_button_create(GX_CONST GX_STUDIO_WIDGET *info, GX_WIDGET *control_block, GX_WIDGET *parent)
73 {
74 UINT status;
75 GX_ICON_BUTTON *button = (GX_ICON_BUTTON *) control_block;
76 GX_ICON_BUTTON_PROPERTIES *props = (GX_ICON_BUTTON_PROPERTIES *) info->properties;
77 status = gx_icon_button_create(button, info->widget_name, parent, props->pixelmap_id, info->style, info->widget_id, &info->size);
78 return status;
79 }
80
gx_studio_icon_create(GX_CONST GX_STUDIO_WIDGET * info,GX_WIDGET * control_block,GX_WIDGET * parent)81 UINT gx_studio_icon_create(GX_CONST GX_STUDIO_WIDGET *info, GX_WIDGET *control_block, GX_WIDGET *parent)
82 {
83 UINT status;
84 GX_ICON *icon = (GX_ICON *) control_block;
85 GX_ICON_PROPERTIES *props = (GX_ICON_PROPERTIES *) info->properties;
86 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);
87 if (props->selected_pixelmap_id)
88 {
89 gx_icon_pixelmap_set(icon, props->normal_pixelmap_id, props->selected_pixelmap_id);
90 }
91 else
92 {
93 gx_widget_resize((GX_WIDGET *)icon, (GX_RECTANGLE *)&info->size);
94 }
95 return status;
96 }
97
gx_studio_prompt_create(GX_CONST GX_STUDIO_WIDGET * info,GX_WIDGET * control_block,GX_WIDGET * parent)98 UINT gx_studio_prompt_create(GX_CONST GX_STUDIO_WIDGET *info, GX_WIDGET *control_block, GX_WIDGET *parent)
99 {
100 UINT status;
101 GX_PROMPT *prompt = (GX_PROMPT *) control_block;
102 GX_PROMPT_PROPERTIES *props = (GX_PROMPT_PROPERTIES *) info->properties;
103 status = gx_prompt_create(prompt, info->widget_name, parent, props->string_id, info->style, info->widget_id, &info->size);
104 if (status == GX_SUCCESS)
105 {
106 gx_prompt_font_set(prompt, props->font_id);
107 #if defined(GUIX_5_4_0_COMPATIBILITY)
108 gx_prompt_text_color_set(prompt, props->normal_text_color_id, props->selected_text_color_id);
109 #else
110 gx_prompt_text_color_set(prompt, props->normal_text_color_id, props->selected_text_color_id, props->disabled_text_color_id);
111 #endif
112 }
113 return status;
114 }
115
gx_studio_window_create(GX_CONST GX_STUDIO_WIDGET * info,GX_WIDGET * control_block,GX_WIDGET * parent)116 UINT gx_studio_window_create(GX_CONST GX_STUDIO_WIDGET *info, GX_WIDGET *control_block, GX_WIDGET *parent)
117 {
118 UINT status;
119 GX_WINDOW *window = (GX_WINDOW *) control_block;
120 GX_WINDOW_PROPERTIES *props = (GX_WINDOW_PROPERTIES *) info->properties;
121 status = gx_window_create(window, info->widget_name, parent, info->style, info->widget_id, &info->size);
122 if (status == GX_SUCCESS)
123 {
124 if (props->wallpaper_id)
125 {
126 gx_window_wallpaper_set(window, props->wallpaper_id, info->style & GX_STYLE_TILE_WALLPAPER);
127 }
128 }
129 return status;
130 }
131 GX_WINDOW_PROPERTIES MAIN_DISPLAY_main_window_properties =
132 {
133 0 /* wallpaper pixelmap id */
134 };
135 GX_ICON_PROPERTIES MAIN_DISPLAY_main_window_icon_1_properties =
136 {
137 GX_PIXELMAP_ID_MAIN_DISPLAY_HOME, /* normal pixelmap id */
138 0 /* selected pixelmap id */
139 };
140 GX_PROMPT_PROPERTIES MAIN_DISPLAY_main_window_prompt_properties =
141 {
142 GX_STRING_ID_MAIN_DISPLAY_STRING_2, /* string id */
143 GX_FONT_ID_PROMPT, /* font id */
144 GX_COLOR_ID_TEXT, /* normal text color */
145 GX_COLOR_ID_SELECTED_TEXT, /* selected text color */
146 GX_COLOR_ID_TEXT /* disabled text color */
147 };
148
149 GX_CONST GX_STUDIO_WIDGET MAIN_DISPLAY_main_window_prompt_define =
150 {
151 "prompt",
152 GX_TYPE_PROMPT, /* widget type */
153 GX_ID_NONE, /* widget id */
154 #if defined(GX_WIDGET_USER_DATA)
155 0, /* user data */
156 #endif
157 GX_STYLE_BORDER_NONE|GX_STYLE_TRANSPARENT|GX_STYLE_TEXT_CENTER, /* style flags */
158 0, /* status flags */
159 sizeof(GX_PROMPT), /* control block size */
160 GX_COLOR_ID_WIDGET_FILL, /* normal color id */
161 GX_COLOR_ID_SELECTED_FILL, /* selected color id */
162 GX_COLOR_ID_WIDGET_FILL, /* disabled color id */
163 gx_studio_prompt_create, /* create function */
164 GX_NULL, /* drawing function override */
165 GX_NULL, /* event function override */
166 {111, 42, 205, 59}, /* widget size */
167 GX_NULL, /* no next widget */
168 GX_NULL, /* no child widgets */
169 offsetof(MAIN_DISPLAY_MAIN_WINDOW_CONTROL_BLOCK, MAIN_DISPLAY_main_window_prompt), /* control block */
170 (void *) &MAIN_DISPLAY_main_window_prompt_properties /* extended properties */
171 };
172
173 GX_CONST GX_STUDIO_WIDGET MAIN_DISPLAY_main_window_icon_1_define =
174 {
175 "icon_1",
176 GX_TYPE_ICON, /* widget type */
177 GX_ID_NONE, /* widget id */
178 #if defined(GX_WIDGET_USER_DATA)
179 0, /* user data */
180 #endif
181 GX_STYLE_BORDER_NONE|GX_STYLE_ENABLED|GX_STYLE_HALIGN_LEFT|GX_STYLE_VALIGN_TOP, /* style flags */
182 GX_STATUS_ACCEPTS_FOCUS, /* status flags */
183 sizeof(GX_ICON), /* control block size */
184 GX_COLOR_ID_WIDGET_FILL, /* normal color id */
185 GX_COLOR_ID_SELECTED_FILL, /* selected color id */
186 GX_COLOR_ID_WIDGET_FILL, /* disabled color id */
187 gx_studio_icon_create, /* create function */
188 GX_NULL, /* drawing function override */
189 GX_NULL, /* event function override */
190 {137, 88, 176, 127}, /* widget size */
191 &MAIN_DISPLAY_main_window_prompt_define, /* next widget definition */
192 GX_NULL, /* no child widgets */
193 offsetof(MAIN_DISPLAY_MAIN_WINDOW_CONTROL_BLOCK, MAIN_DISPLAY_main_window_icon_1), /* control block */
194 (void *) &MAIN_DISPLAY_main_window_icon_1_properties /* extended properties */
195 };
196
197 GX_CONST GX_STUDIO_WIDGET MAIN_DISPLAY_main_window_define =
198 {
199 "MAIN_DISPLAY_main_window",
200 GX_TYPE_WINDOW, /* widget type */
201 GX_ID_NONE, /* widget id */
202 #if defined(GX_WIDGET_USER_DATA)
203 0, /* user data */
204 #endif
205 GX_STYLE_BORDER_THIN, /* style flags */
206 GX_STATUS_ACCEPTS_FOCUS, /* status flags */
207 sizeof(MAIN_DISPLAY_MAIN_WINDOW_CONTROL_BLOCK), /* control block size */
208 GX_COLOR_ID_WINDOW_FILL, /* normal color id */
209 GX_COLOR_ID_WINDOW_FILL, /* selected color id */
210 GX_COLOR_ID_WINDOW_FILL, /* disabled color id */
211 gx_studio_window_create, /* create function */
212 GX_NULL, /* drawing function override */
213 GX_NULL, /* event function override */
214 {24, 18, 290, 197}, /* widget size */
215 GX_NULL, /* next widget */
216 &MAIN_DISPLAY_main_window_icon_1_define, /* child widget */
217 0, /* control block */
218 (void *) &MAIN_DISPLAY_main_window_properties /* extended properties */
219 };
220 GX_WINDOW_PROPERTIES SECONDARY_main_window_properties =
221 {
222 0 /* wallpaper pixelmap id */
223 };
224 GX_ICON_BUTTON_PROPERTIES SECONDARY_main_window_icon_button_1_properties =
225 {
226 GX_PIXELMAP_ID_SECONDARY_I_PATIENTLIST_LG /* pixelmap id */
227 };
228 GX_PROMPT_PROPERTIES SECONDARY_main_window_prompt_properties =
229 {
230 GX_STRING_ID_SECONDARY_STRING_2, /* string id */
231 GX_FONT_ID_PROMPT, /* font id */
232 GX_COLOR_ID_TEXT, /* normal text color */
233 GX_COLOR_ID_SELECTED_TEXT, /* selected text color */
234 GX_COLOR_ID_TEXT /* disabled text color */
235 };
236
237 GX_CONST GX_STUDIO_WIDGET SECONDARY_main_window_prompt_define =
238 {
239 "prompt",
240 GX_TYPE_PROMPT, /* widget type */
241 GX_ID_NONE, /* widget id */
242 #if defined(GX_WIDGET_USER_DATA)
243 0, /* user data */
244 #endif
245 GX_STYLE_BORDER_NONE|GX_STYLE_TRANSPARENT|GX_STYLE_TEXT_CENTER, /* style flags */
246 0, /* status flags */
247 sizeof(GX_PROMPT), /* control block size */
248 GX_COLOR_ID_WIDGET_FILL, /* normal color id */
249 GX_COLOR_ID_SELECTED_FILL, /* selected color id */
250 GX_COLOR_ID_WIDGET_FILL, /* disabled color id */
251 gx_studio_prompt_create, /* create function */
252 GX_NULL, /* drawing function override */
253 GX_NULL, /* event function override */
254 {71, 106, 150, 123}, /* widget size */
255 GX_NULL, /* no next widget */
256 GX_NULL, /* no child widgets */
257 offsetof(SECONDARY_MAIN_WINDOW_CONTROL_BLOCK, SECONDARY_main_window_prompt), /* control block */
258 (void *) &SECONDARY_main_window_prompt_properties /* extended properties */
259 };
260
261 GX_CONST GX_STUDIO_WIDGET SECONDARY_main_window_icon_button_1_define =
262 {
263 "icon_button_1",
264 GX_TYPE_ICON_BUTTON, /* widget type */
265 GX_ID_NONE, /* widget id */
266 #if defined(GX_WIDGET_USER_DATA)
267 0, /* user data */
268 #endif
269 GX_STYLE_BORDER_NONE|GX_STYLE_ENABLED|GX_STYLE_HALIGN_CENTER|GX_STYLE_VALIGN_CENTER, /* style flags */
270 GX_STATUS_ACCEPTS_FOCUS, /* status flags */
271 sizeof(GX_ICON_BUTTON), /* control block size */
272 GX_COLOR_ID_BTN_LOWER, /* normal color id */
273 GX_COLOR_ID_BTN_UPPER, /* selected color id */
274 GX_COLOR_ID_BTN_LOWER, /* disabled color id */
275 gx_studio_icon_button_create, /* create function */
276 GX_NULL, /* drawing function override */
277 GX_NULL, /* event function override */
278 {87, 37, 128, 78}, /* widget size */
279 &SECONDARY_main_window_prompt_define, /* next widget definition */
280 GX_NULL, /* no child widgets */
281 offsetof(SECONDARY_MAIN_WINDOW_CONTROL_BLOCK, SECONDARY_main_window_icon_button_1), /* control block */
282 (void *) &SECONDARY_main_window_icon_button_1_properties /* extended properties */
283 };
284
285 GX_CONST GX_STUDIO_WIDGET SECONDARY_main_window_define =
286 {
287 "SECONDARY_main_window",
288 GX_TYPE_WINDOW, /* widget type */
289 GX_ID_NONE, /* widget id */
290 #if defined(GX_WIDGET_USER_DATA)
291 0, /* user data */
292 #endif
293 GX_STYLE_BORDER_THIN, /* style flags */
294 GX_STATUS_ACCEPTS_FOCUS, /* status flags */
295 sizeof(SECONDARY_MAIN_WINDOW_CONTROL_BLOCK), /* control block size */
296 GX_COLOR_ID_WINDOW_FILL, /* normal color id */
297 GX_COLOR_ID_WINDOW_FILL, /* selected color id */
298 GX_COLOR_ID_WINDOW_FILL, /* disabled color id */
299 gx_studio_window_create, /* create function */
300 GX_NULL, /* drawing function override */
301 GX_NULL, /* event function override */
302 {37, 19, 185, 217}, /* widget size */
303 GX_NULL, /* next widget */
304 &SECONDARY_main_window_icon_button_1_define, /* child widget */
305 0, /* control block */
306 (void *) &SECONDARY_main_window_properties /* extended properties */
307 };
308 GX_CONST GX_STUDIO_WIDGET_ENTRY two_displays_binres_widget_table[] =
309 {
310 { &MAIN_DISPLAY_main_window_define, (GX_WIDGET *) &MAIN_DISPLAY_main_window },
311 { &SECONDARY_main_window_define, (GX_WIDGET *) &SECONDARY_main_window },
312 {GX_NULL, GX_NULL}
313 };
314
gx_studio_nested_widget_create(GX_BYTE * control,GX_CONST GX_STUDIO_WIDGET * definition,GX_WIDGET * parent)315 static GX_WIDGET *gx_studio_nested_widget_create(GX_BYTE *control, GX_CONST GX_STUDIO_WIDGET *definition, GX_WIDGET *parent)
316 {
317 UINT status = GX_SUCCESS;
318 GX_WIDGET *widget = GX_NULL;
319 GX_VALUE list_count = 0;
320 GX_VALUE list_total_count = 0;
321
322 if(parent && (parent->gx_widget_type == GX_TYPE_MENU))
323 {
324 list_total_count = ((GX_MENU *)parent)->gx_menu_list_total_count;
325 }
326
327 while(definition && status == GX_SUCCESS)
328 {
329 if (definition->create_function)
330 {
331 if (definition->style & GX_STYLE_DYNAMICALLY_ALLOCATED)
332 {
333 status = gx_widget_allocate(&widget, definition->control_block_size);
334 if (status != GX_SUCCESS)
335 {
336 return GX_NULL;
337 }
338 }
339 else
340 {
341 if (control == GX_NULL)
342 {
343 return GX_NULL;
344 }
345 widget = (GX_WIDGET *) (control + definition->control_block_offset);
346 }
347
348 status = definition->create_function(definition, widget, parent);
349
350 if(list_count < list_total_count)
351 {
352 gx_menu_insert((GX_MENU *)parent, widget);
353 ((GX_MENU *)parent)->gx_menu_list_total_count--;
354 list_count++;
355 }
356
357 if (status == GX_SUCCESS)
358 {
359 if (definition->widget_type != GX_TYPE_TEMPLATE)
360 {
361 #if defined(GUIX_5_4_0_COMPATIBILITY)
362 gx_widget_fill_color_set(widget, definition->normal_fill_color_id, definition->selected_fill_color_id);
363 #else
364 gx_widget_fill_color_set(widget, definition->normal_fill_color_id, definition->selected_fill_color_id, definition->disabled_fill_color_id);
365 #endif
366 }
367
368 if (!(definition->status & GX_STATUS_ACCEPTS_FOCUS))
369 {
370 gx_widget_status_remove(widget, GX_STATUS_ACCEPTS_FOCUS);
371 }
372
373 if (definition->draw_function)
374 {
375 gx_widget_draw_set(widget, definition->draw_function);
376 }
377 if (definition->event_function)
378 {
379 gx_widget_event_process_set(widget, definition->event_function);
380 }
381
382 #if defined(GX_WIDGET_USER_DATA)
383 widget->gx_widget_user_data = definition->user_data;
384 #endif
385
386 if (definition->child_widget)
387 {
388 gx_studio_nested_widget_create(control, definition->child_widget, widget);
389 }
390 }
391 definition = definition->next_widget;
392 }
393 }
394 return widget;
395 }
396
gx_studio_widget_create(GX_BYTE * control,GX_CONST GX_STUDIO_WIDGET * definition,GX_WIDGET * parent)397 GX_WIDGET *gx_studio_widget_create(GX_BYTE *control, GX_CONST GX_STUDIO_WIDGET *definition, GX_WIDGET *parent)
398 {
399 GX_WIDGET *widget;
400 widget = gx_studio_nested_widget_create(control, definition, GX_NULL);
401
402 if (parent && widget)
403 {
404 gx_widget_attach(parent, widget);
405 }
406 return widget;
407 }
408
gx_studio_named_widget_create(char * name,GX_WIDGET * parent,GX_WIDGET ** new_widget)409 UINT gx_studio_named_widget_create(char *name, GX_WIDGET *parent, GX_WIDGET **new_widget)
410 {
411 UINT status = GX_FAILURE;
412 GX_CONST GX_STUDIO_WIDGET_ENTRY *entry = two_displays_binres_widget_table;
413 GX_WIDGET *widget = GX_NULL;
414
415 while(entry->widget_information)
416 {
417 if (!strcmp(name, entry->widget_information->widget_name))
418 {
419 widget = gx_studio_widget_create((GX_BYTE *) entry->widget, entry->widget_information, parent);
420 if (widget)
421 {
422 status = GX_SUCCESS;
423 }
424 break;
425 }
426 entry++;
427 }
428
429 if (new_widget)
430 {
431 *new_widget = widget;
432 }
433 return status;
434 }
435
436
gx_studio_display_configure(USHORT display,UINT (* driver)(GX_DISPLAY *),GX_UBYTE language,USHORT theme,GX_WINDOW_ROOT ** return_root)437 UINT gx_studio_display_configure(USHORT display, UINT (*driver)(GX_DISPLAY *),
438 GX_UBYTE language, USHORT theme, GX_WINDOW_ROOT **return_root)
439 {
440 GX_CONST GX_THEME *theme_ptr;
441 GX_RECTANGLE size;
442
443 GX_STUDIO_DISPLAY_INFO *display_info = &two_displays_binres_display_table[display];
444
445
446 /* create the requested display */
447
448 gx_display_create(display_info->display,
449 display_info->name,
450 driver,
451 (GX_VALUE) display_info->x_resolution,
452 (GX_VALUE) display_info->y_resolution);
453
454
455 /* install the request theme */
456
457 if(display_info->theme_table)
458 {
459 theme_ptr = display_info->theme_table[theme];
460 if(theme_ptr)
461 {
462 gx_display_color_table_set(display_info->display, theme_ptr->theme_color_table, theme_ptr->theme_color_table_size);
463
464 /* install the color palette if required */
465 if (display_info->display->gx_display_driver_palette_set &&
466 theme_ptr->theme_palette != NULL)
467 {
468 display_info->display->gx_display_driver_palette_set(display_info->display, theme_ptr->theme_palette, theme_ptr->theme_palette_size);
469 }
470
471 gx_display_font_table_set(display_info->display, theme_ptr->theme_font_table, theme_ptr->theme_font_table_size);
472 gx_display_pixelmap_table_set(display_info->display, theme_ptr->theme_pixelmap_table, theme_ptr->theme_pixelmap_table_size);
473 gx_system_scroll_appearance_set(theme_ptr->theme_vertical_scroll_style, (GX_SCROLLBAR_APPEARANCE *) &theme_ptr->theme_vertical_scrollbar_appearance);
474 gx_system_scroll_appearance_set(theme_ptr->theme_horizontal_scroll_style, (GX_SCROLLBAR_APPEARANCE *) &theme_ptr->theme_horizontal_scrollbar_appearance);
475 }
476 }
477
478 /* Install the language table. */
479
480 if(display_info->language_table)
481 {
482 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);
483 gx_display_active_language_set(display_info->display, language);
484 }
485
486 /* Set screen rotation angle. */
487
488 display_info->display->gx_display_rotation_angle = display_info->rotation_angle;
489
490 /* create the canvas for this display */
491
492 gx_canvas_create(display_info->canvas,
493 display_info->canvas_name,
494 display_info->display,
495 GX_CANVAS_MANAGED | GX_CANVAS_VISIBLE,
496 display_info->x_resolution,
497 display_info->y_resolution,
498 display_info->canvas_memory,
499 display_info->canvas_memory_size);
500
501 /* Create the root window for this canvas */
502
503 gx_utility_rectangle_define(&size,
504 0, 0,
505 (GX_VALUE) (display_info->x_resolution - 1),
506 (GX_VALUE) (display_info->y_resolution - 1));
507
508 gx_window_root_create(display_info->root_window,
509 display_info->name,
510 display_info->canvas, GX_STYLE_NONE, 0, &size);
511 if (return_root)
512 {
513 *return_root = display_info->root_window;
514 }
515 return GX_SUCCESS;
516 }
517 #undef GUIX_STUDIO_GENERATED_FILE
518