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:08 */
10 /*******************************************************************************/
11
12
13 #define GUIX_STUDIO_GENERATED_FILE
14 #include <stddef.h>
15 #include "alphamap_16bppdriver_resources.h"
16 #include "alphamap_16bppdriver_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 WINDOW_CONTROL_BLOCK 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[153600];
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 alphamap_16bppdriver_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 614400, /* canvas memory size in bytes */
45 0 /* rotation angle */
46 }
47 };
48
49
gx_studio_icon_button_create(GX_CONST GX_STUDIO_WIDGET * info,GX_WIDGET * control_block,GX_WIDGET * parent)50 UINT gx_studio_icon_button_create(GX_CONST GX_STUDIO_WIDGET *info, GX_WIDGET *control_block, GX_WIDGET *parent)
51 {
52 UINT status;
53 GX_ICON_BUTTON *button = (GX_ICON_BUTTON *) control_block;
54 GX_ICON_BUTTON_PROPERTIES *props = (GX_ICON_BUTTON_PROPERTIES *) info->properties;
55 status = gx_icon_button_create(button, info->widget_name, parent, props->pixelmap_id, info->style, info->widget_id, &info->size);
56 return status;
57 }
58
gx_studio_pixelmap_button_create(GX_CONST GX_STUDIO_WIDGET * info,GX_WIDGET * control_block,GX_WIDGET * parent)59 UINT gx_studio_pixelmap_button_create(GX_CONST GX_STUDIO_WIDGET *info, GX_WIDGET *control_block, GX_WIDGET *parent)
60 {
61 UINT status;
62 GX_PIXELMAP_BUTTON *button = (GX_PIXELMAP_BUTTON *) control_block;
63 GX_PIXELMAP_BUTTON_PROPERTIES *props = (GX_PIXELMAP_BUTTON_PROPERTIES *) info->properties;
64 status = gx_pixelmap_button_create(button, info->widget_name, parent,
65 props->normal_pixelmap_id,
66 props->selected_pixelmap_id,
67 props->disabled_pixelmap_id,
68 info->style, info->widget_id, &info->size);
69 return status;
70 }
71
gx_studio_icon_create(GX_CONST GX_STUDIO_WIDGET * info,GX_WIDGET * control_block,GX_WIDGET * parent)72 UINT gx_studio_icon_create(GX_CONST GX_STUDIO_WIDGET *info, GX_WIDGET *control_block, GX_WIDGET *parent)
73 {
74 UINT status;
75 GX_ICON *icon = (GX_ICON *) control_block;
76 GX_ICON_PROPERTIES *props = (GX_ICON_PROPERTIES *) info->properties;
77 status = gx_icon_create(icon, info->widget_name, parent, props->normal_pixelmap_id, info->style, info->widget_id, info->size.gx_rectangle_left, info->size.gx_rectangle_top);
78 if (props->selected_pixelmap_id)
79 {
80 gx_icon_pixelmap_set(icon, props->normal_pixelmap_id, props->selected_pixelmap_id);
81 }
82 else
83 {
84 gx_widget_resize((GX_WIDGET *)icon, (GX_RECTANGLE *)&info->size);
85 }
86 return status;
87 }
88
gx_studio_pixelmap_slider_create(GX_CONST GX_STUDIO_WIDGET * info,GX_WIDGET * control_block,GX_WIDGET * parent)89 UINT gx_studio_pixelmap_slider_create(GX_CONST GX_STUDIO_WIDGET *info, GX_WIDGET *control_block, GX_WIDGET *parent)
90 {
91 UINT status;
92 GX_PIXELMAP_SLIDER *slider = (GX_PIXELMAP_SLIDER *) control_block;
93 GX_PIXELMAP_SLIDER_PROPERTIES *props = (GX_PIXELMAP_SLIDER_PROPERTIES *) info->properties;
94 GX_PIXELMAP_SLIDER_INFO pixelmap_info;
95 GX_SLIDER_INFO slider_info;
96 slider_info.gx_slider_info_min_val = props->min_val;
97 slider_info.gx_slider_info_max_val = props->max_val;
98 slider_info.gx_slider_info_current_val = props->current_val;
99 slider_info.gx_slider_info_increment = props->increment;
100 slider_info.gx_slider_info_min_travel = props->min_travel;
101 slider_info.gx_slider_info_max_travel = props->max_travel;
102 slider_info.gx_slider_info_needle_width = props->needle_width;
103 slider_info.gx_slider_info_needle_height = props->needle_height;
104 slider_info.gx_slider_info_needle_inset = props->needle_inset;
105 slider_info.gx_slider_info_needle_hotspot_offset = props->needle_hotspot;
106 pixelmap_info.gx_pixelmap_slider_info_lower_background_pixelmap = props->lower_pixelmap;
107 pixelmap_info.gx_pixelmap_slider_info_upper_background_pixelmap = props->upper_pixelmap;
108 pixelmap_info.gx_pixelmap_slider_info_needle_pixelmap = props->needle_pixelmap;
109 status = gx_pixelmap_slider_create(slider,
110 info->widget_name,
111 parent,
112 &slider_info,
113 &pixelmap_info,
114 info->style,
115 info->widget_id,
116 &info->size);
117 return status;
118 }
119
gx_studio_prompt_create(GX_CONST GX_STUDIO_WIDGET * info,GX_WIDGET * control_block,GX_WIDGET * parent)120 UINT gx_studio_prompt_create(GX_CONST GX_STUDIO_WIDGET *info, GX_WIDGET *control_block, GX_WIDGET *parent)
121 {
122 UINT status;
123 GX_PROMPT *prompt = (GX_PROMPT *) control_block;
124 GX_PROMPT_PROPERTIES *props = (GX_PROMPT_PROPERTIES *) info->properties;
125 status = gx_prompt_create(prompt, info->widget_name, parent, props->string_id, info->style, info->widget_id, &info->size);
126 if (status == GX_SUCCESS)
127 {
128 gx_prompt_font_set(prompt, props->font_id);
129 #if defined(GUIX_5_4_0_COMPATIBILITY)
130 gx_prompt_text_color_set(prompt, props->normal_text_color_id, props->selected_text_color_id);
131 #else
132 gx_prompt_text_color_set(prompt, props->normal_text_color_id, props->selected_text_color_id, props->disabled_text_color_id);
133 #endif
134 }
135 return status;
136 }
137
gx_studio_pixelmap_prompt_create(GX_CONST GX_STUDIO_WIDGET * info,GX_WIDGET * control_block,GX_WIDGET * parent)138 UINT gx_studio_pixelmap_prompt_create(GX_CONST GX_STUDIO_WIDGET *info, GX_WIDGET *control_block, GX_WIDGET *parent)
139 {
140 UINT status;
141 GX_PIXELMAP_PROMPT *pix_prompt = (GX_PIXELMAP_PROMPT *) control_block;
142 GX_PROMPT *prompt = (GX_PROMPT *) pix_prompt;
143 GX_PIXELMAP_PROMPT_PROPERTIES *props = (GX_PIXELMAP_PROMPT_PROPERTIES *) info->properties;
144 status = gx_pixelmap_prompt_create(pix_prompt, info->widget_name, parent,
145 props->string_id,
146 props->fill_map_id,
147 info->style, info->widget_id, &info->size);
148
149 if (status == GX_SUCCESS)
150 {
151 gx_pixelmap_prompt_pixelmap_set(pix_prompt,
152 props->left_map_id,
153 props->fill_map_id,
154 props->right_map_id,
155 props->selected_left_map_id,
156 props->selected_fill_map_id,
157 props->selected_right_map_id);
158 gx_prompt_font_set(prompt, props->font_id);
159 #if defined(GUIX_5_4_0_COMPATIBILITY)
160 gx_prompt_text_color_set(prompt, props->normal_text_color_id, props->selected_text_color_id);
161 #else
162 gx_prompt_text_color_set(prompt, props->normal_text_color_id, props->selected_text_color_id, props->disabled_text_color_id);
163 #endif
164 }
165 return status;
166 }
167
gx_studio_window_create(GX_CONST GX_STUDIO_WIDGET * info,GX_WIDGET * control_block,GX_WIDGET * parent)168 UINT gx_studio_window_create(GX_CONST GX_STUDIO_WIDGET *info, GX_WIDGET *control_block, GX_WIDGET *parent)
169 {
170 UINT status;
171 GX_WINDOW *window = (GX_WINDOW *) control_block;
172 GX_WINDOW_PROPERTIES *props = (GX_WINDOW_PROPERTIES *) info->properties;
173 status = gx_window_create(window, info->widget_name, parent, info->style, info->widget_id, &info->size);
174 if (status == GX_SUCCESS)
175 {
176 if (props->wallpaper_id)
177 {
178 gx_window_wallpaper_set(window, props->wallpaper_id, info->style & GX_STYLE_TILE_WALLPAPER);
179 }
180 }
181 return status;
182 }
183 GX_WINDOW_PROPERTIES window_properties =
184 {
185 GX_PIXELMAP_ID_RED_APPLE /* wallpaper pixelmap id */
186 };
187 GX_PIXELMAP_BUTTON_PROPERTIES window_pixelmap_button_1_properties =
188 {
189 GX_PIXELMAP_ID_RED_APPLE, /* normal pixelmap id */
190 GX_PIXELMAP_ID_RED_APPLE, /* selected pixelmap id */
191 0 /* disabled pixelmap id */
192 };
193 GX_ICON_BUTTON_PROPERTIES window_icon_button_1_properties =
194 {
195 GX_PIXELMAP_ID_RED_APPLE /* pixelmap id */
196 };
197 GX_ICON_PROPERTIES window_icon_2_properties =
198 {
199 GX_PIXELMAP_ID_RED_APPLE, /* normal pixelmap id */
200 0 /* selected pixelmap id */
201 };
202 GX_PIXELMAP_PROMPT_PROPERTIES window_prompt_1_properties =
203 {
204 GX_STRING_ID_STRING_5, /* string id */
205 GX_FONT_ID_PROMPT, /* font id */
206 GX_COLOR_ID_TEXT, /* normal text color */
207 GX_COLOR_ID_SELECTED_TEXT, /* selected text color */
208 GX_COLOR_ID_TEXT, /* disabled text color */
209 GX_PIXELMAP_ID_RED_APPLE, /* left pixelmap id */
210 0, /* fill pixelmap id */
211 GX_PIXELMAP_ID_RED_APPLE, /* right pixelmap id */
212 0, /* selected left pixelmap id */
213 0, /* selected fill pixelmap id */
214 0 /* selected right pixelmap id */
215 };
216 GX_PIXELMAP_SLIDER_PROPERTIES window_pixelmap_slider_1_properties =
217 {
218 0, /* minimum value */
219 100, /* maximum value */
220 50, /* current value */
221 10, /* increment */
222 0, /* minimum travel */
223 0, /* maximum travel */
224 5, /* needle width */
225 10, /* needle height */
226 5, /* needle inset */
227 2, /* needle hotspot */
228 GX_PIXELMAP_ID_RED_APPLE, /* lower pixelmap id */
229 GX_PIXELMAP_ID_RED_APPLE, /* upper pixelmap id */
230 GX_PIXELMAP_ID_RED_APPLE /* needle pixelmap id */
231 };
232 GX_PROMPT_PROPERTIES window_prompt_2_properties =
233 {
234 GX_STRING_ID_STRING_2, /* string id */
235 GX_FONT_ID_PROMPT, /* font id */
236 GX_COLOR_ID_TEXT, /* normal text color */
237 GX_COLOR_ID_SELECTED_TEXT, /* selected text color */
238 GX_COLOR_ID_TEXT /* disabled text color */
239 };
240 GX_PROMPT_PROPERTIES window_prompt_3_properties =
241 {
242 GX_STRING_ID_STRING_3, /* string id */
243 GX_FONT_ID_PROMPT, /* font id */
244 GX_COLOR_ID_TEXT, /* normal text color */
245 GX_COLOR_ID_SELECTED_TEXT, /* selected text color */
246 GX_COLOR_ID_TEXT /* disabled text color */
247 };
248 GX_PROMPT_PROPERTIES window_prompt_4_properties =
249 {
250 GX_STRING_ID_STRING_4, /* string id */
251 GX_FONT_ID_PROMPT, /* font id */
252 GX_COLOR_ID_TEXT, /* normal text color */
253 GX_COLOR_ID_SELECTED_TEXT, /* selected text color */
254 GX_COLOR_ID_TEXT /* disabled text color */
255 };
256 GX_PROMPT_PROPERTIES window_prompt_5_properties =
257 {
258 GX_STRING_ID_STRING_6, /* string id */
259 GX_FONT_ID_PROMPT, /* font id */
260 GX_COLOR_ID_TEXT, /* normal text color */
261 GX_COLOR_ID_SELECTED_TEXT, /* selected text color */
262 GX_COLOR_ID_TEXT /* disabled text color */
263 };
264
265 GX_CONST GX_STUDIO_WIDGET window_prompt_5_define =
266 {
267 "prompt_5",
268 GX_TYPE_PROMPT, /* widget type */
269 GX_ID_NONE, /* widget id */
270 #if defined(GX_WIDGET_USER_DATA)
271 0, /* user data */
272 #endif
273 GX_STYLE_BORDER_THIN|GX_STYLE_ENABLED|GX_STYLE_TEXT_CENTER, /* style flags */
274 GX_STATUS_ACCEPTS_FOCUS, /* status flags */
275 sizeof(GX_PROMPT), /* control block size */
276 GX_COLOR_ID_WIDGET_FILL, /* normal color id */
277 GX_COLOR_ID_SELECTED_FILL, /* selected color id */
278 GX_COLOR_ID_WIDGET_FILL, /* disabled color id */
279 gx_studio_prompt_create, /* create function */
280 GX_NULL, /* drawing function override */
281 GX_NULL, /* event function override */
282 {434, 453, 574, 476}, /* widget size */
283 GX_NULL, /* no next widget */
284 GX_NULL, /* no child widgets */
285 offsetof(WINDOW_CONTROL_BLOCK, window_prompt_5), /* control block */
286 (void *) &window_prompt_5_properties /* extended properties */
287 };
288
289 GX_CONST GX_STUDIO_WIDGET window_prompt_4_define =
290 {
291 "prompt_4",
292 GX_TYPE_PROMPT, /* widget type */
293 GX_ID_NONE, /* widget id */
294 #if defined(GX_WIDGET_USER_DATA)
295 0, /* user data */
296 #endif
297 GX_STYLE_BORDER_THIN|GX_STYLE_ENABLED|GX_STYLE_TEXT_CENTER, /* style flags */
298 GX_STATUS_ACCEPTS_FOCUS, /* status flags */
299 sizeof(GX_PROMPT), /* control block size */
300 GX_COLOR_ID_WIDGET_FILL, /* normal color id */
301 GX_COLOR_ID_SELECTED_FILL, /* selected color id */
302 GX_COLOR_ID_WIDGET_FILL, /* disabled color id */
303 gx_studio_prompt_create, /* create function */
304 GX_NULL, /* drawing function override */
305 GX_NULL, /* event function override */
306 {5, 342, 137, 365}, /* widget size */
307 &window_prompt_5_define, /* next widget definition */
308 GX_NULL, /* no child widgets */
309 offsetof(WINDOW_CONTROL_BLOCK, window_prompt_4), /* control block */
310 (void *) &window_prompt_4_properties /* extended properties */
311 };
312
313 GX_CONST GX_STUDIO_WIDGET window_prompt_3_define =
314 {
315 "prompt_3",
316 GX_TYPE_PROMPT, /* widget type */
317 GX_ID_NONE, /* widget id */
318 #if defined(GX_WIDGET_USER_DATA)
319 0, /* user data */
320 #endif
321 GX_STYLE_BORDER_THIN|GX_STYLE_ENABLED|GX_STYLE_TEXT_CENTER, /* style flags */
322 GX_STATUS_ACCEPTS_FOCUS, /* status flags */
323 sizeof(GX_PROMPT), /* control block size */
324 GX_COLOR_ID_WIDGET_FILL, /* normal color id */
325 GX_COLOR_ID_SELECTED_FILL, /* selected color id */
326 GX_COLOR_ID_WIDGET_FILL, /* disabled color id */
327 gx_studio_prompt_create, /* create function */
328 GX_NULL, /* drawing function override */
329 GX_NULL, /* event function override */
330 {358, 259, 407, 282}, /* widget size */
331 &window_prompt_4_define, /* next widget definition */
332 GX_NULL, /* no child widgets */
333 offsetof(WINDOW_CONTROL_BLOCK, window_prompt_3), /* control block */
334 (void *) &window_prompt_3_properties /* extended properties */
335 };
336
337 GX_CONST GX_STUDIO_WIDGET window_prompt_2_define =
338 {
339 "prompt_2",
340 GX_TYPE_PROMPT, /* widget type */
341 GX_ID_NONE, /* widget id */
342 #if defined(GX_WIDGET_USER_DATA)
343 0, /* user data */
344 #endif
345 GX_STYLE_BORDER_THIN|GX_STYLE_ENABLED|GX_STYLE_TEXT_CENTER, /* style flags */
346 GX_STATUS_ACCEPTS_FOCUS, /* status flags */
347 sizeof(GX_PROMPT), /* control block size */
348 GX_COLOR_ID_WIDGET_FILL, /* normal color id */
349 GX_COLOR_ID_SELECTED_FILL, /* selected color id */
350 GX_COLOR_ID_WIDGET_FILL, /* disabled color id */
351 gx_studio_prompt_create, /* create function */
352 GX_NULL, /* drawing function override */
353 GX_NULL, /* event function override */
354 {500, 361, 629, 384}, /* widget size */
355 &window_prompt_3_define, /* next widget definition */
356 GX_NULL, /* no child widgets */
357 offsetof(WINDOW_CONTROL_BLOCK, window_prompt_2), /* control block */
358 (void *) &window_prompt_2_properties /* extended properties */
359 };
360
361 GX_CONST GX_STUDIO_WIDGET window_pixelmap_slider_1_define =
362 {
363 "pixelmap_slider_1",
364 GX_TYPE_PIXELMAP_SLIDER, /* widget type */
365 GX_ID_NONE, /* widget id */
366 #if defined(GX_WIDGET_USER_DATA)
367 0, /* user data */
368 #endif
369 GX_STYLE_BORDER_RAISED|GX_STYLE_ENABLED, /* style flags */
370 GX_STATUS_ACCEPTS_FOCUS, /* status flags */
371 sizeof(GX_PIXELMAP_SLIDER), /* control block size */
372 GX_COLOR_ID_BLUE, /* normal color id */
373 GX_COLOR_ID_BLUE, /* selected color id */
374 GX_COLOR_ID_BLUE, /* disabled color id */
375 gx_studio_pixelmap_slider_create, /* create function */
376 GX_NULL, /* drawing function override */
377 GX_NULL, /* event function override */
378 {113, 317, 522, 493}, /* widget size */
379 &window_prompt_2_define, /* next widget definition */
380 GX_NULL, /* no child widgets */
381 offsetof(WINDOW_CONTROL_BLOCK, window_pixelmap_slider_1), /* control block */
382 (void *) &window_pixelmap_slider_1_properties /* extended properties */
383 };
384
385 GX_CONST GX_STUDIO_WIDGET window_prompt_1_define =
386 {
387 "prompt_1",
388 GX_TYPE_PIXELMAP_PROMPT, /* widget type */
389 GX_ID_NONE, /* widget id */
390 #if defined(GX_WIDGET_USER_DATA)
391 0, /* user data */
392 #endif
393 GX_STYLE_BORDER_THIN|GX_STYLE_TRANSPARENT|GX_STYLE_ENABLED|GX_STYLE_TEXT_CENTER, /* style flags */
394 GX_STATUS_ACCEPTS_FOCUS, /* status flags */
395 sizeof(GX_PIXELMAP_PROMPT), /* control block size */
396 GX_COLOR_ID_SCROLL_FILL, /* normal color id */
397 GX_COLOR_ID_GREEN, /* selected color id */
398 GX_COLOR_ID_SCROLL_FILL, /* disabled color id */
399 gx_studio_pixelmap_prompt_create, /* create function */
400 GX_NULL, /* drawing function override */
401 GX_NULL, /* event function override */
402 {241, 6, 638, 167}, /* widget size */
403 &window_pixelmap_slider_1_define, /* next widget definition */
404 GX_NULL, /* no child widgets */
405 offsetof(WINDOW_CONTROL_BLOCK, window_prompt_1), /* control block */
406 (void *) &window_prompt_1_properties /* extended properties */
407 };
408
409 GX_CONST GX_STUDIO_WIDGET window_icon_2_define =
410 {
411 "icon_2",
412 GX_TYPE_ICON, /* widget type */
413 GX_ID_NONE, /* widget id */
414 #if defined(GX_WIDGET_USER_DATA)
415 0, /* user data */
416 #endif
417 GX_STYLE_BORDER_NONE|GX_STYLE_ENABLED|GX_STYLE_HALIGN_LEFT|GX_STYLE_VALIGN_TOP, /* style flags */
418 GX_STATUS_ACCEPTS_FOCUS, /* status flags */
419 sizeof(GX_ICON), /* control block size */
420 GX_COLOR_ID_BTN_UPPER, /* normal color id */
421 GX_COLOR_ID_SELECTED_FILL, /* selected color id */
422 GX_COLOR_ID_BTN_UPPER, /* disabled color id */
423 gx_studio_icon_create, /* create function */
424 GX_NULL, /* drawing function override */
425 GX_NULL, /* event function override */
426 {232, 176, 351, 339}, /* widget size */
427 &window_prompt_1_define, /* next widget definition */
428 GX_NULL, /* no child widgets */
429 offsetof(WINDOW_CONTROL_BLOCK, window_icon_2), /* control block */
430 (void *) &window_icon_2_properties /* extended properties */
431 };
432
433 GX_CONST GX_STUDIO_WIDGET window_icon_button_1_define =
434 {
435 "icon_button_1",
436 GX_TYPE_ICON_BUTTON, /* widget type */
437 GX_ID_NONE, /* widget id */
438 #if defined(GX_WIDGET_USER_DATA)
439 0, /* user data */
440 #endif
441 GX_STYLE_BORDER_RAISED|GX_STYLE_TRANSPARENT|GX_STYLE_ENABLED|GX_STYLE_HALIGN_CENTER|GX_STYLE_VALIGN_CENTER, /* style flags */
442 GX_STATUS_ACCEPTS_FOCUS, /* status flags */
443 sizeof(GX_ICON_BUTTON), /* control block size */
444 GX_COLOR_ID_WINDOW_BORDER, /* normal color id */
445 GX_COLOR_ID_BTN_UPPER, /* selected color id */
446 GX_COLOR_ID_WINDOW_BORDER, /* disabled color id */
447 gx_studio_icon_button_create, /* create function */
448 GX_NULL, /* drawing function override */
449 GX_NULL, /* event function override */
450 {488, 181, 635, 356}, /* widget size */
451 &window_icon_2_define, /* next widget definition */
452 GX_NULL, /* no child widgets */
453 offsetof(WINDOW_CONTROL_BLOCK, window_icon_button_1), /* control block */
454 (void *) &window_icon_button_1_properties /* extended properties */
455 };
456
457 GX_CONST GX_STUDIO_WIDGET window_pixelmap_button_1_define =
458 {
459 "pixelmap_button_1",
460 GX_TYPE_PIXELMAP_BUTTON, /* widget type */
461 GX_ID_NONE, /* widget id */
462 #if defined(GX_WIDGET_USER_DATA)
463 0, /* user data */
464 #endif
465 GX_STYLE_BORDER_NONE|GX_STYLE_ENABLED, /* style flags */
466 GX_STATUS_ACCEPTS_FOCUS, /* status flags */
467 sizeof(GX_PIXELMAP_BUTTON), /* control block size */
468 GX_COLOR_ID_RED, /* normal color id */
469 GX_COLOR_ID_BTN_UPPER, /* selected color id */
470 GX_COLOR_ID_RED, /* disabled color id */
471 gx_studio_pixelmap_button_create, /* create function */
472 GX_NULL, /* drawing function override */
473 GX_NULL, /* event function override */
474 {4, 177, 147, 344}, /* widget size */
475 &window_icon_button_1_define, /* next widget definition */
476 GX_NULL, /* no child widgets */
477 offsetof(WINDOW_CONTROL_BLOCK, window_pixelmap_button_1), /* control block */
478 (void *) &window_pixelmap_button_1_properties /* extended properties */
479 };
480
481 GX_CONST GX_STUDIO_WIDGET window_define =
482 {
483 "window",
484 GX_TYPE_WINDOW, /* widget type */
485 GX_ID_NONE, /* widget id */
486 #if defined(GX_WIDGET_USER_DATA)
487 0, /* user data */
488 #endif
489 GX_STYLE_BORDER_THIN|GX_STYLE_TRANSPARENT, /* style flags */
490 GX_STATUS_ACCEPTS_FOCUS, /* status flags */
491 sizeof(WINDOW_CONTROL_BLOCK), /* control block size */
492 GX_COLOR_ID_SELECTED_FILL, /* normal color id */
493 GX_COLOR_ID_SELECTED_FILL, /* selected color id */
494 GX_COLOR_ID_SELECTED_FILL, /* disabled color id */
495 gx_studio_window_create, /* create function */
496 (VOID (*)(GX_WIDGET *)) pic_win_draw, /* drawing function override */
497 GX_NULL, /* event function override */
498 {2, 1, 641, 480}, /* widget size */
499 GX_NULL, /* next widget */
500 &window_pixelmap_button_1_define, /* child widget */
501 0, /* control block */
502 (void *) &window_properties /* extended properties */
503 };
504 GX_CONST GX_STUDIO_WIDGET_ENTRY alphamap_16bppdriver_widget_table[] =
505 {
506 { &window_define, (GX_WIDGET *) &window },
507 {GX_NULL, GX_NULL}
508 };
509
gx_studio_nested_widget_create(GX_BYTE * control,GX_CONST GX_STUDIO_WIDGET * definition,GX_WIDGET * parent)510 static GX_WIDGET *gx_studio_nested_widget_create(GX_BYTE *control, GX_CONST GX_STUDIO_WIDGET *definition, GX_WIDGET *parent)
511 {
512 UINT status = GX_SUCCESS;
513 GX_WIDGET *widget = GX_NULL;
514 GX_VALUE list_count = 0;
515 GX_VALUE list_total_count = 0;
516
517 if(parent && (parent->gx_widget_type == GX_TYPE_MENU))
518 {
519 list_total_count = ((GX_MENU *)parent)->gx_menu_list_total_count;
520 }
521
522 while(definition && status == GX_SUCCESS)
523 {
524 if (definition->create_function)
525 {
526 if (definition->style & GX_STYLE_DYNAMICALLY_ALLOCATED)
527 {
528 status = gx_widget_allocate(&widget, definition->control_block_size);
529 if (status != GX_SUCCESS)
530 {
531 return GX_NULL;
532 }
533 }
534 else
535 {
536 if (control == GX_NULL)
537 {
538 return GX_NULL;
539 }
540 widget = (GX_WIDGET *) (control + definition->control_block_offset);
541 }
542
543 status = definition->create_function(definition, widget, parent);
544
545 if(list_count < list_total_count)
546 {
547 gx_menu_insert((GX_MENU *)parent, widget);
548 ((GX_MENU *)parent)->gx_menu_list_total_count--;
549 list_count++;
550 }
551
552 if (status == GX_SUCCESS)
553 {
554 if (definition->widget_type != GX_TYPE_TEMPLATE)
555 {
556 #if defined(GUIX_5_4_0_COMPATIBILITY)
557 gx_widget_fill_color_set(widget, definition->normal_fill_color_id, definition->selected_fill_color_id);
558 #else
559 gx_widget_fill_color_set(widget, definition->normal_fill_color_id, definition->selected_fill_color_id, definition->disabled_fill_color_id);
560 #endif
561 }
562
563 if (!(definition->status & GX_STATUS_ACCEPTS_FOCUS))
564 {
565 gx_widget_status_remove(widget, GX_STATUS_ACCEPTS_FOCUS);
566 }
567
568 if (definition->draw_function)
569 {
570 gx_widget_draw_set(widget, definition->draw_function);
571 }
572 if (definition->event_function)
573 {
574 gx_widget_event_process_set(widget, definition->event_function);
575 }
576
577 #if defined(GX_WIDGET_USER_DATA)
578 widget->gx_widget_user_data = definition->user_data;
579 #endif
580
581 if (definition->child_widget)
582 {
583 gx_studio_nested_widget_create(control, definition->child_widget, widget);
584 }
585 }
586 definition = definition->next_widget;
587 }
588 }
589 return widget;
590 }
591
gx_studio_widget_create(GX_BYTE * control,GX_CONST GX_STUDIO_WIDGET * definition,GX_WIDGET * parent)592 GX_WIDGET *gx_studio_widget_create(GX_BYTE *control, GX_CONST GX_STUDIO_WIDGET *definition, GX_WIDGET *parent)
593 {
594 GX_WIDGET *widget;
595 widget = gx_studio_nested_widget_create(control, definition, GX_NULL);
596
597 if (parent && widget)
598 {
599 gx_widget_attach(parent, widget);
600 }
601 return widget;
602 }
603
gx_studio_named_widget_create(char * name,GX_WIDGET * parent,GX_WIDGET ** new_widget)604 UINT gx_studio_named_widget_create(char *name, GX_WIDGET *parent, GX_WIDGET **new_widget)
605 {
606 UINT status = GX_FAILURE;
607 GX_CONST GX_STUDIO_WIDGET_ENTRY *entry = alphamap_16bppdriver_widget_table;
608 GX_WIDGET *widget = GX_NULL;
609
610 while(entry->widget_information)
611 {
612 if (!strcmp(name, entry->widget_information->widget_name))
613 {
614 widget = gx_studio_widget_create((GX_BYTE *) entry->widget, entry->widget_information, parent);
615 if (widget)
616 {
617 status = GX_SUCCESS;
618 }
619 break;
620 }
621 entry++;
622 }
623
624 if (new_widget)
625 {
626 *new_widget = widget;
627 }
628 return status;
629 }
630
631
gx_studio_display_configure(USHORT display,UINT (* driver)(GX_DISPLAY *),GX_UBYTE language,USHORT theme,GX_WINDOW_ROOT ** return_root)632 UINT gx_studio_display_configure(USHORT display, UINT (*driver)(GX_DISPLAY *),
633 GX_UBYTE language, USHORT theme, GX_WINDOW_ROOT **return_root)
634 {
635 GX_CONST GX_THEME *theme_ptr;
636 GX_RECTANGLE size;
637
638 GX_STUDIO_DISPLAY_INFO *display_info = &alphamap_16bppdriver_display_table[display];
639
640
641 /* create the requested display */
642
643 gx_display_create(display_info->display,
644 display_info->name,
645 driver,
646 (GX_VALUE) display_info->x_resolution,
647 (GX_VALUE) display_info->y_resolution);
648
649
650 /* install the request theme */
651
652 if(display_info->theme_table)
653 {
654 theme_ptr = display_info->theme_table[theme];
655 if(theme_ptr)
656 {
657 gx_display_color_table_set(display_info->display, theme_ptr->theme_color_table, theme_ptr->theme_color_table_size);
658
659 /* install the color palette if required */
660 if (display_info->display->gx_display_driver_palette_set &&
661 theme_ptr->theme_palette != NULL)
662 {
663 display_info->display->gx_display_driver_palette_set(display_info->display, theme_ptr->theme_palette, theme_ptr->theme_palette_size);
664 }
665
666 gx_display_font_table_set(display_info->display, theme_ptr->theme_font_table, theme_ptr->theme_font_table_size);
667 gx_display_pixelmap_table_set(display_info->display, theme_ptr->theme_pixelmap_table, theme_ptr->theme_pixelmap_table_size);
668 gx_system_scroll_appearance_set(theme_ptr->theme_vertical_scroll_style, (GX_SCROLLBAR_APPEARANCE *) &theme_ptr->theme_vertical_scrollbar_appearance);
669 gx_system_scroll_appearance_set(theme_ptr->theme_horizontal_scroll_style, (GX_SCROLLBAR_APPEARANCE *) &theme_ptr->theme_horizontal_scrollbar_appearance);
670 }
671 }
672
673 /* Install the language table. */
674
675 if(display_info->language_table)
676 {
677 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);
678 gx_display_active_language_set(display_info->display, language);
679 }
680
681 /* Set screen rotation angle. */
682
683 display_info->display->gx_display_rotation_angle = display_info->rotation_angle;
684
685 /* create the canvas for this display */
686
687 gx_canvas_create(display_info->canvas,
688 display_info->canvas_name,
689 display_info->display,
690 GX_CANVAS_MANAGED | GX_CANVAS_VISIBLE,
691 display_info->x_resolution,
692 display_info->y_resolution,
693 display_info->canvas_memory,
694 display_info->canvas_memory_size);
695
696 /* Create the root window for this canvas */
697
698 gx_utility_rectangle_define(&size,
699 0, 0,
700 (GX_VALUE) (display_info->x_resolution - 1),
701 (GX_VALUE) (display_info->y_resolution - 1));
702
703 gx_window_root_create(display_info->root_window,
704 display_info->name,
705 display_info->canvas, GX_STYLE_NONE, 0, &size);
706 if (return_root)
707 {
708 *return_root = display_info->root_window;
709 }
710 return GX_SUCCESS;
711 }
712 #undef GUIX_STUDIO_GENERATED_FILE
713