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