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:10 */
10 /*******************************************************************************/
11
12
13 #define GUIX_STUDIO_GENERATED_FILE
14 #include <stddef.h>
15 #include "line_chart_resources.h"
16 #include "line_chart_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 PRESSURE_TREND_FRAME_CONTROL_BLOCK pressure_trend_frame;
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[153600];
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 line_chart_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 614400, /* canvas memory size in bytes */
45 0 /* rotation angle */
46 }
47 };
48
49
gx_studio_prompt_create(GX_CONST GX_STUDIO_WIDGET * info,GX_WIDGET * control_block,GX_WIDGET * parent)50 UINT gx_studio_prompt_create(GX_CONST GX_STUDIO_WIDGET *info, GX_WIDGET *control_block, GX_WIDGET *parent)
51 {
52 UINT status;
53 GX_PROMPT *prompt = (GX_PROMPT *) control_block;
54 GX_PROMPT_PROPERTIES *props = (GX_PROMPT_PROPERTIES *) info->properties;
55 status = gx_prompt_create(prompt, info->widget_name, parent, props->string_id, info->style, info->widget_id, &info->size);
56 if (status == GX_SUCCESS)
57 {
58 gx_prompt_font_set(prompt, props->font_id);
59 #if defined(GUIX_5_4_0_COMPATIBILITY)
60 gx_prompt_text_color_set(prompt, props->normal_text_color_id, props->selected_text_color_id);
61 #else
62 gx_prompt_text_color_set(prompt, props->normal_text_color_id, props->selected_text_color_id, props->disabled_text_color_id);
63 #endif
64 }
65 return status;
66 }
67
gx_studio_pixelmap_prompt_create(GX_CONST GX_STUDIO_WIDGET * info,GX_WIDGET * control_block,GX_WIDGET * parent)68 UINT gx_studio_pixelmap_prompt_create(GX_CONST GX_STUDIO_WIDGET *info, GX_WIDGET *control_block, GX_WIDGET *parent)
69 {
70 UINT status;
71 GX_PIXELMAP_PROMPT *pix_prompt = (GX_PIXELMAP_PROMPT *) control_block;
72 GX_PROMPT *prompt = (GX_PROMPT *) pix_prompt;
73 GX_PIXELMAP_PROMPT_PROPERTIES *props = (GX_PIXELMAP_PROMPT_PROPERTIES *) info->properties;
74 status = gx_pixelmap_prompt_create(pix_prompt, info->widget_name, parent,
75 props->string_id,
76 props->fill_map_id,
77 info->style, info->widget_id, &info->size);
78
79 if (status == GX_SUCCESS)
80 {
81 gx_pixelmap_prompt_pixelmap_set(pix_prompt,
82 props->left_map_id,
83 props->fill_map_id,
84 props->right_map_id,
85 props->selected_left_map_id,
86 props->selected_fill_map_id,
87 props->selected_right_map_id);
88 gx_prompt_font_set(prompt, props->font_id);
89 #if defined(GUIX_5_4_0_COMPATIBILITY)
90 gx_prompt_text_color_set(prompt, props->normal_text_color_id, props->selected_text_color_id);
91 #else
92 gx_prompt_text_color_set(prompt, props->normal_text_color_id, props->selected_text_color_id, props->disabled_text_color_id);
93 #endif
94 }
95 return status;
96 }
97
gx_studio_window_create(GX_CONST GX_STUDIO_WIDGET * info,GX_WIDGET * control_block,GX_WIDGET * parent)98 UINT gx_studio_window_create(GX_CONST GX_STUDIO_WIDGET *info, GX_WIDGET *control_block, GX_WIDGET *parent)
99 {
100 UINT status;
101 GX_WINDOW *window = (GX_WINDOW *) control_block;
102 GX_WINDOW_PROPERTIES *props = (GX_WINDOW_PROPERTIES *) info->properties;
103 status = gx_window_create(window, info->widget_name, parent, info->style, info->widget_id, &info->size);
104 if (status == GX_SUCCESS)
105 {
106 if (props->wallpaper_id)
107 {
108 gx_window_wallpaper_set(window, props->wallpaper_id, info->style & GX_STYLE_TILE_WALLPAPER);
109 }
110 }
111 return status;
112 }
113
gx_studio_line_chart_create(GX_CONST GX_STUDIO_WIDGET * info,GX_WIDGET * control_block,GX_WIDGET * parent)114 UINT gx_studio_line_chart_create(GX_CONST GX_STUDIO_WIDGET *info, GX_WIDGET *control_block, GX_WIDGET *parent)
115 {
116 UINT status;
117 GX_LINE_CHART *chart = (GX_LINE_CHART *) control_block;
118 GX_LINE_CHART_INFO *chart_info = (GX_LINE_CHART_INFO *) info->properties;
119
120 status = gx_line_chart_create(chart, info->widget_name, parent, chart_info, info->style, info->widget_id, &info->size);
121 return status;
122 }
123 GX_WINDOW_PROPERTIES pressure_trend_frame_properties =
124 {
125 0 /* wallpaper pixelmap id */
126 };
127 GX_WINDOW_PROPERTIES pressure_trend_frame_title_bar_properties =
128 {
129 0 /* wallpaper pixelmap id */
130 };
131 GX_PROMPT_PROPERTIES pressure_trend_frame_prompt_properties =
132 {
133 GX_STRING_ID_STRING_14, /* string id */
134 GX_FONT_ID_BOLD_ITALIC, /* font id */
135 GX_COLOR_ID_TEXT, /* normal text color */
136 GX_COLOR_ID_SELECTED_TEXT, /* selected text color */
137 GX_COLOR_ID_TEXT /* disabled text color */
138 };
139 GX_PROMPT_PROPERTIES pressure_trend_frame_prompt_1_properties =
140 {
141 GX_STRING_ID_STRING_16, /* string id */
142 GX_FONT_ID_LARGE_BOLD, /* font id */
143 GX_COLOR_ID_TEXT, /* normal text color */
144 GX_COLOR_ID_SELECTED_TEXT, /* selected text color */
145 GX_COLOR_ID_TEXT /* disabled text color */
146 };
147 GX_PIXELMAP_PROMPT_PROPERTIES pressure_trend_frame_prompt_2_properties =
148 {
149 GX_STRING_ID_STRING_18, /* string id */
150 GX_FONT_ID_PROMPT, /* font id */
151 GX_COLOR_ID_TEXT, /* normal text color */
152 GX_COLOR_ID_SELECTED_TEXT, /* selected text color */
153 GX_COLOR_ID_TEXT, /* disabled text color */
154 0, /* left pixelmap id */
155 GX_PIXELMAP_ID_BUTTON_BACK, /* fill pixelmap id */
156 0, /* right pixelmap id */
157 0, /* selected left pixelmap id */
158 0, /* selected fill pixelmap id */
159 0 /* selected right pixelmap id */
160 };
161 GX_PIXELMAP_PROMPT_PROPERTIES pressure_trend_frame_prompt_3_properties =
162 {
163 GX_STRING_ID_STRING_19, /* string id */
164 GX_FONT_ID_PROMPT, /* font id */
165 GX_COLOR_ID_TEXT, /* normal text color */
166 GX_COLOR_ID_SELECTED_TEXT, /* selected text color */
167 GX_COLOR_ID_TEXT, /* disabled text color */
168 0, /* left pixelmap id */
169 GX_PIXELMAP_ID_BUTTON_BACK, /* fill pixelmap id */
170 0, /* right pixelmap id */
171 0, /* selected left pixelmap id */
172 0, /* selected fill pixelmap id */
173 0 /* selected right pixelmap id */
174 };
175 GX_PIXELMAP_PROMPT_PROPERTIES pressure_trend_frame_prompt_4_properties =
176 {
177 0, /* string id */
178 GX_FONT_ID_PROMPT, /* font id */
179 GX_COLOR_ID_TEXT, /* normal text color */
180 GX_COLOR_ID_SELECTED_TEXT, /* selected text color */
181 GX_COLOR_ID_TEXT, /* disabled text color */
182 0, /* left pixelmap id */
183 GX_PIXELMAP_ID_BUTTON_BACK, /* fill pixelmap id */
184 0, /* right pixelmap id */
185 0, /* selected left pixelmap id */
186 0, /* selected fill pixelmap id */
187 0 /* selected right pixelmap id */
188 };
189 GX_LINE_CHART_INFO pressure_trend_frame_line_chart_properties =
190 {
191 0, /* min data value */
192 24, /* max data value */
193 GX_NULL, /* data pointer */
194 0, /* left margin */
195 0, /* top margin */
196 80, /* right margin */
197 32, /* bottom margin */
198 60, /* max data items */
199 0, /* active data items */
200 3, /* axis line width */
201 2, /* data line width */
202 GX_COLOR_ID_AXIS_LINE, /* axis line color */
203 GX_COLOR_ID_DATA_LINE /* data line color */
204 };
205
206 GX_CONST GX_STUDIO_WIDGET pressure_trend_frame_prompt_1_define =
207 {
208 "prompt_1",
209 GX_TYPE_PROMPT, /* widget type */
210 GX_ID_NONE, /* widget id */
211 #if defined(GX_WIDGET_USER_DATA)
212 0, /* user data */
213 #endif
214 GX_STYLE_BORDER_NONE|GX_STYLE_TRANSPARENT|GX_STYLE_ENABLED|GX_STYLE_TEXT_CENTER, /* style flags */
215 GX_STATUS_ACCEPTS_FOCUS, /* status flags */
216 sizeof(GX_PROMPT), /* control block size */
217 GX_COLOR_ID_WIDGET_FILL, /* normal color id */
218 GX_COLOR_ID_SELECTED_FILL, /* selected color id */
219 GX_COLOR_ID_WIDGET_FILL, /* disabled color id */
220 gx_studio_prompt_create, /* create function */
221 GX_NULL, /* drawing function override */
222 GX_NULL, /* event function override */
223 {499, 10, 626, 34}, /* widget size */
224 GX_NULL, /* no next widget */
225 GX_NULL, /* no child widgets */
226 offsetof(PRESSURE_TREND_FRAME_CONTROL_BLOCK, pressure_trend_frame_prompt_1), /* control block */
227 (void *) &pressure_trend_frame_prompt_1_properties /* extended properties */
228 };
229
230 GX_CONST GX_STUDIO_WIDGET pressure_trend_frame_prompt_define =
231 {
232 "prompt",
233 GX_TYPE_PROMPT, /* widget type */
234 GX_ID_NONE, /* widget id */
235 #if defined(GX_WIDGET_USER_DATA)
236 0, /* user data */
237 #endif
238 GX_STYLE_BORDER_NONE|GX_STYLE_TRANSPARENT|GX_STYLE_ENABLED|GX_STYLE_TEXT_CENTER, /* style flags */
239 GX_STATUS_ACCEPTS_FOCUS, /* status flags */
240 sizeof(GX_PROMPT), /* control block size */
241 GX_COLOR_ID_WIDGET_FILL, /* normal color id */
242 GX_COLOR_ID_SELECTED_FILL, /* selected color id */
243 GX_COLOR_ID_WIDGET_FILL, /* disabled color id */
244 gx_studio_prompt_create, /* create function */
245 GX_NULL, /* drawing function override */
246 GX_NULL, /* event function override */
247 {59, 9, 263, 33}, /* widget size */
248 &pressure_trend_frame_prompt_1_define, /* next widget definition */
249 GX_NULL, /* no child widgets */
250 offsetof(PRESSURE_TREND_FRAME_CONTROL_BLOCK, pressure_trend_frame_prompt), /* control block */
251 (void *) &pressure_trend_frame_prompt_properties /* extended properties */
252 };
253
254 GX_CONST GX_STUDIO_WIDGET pressure_trend_frame_line_chart_define =
255 {
256 "line_chart",
257 GX_TYPE_LINE_CHART, /* widget type */
258 GX_ID_NONE, /* widget id */
259 #if defined(GX_WIDGET_USER_DATA)
260 0, /* user data */
261 #endif
262 GX_STYLE_BORDER_NONE, /* style flags */
263 0, /* status flags */
264 sizeof(GX_LINE_CHART), /* control block size */
265 GX_COLOR_ID_BLACK, /* normal color id */
266 GX_COLOR_ID_BLACK, /* selected color id */
267 GX_COLOR_ID_BLACK, /* disabled color id */
268 gx_studio_line_chart_create, /* create function */
269 (VOID (*)(GX_WIDGET *)) test_line_chart_draw, /* drawing function override */
270 GX_NULL, /* event function override */
271 {16, 87, 628, 428}, /* widget size */
272 GX_NULL, /* no next widget */
273 GX_NULL, /* no child widgets */
274 offsetof(PRESSURE_TREND_FRAME_CONTROL_BLOCK, pressure_trend_frame_line_chart), /* control block */
275 (void *) &pressure_trend_frame_line_chart_properties /* extended properties */
276 };
277
278 GX_CONST GX_STUDIO_WIDGET pressure_trend_frame_prompt_4_define =
279 {
280 "prompt_4",
281 GX_TYPE_PIXELMAP_PROMPT, /* widget type */
282 GX_ID_NONE, /* widget id */
283 #if defined(GX_WIDGET_USER_DATA)
284 0, /* user data */
285 #endif
286 GX_STYLE_BORDER_NONE|GX_STYLE_ENABLED|GX_STYLE_TEXT_CENTER, /* style flags */
287 GX_STATUS_ACCEPTS_FOCUS, /* status flags */
288 sizeof(GX_PIXELMAP_PROMPT), /* control block size */
289 GX_COLOR_ID_WIDGET_FILL, /* normal color id */
290 GX_COLOR_ID_SELECTED_FILL, /* selected color id */
291 GX_COLOR_ID_WIDGET_FILL, /* disabled color id */
292 gx_studio_pixelmap_prompt_create, /* create function */
293 GX_NULL, /* drawing function override */
294 GX_NULL, /* event function override */
295 {426, 440, 634, 477}, /* widget size */
296 &pressure_trend_frame_line_chart_define, /* next widget definition */
297 GX_NULL, /* no child widgets */
298 offsetof(PRESSURE_TREND_FRAME_CONTROL_BLOCK, pressure_trend_frame_prompt_4), /* control block */
299 (void *) &pressure_trend_frame_prompt_4_properties /* extended properties */
300 };
301
302 GX_CONST GX_STUDIO_WIDGET pressure_trend_frame_prompt_3_define =
303 {
304 "prompt_3",
305 GX_TYPE_PIXELMAP_PROMPT, /* widget type */
306 GX_ID_NONE, /* widget id */
307 #if defined(GX_WIDGET_USER_DATA)
308 0, /* user data */
309 #endif
310 GX_STYLE_BORDER_NONE|GX_STYLE_ENABLED|GX_STYLE_TEXT_CENTER, /* style flags */
311 GX_STATUS_ACCEPTS_FOCUS, /* status flags */
312 sizeof(GX_PIXELMAP_PROMPT), /* control block size */
313 GX_COLOR_ID_WIDGET_FILL, /* normal color id */
314 GX_COLOR_ID_SELECTED_FILL, /* selected color id */
315 GX_COLOR_ID_WIDGET_FILL, /* disabled color id */
316 gx_studio_pixelmap_prompt_create, /* create function */
317 GX_NULL, /* drawing function override */
318 GX_NULL, /* event function override */
319 {214, 440, 422, 477}, /* widget size */
320 &pressure_trend_frame_prompt_4_define, /* next widget definition */
321 GX_NULL, /* no child widgets */
322 offsetof(PRESSURE_TREND_FRAME_CONTROL_BLOCK, pressure_trend_frame_prompt_3), /* control block */
323 (void *) &pressure_trend_frame_prompt_3_properties /* extended properties */
324 };
325
326 GX_CONST GX_STUDIO_WIDGET pressure_trend_frame_prompt_2_define =
327 {
328 "prompt_2",
329 GX_TYPE_PIXELMAP_PROMPT, /* widget type */
330 GX_ID_NONE, /* widget id */
331 #if defined(GX_WIDGET_USER_DATA)
332 0, /* user data */
333 #endif
334 GX_STYLE_BORDER_NONE|GX_STYLE_ENABLED|GX_STYLE_TEXT_CENTER, /* style flags */
335 GX_STATUS_ACCEPTS_FOCUS, /* status flags */
336 sizeof(GX_PIXELMAP_PROMPT), /* control block size */
337 GX_COLOR_ID_WIDGET_FILL, /* normal color id */
338 GX_COLOR_ID_SELECTED_FILL, /* selected color id */
339 GX_COLOR_ID_WIDGET_FILL, /* disabled color id */
340 gx_studio_pixelmap_prompt_create, /* create function */
341 GX_NULL, /* drawing function override */
342 GX_NULL, /* event function override */
343 {4, 440, 212, 477}, /* widget size */
344 &pressure_trend_frame_prompt_3_define, /* next widget definition */
345 GX_NULL, /* no child widgets */
346 offsetof(PRESSURE_TREND_FRAME_CONTROL_BLOCK, pressure_trend_frame_prompt_2), /* control block */
347 (void *) &pressure_trend_frame_prompt_2_properties /* extended properties */
348 };
349
350 GX_CONST GX_STUDIO_WIDGET pressure_trend_frame_title_bar_define =
351 {
352 "title_bar",
353 GX_TYPE_WINDOW, /* widget type */
354 GX_ID_NONE, /* widget id */
355 #if defined(GX_WIDGET_USER_DATA)
356 0, /* user data */
357 #endif
358 GX_STYLE_BORDER_NONE, /* style flags */
359 GX_STATUS_ACCEPTS_FOCUS, /* status flags */
360 sizeof(GX_WINDOW), /* control block size */
361 GX_COLOR_ID_GRAY, /* normal color id */
362 GX_COLOR_ID_GRAY, /* selected color id */
363 GX_COLOR_ID_GRAY, /* disabled color id */
364 gx_studio_window_create, /* create function */
365 GX_NULL, /* drawing function override */
366 GX_NULL, /* event function override */
367 {0, 0, 639, 39}, /* widget size */
368 &pressure_trend_frame_prompt_2_define, /* next widget definition */
369 &pressure_trend_frame_prompt_define, /* child widget definition */
370 offsetof(PRESSURE_TREND_FRAME_CONTROL_BLOCK, pressure_trend_frame_title_bar), /* control block */
371 (void *) &pressure_trend_frame_title_bar_properties /* extended properties */
372 };
373
374 GX_CONST GX_STUDIO_WIDGET pressure_trend_frame_define =
375 {
376 "pressure_trend_frame",
377 GX_TYPE_WINDOW, /* widget type */
378 GX_ID_NONE, /* widget id */
379 #if defined(GX_WIDGET_USER_DATA)
380 0, /* user data */
381 #endif
382 GX_STYLE_BORDER_THIN, /* style flags */
383 GX_STATUS_ACCEPTS_FOCUS, /* status flags */
384 sizeof(PRESSURE_TREND_FRAME_CONTROL_BLOCK), /* control block size */
385 GX_COLOR_ID_BLACK, /* normal color id */
386 GX_COLOR_ID_BLACK, /* selected color id */
387 GX_COLOR_ID_BLACK, /* disabled color id */
388 gx_studio_window_create, /* create function */
389 GX_NULL, /* drawing function override */
390 (UINT (*)(GX_WIDGET *, GX_EVENT *)) trend_frame_event_process, /* event function override */
391 {0, 0, 639, 479}, /* widget size */
392 GX_NULL, /* next widget */
393 &pressure_trend_frame_title_bar_define, /* child widget */
394 0, /* control block */
395 (void *) &pressure_trend_frame_properties /* extended properties */
396 };
397 GX_CONST GX_STUDIO_WIDGET_ENTRY line_chart_widget_table[] =
398 {
399 { &pressure_trend_frame_define, (GX_WIDGET *) &pressure_trend_frame },
400 {GX_NULL, GX_NULL}
401 };
402
gx_studio_nested_widget_create(GX_BYTE * control,GX_CONST GX_STUDIO_WIDGET * definition,GX_WIDGET * parent)403 static GX_WIDGET *gx_studio_nested_widget_create(GX_BYTE *control, GX_CONST GX_STUDIO_WIDGET *definition, GX_WIDGET *parent)
404 {
405 UINT status = GX_SUCCESS;
406 GX_WIDGET *widget = GX_NULL;
407 GX_VALUE list_count = 0;
408 GX_VALUE list_total_count = 0;
409
410 if(parent && (parent->gx_widget_type == GX_TYPE_MENU))
411 {
412 list_total_count = ((GX_MENU *)parent)->gx_menu_list_total_count;
413 }
414
415 while(definition && status == GX_SUCCESS)
416 {
417 if (definition->create_function)
418 {
419 if (definition->style & GX_STYLE_DYNAMICALLY_ALLOCATED)
420 {
421 status = gx_widget_allocate(&widget, definition->control_block_size);
422 if (status != GX_SUCCESS)
423 {
424 return GX_NULL;
425 }
426 }
427 else
428 {
429 if (control == GX_NULL)
430 {
431 return GX_NULL;
432 }
433 widget = (GX_WIDGET *) (control + definition->control_block_offset);
434 }
435
436 status = definition->create_function(definition, widget, parent);
437
438 if(list_count < list_total_count)
439 {
440 gx_menu_insert((GX_MENU *)parent, widget);
441 ((GX_MENU *)parent)->gx_menu_list_total_count--;
442 list_count++;
443 }
444
445 if (status == GX_SUCCESS)
446 {
447 if (definition->widget_type != GX_TYPE_TEMPLATE)
448 {
449 #if defined(GUIX_5_4_0_COMPATIBILITY)
450 gx_widget_fill_color_set(widget, definition->normal_fill_color_id, definition->selected_fill_color_id);
451 #else
452 gx_widget_fill_color_set(widget, definition->normal_fill_color_id, definition->selected_fill_color_id, definition->disabled_fill_color_id);
453 #endif
454 }
455
456 if (!(definition->status & GX_STATUS_ACCEPTS_FOCUS))
457 {
458 gx_widget_status_remove(widget, GX_STATUS_ACCEPTS_FOCUS);
459 }
460
461 if (definition->draw_function)
462 {
463 gx_widget_draw_set(widget, definition->draw_function);
464 }
465 if (definition->event_function)
466 {
467 gx_widget_event_process_set(widget, definition->event_function);
468 }
469
470 #if defined(GX_WIDGET_USER_DATA)
471 widget->gx_widget_user_data = definition->user_data;
472 #endif
473
474 if (definition->child_widget)
475 {
476 gx_studio_nested_widget_create(control, definition->child_widget, widget);
477 }
478 }
479 definition = definition->next_widget;
480 }
481 }
482 return widget;
483 }
484
gx_studio_widget_create(GX_BYTE * control,GX_CONST GX_STUDIO_WIDGET * definition,GX_WIDGET * parent)485 GX_WIDGET *gx_studio_widget_create(GX_BYTE *control, GX_CONST GX_STUDIO_WIDGET *definition, GX_WIDGET *parent)
486 {
487 GX_WIDGET *widget;
488 widget = gx_studio_nested_widget_create(control, definition, GX_NULL);
489
490 if (parent && widget)
491 {
492 gx_widget_attach(parent, widget);
493 }
494 return widget;
495 }
496
gx_studio_named_widget_create(char * name,GX_WIDGET * parent,GX_WIDGET ** new_widget)497 UINT gx_studio_named_widget_create(char *name, GX_WIDGET *parent, GX_WIDGET **new_widget)
498 {
499 UINT status = GX_FAILURE;
500 GX_CONST GX_STUDIO_WIDGET_ENTRY *entry = line_chart_widget_table;
501 GX_WIDGET *widget = GX_NULL;
502
503 while(entry->widget_information)
504 {
505 if (!strcmp(name, entry->widget_information->widget_name))
506 {
507 widget = gx_studio_widget_create((GX_BYTE *) entry->widget, entry->widget_information, parent);
508 if (widget)
509 {
510 status = GX_SUCCESS;
511 }
512 break;
513 }
514 entry++;
515 }
516
517 if (new_widget)
518 {
519 *new_widget = widget;
520 }
521 return status;
522 }
523
524
gx_studio_display_configure(USHORT display,UINT (* driver)(GX_DISPLAY *),GX_UBYTE language,USHORT theme,GX_WINDOW_ROOT ** return_root)525 UINT gx_studio_display_configure(USHORT display, UINT (*driver)(GX_DISPLAY *),
526 GX_UBYTE language, USHORT theme, GX_WINDOW_ROOT **return_root)
527 {
528 GX_CONST GX_THEME *theme_ptr;
529 GX_RECTANGLE size;
530
531 GX_STUDIO_DISPLAY_INFO *display_info = &line_chart_display_table[display];
532
533
534 /* create the requested display */
535
536 gx_display_create(display_info->display,
537 display_info->name,
538 driver,
539 (GX_VALUE) display_info->x_resolution,
540 (GX_VALUE) display_info->y_resolution);
541
542
543 /* install the request theme */
544
545 if(display_info->theme_table)
546 {
547 theme_ptr = display_info->theme_table[theme];
548 if(theme_ptr)
549 {
550 gx_display_color_table_set(display_info->display, theme_ptr->theme_color_table, theme_ptr->theme_color_table_size);
551
552 /* install the color palette if required */
553 if (display_info->display->gx_display_driver_palette_set &&
554 theme_ptr->theme_palette != NULL)
555 {
556 display_info->display->gx_display_driver_palette_set(display_info->display, theme_ptr->theme_palette, theme_ptr->theme_palette_size);
557 }
558
559 gx_display_font_table_set(display_info->display, theme_ptr->theme_font_table, theme_ptr->theme_font_table_size);
560 gx_display_pixelmap_table_set(display_info->display, theme_ptr->theme_pixelmap_table, theme_ptr->theme_pixelmap_table_size);
561 gx_system_scroll_appearance_set(theme_ptr->theme_vertical_scroll_style, (GX_SCROLLBAR_APPEARANCE *) &theme_ptr->theme_vertical_scrollbar_appearance);
562 gx_system_scroll_appearance_set(theme_ptr->theme_horizontal_scroll_style, (GX_SCROLLBAR_APPEARANCE *) &theme_ptr->theme_horizontal_scrollbar_appearance);
563 }
564 }
565
566 /* Install the language table. */
567
568 if(display_info->language_table)
569 {
570 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);
571 gx_display_active_language_set(display_info->display, language);
572 }
573
574 /* Set screen rotation angle. */
575
576 display_info->display->gx_display_rotation_angle = display_info->rotation_angle;
577
578 /* create the canvas for this display */
579
580 gx_canvas_create(display_info->canvas,
581 display_info->canvas_name,
582 display_info->display,
583 GX_CANVAS_MANAGED | GX_CANVAS_VISIBLE,
584 display_info->x_resolution,
585 display_info->y_resolution,
586 display_info->canvas_memory,
587 display_info->canvas_memory_size);
588
589 /* Create the root window for this canvas */
590
591 gx_utility_rectangle_define(&size,
592 0, 0,
593 (GX_VALUE) (display_info->x_resolution - 1),
594 (GX_VALUE) (display_info->y_resolution - 1));
595
596 gx_window_root_create(display_info->root_window,
597 display_info->name,
598 display_info->canvas, GX_STYLE_NONE, 0, &size);
599 if (return_root)
600 {
601 *return_root = display_info->root_window;
602 }
603 return GX_SUCCESS;
604 }
605 #undef GUIX_STUDIO_GENERATED_FILE
606