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:11 */
10 /*******************************************************************************/
11
12
13 #define GUIX_STUDIO_GENERATED_FILE
14 #include <stddef.h>
15 #include "polygon_32bpp_resources.h"
16 #include "polygon_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[307200];
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 polygon_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 640, /* 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 1228800, /* canvas memory size in bytes */
45 0 /* rotation angle */
46 }
47 };
48
49
gx_studio_checkbox_create(GX_CONST GX_STUDIO_WIDGET * info,GX_WIDGET * control_block,GX_WIDGET * parent)50 UINT gx_studio_checkbox_create(GX_CONST GX_STUDIO_WIDGET *info, GX_WIDGET *control_block, GX_WIDGET *parent)
51 {
52 UINT status;
53 GX_CHECKBOX *button = (GX_CHECKBOX *) control_block;
54 GX_TEXT_BUTTON *text_button = (GX_TEXT_BUTTON *) button;
55 GX_CHECKBOX_PROPERTIES *props = (GX_CHECKBOX_PROPERTIES *) info->properties;
56 status = gx_checkbox_create(button, info->widget_name, parent, props->string_id, info->style, info->widget_id, &info->size);
57 if (status == GX_SUCCESS)
58 {
59 gx_text_button_font_set(text_button, props->font_id);
60 #if defined(GUIX_5_4_0_COMPATIBILITY)
61 gx_text_button_text_color_set(text_button, props->normal_text_color_id, props->selected_text_color_id);
62 #else
63 gx_text_button_text_color_set(text_button, props->normal_text_color_id, props->selected_text_color_id, props->disabled_text_color_id);
64 #endif
65
66 if (props->unchecked_pixelmap_id ||
67 props->checked_pixelmap_id ||
68 props->unchecked_disabled_pixelmap_id ||
69 props->checked_disabled_pixelmap_id)
70 {
71 gx_checkbox_pixelmap_set(button,
72 props->unchecked_pixelmap_id,
73 props->checked_pixelmap_id,
74 props->unchecked_disabled_pixelmap_id,
75 props->checked_disabled_pixelmap_id);
76 }
77 }
78 return status;
79 }
80
gx_studio_radio_button_create(GX_CONST GX_STUDIO_WIDGET * info,GX_WIDGET * control_block,GX_WIDGET * parent)81 UINT gx_studio_radio_button_create(GX_CONST GX_STUDIO_WIDGET *info, GX_WIDGET *control_block, GX_WIDGET *parent)
82 {
83 UINT status;
84 GX_RADIO_BUTTON *button = (GX_RADIO_BUTTON *) control_block;
85 GX_TEXT_BUTTON *text_button = (GX_TEXT_BUTTON *) button;
86 GX_RADIO_BUTTON_PROPERTIES *props = (GX_RADIO_BUTTON_PROPERTIES *) info->properties;
87 status = gx_radio_button_create(button, info->widget_name, parent, props->string_id, info->style, info->widget_id, &info->size);
88 if (status == GX_SUCCESS)
89 {
90 gx_text_button_font_set(text_button, props->font_id);
91 #if defined(GUIX_5_4_0_COMPATIBILITY)
92 gx_text_button_text_color_set(text_button, props->normal_text_color_id, props->selected_text_color_id);
93 #else
94 gx_text_button_text_color_set(text_button, props->normal_text_color_id, props->selected_text_color_id, props->disabled_text_color_id);
95 #endif
96
97 if (props->off_pixelmap_id ||
98 props->on_pixelmap_id ||
99 props->off_disabled_pixelmap_id ||
100 props->on_disabled_pixelmap_id)
101 {
102 gx_radio_button_pixelmap_set(button,
103 props->off_pixelmap_id,
104 props->on_pixelmap_id,
105 props->off_disabled_pixelmap_id,
106 props->on_disabled_pixelmap_id);
107 }
108 }
109 return status;
110 }
111
gx_studio_slider_create(GX_CONST GX_STUDIO_WIDGET * info,GX_WIDGET * control_block,GX_WIDGET * parent)112 UINT gx_studio_slider_create(GX_CONST GX_STUDIO_WIDGET *info, GX_WIDGET *control_block, GX_WIDGET *parent)
113 {
114 UINT status;
115 GX_SLIDER *slider = (GX_SLIDER *) control_block;
116 GX_SLIDER_PROPERTIES *props = (GX_SLIDER_PROPERTIES *) info->properties;
117 GX_SLIDER_INFO slider_info;
118 slider_info.gx_slider_info_min_val = props->minval;
119 slider_info.gx_slider_info_max_val = props->maxval;
120 slider_info.gx_slider_info_current_val = props->current_val;
121 slider_info.gx_slider_info_increment = props->increment;
122 slider_info.gx_slider_info_min_travel = props->min_travel;
123 slider_info.gx_slider_info_max_travel = props->max_travel;
124 slider_info.gx_slider_info_needle_width = props->needle_width;
125 slider_info.gx_slider_info_needle_height = props->needle_height;
126 slider_info.gx_slider_info_needle_inset = props->needle_inset;
127 slider_info.gx_slider_info_needle_hotspot_offset = props->needle_hotspot;
128 status = gx_slider_create(slider,
129 info->widget_name,
130 parent,
131 props->tickmark_count,
132 &slider_info,
133 info->style,
134 info->widget_id,
135 &info->size);
136 return status;
137 }
138
gx_studio_prompt_create(GX_CONST GX_STUDIO_WIDGET * info,GX_WIDGET * control_block,GX_WIDGET * parent)139 UINT gx_studio_prompt_create(GX_CONST GX_STUDIO_WIDGET *info, GX_WIDGET *control_block, GX_WIDGET *parent)
140 {
141 UINT status;
142 GX_PROMPT *prompt = (GX_PROMPT *) control_block;
143 GX_PROMPT_PROPERTIES *props = (GX_PROMPT_PROPERTIES *) info->properties;
144 status = gx_prompt_create(prompt, info->widget_name, parent, props->string_id, info->style, info->widget_id, &info->size);
145 if (status == GX_SUCCESS)
146 {
147 gx_prompt_font_set(prompt, props->font_id);
148 #if defined(GUIX_5_4_0_COMPATIBILITY)
149 gx_prompt_text_color_set(prompt, props->normal_text_color_id, props->selected_text_color_id);
150 #else
151 gx_prompt_text_color_set(prompt, props->normal_text_color_id, props->selected_text_color_id, props->disabled_text_color_id);
152 #endif
153 }
154 return status;
155 }
156
gx_studio_window_create(GX_CONST GX_STUDIO_WIDGET * info,GX_WIDGET * control_block,GX_WIDGET * parent)157 UINT gx_studio_window_create(GX_CONST GX_STUDIO_WIDGET *info, GX_WIDGET *control_block, GX_WIDGET *parent)
158 {
159 UINT status;
160 GX_WINDOW *window = (GX_WINDOW *) control_block;
161 GX_WINDOW_PROPERTIES *props = (GX_WINDOW_PROPERTIES *) info->properties;
162 status = gx_window_create(window, info->widget_name, parent, info->style, info->widget_id, &info->size);
163 if (status == GX_SUCCESS)
164 {
165 if (props->wallpaper_id)
166 {
167 gx_window_wallpaper_set(window, props->wallpaper_id, info->style & GX_STYLE_TILE_WALLPAPER);
168 }
169 }
170 return status;
171 }
172 GX_WINDOW_PROPERTIES main_window_properties =
173 {
174 0 /* wallpaper pixelmap id */
175 };
176 GX_WINDOW_PROPERTIES main_window_polygon_window_properties =
177 {
178 0 /* wallpaper pixelmap id */
179 };
180 GX_CHECKBOX_PROPERTIES main_window_checkbox_anti_alised_properties =
181 {
182 GX_STRING_ID_STRING_20, /* string id */
183 GX_FONT_ID_BUTTON, /* font id */
184 GX_COLOR_ID_BTN_TEXT, /* normal text color */
185 GX_COLOR_ID_BTN_TEXT, /* selected text color */
186 GX_COLOR_ID_BTN_TEXT, /* disabled text color */
187 0, /* unchecked pixelmap id */
188 0, /* checked pixelmap id */
189 0, /* unchecked disabled pixelmap id */
190 0 /* checked disabled pixelmap id */
191 };
192 GX_CHECKBOX_PROPERTIES main_window_checkbox_round_properties =
193 {
194 GX_STRING_ID_STRING_10, /* string id */
195 GX_FONT_ID_BUTTON, /* font id */
196 GX_COLOR_ID_BTN_TEXT, /* normal text color */
197 GX_COLOR_ID_BTN_TEXT, /* selected text color */
198 GX_COLOR_ID_BTN_TEXT, /* disabled text color */
199 0, /* unchecked pixelmap id */
200 0, /* checked pixelmap id */
201 0, /* unchecked disabled pixelmap id */
202 0 /* checked disabled pixelmap id */
203 };
204 GX_PROMPT_PROPERTIES main_window_prompt_4_properties =
205 {
206 GX_STRING_ID_STRING_9, /* string id */
207 GX_FONT_ID_PROMPT, /* font id */
208 GX_COLOR_ID_TEXT, /* normal text color */
209 GX_COLOR_ID_SELECTED_TEXT, /* selected text color */
210 GX_COLOR_ID_TEXT /* disabled text color */
211 };
212 GX_CHECKBOX_PROPERTIES main_window_checkbox_fill_properties =
213 {
214 GX_STRING_ID_STRING_11, /* string id */
215 GX_FONT_ID_BUTTON, /* font id */
216 GX_COLOR_ID_BTN_TEXT, /* normal text color */
217 GX_COLOR_ID_BTN_TEXT, /* selected text color */
218 GX_COLOR_ID_BTN_TEXT, /* disabled text color */
219 0, /* unchecked pixelmap id */
220 0, /* checked pixelmap id */
221 0, /* unchecked disabled pixelmap id */
222 0 /* checked disabled pixelmap id */
223 };
224 GX_SLIDER_PROPERTIES main_window_stroke_slider_properties =
225 {
226 10, /* tickmark count */
227 1, /* mimimun value */
228 5, /* maximum value */
229 1, /* current value */
230 1, /* increment */
231 10, /* minimum travel */
232 10, /* maximum travel */
233 5, /* needle width */
234 14, /* needle height */
235 5, /* needle inset */
236 1 /* needle hotspot */
237 };
238 GX_PROMPT_PROPERTIES main_window_prompt_3_properties =
239 {
240 GX_STRING_ID_STRING_17, /* string id */
241 GX_FONT_ID_PROMPT, /* font id */
242 GX_COLOR_ID_TEXT, /* normal text color */
243 GX_COLOR_ID_SELECTED_TEXT, /* selected text color */
244 GX_COLOR_ID_TEXT /* disabled text color */
245 };
246 GX_PROMPT_PROPERTIES main_window_angle_display_1_properties =
247 {
248 GX_STRING_ID_STRING_18, /* string id */
249 GX_FONT_ID_PROMPT, /* font id */
250 GX_COLOR_ID_SELECTED_TEXT, /* normal text color */
251 GX_COLOR_ID_SELECTED_TEXT, /* selected text color */
252 GX_COLOR_ID_SELECTED_TEXT /* disabled text color */
253 };
254 GX_CHECKBOX_PROPERTIES main_window_checkbox_2_properties =
255 {
256 GX_STRING_ID_STRING_35, /* string id */
257 GX_FONT_ID_BUTTON, /* font id */
258 GX_COLOR_ID_BTN_TEXT, /* normal text color */
259 GX_COLOR_ID_BTN_TEXT, /* selected text color */
260 GX_COLOR_ID_BTN_TEXT, /* disabled text color */
261 0, /* unchecked pixelmap id */
262 0, /* checked pixelmap id */
263 0, /* unchecked disabled pixelmap id */
264 0 /* checked disabled pixelmap id */
265 };
266 GX_CHECKBOX_PROPERTIES main_window_checkbox_fill_1_properties =
267 {
268 GX_STRING_ID_STRING_36, /* string id */
269 GX_FONT_ID_BUTTON, /* font id */
270 GX_COLOR_ID_BTN_TEXT, /* normal text color */
271 GX_COLOR_ID_BTN_TEXT, /* selected text color */
272 GX_COLOR_ID_BTN_TEXT, /* disabled text color */
273 0, /* unchecked pixelmap id */
274 0, /* checked pixelmap id */
275 0, /* unchecked disabled pixelmap id */
276 0 /* checked disabled pixelmap id */
277 };
278 GX_RADIO_BUTTON_PROPERTIES main_window_radio_button_1_properties =
279 {
280 GX_STRING_ID_STRING_37, /* string id */
281 GX_FONT_ID_BUTTON, /* font id */
282 GX_COLOR_ID_BTN_TEXT, /* normal text color */
283 GX_COLOR_ID_BTN_TEXT, /* selected text color */
284 GX_COLOR_ID_BTN_TEXT, /* disabled text color */
285 0, /* off pixelmap id */
286 0, /* on pixelmap id */
287 0, /* off disabled pixelmap id */
288 0 /* on disabled pixelmap id */
289 };
290 GX_RADIO_BUTTON_PROPERTIES main_window_radio_button_2_properties =
291 {
292 GX_STRING_ID_STRING_39, /* string id */
293 GX_FONT_ID_BUTTON, /* font id */
294 GX_COLOR_ID_BTN_TEXT, /* normal text color */
295 GX_COLOR_ID_BTN_TEXT, /* selected text color */
296 GX_COLOR_ID_BTN_TEXT, /* disabled text color */
297 0, /* off pixelmap id */
298 0, /* on pixelmap id */
299 0, /* off disabled pixelmap id */
300 0 /* on disabled pixelmap id */
301 };
302 GX_CHECKBOX_PROPERTIES main_window_checkbox_4_properties =
303 {
304 GX_STRING_ID_STRING_33, /* string id */
305 GX_FONT_ID_BUTTON, /* font id */
306 GX_COLOR_ID_BTN_TEXT, /* normal text color */
307 GX_COLOR_ID_BTN_TEXT, /* selected text color */
308 GX_COLOR_ID_BTN_TEXT, /* disabled text color */
309 0, /* unchecked pixelmap id */
310 0, /* checked pixelmap id */
311 0, /* unchecked disabled pixelmap id */
312 0 /* checked disabled pixelmap id */
313 };
314 GX_CHECKBOX_PROPERTIES main_window_checkbox_5_properties =
315 {
316 GX_STRING_ID_STRING_27, /* string id */
317 GX_FONT_ID_BUTTON, /* font id */
318 GX_COLOR_ID_BTN_TEXT, /* normal text color */
319 GX_COLOR_ID_BTN_TEXT, /* selected text color */
320 GX_COLOR_ID_BTN_TEXT, /* disabled text color */
321 0, /* unchecked pixelmap id */
322 0, /* checked pixelmap id */
323 0, /* unchecked disabled pixelmap id */
324 0 /* checked disabled pixelmap id */
325 };
326
327 GX_CONST GX_STUDIO_WIDGET main_window_checkbox_5_define =
328 {
329 "checkbox_5",
330 GX_TYPE_CHECKBOX, /* widget type */
331 ID_COMPRESS, /* widget id */
332 #if defined(GX_WIDGET_USER_DATA)
333 0, /* user data */
334 #endif
335 GX_STYLE_BORDER_NONE|GX_STYLE_TRANSPARENT|GX_STYLE_ENABLED|GX_STYLE_BUTTON_TOGGLE|GX_STYLE_TEXT_LEFT, /* style flags */
336 GX_STATUS_ACCEPTS_FOCUS, /* status flags */
337 sizeof(GX_CHECKBOX), /* control block size */
338 GX_COLOR_ID_BTN_LOWER, /* normal color id */
339 GX_COLOR_ID_BTN_UPPER, /* selected color id */
340 GX_COLOR_ID_BTN_LOWER, /* disabled color id */
341 gx_studio_checkbox_create, /* create function */
342 GX_NULL, /* drawing function override */
343 GX_NULL, /* event function override */
344 {522, 328, 651, 351}, /* widget size */
345 GX_NULL, /* no next widget */
346 GX_NULL, /* no child widgets */
347 offsetof(MAIN_WINDOW_CONTROL_BLOCK, main_window_checkbox_5), /* control block */
348 (void *) &main_window_checkbox_5_properties /* extended properties */
349 };
350
351 GX_CONST GX_STUDIO_WIDGET main_window_checkbox_4_define =
352 {
353 "checkbox_4",
354 GX_TYPE_CHECKBOX, /* widget type */
355 ID_ALPHA, /* widget id */
356 #if defined(GX_WIDGET_USER_DATA)
357 0, /* user data */
358 #endif
359 GX_STYLE_BORDER_NONE|GX_STYLE_TRANSPARENT|GX_STYLE_ENABLED|GX_STYLE_BUTTON_TOGGLE|GX_STYLE_TEXT_LEFT, /* style flags */
360 GX_STATUS_ACCEPTS_FOCUS, /* status flags */
361 sizeof(GX_CHECKBOX), /* control block size */
362 GX_COLOR_ID_BTN_LOWER, /* normal color id */
363 GX_COLOR_ID_BTN_UPPER, /* selected color id */
364 GX_COLOR_ID_BTN_LOWER, /* disabled color id */
365 gx_studio_checkbox_create, /* create function */
366 GX_NULL, /* drawing function override */
367 GX_NULL, /* event function override */
368 {440, 327, 519, 350}, /* widget size */
369 &main_window_checkbox_5_define, /* next widget definition */
370 GX_NULL, /* no child widgets */
371 offsetof(MAIN_WINDOW_CONTROL_BLOCK, main_window_checkbox_4), /* control block */
372 (void *) &main_window_checkbox_4_properties /* extended properties */
373 };
374
375 GX_CONST GX_STUDIO_WIDGET main_window_radio_button_2_define =
376 {
377 "radio_button_2",
378 GX_TYPE_RADIO_BUTTON, /* widget type */
379 ID_COLOR_BLUE, /* widget id */
380 #if defined(GX_WIDGET_USER_DATA)
381 0, /* user data */
382 #endif
383 GX_STYLE_BORDER_NONE|GX_STYLE_TRANSPARENT|GX_STYLE_ENABLED|GX_STYLE_BUTTON_PUSHED|GX_STYLE_BUTTON_RADIO|GX_STYLE_TEXT_LEFT, /* style flags */
384 GX_STATUS_ACCEPTS_FOCUS, /* status flags */
385 sizeof(GX_RADIO_BUTTON), /* control block size */
386 GX_COLOR_ID_BTN_LOWER, /* normal color id */
387 GX_COLOR_ID_BTN_UPPER, /* selected color id */
388 GX_COLOR_ID_BTN_LOWER, /* disabled color id */
389 gx_studio_radio_button_create, /* create function */
390 GX_NULL, /* drawing function override */
391 GX_NULL, /* event function override */
392 {515, 262, 624, 285}, /* widget size */
393 &main_window_checkbox_4_define, /* next widget definition */
394 GX_NULL, /* no child widgets */
395 offsetof(MAIN_WINDOW_CONTROL_BLOCK, main_window_radio_button_2), /* control block */
396 (void *) &main_window_radio_button_2_properties /* extended properties */
397 };
398
399 GX_CONST GX_STUDIO_WIDGET main_window_radio_button_1_define =
400 {
401 "radio_button_1",
402 GX_TYPE_RADIO_BUTTON, /* widget type */
403 ID_COLOR_BLACK, /* widget id */
404 #if defined(GX_WIDGET_USER_DATA)
405 0, /* user data */
406 #endif
407 GX_STYLE_BORDER_NONE|GX_STYLE_TRANSPARENT|GX_STYLE_ENABLED|GX_STYLE_BUTTON_RADIO|GX_STYLE_TEXT_LEFT, /* style flags */
408 GX_STATUS_ACCEPTS_FOCUS, /* status flags */
409 sizeof(GX_RADIO_BUTTON), /* control block size */
410 GX_COLOR_ID_BTN_LOWER, /* normal color id */
411 GX_COLOR_ID_BTN_UPPER, /* selected color id */
412 GX_COLOR_ID_BTN_LOWER, /* disabled color id */
413 gx_studio_radio_button_create, /* create function */
414 GX_NULL, /* drawing function override */
415 GX_NULL, /* event function override */
416 {438, 263, 517, 286}, /* widget size */
417 &main_window_radio_button_2_define, /* next widget definition */
418 GX_NULL, /* no child widgets */
419 offsetof(MAIN_WINDOW_CONTROL_BLOCK, main_window_radio_button_1), /* control block */
420 (void *) &main_window_radio_button_1_properties /* extended properties */
421 };
422
423 GX_CONST GX_STUDIO_WIDGET main_window_checkbox_fill_1_define =
424 {
425 "checkbox_fill_1",
426 GX_TYPE_CHECKBOX, /* widget type */
427 ID_PIXELMAP_FILL, /* widget id */
428 #if defined(GX_WIDGET_USER_DATA)
429 0, /* user data */
430 #endif
431 GX_STYLE_BORDER_NONE|GX_STYLE_TRANSPARENT|GX_STYLE_ENABLED|GX_STYLE_BUTTON_TOGGLE|GX_STYLE_TEXT_LEFT, /* style flags */
432 GX_STATUS_ACCEPTS_FOCUS, /* status flags */
433 sizeof(GX_CHECKBOX), /* control block size */
434 GX_COLOR_ID_BTN_LOWER, /* normal color id */
435 GX_COLOR_ID_BTN_UPPER, /* selected color id */
436 GX_COLOR_ID_BTN_LOWER, /* disabled color id */
437 gx_studio_checkbox_create, /* create function */
438 GX_NULL, /* drawing function override */
439 GX_NULL, /* event function override */
440 {414, 299, 537, 322}, /* widget size */
441 &main_window_radio_button_1_define, /* next widget definition */
442 GX_NULL, /* no child widgets */
443 offsetof(MAIN_WINDOW_CONTROL_BLOCK, main_window_checkbox_fill_1), /* control block */
444 (void *) &main_window_checkbox_fill_1_properties /* extended properties */
445 };
446
447 GX_CONST GX_STUDIO_WIDGET main_window_checkbox_2_define =
448 {
449 "checkbox_2",
450 GX_TYPE_CHECKBOX, /* widget type */
451 ID_WALLPAPER, /* widget id */
452 #if defined(GX_WIDGET_USER_DATA)
453 0, /* user data */
454 #endif
455 GX_STYLE_BORDER_NONE|GX_STYLE_TRANSPARENT|GX_STYLE_ENABLED|GX_STYLE_BUTTON_TOGGLE|GX_STYLE_TEXT_LEFT, /* style flags */
456 GX_STATUS_ACCEPTS_FOCUS, /* status flags */
457 sizeof(GX_CHECKBOX), /* control block size */
458 GX_COLOR_ID_BTN_LOWER, /* normal color id */
459 GX_COLOR_ID_BTN_UPPER, /* selected color id */
460 GX_COLOR_ID_BTN_LOWER, /* disabled color id */
461 gx_studio_checkbox_create, /* create function */
462 GX_NULL, /* drawing function override */
463 GX_NULL, /* event function override */
464 {410, 74, 527, 97}, /* widget size */
465 &main_window_checkbox_fill_1_define, /* next widget definition */
466 GX_NULL, /* no child widgets */
467 offsetof(MAIN_WINDOW_CONTROL_BLOCK, main_window_checkbox_2), /* control block */
468 (void *) &main_window_checkbox_2_properties /* extended properties */
469 };
470
471 GX_CONST GX_STUDIO_WIDGET main_window_angle_display_1_define =
472 {
473 "angle_display_1",
474 GX_TYPE_PROMPT, /* widget type */
475 ID_LINE_WIDTH_DISPLAY, /* widget id */
476 #if defined(GX_WIDGET_USER_DATA)
477 0, /* user data */
478 #endif
479 GX_STYLE_BORDER_RECESSED|GX_STYLE_ENABLED|GX_STYLE_TEXT_RIGHT, /* style flags */
480 GX_STATUS_ACCEPTS_FOCUS, /* status flags */
481 sizeof(GX_PROMPT), /* control block size */
482 GX_COLOR_ID_SLIDER_TICK, /* normal color id */
483 GX_COLOR_ID_SELECTED_FILL, /* selected color id */
484 GX_COLOR_ID_SLIDER_TICK, /* disabled color id */
485 gx_studio_prompt_create, /* create function */
486 GX_NULL, /* drawing function override */
487 GX_NULL, /* event function override */
488 {585, 31, 623, 54}, /* widget size */
489 &main_window_checkbox_2_define, /* next widget definition */
490 GX_NULL, /* no child widgets */
491 offsetof(MAIN_WINDOW_CONTROL_BLOCK, main_window_angle_display_1), /* control block */
492 (void *) &main_window_angle_display_1_properties /* extended properties */
493 };
494
495 GX_CONST GX_STUDIO_WIDGET main_window_prompt_3_define =
496 {
497 "prompt_3",
498 GX_TYPE_PROMPT, /* widget type */
499 GX_ID_NONE, /* widget id */
500 #if defined(GX_WIDGET_USER_DATA)
501 0, /* user data */
502 #endif
503 GX_STYLE_BORDER_NONE|GX_STYLE_TRANSPARENT|GX_STYLE_TEXT_LEFT, /* style flags */
504 0, /* status flags */
505 sizeof(GX_PROMPT), /* control block size */
506 GX_COLOR_ID_TEXT_INPUT_TEXT, /* normal color id */
507 GX_COLOR_ID_SELECTED_FILL, /* selected color id */
508 GX_COLOR_ID_TEXT_INPUT_TEXT, /* disabled color id */
509 gx_studio_prompt_create, /* create function */
510 GX_NULL, /* drawing function override */
511 GX_NULL, /* event function override */
512 {408, 29, 458, 52}, /* widget size */
513 &main_window_angle_display_1_define, /* next widget definition */
514 GX_NULL, /* no child widgets */
515 offsetof(MAIN_WINDOW_CONTROL_BLOCK, main_window_prompt_3), /* control block */
516 (void *) &main_window_prompt_3_properties /* extended properties */
517 };
518
519 GX_CONST GX_STUDIO_WIDGET main_window_stroke_slider_define =
520 {
521 "stroke_slider",
522 GX_TYPE_SLIDER, /* widget type */
523 ID_LINE_WIDTH, /* widget id */
524 #if defined(GX_WIDGET_USER_DATA)
525 0, /* user data */
526 #endif
527 GX_STYLE_BORDER_RAISED|GX_STYLE_ENABLED|GX_STYLE_SHOW_NEEDLE|GX_STYLE_SHOW_TICKMARKS, /* style flags */
528 GX_STATUS_ACCEPTS_FOCUS, /* status flags */
529 sizeof(GX_SLIDER), /* control block size */
530 GX_COLOR_ID_WIDGET_FILL, /* normal color id */
531 GX_COLOR_ID_WIDGET_FILL, /* selected color id */
532 GX_COLOR_ID_WIDGET_FILL, /* disabled color id */
533 gx_studio_slider_create, /* create function */
534 GX_NULL, /* drawing function override */
535 GX_NULL, /* event function override */
536 {463, 31, 579, 54}, /* widget size */
537 &main_window_prompt_3_define, /* next widget definition */
538 GX_NULL, /* no child widgets */
539 offsetof(MAIN_WINDOW_CONTROL_BLOCK, main_window_stroke_slider), /* control block */
540 (void *) &main_window_stroke_slider_properties /* extended properties */
541 };
542
543 GX_CONST GX_STUDIO_WIDGET main_window_checkbox_fill_define =
544 {
545 "checkbox_fill",
546 GX_TYPE_CHECKBOX, /* widget type */
547 ID_SOLID_FILL, /* widget id */
548 #if defined(GX_WIDGET_USER_DATA)
549 0, /* user data */
550 #endif
551 GX_STYLE_BORDER_NONE|GX_STYLE_TRANSPARENT|GX_STYLE_ENABLED|GX_STYLE_BUTTON_PUSHED|GX_STYLE_BUTTON_TOGGLE|GX_STYLE_TEXT_LEFT, /* style flags */
552 GX_STATUS_ACCEPTS_FOCUS, /* status flags */
553 sizeof(GX_CHECKBOX), /* control block size */
554 GX_COLOR_ID_BTN_LOWER, /* normal color id */
555 GX_COLOR_ID_BTN_UPPER, /* selected color id */
556 GX_COLOR_ID_BTN_LOWER, /* disabled color id */
557 gx_studio_checkbox_create, /* create function */
558 GX_NULL, /* drawing function override */
559 GX_NULL, /* event function override */
560 {413, 240, 536, 263}, /* widget size */
561 &main_window_stroke_slider_define, /* next widget definition */
562 GX_NULL, /* no child widgets */
563 offsetof(MAIN_WINDOW_CONTROL_BLOCK, main_window_checkbox_fill), /* control block */
564 (void *) &main_window_checkbox_fill_properties /* extended properties */
565 };
566
567 GX_CONST GX_STUDIO_WIDGET main_window_prompt_4_define =
568 {
569 "prompt_4",
570 GX_TYPE_PROMPT, /* widget type */
571 GX_ID_NONE, /* widget id */
572 #if defined(GX_WIDGET_USER_DATA)
573 0, /* user data */
574 #endif
575 GX_STYLE_BORDER_NONE|GX_STYLE_TRANSPARENT|GX_STYLE_ENABLED|GX_STYLE_TEXT_LEFT, /* style flags */
576 GX_STATUS_ACCEPTS_FOCUS, /* status flags */
577 sizeof(GX_PROMPT), /* control block size */
578 GX_COLOR_ID_WIDGET_FILL, /* normal color id */
579 GX_COLOR_ID_SELECTED_FILL, /* selected color id */
580 GX_COLOR_ID_WIDGET_FILL, /* disabled color id */
581 gx_studio_prompt_create, /* create function */
582 GX_NULL, /* drawing function override */
583 GX_NULL, /* event function override */
584 {409, 145, 540, 168}, /* widget size */
585 &main_window_checkbox_fill_define, /* next widget definition */
586 GX_NULL, /* no child widgets */
587 offsetof(MAIN_WINDOW_CONTROL_BLOCK, main_window_prompt_4), /* control block */
588 (void *) &main_window_prompt_4_properties /* extended properties */
589 };
590
591 GX_CONST GX_STUDIO_WIDGET main_window_checkbox_round_define =
592 {
593 "checkbox_round",
594 GX_TYPE_CHECKBOX, /* widget type */
595 ID_ROUND, /* widget id */
596 #if defined(GX_WIDGET_USER_DATA)
597 0, /* user data */
598 #endif
599 GX_STYLE_BORDER_NONE|GX_STYLE_TRANSPARENT|GX_STYLE_ENABLED|GX_STYLE_BUTTON_PUSHED|GX_STYLE_BUTTON_TOGGLE|GX_STYLE_TEXT_LEFT, /* style flags */
600 GX_STATUS_ACCEPTS_FOCUS, /* status flags */
601 sizeof(GX_CHECKBOX), /* control block size */
602 GX_COLOR_ID_BTN_LOWER, /* normal color id */
603 GX_COLOR_ID_BTN_UPPER, /* selected color id */
604 GX_COLOR_ID_BTN_LOWER, /* disabled color id */
605 gx_studio_checkbox_create, /* create function */
606 GX_NULL, /* drawing function override */
607 GX_NULL, /* event function override */
608 {413, 209, 526, 232}, /* widget size */
609 &main_window_prompt_4_define, /* next widget definition */
610 GX_NULL, /* no child widgets */
611 offsetof(MAIN_WINDOW_CONTROL_BLOCK, main_window_checkbox_round), /* control block */
612 (void *) &main_window_checkbox_round_properties /* extended properties */
613 };
614
615 GX_CONST GX_STUDIO_WIDGET main_window_checkbox_anti_alised_define =
616 {
617 "checkbox_anti_alised",
618 GX_TYPE_CHECKBOX, /* widget type */
619 ID_ANTI_ALIASED, /* widget id */
620 #if defined(GX_WIDGET_USER_DATA)
621 0, /* user data */
622 #endif
623 GX_STYLE_BORDER_NONE|GX_STYLE_TRANSPARENT|GX_STYLE_ENABLED|GX_STYLE_BUTTON_PUSHED|GX_STYLE_BUTTON_TOGGLE|GX_STYLE_TEXT_LEFT, /* style flags */
624 GX_STATUS_ACCEPTS_FOCUS, /* status flags */
625 sizeof(GX_CHECKBOX), /* control block size */
626 GX_COLOR_ID_BTN_LOWER, /* normal color id */
627 GX_COLOR_ID_BTN_UPPER, /* selected color id */
628 GX_COLOR_ID_BTN_LOWER, /* disabled color id */
629 gx_studio_checkbox_create, /* create function */
630 GX_NULL, /* drawing function override */
631 GX_NULL, /* event function override */
632 {413, 178, 537, 201}, /* widget size */
633 &main_window_checkbox_round_define, /* next widget definition */
634 GX_NULL, /* no child widgets */
635 offsetof(MAIN_WINDOW_CONTROL_BLOCK, main_window_checkbox_anti_alised), /* control block */
636 (void *) &main_window_checkbox_anti_alised_properties /* extended properties */
637 };
638
639 GX_CONST GX_STUDIO_WIDGET main_window_polygon_window_define =
640 {
641 "polygon_window",
642 GX_TYPE_WINDOW, /* widget type */
643 ID_POLYGON_WINDOW, /* widget id */
644 #if defined(GX_WIDGET_USER_DATA)
645 0, /* user data */
646 #endif
647 GX_STYLE_BORDER_THIN|GX_STYLE_TILE_WALLPAPER, /* style flags */
648 GX_STATUS_ACCEPTS_FOCUS, /* status flags */
649 sizeof(GX_WINDOW), /* control block size */
650 GX_COLOR_ID_TEXT_INPUT_TEXT, /* normal color id */
651 GX_COLOR_ID_TEXT_INPUT_TEXT, /* selected color id */
652 GX_COLOR_ID_TEXT_INPUT_TEXT, /* disabled color id */
653 gx_studio_window_create, /* create function */
654 (VOID (*)(GX_WIDGET *)) polygon_draw, /* drawing function override */
655 GX_NULL, /* event function override */
656 {28, 24, 397, 452}, /* widget size */
657 &main_window_checkbox_anti_alised_define, /* next widget definition */
658 GX_NULL, /* no child widgets */
659 offsetof(MAIN_WINDOW_CONTROL_BLOCK, main_window_polygon_window), /* control block */
660 (void *) &main_window_polygon_window_properties /* extended properties */
661 };
662
663 GX_CONST GX_STUDIO_WIDGET main_window_define =
664 {
665 "main_window",
666 GX_TYPE_WINDOW, /* widget type */
667 GX_ID_NONE, /* widget id */
668 #if defined(GX_WIDGET_USER_DATA)
669 0, /* user data */
670 #endif
671 GX_STYLE_BORDER_NONE, /* style flags */
672 GX_STATUS_ACCEPTS_FOCUS, /* status flags */
673 sizeof(MAIN_WINDOW_CONTROL_BLOCK), /* control block size */
674 GX_COLOR_ID_SELECTED_TEXT, /* normal color id */
675 GX_COLOR_ID_SELECTED_TEXT, /* selected color id */
676 GX_COLOR_ID_SELECTED_TEXT, /* disabled color id */
677 gx_studio_window_create, /* create function */
678 GX_NULL, /* drawing function override */
679 (UINT (*)(GX_WIDGET *, GX_EVENT *)) main_event_handler, /* event function override */
680 {0, 0, 638, 478}, /* widget size */
681 GX_NULL, /* next widget */
682 &main_window_polygon_window_define, /* child widget */
683 0, /* control block */
684 (void *) &main_window_properties /* extended properties */
685 };
686 GX_CONST GX_STUDIO_WIDGET_ENTRY polygon_32bpp_widget_table[] =
687 {
688 { &main_window_define, (GX_WIDGET *) &main_window },
689 {GX_NULL, GX_NULL}
690 };
691
gx_studio_nested_widget_create(GX_BYTE * control,GX_CONST GX_STUDIO_WIDGET * definition,GX_WIDGET * parent)692 static GX_WIDGET *gx_studio_nested_widget_create(GX_BYTE *control, GX_CONST GX_STUDIO_WIDGET *definition, GX_WIDGET *parent)
693 {
694 UINT status = GX_SUCCESS;
695 GX_WIDGET *widget = GX_NULL;
696 GX_VALUE list_count = 0;
697 GX_VALUE list_total_count = 0;
698
699 if(parent && (parent->gx_widget_type == GX_TYPE_MENU))
700 {
701 list_total_count = ((GX_MENU *)parent)->gx_menu_list_total_count;
702 }
703
704 while(definition && status == GX_SUCCESS)
705 {
706 if (definition->create_function)
707 {
708 if (definition->style & GX_STYLE_DYNAMICALLY_ALLOCATED)
709 {
710 status = gx_widget_allocate(&widget, definition->control_block_size);
711 if (status != GX_SUCCESS)
712 {
713 return GX_NULL;
714 }
715 }
716 else
717 {
718 if (control == GX_NULL)
719 {
720 return GX_NULL;
721 }
722 widget = (GX_WIDGET *) (control + definition->control_block_offset);
723 }
724
725 status = definition->create_function(definition, widget, parent);
726
727 if(list_count < list_total_count)
728 {
729 gx_menu_insert((GX_MENU *)parent, widget);
730 ((GX_MENU *)parent)->gx_menu_list_total_count--;
731 list_count++;
732 }
733
734 if (status == GX_SUCCESS)
735 {
736 if (definition->widget_type != GX_TYPE_TEMPLATE)
737 {
738 #if defined(GUIX_5_4_0_COMPATIBILITY)
739 gx_widget_fill_color_set(widget, definition->normal_fill_color_id, definition->selected_fill_color_id);
740 #else
741 gx_widget_fill_color_set(widget, definition->normal_fill_color_id, definition->selected_fill_color_id, definition->disabled_fill_color_id);
742 #endif
743 }
744
745 if (!(definition->status & GX_STATUS_ACCEPTS_FOCUS))
746 {
747 gx_widget_status_remove(widget, GX_STATUS_ACCEPTS_FOCUS);
748 }
749
750 if (definition->draw_function)
751 {
752 gx_widget_draw_set(widget, definition->draw_function);
753 }
754 if (definition->event_function)
755 {
756 gx_widget_event_process_set(widget, definition->event_function);
757 }
758
759 #if defined(GX_WIDGET_USER_DATA)
760 widget->gx_widget_user_data = definition->user_data;
761 #endif
762
763 if (definition->child_widget)
764 {
765 gx_studio_nested_widget_create(control, definition->child_widget, widget);
766 }
767 }
768 definition = definition->next_widget;
769 }
770 }
771 return widget;
772 }
773
gx_studio_widget_create(GX_BYTE * control,GX_CONST GX_STUDIO_WIDGET * definition,GX_WIDGET * parent)774 GX_WIDGET *gx_studio_widget_create(GX_BYTE *control, GX_CONST GX_STUDIO_WIDGET *definition, GX_WIDGET *parent)
775 {
776 GX_WIDGET *widget;
777 widget = gx_studio_nested_widget_create(control, definition, GX_NULL);
778
779 if (parent && widget)
780 {
781 gx_widget_attach(parent, widget);
782 }
783 return widget;
784 }
785
gx_studio_named_widget_create(char * name,GX_WIDGET * parent,GX_WIDGET ** new_widget)786 UINT gx_studio_named_widget_create(char *name, GX_WIDGET *parent, GX_WIDGET **new_widget)
787 {
788 UINT status = GX_FAILURE;
789 GX_CONST GX_STUDIO_WIDGET_ENTRY *entry = polygon_32bpp_widget_table;
790 GX_WIDGET *widget = GX_NULL;
791
792 while(entry->widget_information)
793 {
794 if (!strcmp(name, entry->widget_information->widget_name))
795 {
796 widget = gx_studio_widget_create((GX_BYTE *) entry->widget, entry->widget_information, parent);
797 if (widget)
798 {
799 status = GX_SUCCESS;
800 }
801 break;
802 }
803 entry++;
804 }
805
806 if (new_widget)
807 {
808 *new_widget = widget;
809 }
810 return status;
811 }
812
813
gx_studio_display_configure(USHORT display,UINT (* driver)(GX_DISPLAY *),GX_UBYTE language,USHORT theme,GX_WINDOW_ROOT ** return_root)814 UINT gx_studio_display_configure(USHORT display, UINT (*driver)(GX_DISPLAY *),
815 GX_UBYTE language, USHORT theme, GX_WINDOW_ROOT **return_root)
816 {
817 GX_CONST GX_THEME *theme_ptr;
818 GX_RECTANGLE size;
819
820 GX_STUDIO_DISPLAY_INFO *display_info = &polygon_32bpp_display_table[display];
821
822
823 /* create the requested display */
824
825 gx_display_create(display_info->display,
826 display_info->name,
827 driver,
828 (GX_VALUE) display_info->x_resolution,
829 (GX_VALUE) display_info->y_resolution);
830
831
832 /* install the request theme */
833
834 if(display_info->theme_table)
835 {
836 theme_ptr = display_info->theme_table[theme];
837 if(theme_ptr)
838 {
839 gx_display_color_table_set(display_info->display, theme_ptr->theme_color_table, theme_ptr->theme_color_table_size);
840
841 /* install the color palette if required */
842 if (display_info->display->gx_display_driver_palette_set &&
843 theme_ptr->theme_palette != NULL)
844 {
845 display_info->display->gx_display_driver_palette_set(display_info->display, theme_ptr->theme_palette, theme_ptr->theme_palette_size);
846 }
847
848 gx_display_font_table_set(display_info->display, theme_ptr->theme_font_table, theme_ptr->theme_font_table_size);
849 gx_display_pixelmap_table_set(display_info->display, theme_ptr->theme_pixelmap_table, theme_ptr->theme_pixelmap_table_size);
850 gx_system_scroll_appearance_set(theme_ptr->theme_vertical_scroll_style, (GX_SCROLLBAR_APPEARANCE *) &theme_ptr->theme_vertical_scrollbar_appearance);
851 gx_system_scroll_appearance_set(theme_ptr->theme_horizontal_scroll_style, (GX_SCROLLBAR_APPEARANCE *) &theme_ptr->theme_horizontal_scrollbar_appearance);
852 }
853 }
854
855 /* Install the language table. */
856
857 if(display_info->language_table)
858 {
859 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);
860 gx_display_active_language_set(display_info->display, language);
861 }
862
863 /* Set screen rotation angle. */
864
865 display_info->display->gx_display_rotation_angle = display_info->rotation_angle;
866
867 /* create the canvas for this display */
868
869 gx_canvas_create(display_info->canvas,
870 display_info->canvas_name,
871 display_info->display,
872 GX_CANVAS_MANAGED | GX_CANVAS_VISIBLE,
873 display_info->x_resolution,
874 display_info->y_resolution,
875 display_info->canvas_memory,
876 display_info->canvas_memory_size);
877
878 /* Create the root window for this canvas */
879
880 gx_utility_rectangle_define(&size,
881 0, 0,
882 (GX_VALUE) (display_info->x_resolution - 1),
883 (GX_VALUE) (display_info->y_resolution - 1));
884
885 gx_window_root_create(display_info->root_window,
886 display_info->name,
887 display_info->canvas, GX_STYLE_NONE, 0, &size);
888 if (return_root)
889 {
890 *return_root = display_info->root_window;
891 }
892 return GX_SUCCESS;
893 }
894 #undef GUIX_STUDIO_GENERATED_FILE
895