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.3.0.0 */
9 /* Date (dd.mm.yyyy): 24.11.2023 Time (hh:mm): 16:57 */
10 /*******************************************************************************/
11
12
13 #define GUIX_STUDIO_GENERATED_FILE
14 #include <stddef.h>
15 #include "shapes_resources.h"
16 #include "shapes_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 shapes_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_graphics_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_PROMPT_PROPERTIES main_window_prompt_4_properties =
193 {
194 GX_STRING_ID_STRING_9, /* string id */
195 GX_FONT_ID_PROMPT, /* font id */
196 GX_COLOR_ID_TEXT, /* normal text color */
197 GX_COLOR_ID_SELECTED_TEXT, /* selected text color */
198 GX_COLOR_ID_TEXT /* disabled text color */
199 };
200 GX_CHECKBOX_PROPERTIES main_window_checkbox_fill_properties =
201 {
202 GX_STRING_ID_STRING_11, /* string id */
203 GX_FONT_ID_BUTTON, /* font id */
204 GX_COLOR_ID_BTN_TEXT, /* normal text color */
205 GX_COLOR_ID_BTN_TEXT, /* selected text color */
206 GX_COLOR_ID_BTN_TEXT, /* disabled text color */
207 0, /* unchecked pixelmap id */
208 0, /* checked pixelmap id */
209 0, /* unchecked disabled pixelmap id */
210 0 /* checked disabled pixelmap id */
211 };
212 GX_CHECKBOX_PROPERTIES main_window_checkbox_pixelmap_fill_properties =
213 {
214 GX_STRING_ID_STRING_38, /* 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_PROMPT_PROPERTIES main_window_prompt_7_properties =
225 {
226 GX_STRING_ID_STRING_43, /* string id */
227 GX_FONT_ID_PROMPT, /* font id */
228 GX_COLOR_ID_TEXT, /* normal text color */
229 GX_COLOR_ID_SELECTED_TEXT, /* selected text color */
230 GX_COLOR_ID_TEXT /* disabled text color */
231 };
232 GX_SLIDER_PROPERTIES main_window_radius_slider_properties =
233 {
234 10, /* tickmark count */
235 5, /* mimimun value */
236 200, /* maximum value */
237 160, /* current value */
238 1, /* increment */
239 10, /* minimum travel */
240 10, /* maximum travel */
241 5, /* needle width */
242 14, /* needle height */
243 5, /* needle inset */
244 1 /* needle hotspot */
245 };
246 GX_PROMPT_PROPERTIES main_window_radius_prompt_properties =
247 {
248 GX_STRING_ID_STRING_63, /* 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_WINDOW_PROPERTIES main_window_window_1_properties =
255 {
256 0 /* wallpaper pixelmap id */
257 };
258 GX_RADIO_BUTTON_PROPERTIES main_window_radio_button_3_properties =
259 {
260 GX_STRING_ID_STRING_36, /* string id */
261 GX_FONT_ID_BUTTON, /* font id */
262 GX_COLOR_ID_BTN_TEXT, /* normal text color */
263 GX_COLOR_ID_BTN_TEXT, /* selected text color */
264 GX_COLOR_ID_BTN_TEXT, /* disabled text color */
265 0, /* off pixelmap id */
266 0, /* on pixelmap id */
267 0, /* off disabled pixelmap id */
268 0 /* on disabled pixelmap id */
269 };
270 GX_RADIO_BUTTON_PROPERTIES main_window_radio_button_4_properties =
271 {
272 GX_STRING_ID_STRING_52, /* string id */
273 GX_FONT_ID_BUTTON, /* font id */
274 GX_COLOR_ID_BTN_TEXT, /* normal text color */
275 GX_COLOR_ID_BTN_TEXT, /* selected text color */
276 GX_COLOR_ID_BTN_TEXT, /* disabled text color */
277 0, /* off pixelmap id */
278 0, /* on pixelmap id */
279 0, /* off disabled pixelmap id */
280 0 /* on disabled pixelmap id */
281 };
282 GX_RADIO_BUTTON_PROPERTIES main_window_radio_button_5_properties =
283 {
284 GX_STRING_ID_STRING_53, /* string id */
285 GX_FONT_ID_BUTTON, /* font id */
286 GX_COLOR_ID_BTN_TEXT, /* normal text color */
287 GX_COLOR_ID_BTN_TEXT, /* selected text color */
288 GX_COLOR_ID_BTN_TEXT, /* disabled text color */
289 0, /* off pixelmap id */
290 0, /* on pixelmap id */
291 0, /* off disabled pixelmap id */
292 0 /* on disabled pixelmap id */
293 };
294 GX_RADIO_BUTTON_PROPERTIES main_window_radio_button_6_properties =
295 {
296 GX_STRING_ID_STRING_54, /* string id */
297 GX_FONT_ID_BUTTON, /* font id */
298 GX_COLOR_ID_BTN_TEXT, /* normal text color */
299 GX_COLOR_ID_BTN_TEXT, /* selected text color */
300 GX_COLOR_ID_BTN_TEXT, /* disabled text color */
301 0, /* off pixelmap id */
302 0, /* on pixelmap id */
303 0, /* off disabled pixelmap id */
304 0 /* on disabled pixelmap id */
305 };
306 GX_RADIO_BUTTON_PROPERTIES main_window_radio_button_1_properties =
307 {
308 GX_STRING_ID_STRING_58, /* string id */
309 GX_FONT_ID_BUTTON, /* font id */
310 GX_COLOR_ID_BTN_TEXT, /* normal text color */
311 GX_COLOR_ID_BTN_TEXT, /* selected text color */
312 GX_COLOR_ID_BTN_TEXT, /* disabled text color */
313 0, /* off pixelmap id */
314 0, /* on pixelmap id */
315 0, /* off disabled pixelmap id */
316 0 /* on disabled pixelmap id */
317 };
318 GX_RADIO_BUTTON_PROPERTIES main_window_radio_button_2_properties =
319 {
320 GX_STRING_ID_STRING_65, /* string id */
321 GX_FONT_ID_BUTTON, /* font id */
322 GX_COLOR_ID_BTN_TEXT, /* normal text color */
323 GX_COLOR_ID_BTN_TEXT, /* selected text color */
324 GX_COLOR_ID_BTN_TEXT, /* disabled text color */
325 0, /* off pixelmap id */
326 0, /* on pixelmap id */
327 0, /* off disabled pixelmap id */
328 0 /* on disabled pixelmap id */
329 };
330 GX_SLIDER_PROPERTIES main_window_brush_width_slider_properties =
331 {
332 10, /* tickmark count */
333 0, /* mimimun value */
334 20, /* maximum value */
335 2, /* current value */
336 1, /* increment */
337 10, /* minimum travel */
338 10, /* maximum travel */
339 5, /* needle width */
340 14, /* needle height */
341 5, /* needle inset */
342 1 /* needle hotspot */
343 };
344 GX_PROMPT_PROPERTIES main_window_brush_width_prompt_properties =
345 {
346 GX_STRING_ID_STRING_64, /* string id */
347 GX_FONT_ID_PROMPT, /* font id */
348 GX_COLOR_ID_SELECTED_TEXT, /* normal text color */
349 GX_COLOR_ID_SELECTED_TEXT, /* selected text color */
350 GX_COLOR_ID_SELECTED_TEXT /* disabled text color */
351 };
352 GX_PROMPT_PROPERTIES main_window_prompt_9_properties =
353 {
354 GX_STRING_ID_STRING_41, /* string id */
355 GX_FONT_ID_PROMPT, /* font id */
356 GX_COLOR_ID_TEXT, /* normal text color */
357 GX_COLOR_ID_SELECTED_TEXT, /* selected text color */
358 GX_COLOR_ID_TEXT /* disabled text color */
359 };
360 GX_CHECKBOX_PROPERTIES main_window_checkbox_round_end_properties =
361 {
362 GX_STRING_ID_STRING_67, /* string id */
363 GX_FONT_ID_BUTTON, /* font id */
364 GX_COLOR_ID_BTN_TEXT, /* normal text color */
365 GX_COLOR_ID_BTN_TEXT, /* selected text color */
366 GX_COLOR_ID_BTN_TEXT, /* disabled text color */
367 0, /* unchecked pixelmap id */
368 0, /* checked pixelmap id */
369 0, /* unchecked disabled pixelmap id */
370 0 /* checked disabled pixelmap id */
371 };
372
373 GX_CONST GX_STUDIO_WIDGET main_window_radio_button_2_define =
374 {
375 "radio_button_2",
376 GX_TYPE_RADIO_BUTTON, /* widget type */
377 ID_RECTANGLE, /* widget id */
378 #if defined(GX_WIDGET_USER_DATA)
379 0, /* user data */
380 #endif
381 GX_STYLE_BORDER_NONE|GX_STYLE_TRANSPARENT|GX_STYLE_ENABLED|GX_STYLE_BUTTON_RADIO|GX_STYLE_TEXT_LEFT, /* style flags */
382 GX_STATUS_ACCEPTS_FOCUS, /* status flags */
383 sizeof(GX_RADIO_BUTTON), /* control block size */
384 GX_COLOR_ID_BTN_LOWER, /* normal color id */
385 GX_COLOR_ID_BTN_UPPER, /* selected color id */
386 GX_COLOR_ID_BTN_LOWER, /* disabled color id */
387 gx_studio_radio_button_create, /* create function */
388 GX_NULL, /* drawing function override */
389 GX_NULL, /* event function override */
390 {375, 436, 478, 459}, /* widget size */
391 GX_NULL, /* no next widget */
392 GX_NULL, /* no child widgets */
393 offsetof(MAIN_WINDOW_CONTROL_BLOCK, main_window_radio_button_2), /* control block */
394 (void *) &main_window_radio_button_2_properties /* extended properties */
395 };
396
397 GX_CONST GX_STUDIO_WIDGET main_window_radio_button_1_define =
398 {
399 "radio_button_1",
400 GX_TYPE_RADIO_BUTTON, /* widget type */
401 ID_ELLIPSE, /* widget id */
402 #if defined(GX_WIDGET_USER_DATA)
403 0, /* user data */
404 #endif
405 GX_STYLE_BORDER_NONE|GX_STYLE_TRANSPARENT|GX_STYLE_ENABLED|GX_STYLE_BUTTON_RADIO|GX_STYLE_TEXT_LEFT, /* style flags */
406 GX_STATUS_ACCEPTS_FOCUS, /* status flags */
407 sizeof(GX_RADIO_BUTTON), /* control block size */
408 GX_COLOR_ID_BTN_LOWER, /* normal color id */
409 GX_COLOR_ID_BTN_UPPER, /* selected color id */
410 GX_COLOR_ID_BTN_LOWER, /* disabled color id */
411 gx_studio_radio_button_create, /* create function */
412 GX_NULL, /* drawing function override */
413 GX_NULL, /* event function override */
414 {123, 436, 203, 459}, /* widget size */
415 &main_window_radio_button_2_define, /* next widget definition */
416 GX_NULL, /* no child widgets */
417 offsetof(MAIN_WINDOW_CONTROL_BLOCK, main_window_radio_button_1), /* control block */
418 (void *) &main_window_radio_button_1_properties /* extended properties */
419 };
420
421 GX_CONST GX_STUDIO_WIDGET main_window_radio_button_6_define =
422 {
423 "radio_button_6",
424 GX_TYPE_RADIO_BUTTON, /* widget type */
425 ID_POLYGON, /* widget id */
426 #if defined(GX_WIDGET_USER_DATA)
427 0, /* user data */
428 #endif
429 GX_STYLE_BORDER_NONE|GX_STYLE_TRANSPARENT|GX_STYLE_ENABLED|GX_STYLE_BUTTON_RADIO|GX_STYLE_TEXT_LEFT, /* style flags */
430 GX_STATUS_ACCEPTS_FOCUS, /* status flags */
431 sizeof(GX_RADIO_BUTTON), /* control block size */
432 GX_COLOR_ID_BTN_LOWER, /* normal color id */
433 GX_COLOR_ID_BTN_UPPER, /* selected color id */
434 GX_COLOR_ID_BTN_LOWER, /* disabled color id */
435 gx_studio_radio_button_create, /* create function */
436 GX_NULL, /* drawing function override */
437 GX_NULL, /* event function override */
438 {503, 436, 593, 459}, /* widget size */
439 &main_window_radio_button_1_define, /* next widget definition */
440 GX_NULL, /* no child widgets */
441 offsetof(MAIN_WINDOW_CONTROL_BLOCK, main_window_radio_button_6), /* control block */
442 (void *) &main_window_radio_button_6_properties /* extended properties */
443 };
444
445 GX_CONST GX_STUDIO_WIDGET main_window_radio_button_5_define =
446 {
447 "radio_button_5",
448 GX_TYPE_RADIO_BUTTON, /* widget type */
449 ID_PIE, /* widget id */
450 #if defined(GX_WIDGET_USER_DATA)
451 0, /* user data */
452 #endif
453 GX_STYLE_BORDER_NONE|GX_STYLE_TRANSPARENT|GX_STYLE_ENABLED|GX_STYLE_BUTTON_RADIO|GX_STYLE_TEXT_LEFT, /* style flags */
454 GX_STATUS_ACCEPTS_FOCUS, /* status flags */
455 sizeof(GX_RADIO_BUTTON), /* control block size */
456 GX_COLOR_ID_BTN_LOWER, /* normal color id */
457 GX_COLOR_ID_BTN_UPPER, /* selected color id */
458 GX_COLOR_ID_BTN_LOWER, /* disabled color id */
459 gx_studio_radio_button_create, /* create function */
460 GX_NULL, /* drawing function override */
461 GX_NULL, /* event function override */
462 {302, 436, 350, 459}, /* widget size */
463 &main_window_radio_button_6_define, /* next widget definition */
464 GX_NULL, /* no child widgets */
465 offsetof(MAIN_WINDOW_CONTROL_BLOCK, main_window_radio_button_5), /* control block */
466 (void *) &main_window_radio_button_5_properties /* extended properties */
467 };
468
469 GX_CONST GX_STUDIO_WIDGET main_window_radio_button_4_define =
470 {
471 "radio_button_4",
472 GX_TYPE_RADIO_BUTTON, /* widget type */
473 ID_ARC, /* widget id */
474 #if defined(GX_WIDGET_USER_DATA)
475 0, /* user data */
476 #endif
477 GX_STYLE_BORDER_NONE|GX_STYLE_TRANSPARENT|GX_STYLE_ENABLED|GX_STYLE_BUTTON_RADIO|GX_STYLE_TEXT_LEFT, /* style flags */
478 GX_STATUS_ACCEPTS_FOCUS, /* status flags */
479 sizeof(GX_RADIO_BUTTON), /* control block size */
480 GX_COLOR_ID_BTN_LOWER, /* normal color id */
481 GX_COLOR_ID_BTN_UPPER, /* selected color id */
482 GX_COLOR_ID_BTN_LOWER, /* disabled color id */
483 gx_studio_radio_button_create, /* create function */
484 GX_NULL, /* drawing function override */
485 GX_NULL, /* event function override */
486 {228, 436, 277, 459}, /* widget size */
487 &main_window_radio_button_5_define, /* next widget definition */
488 GX_NULL, /* no child widgets */
489 offsetof(MAIN_WINDOW_CONTROL_BLOCK, main_window_radio_button_4), /* control block */
490 (void *) &main_window_radio_button_4_properties /* extended properties */
491 };
492
493 GX_CONST GX_STUDIO_WIDGET main_window_radio_button_3_define =
494 {
495 "radio_button_3",
496 GX_TYPE_RADIO_BUTTON, /* widget type */
497 ID_CIRCLE, /* widget id */
498 #if defined(GX_WIDGET_USER_DATA)
499 0, /* user data */
500 #endif
501 GX_STYLE_BORDER_NONE|GX_STYLE_TRANSPARENT|GX_STYLE_ENABLED|GX_STYLE_BUTTON_PUSHED|GX_STYLE_BUTTON_RADIO|GX_STYLE_TEXT_LEFT, /* style flags */
502 GX_STATUS_ACCEPTS_FOCUS, /* status flags */
503 sizeof(GX_RADIO_BUTTON), /* control block size */
504 GX_COLOR_ID_BTN_LOWER, /* normal color id */
505 GX_COLOR_ID_BTN_UPPER, /* selected color id */
506 GX_COLOR_ID_BTN_LOWER, /* disabled color id */
507 gx_studio_radio_button_create, /* create function */
508 GX_NULL, /* drawing function override */
509 GX_NULL, /* event function override */
510 {34, 436, 98, 459}, /* widget size */
511 &main_window_radio_button_4_define, /* next widget definition */
512 GX_NULL, /* no child widgets */
513 offsetof(MAIN_WINDOW_CONTROL_BLOCK, main_window_radio_button_3), /* control block */
514 (void *) &main_window_radio_button_3_properties /* extended properties */
515 };
516
517 GX_CONST GX_STUDIO_WIDGET main_window_checkbox_round_end_define =
518 {
519 "checkbox_round_end",
520 GX_TYPE_CHECKBOX, /* widget type */
521 ID_ROUND_END, /* widget id */
522 #if defined(GX_WIDGET_USER_DATA)
523 0, /* user data */
524 #endif
525 GX_STYLE_BORDER_NONE|GX_STYLE_TRANSPARENT|GX_STYLE_ENABLED|GX_STYLE_BUTTON_PUSHED|GX_STYLE_BUTTON_TOGGLE|GX_STYLE_TEXT_LEFT, /* style flags */
526 GX_STATUS_ACCEPTS_FOCUS, /* status flags */
527 sizeof(GX_CHECKBOX), /* control block size */
528 GX_COLOR_ID_BTN_LOWER, /* normal color id */
529 GX_COLOR_ID_BTN_UPPER, /* selected color id */
530 GX_COLOR_ID_BTN_LOWER, /* disabled color id */
531 gx_studio_checkbox_create, /* create function */
532 GX_NULL, /* drawing function override */
533 GX_NULL, /* event function override */
534 {420, 209, 544, 232}, /* widget size */
535 GX_NULL, /* no next widget */
536 GX_NULL, /* no child widgets */
537 offsetof(MAIN_WINDOW_CONTROL_BLOCK, main_window_checkbox_round_end), /* control block */
538 (void *) &main_window_checkbox_round_end_properties /* extended properties */
539 };
540
541 GX_CONST GX_STUDIO_WIDGET main_window_prompt_9_define =
542 {
543 "prompt_9",
544 GX_TYPE_PROMPT, /* widget type */
545 GX_ID_NONE, /* widget id */
546 #if defined(GX_WIDGET_USER_DATA)
547 0, /* user data */
548 #endif
549 GX_STYLE_BORDER_NONE|GX_STYLE_TRANSPARENT|GX_STYLE_ENABLED|GX_STYLE_TEXT_CENTER, /* style flags */
550 GX_STATUS_ACCEPTS_FOCUS, /* status flags */
551 sizeof(GX_PROMPT), /* control block size */
552 GX_COLOR_ID_WIDGET_FILL, /* normal color id */
553 GX_COLOR_ID_SELECTED_FILL, /* selected color id */
554 GX_COLOR_ID_WIDGET_FILL, /* disabled color id */
555 gx_studio_prompt_create, /* create function */
556 GX_NULL, /* drawing function override */
557 GX_NULL, /* event function override */
558 {415, 82, 514, 105}, /* widget size */
559 &main_window_checkbox_round_end_define, /* next widget definition */
560 GX_NULL, /* no child widgets */
561 offsetof(MAIN_WINDOW_CONTROL_BLOCK, main_window_prompt_9), /* control block */
562 (void *) &main_window_prompt_9_properties /* extended properties */
563 };
564
565 GX_CONST GX_STUDIO_WIDGET main_window_brush_width_prompt_define =
566 {
567 "brush_width_prompt",
568 GX_TYPE_PROMPT, /* widget type */
569 ID_BRUSH_WIDTH_PROMPT, /* widget id */
570 #if defined(GX_WIDGET_USER_DATA)
571 0, /* user data */
572 #endif
573 GX_STYLE_BORDER_RECESSED|GX_STYLE_ENABLED|GX_STYLE_TEXT_RIGHT, /* style flags */
574 GX_STATUS_ACCEPTS_FOCUS, /* status flags */
575 sizeof(GX_PROMPT), /* control block size */
576 GX_COLOR_ID_SLIDER_TICK, /* normal color id */
577 GX_COLOR_ID_SELECTED_FILL, /* selected color id */
578 GX_COLOR_ID_SLIDER_TICK, /* disabled color id */
579 gx_studio_prompt_create, /* create function */
580 GX_NULL, /* drawing function override */
581 GX_NULL, /* event function override */
582 {581, 106, 619, 129}, /* widget size */
583 &main_window_prompt_9_define, /* next widget definition */
584 GX_NULL, /* no child widgets */
585 offsetof(MAIN_WINDOW_CONTROL_BLOCK, main_window_brush_width_prompt), /* control block */
586 (void *) &main_window_brush_width_prompt_properties /* extended properties */
587 };
588
589 GX_CONST GX_STUDIO_WIDGET main_window_brush_width_slider_define =
590 {
591 "brush_width_slider",
592 GX_TYPE_SLIDER, /* widget type */
593 ID_BRUSH_WIDTH, /* widget id */
594 #if defined(GX_WIDGET_USER_DATA)
595 0, /* user data */
596 #endif
597 GX_STYLE_BORDER_RAISED|GX_STYLE_ENABLED|GX_STYLE_SHOW_NEEDLE|GX_STYLE_SHOW_TICKMARKS, /* style flags */
598 GX_STATUS_ACCEPTS_FOCUS, /* status flags */
599 sizeof(GX_SLIDER), /* control block size */
600 GX_COLOR_ID_WIDGET_FILL, /* normal color id */
601 GX_COLOR_ID_WIDGET_FILL, /* selected color id */
602 GX_COLOR_ID_WIDGET_FILL, /* disabled color id */
603 gx_studio_slider_create, /* create function */
604 GX_NULL, /* drawing function override */
605 GX_NULL, /* event function override */
606 {454, 106, 570, 129}, /* widget size */
607 &main_window_brush_width_prompt_define, /* next widget definition */
608 GX_NULL, /* no child widgets */
609 offsetof(MAIN_WINDOW_CONTROL_BLOCK, main_window_brush_width_slider), /* control block */
610 (void *) &main_window_brush_width_slider_properties /* extended properties */
611 };
612
613 GX_CONST GX_STUDIO_WIDGET main_window_window_1_define =
614 {
615 "window_1",
616 GX_TYPE_WINDOW, /* widget type */
617 GX_ID_NONE, /* widget id */
618 #if defined(GX_WIDGET_USER_DATA)
619 0, /* user data */
620 #endif
621 GX_STYLE_BORDER_NONE|GX_STYLE_TRANSPARENT, /* style flags */
622 GX_STATUS_ACCEPTS_FOCUS, /* status flags */
623 sizeof(GX_WINDOW), /* control block size */
624 GX_COLOR_ID_WINDOW_FILL, /* normal color id */
625 GX_COLOR_ID_WINDOW_FILL, /* selected color id */
626 GX_COLOR_ID_WINDOW_FILL, /* disabled color id */
627 gx_studio_window_create, /* create function */
628 GX_NULL, /* drawing function override */
629 GX_NULL, /* event function override */
630 {10, 423, 626, 467}, /* widget size */
631 &main_window_brush_width_slider_define, /* next widget definition */
632 &main_window_radio_button_3_define, /* child widget definition */
633 offsetof(MAIN_WINDOW_CONTROL_BLOCK, main_window_window_1), /* control block */
634 (void *) &main_window_window_1_properties /* extended properties */
635 };
636
637 GX_CONST GX_STUDIO_WIDGET main_window_radius_prompt_define =
638 {
639 "radius_prompt",
640 GX_TYPE_PROMPT, /* widget type */
641 ID_RADIUS_PROMPT, /* widget id */
642 #if defined(GX_WIDGET_USER_DATA)
643 0, /* user data */
644 #endif
645 GX_STYLE_BORDER_RECESSED|GX_STYLE_ENABLED|GX_STYLE_TEXT_RIGHT, /* style flags */
646 GX_STATUS_ACCEPTS_FOCUS, /* status flags */
647 sizeof(GX_PROMPT), /* control block size */
648 GX_COLOR_ID_SLIDER_TICK, /* normal color id */
649 GX_COLOR_ID_SELECTED_FILL, /* selected color id */
650 GX_COLOR_ID_SLIDER_TICK, /* disabled color id */
651 gx_studio_prompt_create, /* create function */
652 GX_NULL, /* drawing function override */
653 GX_NULL, /* event function override */
654 {581, 53, 619, 76}, /* widget size */
655 &main_window_window_1_define, /* next widget definition */
656 GX_NULL, /* no child widgets */
657 offsetof(MAIN_WINDOW_CONTROL_BLOCK, main_window_radius_prompt), /* control block */
658 (void *) &main_window_radius_prompt_properties /* extended properties */
659 };
660
661 GX_CONST GX_STUDIO_WIDGET main_window_radius_slider_define =
662 {
663 "radius_slider",
664 GX_TYPE_SLIDER, /* widget type */
665 ID_RADIUS_SLIDER, /* widget id */
666 #if defined(GX_WIDGET_USER_DATA)
667 0, /* user data */
668 #endif
669 GX_STYLE_BORDER_RAISED|GX_STYLE_ENABLED|GX_STYLE_SHOW_NEEDLE|GX_STYLE_SHOW_TICKMARKS, /* style flags */
670 GX_STATUS_ACCEPTS_FOCUS, /* status flags */
671 sizeof(GX_SLIDER), /* control block size */
672 GX_COLOR_ID_WIDGET_FILL, /* normal color id */
673 GX_COLOR_ID_WIDGET_FILL, /* selected color id */
674 GX_COLOR_ID_WIDGET_FILL, /* disabled color id */
675 gx_studio_slider_create, /* create function */
676 GX_NULL, /* drawing function override */
677 GX_NULL, /* event function override */
678 {454, 53, 570, 76}, /* widget size */
679 &main_window_radius_prompt_define, /* next widget definition */
680 GX_NULL, /* no child widgets */
681 offsetof(MAIN_WINDOW_CONTROL_BLOCK, main_window_radius_slider), /* control block */
682 (void *) &main_window_radius_slider_properties /* extended properties */
683 };
684
685 GX_CONST GX_STUDIO_WIDGET main_window_prompt_7_define =
686 {
687 "prompt_7",
688 GX_TYPE_PROMPT, /* widget type */
689 GX_ID_NONE, /* widget id */
690 #if defined(GX_WIDGET_USER_DATA)
691 0, /* user data */
692 #endif
693 GX_STYLE_BORDER_NONE|GX_STYLE_TRANSPARENT|GX_STYLE_TEXT_LEFT, /* style flags */
694 0, /* status flags */
695 sizeof(GX_PROMPT), /* control block size */
696 GX_COLOR_ID_TEXT_INPUT_TEXT, /* normal color id */
697 GX_COLOR_ID_SELECTED_FILL, /* selected color id */
698 GX_COLOR_ID_TEXT_INPUT_TEXT, /* disabled color id */
699 gx_studio_prompt_create, /* create function */
700 GX_NULL, /* drawing function override */
701 GX_NULL, /* event function override */
702 {417, 27, 502, 50}, /* widget size */
703 &main_window_radius_slider_define, /* next widget definition */
704 GX_NULL, /* no child widgets */
705 offsetof(MAIN_WINDOW_CONTROL_BLOCK, main_window_prompt_7), /* control block */
706 (void *) &main_window_prompt_7_properties /* extended properties */
707 };
708
709 GX_CONST GX_STUDIO_WIDGET main_window_checkbox_pixelmap_fill_define =
710 {
711 "checkbox_pixelmap_fill",
712 GX_TYPE_CHECKBOX, /* widget type */
713 ID_PIXELMAP_FILL, /* widget id */
714 #if defined(GX_WIDGET_USER_DATA)
715 0, /* user data */
716 #endif
717 GX_STYLE_BORDER_NONE|GX_STYLE_TRANSPARENT|GX_STYLE_ENABLED|GX_STYLE_BUTTON_TOGGLE|GX_STYLE_TEXT_LEFT, /* style flags */
718 GX_STATUS_ACCEPTS_FOCUS, /* status flags */
719 sizeof(GX_CHECKBOX), /* control block size */
720 GX_COLOR_ID_BTN_LOWER, /* normal color id */
721 GX_COLOR_ID_BTN_UPPER, /* selected color id */
722 GX_COLOR_ID_BTN_LOWER, /* disabled color id */
723 gx_studio_checkbox_create, /* create function */
724 GX_NULL, /* drawing function override */
725 GX_NULL, /* event function override */
726 {420, 279, 543, 302}, /* widget size */
727 &main_window_prompt_7_define, /* next widget definition */
728 GX_NULL, /* no child widgets */
729 offsetof(MAIN_WINDOW_CONTROL_BLOCK, main_window_checkbox_pixelmap_fill), /* control block */
730 (void *) &main_window_checkbox_pixelmap_fill_properties /* extended properties */
731 };
732
733 GX_CONST GX_STUDIO_WIDGET main_window_checkbox_fill_define =
734 {
735 "checkbox_fill",
736 GX_TYPE_CHECKBOX, /* widget type */
737 ID_SOLID_FILL, /* widget id */
738 #if defined(GX_WIDGET_USER_DATA)
739 0, /* user data */
740 #endif
741 GX_STYLE_BORDER_NONE|GX_STYLE_TRANSPARENT|GX_STYLE_ENABLED|GX_STYLE_BUTTON_PUSHED|GX_STYLE_BUTTON_TOGGLE|GX_STYLE_TEXT_LEFT, /* style flags */
742 GX_STATUS_ACCEPTS_FOCUS, /* status flags */
743 sizeof(GX_CHECKBOX), /* control block size */
744 GX_COLOR_ID_BTN_LOWER, /* normal color id */
745 GX_COLOR_ID_BTN_UPPER, /* selected color id */
746 GX_COLOR_ID_BTN_LOWER, /* disabled color id */
747 gx_studio_checkbox_create, /* create function */
748 GX_NULL, /* drawing function override */
749 GX_NULL, /* event function override */
750 {420, 244, 543, 267}, /* widget size */
751 &main_window_checkbox_pixelmap_fill_define, /* next widget definition */
752 GX_NULL, /* no child widgets */
753 offsetof(MAIN_WINDOW_CONTROL_BLOCK, main_window_checkbox_fill), /* control block */
754 (void *) &main_window_checkbox_fill_properties /* extended properties */
755 };
756
757 GX_CONST GX_STUDIO_WIDGET main_window_prompt_4_define =
758 {
759 "prompt_4",
760 GX_TYPE_PROMPT, /* widget type */
761 GX_ID_NONE, /* widget id */
762 #if defined(GX_WIDGET_USER_DATA)
763 0, /* user data */
764 #endif
765 GX_STYLE_BORDER_NONE|GX_STYLE_TRANSPARENT|GX_STYLE_ENABLED|GX_STYLE_TEXT_LEFT, /* style flags */
766 GX_STATUS_ACCEPTS_FOCUS, /* status flags */
767 sizeof(GX_PROMPT), /* control block size */
768 GX_COLOR_ID_WIDGET_FILL, /* normal color id */
769 GX_COLOR_ID_SELECTED_FILL, /* selected color id */
770 GX_COLOR_ID_WIDGET_FILL, /* disabled color id */
771 gx_studio_prompt_create, /* create function */
772 GX_NULL, /* drawing function override */
773 GX_NULL, /* event function override */
774 {419, 144, 550, 167}, /* widget size */
775 &main_window_checkbox_fill_define, /* next widget definition */
776 GX_NULL, /* no child widgets */
777 offsetof(MAIN_WINDOW_CONTROL_BLOCK, main_window_prompt_4), /* control block */
778 (void *) &main_window_prompt_4_properties /* extended properties */
779 };
780
781 GX_CONST GX_STUDIO_WIDGET main_window_checkbox_anti_alised_define =
782 {
783 "checkbox_anti_alised",
784 GX_TYPE_CHECKBOX, /* widget type */
785 ID_ANTI_ALIASED, /* widget id */
786 #if defined(GX_WIDGET_USER_DATA)
787 0, /* user data */
788 #endif
789 GX_STYLE_BORDER_NONE|GX_STYLE_TRANSPARENT|GX_STYLE_ENABLED|GX_STYLE_BUTTON_PUSHED|GX_STYLE_BUTTON_TOGGLE|GX_STYLE_TEXT_LEFT, /* style flags */
790 GX_STATUS_ACCEPTS_FOCUS, /* status flags */
791 sizeof(GX_CHECKBOX), /* control block size */
792 GX_COLOR_ID_BTN_LOWER, /* normal color id */
793 GX_COLOR_ID_BTN_UPPER, /* selected color id */
794 GX_COLOR_ID_BTN_LOWER, /* disabled color id */
795 gx_studio_checkbox_create, /* create function */
796 GX_NULL, /* drawing function override */
797 GX_NULL, /* event function override */
798 {420, 174, 544, 197}, /* widget size */
799 &main_window_prompt_4_define, /* next widget definition */
800 GX_NULL, /* no child widgets */
801 offsetof(MAIN_WINDOW_CONTROL_BLOCK, main_window_checkbox_anti_alised), /* control block */
802 (void *) &main_window_checkbox_anti_alised_properties /* extended properties */
803 };
804
805 GX_CONST GX_STUDIO_WIDGET main_window_graphics_window_define =
806 {
807 "graphics_window",
808 GX_TYPE_WINDOW, /* widget type */
809 ID_GRAPHICS_WINDOW, /* widget id */
810 #if defined(GX_WIDGET_USER_DATA)
811 0, /* user data */
812 #endif
813 GX_STYLE_BORDER_THIN|GX_STYLE_TILE_WALLPAPER, /* style flags */
814 GX_STATUS_ACCEPTS_FOCUS, /* status flags */
815 sizeof(GX_WINDOW), /* control block size */
816 GX_COLOR_ID_TEXT_INPUT_TEXT, /* normal color id */
817 GX_COLOR_ID_TEXT_INPUT_TEXT, /* selected color id */
818 GX_COLOR_ID_TEXT_INPUT_TEXT, /* disabled color id */
819 gx_studio_window_create, /* create function */
820 (VOID (*)(GX_WIDGET *)) graphics_draw, /* drawing function override */
821 GX_NULL, /* event function override */
822 {28, 24, 397, 425}, /* widget size */
823 &main_window_checkbox_anti_alised_define, /* next widget definition */
824 GX_NULL, /* no child widgets */
825 offsetof(MAIN_WINDOW_CONTROL_BLOCK, main_window_graphics_window), /* control block */
826 (void *) &main_window_graphics_window_properties /* extended properties */
827 };
828
829 GX_CONST GX_STUDIO_WIDGET main_window_define =
830 {
831 "main_window",
832 GX_TYPE_WINDOW, /* widget type */
833 ID_CIRCLE_SCREEN, /* widget id */
834 #if defined(GX_WIDGET_USER_DATA)
835 0, /* user data */
836 #endif
837 GX_STYLE_BORDER_NONE, /* style flags */
838 GX_STATUS_ACCEPTS_FOCUS, /* status flags */
839 sizeof(MAIN_WINDOW_CONTROL_BLOCK), /* control block size */
840 GX_COLOR_ID_SELECTED_TEXT, /* normal color id */
841 GX_COLOR_ID_SELECTED_TEXT, /* selected color id */
842 GX_COLOR_ID_SELECTED_TEXT, /* disabled color id */
843 gx_studio_window_create, /* create function */
844 GX_NULL, /* drawing function override */
845 (UINT (*)(GX_WIDGET *, GX_EVENT *)) main_event_handler, /* event function override */
846 {0, 0, 638, 478}, /* widget size */
847 GX_NULL, /* next widget */
848 &main_window_graphics_window_define, /* child widget */
849 0, /* control block */
850 (void *) &main_window_properties /* extended properties */
851 };
852 GX_CONST GX_STUDIO_WIDGET_ENTRY shapes_widget_table[] =
853 {
854 { &main_window_define, (GX_WIDGET *) &main_window },
855 {GX_NULL, GX_NULL}
856 };
857
gx_studio_nested_widget_create(GX_BYTE * control,GX_CONST GX_STUDIO_WIDGET * definition,GX_WIDGET * parent)858 static GX_WIDGET *gx_studio_nested_widget_create(GX_BYTE *control, GX_CONST GX_STUDIO_WIDGET *definition, GX_WIDGET *parent)
859 {
860 UINT status = GX_SUCCESS;
861 GX_WIDGET *widget = GX_NULL;
862 GX_VALUE list_count = 0;
863 GX_VALUE list_total_count = 0;
864
865 if(parent && (parent->gx_widget_type == GX_TYPE_MENU))
866 {
867 list_total_count = ((GX_MENU *)parent)->gx_menu_list_total_count;
868 }
869
870 while(definition && status == GX_SUCCESS)
871 {
872 if (definition->create_function)
873 {
874 if (definition->style & GX_STYLE_DYNAMICALLY_ALLOCATED)
875 {
876 status = gx_widget_allocate(&widget, definition->control_block_size);
877 if (status != GX_SUCCESS)
878 {
879 return GX_NULL;
880 }
881 }
882 else
883 {
884 if (control == GX_NULL)
885 {
886 return GX_NULL;
887 }
888 widget = (GX_WIDGET *) (control + definition->control_block_offset);
889 }
890
891 status = definition->create_function(definition, widget, parent);
892
893 if(list_count < list_total_count)
894 {
895 gx_menu_insert((GX_MENU *)parent, widget);
896 ((GX_MENU *)parent)->gx_menu_list_total_count--;
897 list_count++;
898 }
899
900 if (status == GX_SUCCESS)
901 {
902 if (definition->widget_type != GX_TYPE_TEMPLATE)
903 {
904 #if defined(GUIX_5_4_0_COMPATIBILITY)
905 gx_widget_fill_color_set(widget, definition->normal_fill_color_id, definition->selected_fill_color_id);
906 #else
907 gx_widget_fill_color_set(widget, definition->normal_fill_color_id, definition->selected_fill_color_id, definition->disabled_fill_color_id);
908 #endif
909 }
910
911 if (!(definition->status & GX_STATUS_ACCEPTS_FOCUS))
912 {
913 gx_widget_status_remove(widget, GX_STATUS_ACCEPTS_FOCUS);
914 }
915
916 if (definition->draw_function)
917 {
918 gx_widget_draw_set(widget, definition->draw_function);
919 }
920 if (definition->event_function)
921 {
922 gx_widget_event_process_set(widget, definition->event_function);
923 }
924
925 #if defined(GX_WIDGET_USER_DATA)
926 widget->gx_widget_user_data = definition->user_data;
927 #endif
928
929 if (definition->child_widget)
930 {
931 gx_studio_nested_widget_create(control, definition->child_widget, widget);
932 }
933 }
934 definition = definition->next_widget;
935 }
936 }
937 return widget;
938 }
939
gx_studio_widget_create(GX_BYTE * control,GX_CONST GX_STUDIO_WIDGET * definition,GX_WIDGET * parent)940 GX_WIDGET *gx_studio_widget_create(GX_BYTE *control, GX_CONST GX_STUDIO_WIDGET *definition, GX_WIDGET *parent)
941 {
942 GX_WIDGET *widget;
943 widget = gx_studio_nested_widget_create(control, definition, GX_NULL);
944
945 if (parent && widget)
946 {
947 gx_widget_attach(parent, widget);
948 }
949 return widget;
950 }
951
gx_studio_named_widget_create(char * name,GX_WIDGET * parent,GX_WIDGET ** new_widget)952 UINT gx_studio_named_widget_create(char *name, GX_WIDGET *parent, GX_WIDGET **new_widget)
953 {
954 UINT status = GX_FAILURE;
955 GX_CONST GX_STUDIO_WIDGET_ENTRY *entry = shapes_widget_table;
956 GX_WIDGET *widget = GX_NULL;
957
958 while(entry->widget_information)
959 {
960 if (!strcmp(name, entry->widget_information->widget_name))
961 {
962 widget = gx_studio_widget_create((GX_BYTE *) entry->widget, entry->widget_information, parent);
963 if (widget)
964 {
965 status = GX_SUCCESS;
966 }
967 break;
968 }
969 entry++;
970 }
971
972 if (new_widget)
973 {
974 *new_widget = widget;
975 }
976 return status;
977 }
978
979
gx_studio_display_configure(USHORT display,UINT (* driver)(GX_DISPLAY *),GX_UBYTE language,USHORT theme,GX_WINDOW_ROOT ** return_root)980 UINT gx_studio_display_configure(USHORT display, UINT (*driver)(GX_DISPLAY *),
981 GX_UBYTE language, USHORT theme, GX_WINDOW_ROOT **return_root)
982 {
983 GX_CONST GX_THEME *theme_ptr;
984 GX_RECTANGLE size;
985
986 GX_STUDIO_DISPLAY_INFO *display_info = &shapes_display_table[display];
987
988
989 /* create the requested display */
990
991 gx_display_create(display_info->display,
992 display_info->name,
993 driver,
994 (GX_VALUE) display_info->x_resolution,
995 (GX_VALUE) display_info->y_resolution);
996
997
998 /* install the request theme */
999
1000 if(display_info->theme_table)
1001 {
1002 theme_ptr = display_info->theme_table[theme];
1003 if(theme_ptr)
1004 {
1005 gx_display_color_table_set(display_info->display, theme_ptr->theme_color_table, theme_ptr->theme_color_table_size);
1006
1007 /* install the color palette if required */
1008 if (display_info->display->gx_display_driver_palette_set &&
1009 theme_ptr->theme_palette != NULL)
1010 {
1011 display_info->display->gx_display_driver_palette_set(display_info->display, theme_ptr->theme_palette, theme_ptr->theme_palette_size);
1012 }
1013
1014 gx_display_font_table_set(display_info->display, theme_ptr->theme_font_table, theme_ptr->theme_font_table_size);
1015 gx_display_pixelmap_table_set(display_info->display, theme_ptr->theme_pixelmap_table, theme_ptr->theme_pixelmap_table_size);
1016 gx_system_scroll_appearance_set(theme_ptr->theme_vertical_scroll_style, (GX_SCROLLBAR_APPEARANCE *) &theme_ptr->theme_vertical_scrollbar_appearance);
1017 gx_system_scroll_appearance_set(theme_ptr->theme_horizontal_scroll_style, (GX_SCROLLBAR_APPEARANCE *) &theme_ptr->theme_horizontal_scrollbar_appearance);
1018 }
1019 }
1020
1021 /* Install the language table. */
1022
1023 if(display_info->language_table)
1024 {
1025 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);
1026 gx_display_active_language_set(display_info->display, language);
1027 }
1028
1029 /* Set screen rotation angle. */
1030
1031 display_info->display->gx_display_rotation_angle = display_info->rotation_angle;
1032
1033 /* create the canvas for this display */
1034
1035 gx_canvas_create(display_info->canvas,
1036 display_info->canvas_name,
1037 display_info->display,
1038 GX_CANVAS_MANAGED | GX_CANVAS_VISIBLE,
1039 display_info->x_resolution,
1040 display_info->y_resolution,
1041 display_info->canvas_memory,
1042 display_info->canvas_memory_size);
1043
1044 /* Create the root window for this canvas */
1045
1046 gx_utility_rectangle_define(&size,
1047 0, 0,
1048 (GX_VALUE) (display_info->x_resolution - 1),
1049 (GX_VALUE) (display_info->y_resolution - 1));
1050
1051 gx_window_root_create(display_info->root_window,
1052 display_info->name,
1053 display_info->canvas, GX_STYLE_NONE, 0, &size);
1054 if (return_root)
1055 {
1056 *return_root = display_info->root_window;
1057 }
1058 return GX_SUCCESS;
1059 }
1060 #undef GUIX_STUDIO_GENERATED_FILE
1061