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 "synergy_text_rotation_resources.h"
16 #include "synergy_text_rotation_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 SCREEN_BASE_CONTROL_BLOCK screen_base;
20 GX_DISPLAY main_display_control_block;
21 GX_WINDOW_ROOT main_display_root_window;
22 GX_CANVAS main_display_canvas_control_block;
23 ULONG main_display_canvas_memory[307200];
24
25 extern GX_CONST GX_THEME *main_display_theme_table[];
26 extern GX_CONST GX_STRING *main_display_language_table[];
27
28 GX_STUDIO_DISPLAY_INFO synergy_text_rotation_display_table[1] =
29 {
30 {
31 "main_display",
32 "main_display_canvas",
33 main_display_theme_table,
34 main_display_language_table,
35 MAIN_DISPLAY_THEME_TABLE_SIZE,
36 MAIN_DISPLAY_LANGUAGE_TABLE_SIZE,
37 MAIN_DISPLAY_STRING_TABLE_SIZE,
38 640, /* x resolution */
39 480, /* y resolution */
40 &main_display_control_block,
41 &main_display_canvas_control_block,
42 &main_display_root_window,
43 main_display_canvas_memory, /* canvas memory area */
44 1228800, /* canvas memory size in bytes */
45 0 /* rotation angle */
46 }
47 };
48
49
gx_studio_pixelmap_button_create(GX_CONST GX_STUDIO_WIDGET * info,GX_WIDGET * control_block,GX_WIDGET * parent)50 UINT gx_studio_pixelmap_button_create(GX_CONST GX_STUDIO_WIDGET *info, GX_WIDGET *control_block, GX_WIDGET *parent)
51 {
52 UINT status;
53 GX_PIXELMAP_BUTTON *button = (GX_PIXELMAP_BUTTON *) control_block;
54 GX_PIXELMAP_BUTTON_PROPERTIES *props = (GX_PIXELMAP_BUTTON_PROPERTIES *) info->properties;
55 status = gx_pixelmap_button_create(button, info->widget_name, parent,
56 props->normal_pixelmap_id,
57 props->selected_pixelmap_id,
58 props->disabled_pixelmap_id,
59 info->style, info->widget_id, &info->size);
60 return status;
61 }
62
gx_studio_icon_create(GX_CONST GX_STUDIO_WIDGET * info,GX_WIDGET * control_block,GX_WIDGET * parent)63 UINT gx_studio_icon_create(GX_CONST GX_STUDIO_WIDGET *info, GX_WIDGET *control_block, GX_WIDGET *parent)
64 {
65 UINT status;
66 GX_ICON *icon = (GX_ICON *) control_block;
67 GX_ICON_PROPERTIES *props = (GX_ICON_PROPERTIES *) info->properties;
68 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);
69 if (props->selected_pixelmap_id)
70 {
71 gx_icon_pixelmap_set(icon, props->normal_pixelmap_id, props->selected_pixelmap_id);
72 }
73 else
74 {
75 gx_widget_resize((GX_WIDGET *)icon, (GX_RECTANGLE *)&info->size);
76 }
77 return status;
78 }
79
gx_studio_window_create(GX_CONST GX_STUDIO_WIDGET * info,GX_WIDGET * control_block,GX_WIDGET * parent)80 UINT gx_studio_window_create(GX_CONST GX_STUDIO_WIDGET *info, GX_WIDGET *control_block, GX_WIDGET *parent)
81 {
82 UINT status;
83 GX_WINDOW *window = (GX_WINDOW *) control_block;
84 GX_WINDOW_PROPERTIES *props = (GX_WINDOW_PROPERTIES *) info->properties;
85 status = gx_window_create(window, info->widget_name, parent, info->style, info->widget_id, &info->size);
86 if (status == GX_SUCCESS)
87 {
88 if (props->wallpaper_id)
89 {
90 gx_window_wallpaper_set(window, props->wallpaper_id, info->style & GX_STYLE_TILE_WALLPAPER);
91 }
92 }
93 return status;
94 }
95 GX_WINDOW_PROPERTIES screen_base_properties =
96 {
97 0 /* wallpaper pixelmap id */
98 };
99 GX_ICON_PROPERTIES screen_base_guix_icon_properties =
100 {
101 GX_PIXELMAP_ID_GUIX_LOGO, /* normal pixelmap id */
102 0 /* selected pixelmap id */
103 };
104 GX_ICON_PROPERTIES screen_base_express_icon_properties =
105 {
106 GX_PIXELMAP_ID_EXPRESS_LOGIC_LOGO, /* normal pixelmap id */
107 0 /* selected pixelmap id */
108 };
109 GX_ICON_PROPERTIES screen_base_home_icon_properties =
110 {
111 GX_PIXELMAP_ID_HOME, /* normal pixelmap id */
112 0 /* selected pixelmap id */
113 };
114 GX_WINDOW_PROPERTIES screen_base_text_window_properties =
115 {
116 0 /* wallpaper pixelmap id */
117 };
118 GX_WINDOW_PROPERTIES screen_base_text_window_4bpp_properties =
119 {
120 0 /* wallpaper pixelmap id */
121 };
122 GX_WINDOW_PROPERTIES screen_base_text_window_1bpp_properties =
123 {
124 0 /* wallpaper pixelmap id */
125 };
126 GX_WINDOW_PROPERTIES screen_base_dynamic_text_window_properties =
127 {
128 0 /* wallpaper pixelmap id */
129 };
130 GX_PIXELMAP_BUTTON_PROPERTIES screen_base_patients_button_properties =
131 {
132 GX_PIXELMAP_ID_BUTTON, /* normal pixelmap id */
133 GX_PIXELMAP_ID_BUTTON_ACTIVE, /* selected pixelmap id */
134 0 /* disabled pixelmap id */
135 };
136 GX_PIXELMAP_BUTTON_PROPERTIES screen_base_meds_button_properties =
137 {
138 GX_PIXELMAP_ID_BUTTON, /* normal pixelmap id */
139 GX_PIXELMAP_ID_BUTTON_ACTIVE, /* selected pixelmap id */
140 0 /* disabled pixelmap id */
141 };
142 GX_PIXELMAP_BUTTON_PROPERTIES screen_base_vitals_button_properties =
143 {
144 GX_PIXELMAP_ID_BUTTON, /* normal pixelmap id */
145 GX_PIXELMAP_ID_BUTTON_ACTIVE, /* selected pixelmap id */
146 0 /* disabled pixelmap id */
147 };
148
149 GX_CONST GX_STUDIO_WIDGET screen_base_vitals_button_define =
150 {
151 "vitals_button",
152 GX_TYPE_PIXELMAP_BUTTON, /* widget type */
153 ID_BUTTON3, /* widget id */
154 #if defined(GX_WIDGET_USER_DATA)
155 0, /* user data */
156 #endif
157 GX_STYLE_BORDER_NONE|GX_STYLE_ENABLED, /* style flags */
158 GX_STATUS_ACCEPTS_FOCUS, /* status flags */
159 sizeof(GX_PIXELMAP_BUTTON), /* control block size */
160 GX_COLOR_ID_BTN_LOWER, /* normal color id */
161 GX_COLOR_ID_BTN_UPPER, /* selected color id */
162 GX_COLOR_ID_BTN_LOWER, /* disabled color id */
163 gx_studio_pixelmap_button_create, /* create function */
164 (VOID (*)(GX_WIDGET *)) page_button_draw, /* drawing function override */
165 GX_NULL, /* event function override */
166 {423, 401, 623, 463}, /* widget size */
167 GX_NULL, /* no next widget */
168 GX_NULL, /* no child widgets */
169 offsetof(SCREEN_BASE_CONTROL_BLOCK, screen_base_vitals_button), /* control block */
170 (void *) &screen_base_vitals_button_properties /* extended properties */
171 };
172
173 GX_CONST GX_STUDIO_WIDGET screen_base_meds_button_define =
174 {
175 "meds_button",
176 GX_TYPE_PIXELMAP_BUTTON, /* widget type */
177 ID_BUTTON2, /* widget id */
178 #if defined(GX_WIDGET_USER_DATA)
179 0, /* user data */
180 #endif
181 GX_STYLE_BORDER_NONE|GX_STYLE_ENABLED, /* style flags */
182 GX_STATUS_ACCEPTS_FOCUS, /* status flags */
183 sizeof(GX_PIXELMAP_BUTTON), /* control block size */
184 GX_COLOR_ID_BTN_LOWER, /* normal color id */
185 GX_COLOR_ID_BTN_UPPER, /* selected color id */
186 GX_COLOR_ID_BTN_LOWER, /* disabled color id */
187 gx_studio_pixelmap_button_create, /* create function */
188 (VOID (*)(GX_WIDGET *)) page_button_draw, /* drawing function override */
189 GX_NULL, /* event function override */
190 {221, 401, 421, 463}, /* widget size */
191 &screen_base_vitals_button_define, /* next widget definition */
192 GX_NULL, /* no child widgets */
193 offsetof(SCREEN_BASE_CONTROL_BLOCK, screen_base_meds_button), /* control block */
194 (void *) &screen_base_meds_button_properties /* extended properties */
195 };
196
197 GX_CONST GX_STUDIO_WIDGET screen_base_patients_button_define =
198 {
199 "patients_button",
200 GX_TYPE_PIXELMAP_BUTTON, /* widget type */
201 ID_BUTTON1, /* widget id */
202 #if defined(GX_WIDGET_USER_DATA)
203 0, /* user data */
204 #endif
205 GX_STYLE_BORDER_NONE|GX_STYLE_ENABLED, /* style flags */
206 GX_STATUS_ACCEPTS_FOCUS, /* status flags */
207 sizeof(GX_PIXELMAP_BUTTON), /* control block size */
208 GX_COLOR_ID_BTN_LOWER, /* normal color id */
209 GX_COLOR_ID_BTN_UPPER, /* selected color id */
210 GX_COLOR_ID_BTN_LOWER, /* disabled color id */
211 gx_studio_pixelmap_button_create, /* create function */
212 (VOID (*)(GX_WIDGET *)) page_button_draw, /* drawing function override */
213 GX_NULL, /* event function override */
214 {20, 401, 220, 463}, /* widget size */
215 &screen_base_meds_button_define, /* next widget definition */
216 GX_NULL, /* no child widgets */
217 offsetof(SCREEN_BASE_CONTROL_BLOCK, screen_base_patients_button), /* control block */
218 (void *) &screen_base_patients_button_properties /* extended properties */
219 };
220
221 GX_CONST GX_STUDIO_WIDGET screen_base_dynamic_text_window_define =
222 {
223 "dynamic_text_window",
224 GX_TYPE_WINDOW, /* widget type */
225 DYNAMIC_TEXT_WINDOW, /* widget id */
226 #if defined(GX_WIDGET_USER_DATA)
227 0, /* user data */
228 #endif
229 GX_STYLE_BORDER_NONE|GX_STYLE_TRANSPARENT, /* style flags */
230 0, /* status flags */
231 sizeof(GX_WINDOW), /* control block size */
232 GX_COLOR_ID_WINDOW_FILL, /* normal color id */
233 GX_COLOR_ID_WINDOW_FILL, /* selected color id */
234 GX_COLOR_ID_WINDOW_FILL, /* disabled color id */
235 gx_studio_window_create, /* create function */
236 (VOID (*)(GX_WIDGET *)) text_window_draw, /* drawing function override */
237 GX_NULL, /* event function override */
238 {211, 5, 387, 149}, /* widget size */
239 &screen_base_patients_button_define, /* next widget definition */
240 GX_NULL, /* no child widgets */
241 offsetof(SCREEN_BASE_CONTROL_BLOCK, screen_base_dynamic_text_window), /* control block */
242 (void *) &screen_base_dynamic_text_window_properties /* extended properties */
243 };
244
245 GX_CONST GX_STUDIO_WIDGET screen_base_text_window_1bpp_define =
246 {
247 "text_window_1bpp",
248 GX_TYPE_WINDOW, /* widget type */
249 TEXT_WIN_1BPP, /* widget id */
250 #if defined(GX_WIDGET_USER_DATA)
251 0, /* user data */
252 #endif
253 GX_STYLE_BORDER_NONE|GX_STYLE_TRANSPARENT, /* style flags */
254 GX_STATUS_ACCEPTS_FOCUS, /* status flags */
255 sizeof(GX_WINDOW), /* control block size */
256 GX_COLOR_ID_WINDOW_FILL, /* normal color id */
257 GX_COLOR_ID_WINDOW_FILL, /* selected color id */
258 GX_COLOR_ID_WINDOW_FILL, /* disabled color id */
259 gx_studio_window_create, /* create function */
260 (VOID (*)(GX_WIDGET *)) text_window_draw, /* drawing function override */
261 GX_NULL, /* event function override */
262 {437, 269, 636, 468}, /* widget size */
263 &screen_base_dynamic_text_window_define, /* next widget definition */
264 GX_NULL, /* no child widgets */
265 offsetof(SCREEN_BASE_CONTROL_BLOCK, screen_base_text_window_1bpp), /* control block */
266 (void *) &screen_base_text_window_1bpp_properties /* extended properties */
267 };
268
269 GX_CONST GX_STUDIO_WIDGET screen_base_text_window_4bpp_define =
270 {
271 "text_window_4bpp",
272 GX_TYPE_WINDOW, /* widget type */
273 TEXT_WIN_4BPP, /* widget id */
274 #if defined(GX_WIDGET_USER_DATA)
275 0, /* user data */
276 #endif
277 GX_STYLE_BORDER_NONE|GX_STYLE_TRANSPARENT, /* style flags */
278 GX_STATUS_ACCEPTS_FOCUS, /* status flags */
279 sizeof(GX_WINDOW), /* control block size */
280 GX_COLOR_ID_WINDOW_FILL, /* normal color id */
281 GX_COLOR_ID_WINDOW_FILL, /* selected color id */
282 GX_COLOR_ID_WINDOW_FILL, /* disabled color id */
283 gx_studio_window_create, /* create function */
284 (VOID (*)(GX_WIDGET *)) text_window_draw, /* drawing function override */
285 GX_NULL, /* event function override */
286 {39, 32, 238, 231}, /* widget size */
287 &screen_base_text_window_1bpp_define, /* next widget definition */
288 GX_NULL, /* no child widgets */
289 offsetof(SCREEN_BASE_CONTROL_BLOCK, screen_base_text_window_4bpp), /* control block */
290 (void *) &screen_base_text_window_4bpp_properties /* extended properties */
291 };
292
293 GX_CONST GX_STUDIO_WIDGET screen_base_text_window_define =
294 {
295 "text_window",
296 GX_TYPE_WINDOW, /* widget type */
297 TEXT_WIN_8BPP, /* widget id */
298 #if defined(GX_WIDGET_USER_DATA)
299 0, /* user data */
300 #endif
301 GX_STYLE_BORDER_NONE|GX_STYLE_TRANSPARENT, /* style flags */
302 GX_STATUS_ACCEPTS_FOCUS, /* status flags */
303 sizeof(GX_WINDOW), /* control block size */
304 GX_COLOR_ID_WINDOW_FILL, /* normal color id */
305 GX_COLOR_ID_WINDOW_FILL, /* selected color id */
306 GX_COLOR_ID_WINDOW_FILL, /* disabled color id */
307 gx_studio_window_create, /* create function */
308 (VOID (*)(GX_WIDGET *)) text_window_draw, /* drawing function override */
309 GX_NULL, /* event function override */
310 {153, 103, 472, 359}, /* widget size */
311 &screen_base_text_window_4bpp_define, /* next widget definition */
312 GX_NULL, /* no child widgets */
313 offsetof(SCREEN_BASE_CONTROL_BLOCK, screen_base_text_window), /* control block */
314 (void *) &screen_base_text_window_properties /* extended properties */
315 };
316
317 GX_CONST GX_STUDIO_WIDGET screen_base_home_icon_define =
318 {
319 "home_icon",
320 GX_TYPE_ICON, /* widget type */
321 ID_HOME, /* widget id */
322 #if defined(GX_WIDGET_USER_DATA)
323 0, /* user data */
324 #endif
325 GX_STYLE_BORDER_NONE|GX_STYLE_ENABLED|GX_STYLE_HALIGN_LEFT|GX_STYLE_VALIGN_TOP, /* style flags */
326 GX_STATUS_ACCEPTS_FOCUS, /* status flags */
327 sizeof(GX_ICON), /* control block size */
328 GX_COLOR_ID_WIDGET_FILL, /* normal color id */
329 GX_COLOR_ID_SELECTED_FILL, /* selected color id */
330 GX_COLOR_ID_WIDGET_FILL, /* disabled color id */
331 gx_studio_icon_create, /* create function */
332 GX_NULL, /* drawing function override */
333 GX_NULL, /* event function override */
334 {593, 26, 615, 43}, /* widget size */
335 &screen_base_text_window_define, /* next widget definition */
336 GX_NULL, /* no child widgets */
337 offsetof(SCREEN_BASE_CONTROL_BLOCK, screen_base_home_icon), /* control block */
338 (void *) &screen_base_home_icon_properties /* extended properties */
339 };
340
341 GX_CONST GX_STUDIO_WIDGET screen_base_express_icon_define =
342 {
343 "express_icon",
344 GX_TYPE_ICON, /* widget type */
345 GX_ID_NONE, /* widget id */
346 #if defined(GX_WIDGET_USER_DATA)
347 0, /* user data */
348 #endif
349 GX_STYLE_BORDER_NONE|GX_STYLE_HALIGN_LEFT|GX_STYLE_VALIGN_TOP, /* style flags */
350 0, /* status flags */
351 sizeof(GX_ICON), /* control block size */
352 GX_COLOR_ID_WIDGET_FILL, /* normal color id */
353 GX_COLOR_ID_SELECTED_FILL, /* selected color id */
354 GX_COLOR_ID_WIDGET_FILL, /* disabled color id */
355 gx_studio_icon_create, /* create function */
356 GX_NULL, /* drawing function override */
357 GX_NULL, /* event function override */
358 {45, 21, 128, 33}, /* widget size */
359 &screen_base_home_icon_define, /* next widget definition */
360 GX_NULL, /* no child widgets */
361 offsetof(SCREEN_BASE_CONTROL_BLOCK, screen_base_express_icon), /* control block */
362 (void *) &screen_base_express_icon_properties /* extended properties */
363 };
364
365 GX_CONST GX_STUDIO_WIDGET screen_base_guix_icon_define =
366 {
367 "guix_icon",
368 GX_TYPE_ICON, /* widget type */
369 GX_ID_NONE, /* widget id */
370 #if defined(GX_WIDGET_USER_DATA)
371 0, /* user data */
372 #endif
373 GX_STYLE_BORDER_NONE|GX_STYLE_HALIGN_LEFT|GX_STYLE_VALIGN_TOP, /* style flags */
374 0, /* status flags */
375 sizeof(GX_ICON), /* control block size */
376 GX_COLOR_ID_WIDGET_FILL, /* normal color id */
377 GX_COLOR_ID_SELECTED_FILL, /* selected color id */
378 GX_COLOR_ID_WIDGET_FILL, /* disabled color id */
379 gx_studio_icon_create, /* create function */
380 GX_NULL, /* drawing function override */
381 GX_NULL, /* event function override */
382 {18, 21, 37, 84}, /* widget size */
383 &screen_base_express_icon_define, /* next widget definition */
384 GX_NULL, /* no child widgets */
385 offsetof(SCREEN_BASE_CONTROL_BLOCK, screen_base_guix_icon), /* control block */
386 (void *) &screen_base_guix_icon_properties /* extended properties */
387 };
388
389 GX_CONST GX_STUDIO_WIDGET screen_base_define =
390 {
391 "screen_base",
392 GX_TYPE_WINDOW, /* widget type */
393 ID_SCREEN_BASE, /* widget id */
394 #if defined(GX_WIDGET_USER_DATA)
395 0, /* user data */
396 #endif
397 GX_STYLE_BORDER_NONE, /* style flags */
398 GX_STATUS_ACCEPTS_FOCUS, /* status flags */
399 sizeof(SCREEN_BASE_CONTROL_BLOCK), /* control block size */
400 GX_COLOR_ID_WINDOW_FILL, /* normal color id */
401 GX_COLOR_ID_WINDOW_FILL, /* selected color id */
402 GX_COLOR_ID_WINDOW_FILL, /* disabled color id */
403 gx_studio_window_create, /* create function */
404 GX_NULL, /* drawing function override */
405 (UINT (*)(GX_WIDGET *, GX_EVENT *)) background_win_event_process, /* event function override */
406 {0, 0, 639, 479}, /* widget size */
407 GX_NULL, /* next widget */
408 &screen_base_guix_icon_define, /* child widget */
409 0, /* control block */
410 (void *) &screen_base_properties /* extended properties */
411 };
412 GX_CONST GX_STUDIO_WIDGET_ENTRY synergy_text_rotation_widget_table[] =
413 {
414 { &screen_base_define, (GX_WIDGET *) &screen_base },
415 {GX_NULL, GX_NULL}
416 };
417
gx_studio_nested_widget_create(GX_BYTE * control,GX_CONST GX_STUDIO_WIDGET * definition,GX_WIDGET * parent)418 static GX_WIDGET *gx_studio_nested_widget_create(GX_BYTE *control, GX_CONST GX_STUDIO_WIDGET *definition, GX_WIDGET *parent)
419 {
420 UINT status = GX_SUCCESS;
421 GX_WIDGET *widget = GX_NULL;
422 GX_VALUE list_count = 0;
423 GX_VALUE list_total_count = 0;
424
425 if(parent && (parent->gx_widget_type == GX_TYPE_MENU))
426 {
427 list_total_count = ((GX_MENU *)parent)->gx_menu_list_total_count;
428 }
429
430 while(definition && status == GX_SUCCESS)
431 {
432 if (definition->create_function)
433 {
434 if (definition->style & GX_STYLE_DYNAMICALLY_ALLOCATED)
435 {
436 status = gx_widget_allocate(&widget, definition->control_block_size);
437 if (status != GX_SUCCESS)
438 {
439 return GX_NULL;
440 }
441 }
442 else
443 {
444 if (control == GX_NULL)
445 {
446 return GX_NULL;
447 }
448 widget = (GX_WIDGET *) (control + definition->control_block_offset);
449 }
450
451 status = definition->create_function(definition, widget, parent);
452
453 if(list_count < list_total_count)
454 {
455 gx_menu_insert((GX_MENU *)parent, widget);
456 ((GX_MENU *)parent)->gx_menu_list_total_count--;
457 list_count++;
458 }
459
460 if (status == GX_SUCCESS)
461 {
462 if (definition->widget_type != GX_TYPE_TEMPLATE)
463 {
464 #if defined(GUIX_5_4_0_COMPATIBILITY)
465 gx_widget_fill_color_set(widget, definition->normal_fill_color_id, definition->selected_fill_color_id);
466 #else
467 gx_widget_fill_color_set(widget, definition->normal_fill_color_id, definition->selected_fill_color_id, definition->disabled_fill_color_id);
468 #endif
469 }
470
471 if (!(definition->status & GX_STATUS_ACCEPTS_FOCUS))
472 {
473 gx_widget_status_remove(widget, GX_STATUS_ACCEPTS_FOCUS);
474 }
475
476 if (definition->draw_function)
477 {
478 gx_widget_draw_set(widget, definition->draw_function);
479 }
480 if (definition->event_function)
481 {
482 gx_widget_event_process_set(widget, definition->event_function);
483 }
484
485 #if defined(GX_WIDGET_USER_DATA)
486 widget->gx_widget_user_data = definition->user_data;
487 #endif
488
489 if (definition->child_widget)
490 {
491 gx_studio_nested_widget_create(control, definition->child_widget, widget);
492 }
493 }
494 definition = definition->next_widget;
495 }
496 }
497 return widget;
498 }
499
gx_studio_widget_create(GX_BYTE * control,GX_CONST GX_STUDIO_WIDGET * definition,GX_WIDGET * parent)500 GX_WIDGET *gx_studio_widget_create(GX_BYTE *control, GX_CONST GX_STUDIO_WIDGET *definition, GX_WIDGET *parent)
501 {
502 GX_WIDGET *widget;
503 widget = gx_studio_nested_widget_create(control, definition, GX_NULL);
504
505 if (parent && widget)
506 {
507 gx_widget_attach(parent, widget);
508 }
509 return widget;
510 }
511
gx_studio_named_widget_create(char * name,GX_WIDGET * parent,GX_WIDGET ** new_widget)512 UINT gx_studio_named_widget_create(char *name, GX_WIDGET *parent, GX_WIDGET **new_widget)
513 {
514 UINT status = GX_FAILURE;
515 GX_CONST GX_STUDIO_WIDGET_ENTRY *entry = synergy_text_rotation_widget_table;
516 GX_WIDGET *widget = GX_NULL;
517
518 while(entry->widget_information)
519 {
520 if (!strcmp(name, entry->widget_information->widget_name))
521 {
522 widget = gx_studio_widget_create((GX_BYTE *) entry->widget, entry->widget_information, parent);
523 if (widget)
524 {
525 status = GX_SUCCESS;
526 }
527 break;
528 }
529 entry++;
530 }
531
532 if (new_widget)
533 {
534 *new_widget = widget;
535 }
536 return status;
537 }
538
539
gx_studio_display_configure(USHORT display,UINT (* driver)(GX_DISPLAY *),GX_UBYTE language,USHORT theme,GX_WINDOW_ROOT ** return_root)540 UINT gx_studio_display_configure(USHORT display, UINT (*driver)(GX_DISPLAY *),
541 GX_UBYTE language, USHORT theme, GX_WINDOW_ROOT **return_root)
542 {
543 GX_CONST GX_THEME *theme_ptr;
544 GX_RECTANGLE size;
545
546 GX_STUDIO_DISPLAY_INFO *display_info = &synergy_text_rotation_display_table[display];
547
548
549 /* create the requested display */
550
551 gx_display_create(display_info->display,
552 display_info->name,
553 driver,
554 (GX_VALUE) display_info->x_resolution,
555 (GX_VALUE) display_info->y_resolution);
556
557
558 /* install the request theme */
559
560 if(display_info->theme_table)
561 {
562 theme_ptr = display_info->theme_table[theme];
563 if(theme_ptr)
564 {
565 gx_display_color_table_set(display_info->display, theme_ptr->theme_color_table, theme_ptr->theme_color_table_size);
566
567 /* install the color palette if required */
568 if (display_info->display->gx_display_driver_palette_set &&
569 theme_ptr->theme_palette != NULL)
570 {
571 display_info->display->gx_display_driver_palette_set(display_info->display, theme_ptr->theme_palette, theme_ptr->theme_palette_size);
572 }
573
574 gx_display_font_table_set(display_info->display, theme_ptr->theme_font_table, theme_ptr->theme_font_table_size);
575 gx_display_pixelmap_table_set(display_info->display, theme_ptr->theme_pixelmap_table, theme_ptr->theme_pixelmap_table_size);
576 gx_system_scroll_appearance_set(theme_ptr->theme_vertical_scroll_style, (GX_SCROLLBAR_APPEARANCE *) &theme_ptr->theme_vertical_scrollbar_appearance);
577 gx_system_scroll_appearance_set(theme_ptr->theme_horizontal_scroll_style, (GX_SCROLLBAR_APPEARANCE *) &theme_ptr->theme_horizontal_scrollbar_appearance);
578 }
579 }
580
581 /* Install the language table. */
582
583 if(display_info->language_table)
584 {
585 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);
586 gx_display_active_language_set(display_info->display, language);
587 }
588
589 /* Set screen rotation angle. */
590
591 display_info->display->gx_display_rotation_angle = display_info->rotation_angle;
592
593 /* create the canvas for this display */
594
595 gx_canvas_create(display_info->canvas,
596 display_info->canvas_name,
597 display_info->display,
598 GX_CANVAS_MANAGED | GX_CANVAS_VISIBLE,
599 display_info->x_resolution,
600 display_info->y_resolution,
601 display_info->canvas_memory,
602 display_info->canvas_memory_size);
603
604 /* Create the root window for this canvas */
605
606 gx_utility_rectangle_define(&size,
607 0, 0,
608 (GX_VALUE) (display_info->x_resolution - 1),
609 (GX_VALUE) (display_info->y_resolution - 1));
610
611 gx_window_root_create(display_info->root_window,
612 display_info->name,
613 display_info->canvas, GX_STYLE_NONE, 0, &size);
614 if (return_root)
615 {
616 *return_root = display_info->root_window;
617 }
618 return GX_SUCCESS;
619 }
620
621 /* Provide display driver setup function */
622
623 #if defined(GX_TARGET_WIN32) || defined(GX_TARGET_LINUX)
624
_gx_synergy_display_driver_setup(GX_DISPLAY * display)625 UINT _gx_synergy_display_driver_setup(GX_DISPLAY *display)
626 {
627 win32_dave2d_graphics_driver_setup_24xrgb(display);
628 return GX_SUCCESS;
629 }
630 #else
_gx_synergy_display_driver_setup(GX_DISPLAY * display)631 UINT _gx_synergy_display_driver_setup(GX_DISPLAY *display)
632 {
633 _gx_display_driver_32argb_setup(display, GX_NULL, _gx_dave2d_buffer_toggle);
634 display->gx_display_handle = 0;
635 display -> gx_display_driver_horizontal_pattern_line_draw = _gx_dave2d_horizontal_pattern_line_draw_888;
636 display -> gx_display_driver_vertical_pattern_line_draw = _gx_dave2d_vertical_pattern_line_draw_888;
637 display -> gx_display_driver_pixel_write = _gx_dave2d_pixel_write_888;
638 display -> gx_display_driver_pixel_blend = _gx_dave2d_pixel_blend_888;
639 display -> gx_display_driver_drawing_initiate = _gx_dave2d_drawing_initiate;
640 display -> gx_display_driver_drawing_complete = _gx_dave2d_drawing_complete;
641 display -> gx_display_driver_canvas_copy = _gx_dave2d_canvas_copy;
642 display -> gx_display_driver_canvas_blend = _gx_dave2d_canvas_blend;
643 display -> gx_display_driver_simple_line_draw = _gx_dave2d_simple_line_draw;
644 display -> gx_display_driver_horizontal_line_draw = _gx_dave2d_horizontal_line;
645 display -> gx_display_driver_vertical_line_draw = _gx_dave2d_vertical_line;
646 display -> gx_display_driver_polygon_draw = _gx_dave2d_polygon_draw;
647 display -> gx_display_driver_polygon_fill = _gx_dave2d_polygon_fill;
648 display -> gx_display_driver_block_move = _gx_dave2d_block_move;
649 display -> gx_display_driver_pixelmap_draw = _gx_dave2d_pixelmap_draw;
650 display -> gx_display_driver_horizontal_pixelmap_line_draw = _gx_dave2d_horizontal_pixelmap_line_draw;
651 display -> gx_display_driver_alphamap_draw = _gx_dave2d_alphamap_draw;
652 display -> gx_display_driver_simple_wide_line_draw = _gx_dave2d_simple_wide_line;
653 display -> gx_display_driver_anti_aliased_line_draw = _gx_dave2d_aliased_line;
654 display -> gx_display_driver_anti_aliased_wide_line_draw = _gx_dave2d_aliased_wide_line;
655 display -> gx_display_driver_pixelmap_blend = _gx_dave2d_pixelmap_blend;
656 display -> gx_display_driver_8bit_glyph_draw = _gx_dave2d_raw_glyph_8bit_draw;
657 display -> gx_display_driver_4bit_glyph_draw = _gx_dave2d_raw_glyph_4bit_draw;
658 display -> gx_display_driver_1bit_glyph_draw = _gx_dave2d_raw_glyph_1bit_draw;
659 display -> gx_display_driver_8bit_compressed_glyph_draw = _gx_dave2d_compressed_glyph_8bit_draw;
660 display -> gx_display_driver_4bit_compressed_glyph_draw = _gx_dave2d_compressed_glyph_4bit_draw;
661 display -> gx_display_driver_1bit_compressed_glyph_draw = _gx_dave2d_compressed_glyph_1bit_draw;
662 #if defined(GX_ARC_DRAWING_SUPPORT)
663 display -> gx_display_driver_anti_aliased_circle_draw = _gx_dave2d_aliased_circle_draw;
664 display -> gx_display_driver_anti_aliased_wide_circle_draw = _gx_dave2d_aliased_circle_draw;
665 display -> gx_display_driver_circle_draw = _gx_dave2d_circle_draw;
666 display -> gx_display_driver_circle_fill = _gx_dave2d_circle_fill;
667 display -> gx_display_driver_pie_fill = _gx_dave2d_pie_fill;
668 display -> gx_display_driver_anti_aliased_arc_draw = _gx_dave2d_aliased_arc_draw;
669 display -> gx_display_driver_arc_draw = _gx_dave2d_arc_draw;
670 display -> gx_display_driver_arc_fill = _gx_dave2d_arc_fill;
671 display -> gx_display_driver_anti_aliased_ellipse_draw = _gx_dave2d_aliased_ellipse_draw;
672 display -> gx_display_driver_ellipse_draw = _gx_dave2d_ellipse_draw;
673 display -> gx_display_driver_ellipse_fill = _gx_dave2d_ellipse_fill;
674 display -> gx_display_driver_wide_circle_draw = _gx_dave2d_circle_draw;
675 display -> gx_display_driver_anti_aliased_wide_arc_draw = _gx_dave2d_aliased_arc_draw;
676 display -> gx_display_driver_wide_arc_draw = _gx_dave2d_arc_draw;
677 display -> gx_display_driver_anti_aliased_wide_ellipse_draw= _gx_dave2d_aliased_ellipse_draw;
678 display -> gx_display_driver_wide_ellipse_draw = _gx_dave2d_ellipse_draw;
679 #endif
680 display -> gx_display_driver_jpeg_draw = _gx_synergy_jpeg_draw;
681 return GX_SUCCESS;
682 }
683 #endif
684 #undef GUIX_STUDIO_GENERATED_FILE
685