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