1
0
mirror of https://github.com/azure-rtos/guix.git synced 2025-01-28 07:03:11 +08:00
guix/tutorials/demo_guix_scrollbar/demo_guix_scrollbar_specifications.c
2022-10-26 23:43:10 +00:00

914 lines
49 KiB
C

/*******************************************************************************/
/* This file is auto-generated by Azure RTOS GUIX Studio. Do not edit this */
/* file by hand. Modifications to this file should only be made by running */
/* the Azure RTOS GUIX Studio application and re-generating the application */
/* specification file(s). For more information please refer to the Azure RTOS */
/* GUIX Studio User Guide, or visit our web site at azure.com/rtos */
/* */
/* GUIX Studio Revision 6.1.12.0 */
/* Date (dd.mm.yyyy): 25. 8.2022 Time (hh:mm): 18:44 */
/*******************************************************************************/
#define GUIX_STUDIO_GENERATED_FILE
#include <stddef.h>
#include "demo_guix_scrollbar_resources.h"
#include "demo_guix_scrollbar_specifications.h"
static GX_WIDGET *gx_studio_nested_widget_create(GX_BYTE *control, GX_CONST GX_STUDIO_WIDGET *definition, GX_WIDGET *parent);
MAIN_SCREEN_CONTROL_BLOCK main_screen;
GX_DISPLAY display_1_control_block;
GX_WINDOW_ROOT display_1_root_window;
GX_CANVAS display_1_canvas_control_block;
ULONG display_1_canvas_memory[307200];
extern GX_CONST GX_THEME *display_1_theme_table[];
extern GX_CONST GX_STRING *display_1_language_table[];
GX_STUDIO_DISPLAY_INFO demo_guix_scrollbar_display_table[1] =
{
{
"display_1",
"display_1_canvas",
display_1_theme_table,
display_1_language_table,
DISPLAY_1_THEME_TABLE_SIZE,
DISPLAY_1_LANGUAGE_TABLE_SIZE,
DISPLAY_1_STRING_TABLE_SIZE,
640, /* x resolution */
480, /* y resolution */
&display_1_control_block,
&display_1_canvas_control_block,
&display_1_root_window,
display_1_canvas_memory, /* canvas memory area */
1228800, /* canvas memory size in bytes */
GX_SCREEN_ROTATION_NONE /* rotation angle */
}
};
UINT gx_studio_icon_create(GX_CONST GX_STUDIO_WIDGET *info, GX_WIDGET *control_block, GX_WIDGET *parent)
{
UINT status;
GX_ICON *icon = (GX_ICON *) control_block;
GX_ICON_PROPERTIES *props = (GX_ICON_PROPERTIES *) info->properties;
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);
if (props->selected_pixelmap_id)
{
gx_icon_pixelmap_set(icon, props->normal_pixelmap_id, props->selected_pixelmap_id);
}
else
{
gx_widget_resize((GX_WIDGET *)icon, (GX_RECTANGLE *)&info->size);
}
return status;
}
UINT gx_studio_prompt_create(GX_CONST GX_STUDIO_WIDGET *info, GX_WIDGET *control_block, GX_WIDGET *parent)
{
UINT status;
GX_PROMPT *prompt = (GX_PROMPT *) control_block;
GX_PROMPT_PROPERTIES *props = (GX_PROMPT_PROPERTIES *) info->properties;
status = gx_prompt_create(prompt, info->widget_name, parent, props->string_id, info->style, info->widget_id, &info->size);
if (status == GX_SUCCESS)
{
gx_prompt_font_set(prompt, props->font_id);
#if defined(GUIX_5_4_0_COMPATIBILITY)
gx_prompt_text_color_set(prompt, props->normal_text_color_id, props->selected_text_color_id);
#else
gx_prompt_text_color_set(prompt, props->normal_text_color_id, props->selected_text_color_id, props->disabled_text_color_id);
#endif
}
return status;
}
UINT gx_studio_window_create(GX_CONST GX_STUDIO_WIDGET *info, GX_WIDGET *control_block, GX_WIDGET *parent)
{
UINT status;
GX_WINDOW *window = (GX_WINDOW *) control_block;
GX_WINDOW_PROPERTIES *props = (GX_WINDOW_PROPERTIES *) info->properties;
status = gx_window_create(window, info->widget_name, parent, info->style, info->widget_id, &info->size);
if (status == GX_SUCCESS)
{
if (props->wallpaper_id)
{
gx_window_wallpaper_set(window, props->wallpaper_id, info->style & GX_STYLE_TILE_WALLPAPER);
}
}
return status;
}
UINT gx_studio_horizontal_scrollbar_create(GX_CONST GX_STUDIO_WIDGET *info, GX_WIDGET *control_block, GX_WIDGET *parent)
{
UINT status;
GX_SCROLLBAR *scroll = (GX_SCROLLBAR *) control_block;
GX_SCROLLBAR_APPEARANCE *appearance = (GX_SCROLLBAR_APPEARANCE *) info->properties;
status = gx_horizontal_scrollbar_create(scroll, info->widget_name, parent, appearance, info->style);
return status;
}
UINT gx_studio_vertical_scrollbar_create(GX_CONST GX_STUDIO_WIDGET *info, GX_WIDGET *control_block, GX_WIDGET *parent)
{
UINT status;
GX_SCROLLBAR *scroll = (GX_SCROLLBAR *) control_block;
GX_SCROLLBAR_APPEARANCE *appearance = (GX_SCROLLBAR_APPEARANCE *) info->properties;
status = gx_vertical_scrollbar_create(scroll, info->widget_name, parent, appearance, info->style);
return status;
}
GX_WINDOW_PROPERTIES main_screen_properties =
{
0 /* wallpaper pixelmap id */
};
GX_PROMPT_PROPERTIES main_screen_title_properties =
{
GX_STRING_ID_STRING_4, /* string id */
GX_FONT_ID_TITLE, /* font id */
GX_COLOR_ID_LIGHT_SLATE_GRAY, /* normal text color */
GX_COLOR_ID_SELECTED_TEXT, /* selected text color */
GX_COLOR_ID_LIGHT_SLATE_GRAY /* disabled text color */
};
GX_ICON_PROPERTIES main_screen_logo_properties =
{
GX_PIXELMAP_ID_MS_AZURE_LOGO_SMALL, /* normal pixelmap id */
0 /* selected pixelmap id */
};
GX_WINDOW_PROPERTIES main_screen_frame_transparent_properties =
{
0 /* wallpaper pixelmap id */
};
GX_WINDOW_PROPERTIES main_screen_scrollable_frame_properties =
{
GX_PIXELMAP_ID_SCROLLABLE_WINDOW_BG /* wallpaper pixelmap id */
};
GX_SCROLLBAR_APPEARANCE main_screen_hscroll_transparent_properties =
{
30, /* scroll width */
8, /* thumb width */
20, /* thumb travel min */
20, /* thumb travel max */
4, /* thumb border style */
0, /* scroll fill pixelmap */
0, /* scroll thumb pixelmap */
0, /* scroll up pixelmap */
0, /* scroll down pixelmap */
GX_COLOR_ID_WHITE, /* scroll thumb color */
GX_COLOR_ID_WHITE, /* scroll thumb border color */
GX_COLOR_ID_CANVAS, /* scroll button color */
};
GX_SCROLLBAR_APPEARANCE main_screen_vscroll_transparent_properties =
{
20, /* scroll width */
8, /* thumb width */
20, /* thumb travel min */
20, /* thumb travel max */
4, /* thumb border style */
0, /* scroll fill pixelmap */
0, /* scroll thumb pixelmap */
0, /* scroll up pixelmap */
0, /* scroll down pixelmap */
GX_COLOR_ID_WHITE, /* scroll thumb color */
GX_COLOR_ID_WHITE, /* scroll thumb border color */
GX_COLOR_ID_CANVAS, /* scroll button color */
};
GX_WINDOW_PROPERTIES main_screen_frame_button_properties =
{
0 /* wallpaper pixelmap id */
};
GX_WINDOW_PROPERTIES main_screen_scrollable_frame_1_properties =
{
GX_PIXELMAP_ID_SCROLLABLE_WINDOW_BG /* wallpaper pixelmap id */
};
GX_SCROLLBAR_APPEARANCE main_screen_hscroll_button_properties =
{
20, /* scroll width */
16, /* thumb width */
22, /* thumb travel min */
22, /* thumb travel max */
4, /* thumb border style */
0, /* scroll fill pixelmap */
0, /* scroll thumb pixelmap */
0, /* scroll up pixelmap */
0, /* scroll down pixelmap */
GX_COLOR_ID_GREEN, /* scroll thumb color */
GX_COLOR_ID_GREEN, /* scroll thumb border color */
GX_COLOR_ID_CANVAS, /* scroll button color */
};
GX_SCROLLBAR_APPEARANCE main_screen_vscroll_button_properties =
{
20, /* scroll width */
16, /* thumb width */
22, /* thumb travel min */
22, /* thumb travel max */
4, /* thumb border style */
0, /* scroll fill pixelmap */
0, /* scroll thumb pixelmap */
0, /* scroll up pixelmap */
0, /* scroll down pixelmap */
GX_COLOR_ID_GREEN, /* scroll thumb color */
GX_COLOR_ID_GREEN, /* scroll thumb border color */
GX_COLOR_ID_CANVAS, /* scroll button color */
};
GX_WINDOW_PROPERTIES main_screen_frame_pixelmap_properties =
{
0 /* wallpaper pixelmap id */
};
GX_WINDOW_PROPERTIES main_screen_scrollable_frame_2_properties =
{
GX_PIXELMAP_ID_SCROLLABLE_WINDOW_BG /* wallpaper pixelmap id */
};
GX_SCROLLBAR_APPEARANCE main_screen_hscroll_pixelmap_properties =
{
10, /* scroll width */
6, /* thumb width */
2, /* thumb travel min */
2, /* thumb travel max */
4, /* thumb border style */
0, /* scroll fill pixelmap */
GX_PIXELMAP_ID_SCROLLABLE_WINDOW_BG, /* scroll thumb pixelmap */
0, /* scroll up pixelmap */
0, /* scroll down pixelmap */
GX_COLOR_ID_GREEN, /* scroll thumb color */
GX_COLOR_ID_GREEN, /* scroll thumb border color */
GX_COLOR_ID_CANVAS, /* scroll button color */
};
GX_SCROLLBAR_APPEARANCE main_screen_vscroll_pixelmap_properties =
{
10, /* scroll width */
6, /* thumb width */
2, /* thumb travel min */
2, /* thumb travel max */
4, /* thumb border style */
0, /* scroll fill pixelmap */
0, /* scroll thumb pixelmap */
0, /* scroll up pixelmap */
0, /* scroll down pixelmap */
GX_COLOR_ID_GREEN, /* scroll thumb color */
GX_COLOR_ID_GREEN, /* scroll thumb border color */
GX_COLOR_ID_CANVAS, /* scroll button color */
};
GX_PROMPT_PROPERTIES main_screen_prompt_properties =
{
GX_STRING_ID_STRING_2, /* string id */
GX_FONT_ID_PROMPT, /* font id */
GX_COLOR_ID_TEXT, /* normal text color */
GX_COLOR_ID_SELECTED_TEXT, /* selected text color */
GX_COLOR_ID_LIGHT_SLATE_GRAY /* disabled text color */
};
GX_PROMPT_PROPERTIES main_screen_prompt_1_properties =
{
GX_STRING_ID_STRING_3, /* string id */
GX_FONT_ID_PROMPT, /* font id */
GX_COLOR_ID_TEXT, /* normal text color */
GX_COLOR_ID_SELECTED_TEXT, /* selected text color */
GX_COLOR_ID_LIGHT_SLATE_GRAY /* disabled text color */
};
GX_PROMPT_PROPERTIES main_screen_prompt_2_properties =
{
GX_STRING_ID_STRING_5, /* string id */
GX_FONT_ID_PROMPT, /* font id */
GX_COLOR_ID_TEXT, /* normal text color */
GX_COLOR_ID_SELECTED_TEXT, /* selected text color */
GX_COLOR_ID_LIGHT_SLATE_GRAY /* disabled text color */
};
GX_CONST GX_STUDIO_WIDGET main_screen_vscroll_transparent_define =
{
"vscroll_transparent",
GX_TYPE_VERTICAL_SCROLL, /* widget type */
ID_VSCROLL, /* widget id */
#if defined(GX_WIDGET_USER_DATA)
0, /* user data */
#endif
GX_STYLE_BORDER_NONE|GX_STYLE_TRANSPARENT|GX_STYLE_ENABLED|GX_SCROLLBAR_RELATIVE_THUMB|GX_SCROLLBAR_VERTICAL, /* style flags */
0, /* status flags */
sizeof(GX_SCROLLBAR), /* control block size */
GX_COLOR_ID_WIDGET_FILL, /* normal color id */
GX_COLOR_ID_SELECTED_FILL, /* selected color id */
GX_COLOR_ID_WIDGET_FILL, /* disabled color id */
gx_studio_vertical_scrollbar_create, /* create function */
GX_NULL, /* drawing function override */
GX_NULL, /* event function override */
{266, 107, 285, 251}, /* widget size */
GX_NULL, /* no next widget */
GX_NULL, /* no child widgets */
offsetof(MAIN_SCREEN_CONTROL_BLOCK, main_screen_vscroll_transparent), /* control block */
(void *) &main_screen_vscroll_transparent_properties /* extended properties */
};
GX_CONST GX_STUDIO_WIDGET main_screen_hscroll_transparent_define =
{
"hscroll_transparent",
GX_TYPE_HORIZONTAL_SCROLL, /* widget type */
ID_HSCROLL, /* widget id */
#if defined(GX_WIDGET_USER_DATA)
0, /* user data */
#endif
GX_STYLE_BORDER_NONE|GX_STYLE_TRANSPARENT|GX_STYLE_ENABLED|GX_SCROLLBAR_RELATIVE_THUMB|GX_SCROLLBAR_HORIZONTAL, /* style flags */
0, /* status flags */
sizeof(GX_SCROLLBAR), /* control block size */
GX_COLOR_ID_TEAL, /* normal color id */
GX_COLOR_ID_TEAL, /* selected color id */
GX_COLOR_ID_TEAL, /* disabled color id */
gx_studio_horizontal_scrollbar_create, /* create function */
GX_NULL, /* drawing function override */
GX_NULL, /* event function override */
{65, 222, 285, 251}, /* widget size */
&main_screen_vscroll_transparent_define, /* next widget definition */
GX_NULL, /* no child widgets */
offsetof(MAIN_SCREEN_CONTROL_BLOCK, main_screen_hscroll_transparent), /* control block */
(void *) &main_screen_hscroll_transparent_properties /* extended properties */
};
GX_CONST GX_STUDIO_WIDGET main_screen_scrollable_frame_define =
{
"scrollable_frame",
GX_TYPE_WINDOW, /* widget type */
GX_ID_NONE, /* widget id */
#if defined(GX_WIDGET_USER_DATA)
0, /* user data */
#endif
GX_STYLE_BORDER_NONE, /* style flags */
0, /* status flags */
sizeof(GX_WINDOW), /* control block size */
GX_COLOR_ID_WINDOW_FILL, /* normal color id */
GX_COLOR_ID_WINDOW_FILL, /* selected color id */
GX_COLOR_ID_WINDOW_FILL, /* disabled color id */
gx_studio_window_create, /* create function */
GX_NULL, /* drawing function override */
GX_NULL, /* event function override */
{65, 107, 695, 552}, /* widget size */
&main_screen_hscroll_transparent_define, /* next widget definition */
GX_NULL, /* no child widgets */
offsetof(MAIN_SCREEN_CONTROL_BLOCK, main_screen_scrollable_frame), /* control block */
(void *) &main_screen_scrollable_frame_properties /* extended properties */
};
GX_CONST GX_STUDIO_WIDGET main_screen_vscroll_button_define =
{
"vscroll_button",
GX_TYPE_VERTICAL_SCROLL, /* widget type */
ID_VSCROLL, /* widget id */
#if defined(GX_WIDGET_USER_DATA)
0, /* user data */
#endif
GX_STYLE_BORDER_NONE|GX_STYLE_ENABLED|GX_SCROLLBAR_RELATIVE_THUMB|GX_SCROLLBAR_END_BUTTONS|GX_SCROLLBAR_VERTICAL, /* style flags */
0, /* status flags */
sizeof(GX_SCROLLBAR), /* control block size */
GX_COLOR_ID_WIDGET_FILL, /* normal color id */
GX_COLOR_ID_SELECTED_FILL, /* selected color id */
GX_COLOR_ID_WIDGET_FILL, /* disabled color id */
gx_studio_vertical_scrollbar_create, /* create function */
GX_NULL, /* drawing function override */
GX_NULL, /* event function override */
{540, 107, 559, 231}, /* widget size */
GX_NULL, /* no next widget */
GX_NULL, /* no child widgets */
offsetof(MAIN_SCREEN_CONTROL_BLOCK, main_screen_vscroll_button), /* control block */
(void *) &main_screen_vscroll_button_properties /* extended properties */
};
GX_CONST GX_STUDIO_WIDGET main_screen_hscroll_button_define =
{
"hscroll_button",
GX_TYPE_HORIZONTAL_SCROLL, /* widget type */
ID_HSCROLL, /* widget id */
#if defined(GX_WIDGET_USER_DATA)
0, /* user data */
#endif
GX_STYLE_BORDER_NONE|GX_STYLE_ENABLED|GX_SCROLLBAR_RELATIVE_THUMB|GX_SCROLLBAR_END_BUTTONS|GX_SCROLLBAR_HORIZONTAL, /* style flags */
0, /* status flags */
sizeof(GX_SCROLLBAR), /* control block size */
GX_COLOR_ID_WIDGET_FILL, /* normal color id */
GX_COLOR_ID_WIDGET_FILL, /* selected color id */
GX_COLOR_ID_WIDGET_FILL, /* disabled color id */
gx_studio_horizontal_scrollbar_create, /* create function */
GX_NULL, /* drawing function override */
GX_NULL, /* event function override */
{339, 232, 539, 251}, /* widget size */
&main_screen_vscroll_button_define, /* next widget definition */
GX_NULL, /* no child widgets */
offsetof(MAIN_SCREEN_CONTROL_BLOCK, main_screen_hscroll_button), /* control block */
(void *) &main_screen_hscroll_button_properties /* extended properties */
};
GX_CONST GX_STUDIO_WIDGET main_screen_scrollable_frame_1_define =
{
"scrollable_frame_1",
GX_TYPE_WINDOW, /* widget type */
GX_ID_NONE, /* widget id */
#if defined(GX_WIDGET_USER_DATA)
0, /* user data */
#endif
GX_STYLE_BORDER_NONE, /* style flags */
0, /* status flags */
sizeof(GX_WINDOW), /* control block size */
GX_COLOR_ID_WINDOW_FILL, /* normal color id */
GX_COLOR_ID_WINDOW_FILL, /* selected color id */
GX_COLOR_ID_WINDOW_FILL, /* disabled color id */
gx_studio_window_create, /* create function */
GX_NULL, /* drawing function override */
GX_NULL, /* event function override */
{339, 107, 969, 552}, /* widget size */
&main_screen_hscroll_button_define, /* next widget definition */
GX_NULL, /* no child widgets */
offsetof(MAIN_SCREEN_CONTROL_BLOCK, main_screen_scrollable_frame_1), /* control block */
(void *) &main_screen_scrollable_frame_1_properties /* extended properties */
};
GX_CONST GX_STUDIO_WIDGET main_screen_vscroll_pixelmap_define =
{
"vscroll_pixelmap",
GX_TYPE_VERTICAL_SCROLL, /* widget type */
ID_VSCROLL, /* widget id */
#if defined(GX_WIDGET_USER_DATA)
0, /* user data */
#endif
GX_STYLE_BORDER_NONE|GX_STYLE_ENABLED|GX_SCROLLBAR_VERTICAL, /* style flags */
0, /* status flags */
sizeof(GX_SCROLLBAR), /* control block size */
GX_COLOR_ID_CANVAS, /* normal color id */
GX_COLOR_ID_SELECTED_FILL, /* selected color id */
GX_COLOR_ID_WIDGET_FILL, /* disabled color id */
gx_studio_vertical_scrollbar_create, /* create function */
GX_NULL, /* drawing function override */
GX_NULL, /* event function override */
{275, 299, 284, 433}, /* widget size */
GX_NULL, /* no next widget */
GX_NULL, /* no child widgets */
offsetof(MAIN_SCREEN_CONTROL_BLOCK, main_screen_vscroll_pixelmap), /* control block */
(void *) &main_screen_vscroll_pixelmap_properties /* extended properties */
};
GX_CONST GX_STUDIO_WIDGET main_screen_hscroll_pixelmap_define =
{
"hscroll_pixelmap",
GX_TYPE_HORIZONTAL_SCROLL, /* widget type */
ID_HSCROLL, /* widget id */
#if defined(GX_WIDGET_USER_DATA)
0, /* user data */
#endif
GX_STYLE_BORDER_NONE|GX_STYLE_ENABLED|GX_SCROLLBAR_HORIZONTAL, /* style flags */
0, /* status flags */
sizeof(GX_SCROLLBAR), /* control block size */
GX_COLOR_ID_CANVAS, /* normal color id */
GX_COLOR_ID_WIDGET_FILL, /* selected color id */
GX_COLOR_ID_WIDGET_FILL, /* disabled color id */
gx_studio_horizontal_scrollbar_create, /* create function */
GX_NULL, /* drawing function override */
GX_NULL, /* event function override */
{64, 434, 274, 443}, /* widget size */
&main_screen_vscroll_pixelmap_define, /* next widget definition */
GX_NULL, /* no child widgets */
offsetof(MAIN_SCREEN_CONTROL_BLOCK, main_screen_hscroll_pixelmap), /* control block */
(void *) &main_screen_hscroll_pixelmap_properties /* extended properties */
};
GX_CONST GX_STUDIO_WIDGET main_screen_scrollable_frame_2_define =
{
"scrollable_frame_2",
GX_TYPE_WINDOW, /* widget type */
GX_ID_NONE, /* widget id */
#if defined(GX_WIDGET_USER_DATA)
0, /* user data */
#endif
GX_STYLE_BORDER_NONE, /* style flags */
0, /* status flags */
sizeof(GX_WINDOW), /* control block size */
GX_COLOR_ID_WINDOW_FILL, /* normal color id */
GX_COLOR_ID_WINDOW_FILL, /* selected color id */
GX_COLOR_ID_WINDOW_FILL, /* disabled color id */
gx_studio_window_create, /* create function */
GX_NULL, /* drawing function override */
GX_NULL, /* event function override */
{65, 300, 695, 745}, /* widget size */
&main_screen_hscroll_pixelmap_define, /* next widget definition */
GX_NULL, /* no child widgets */
offsetof(MAIN_SCREEN_CONTROL_BLOCK, main_screen_scrollable_frame_2), /* control block */
(void *) &main_screen_scrollable_frame_2_properties /* extended properties */
};
GX_CONST GX_STUDIO_WIDGET main_screen_prompt_2_define =
{
"prompt_2",
GX_TYPE_PROMPT, /* widget type */
GX_ID_NONE, /* widget id */
#if defined(GX_WIDGET_USER_DATA)
0, /* user data */
#endif
GX_STYLE_BORDER_NONE|GX_STYLE_TRANSPARENT|GX_STYLE_TEXT_CENTER, /* style flags */
GX_STATUS_ACCEPTS_FOCUS, /* status flags */
sizeof(GX_PROMPT), /* control block size */
GX_COLOR_ID_WIDGET_FILL, /* normal color id */
GX_COLOR_ID_SELECTED_FILL, /* selected color id */
GX_COLOR_ID_DISABLED_FILL, /* disabled color id */
gx_studio_prompt_create, /* create function */
GX_NULL, /* drawing function override */
GX_NULL, /* event function override */
{57, 271, 289, 288}, /* widget size */
GX_NULL, /* no next widget */
GX_NULL, /* no child widgets */
offsetof(MAIN_SCREEN_CONTROL_BLOCK, main_screen_prompt_2), /* control block */
(void *) &main_screen_prompt_2_properties /* extended properties */
};
GX_CONST GX_STUDIO_WIDGET main_screen_prompt_1_define =
{
"prompt_1",
GX_TYPE_PROMPT, /* widget type */
GX_ID_NONE, /* widget id */
#if defined(GX_WIDGET_USER_DATA)
0, /* user data */
#endif
GX_STYLE_BORDER_NONE|GX_STYLE_TRANSPARENT|GX_STYLE_TEXT_CENTER, /* style flags */
GX_STATUS_ACCEPTS_FOCUS, /* status flags */
sizeof(GX_PROMPT), /* control block size */
GX_COLOR_ID_WIDGET_FILL, /* normal color id */
GX_COLOR_ID_SELECTED_FILL, /* selected color id */
GX_COLOR_ID_DISABLED_FILL, /* disabled color id */
gx_studio_prompt_create, /* create function */
GX_NULL, /* drawing function override */
GX_NULL, /* event function override */
{341, 80, 555, 97}, /* widget size */
&main_screen_prompt_2_define, /* next widget definition */
GX_NULL, /* no child widgets */
offsetof(MAIN_SCREEN_CONTROL_BLOCK, main_screen_prompt_1), /* control block */
(void *) &main_screen_prompt_1_properties /* extended properties */
};
GX_CONST GX_STUDIO_WIDGET main_screen_prompt_define =
{
"prompt",
GX_TYPE_PROMPT, /* widget type */
GX_ID_NONE, /* widget id */
#if defined(GX_WIDGET_USER_DATA)
0, /* user data */
#endif
GX_STYLE_BORDER_NONE|GX_STYLE_TRANSPARENT|GX_STYLE_TEXT_CENTER, /* style flags */
GX_STATUS_ACCEPTS_FOCUS, /* status flags */
sizeof(GX_PROMPT), /* control block size */
GX_COLOR_ID_WIDGET_FILL, /* normal color id */
GX_COLOR_ID_SELECTED_FILL, /* selected color id */
GX_COLOR_ID_DISABLED_FILL, /* disabled color id */
gx_studio_prompt_create, /* create function */
GX_NULL, /* drawing function override */
GX_NULL, /* event function override */
{60, 80, 311, 97}, /* widget size */
&main_screen_prompt_1_define, /* next widget definition */
GX_NULL, /* no child widgets */
offsetof(MAIN_SCREEN_CONTROL_BLOCK, main_screen_prompt), /* control block */
(void *) &main_screen_prompt_properties /* extended properties */
};
GX_CONST GX_STUDIO_WIDGET main_screen_frame_pixelmap_define =
{
"frame_pixelmap",
GX_TYPE_WINDOW, /* widget type */
ID_FRAME_PIXELMAP, /* widget id */
#if defined(GX_WIDGET_USER_DATA)
0, /* user data */
#endif
GX_STYLE_BORDER_NONE|GX_STYLE_TRANSPARENT, /* style flags */
GX_STATUS_ACCEPTS_FOCUS, /* status flags */
sizeof(GX_WINDOW), /* control block size */
GX_COLOR_ID_TEAL, /* normal color id */
GX_COLOR_ID_TEAL, /* selected color id */
GX_COLOR_ID_TEAL, /* disabled color id */
gx_studio_window_create, /* create function */
GX_NULL, /* drawing function override */
GX_NULL, /* event function override */
{64, 299, 284, 443}, /* widget size */
&main_screen_prompt_define, /* next widget definition */
&main_screen_scrollable_frame_2_define, /* child widget definition */
offsetof(MAIN_SCREEN_CONTROL_BLOCK, main_screen_frame_pixelmap), /* control block */
(void *) &main_screen_frame_pixelmap_properties /* extended properties */
};
GX_CONST GX_STUDIO_WIDGET main_screen_frame_button_define =
{
"frame_button",
GX_TYPE_WINDOW, /* widget type */
ID_FRAME_BUTTON, /* widget id */
#if defined(GX_WIDGET_USER_DATA)
0, /* user data */
#endif
GX_STYLE_BORDER_NONE|GX_STYLE_TRANSPARENT, /* style flags */
GX_STATUS_ACCEPTS_FOCUS, /* status flags */
sizeof(GX_WINDOW), /* control block size */
GX_COLOR_ID_TEAL, /* normal color id */
GX_COLOR_ID_TEAL, /* selected color id */
GX_COLOR_ID_TEAL, /* disabled color id */
gx_studio_window_create, /* create function */
GX_NULL, /* drawing function override */
GX_NULL, /* event function override */
{339, 107, 559, 251}, /* widget size */
&main_screen_frame_pixelmap_define, /* next widget definition */
&main_screen_scrollable_frame_1_define, /* child widget definition */
offsetof(MAIN_SCREEN_CONTROL_BLOCK, main_screen_frame_button), /* control block */
(void *) &main_screen_frame_button_properties /* extended properties */
};
GX_CONST GX_STUDIO_WIDGET main_screen_frame_transparent_define =
{
"frame_transparent",
GX_TYPE_WINDOW, /* widget type */
ID_FRAME_TRANSPARENT, /* widget id */
#if defined(GX_WIDGET_USER_DATA)
0, /* user data */
#endif
GX_STYLE_BORDER_NONE|GX_STYLE_TRANSPARENT, /* style flags */
GX_STATUS_ACCEPTS_FOCUS, /* status flags */
sizeof(GX_WINDOW), /* control block size */
GX_COLOR_ID_TEAL, /* normal color id */
GX_COLOR_ID_TEAL, /* selected color id */
GX_COLOR_ID_TEAL, /* disabled color id */
gx_studio_window_create, /* create function */
GX_NULL, /* drawing function override */
GX_NULL, /* event function override */
{65, 107, 285, 251}, /* widget size */
&main_screen_frame_button_define, /* next widget definition */
&main_screen_scrollable_frame_define, /* child widget definition */
offsetof(MAIN_SCREEN_CONTROL_BLOCK, main_screen_frame_transparent), /* control block */
(void *) &main_screen_frame_transparent_properties /* extended properties */
};
GX_CONST GX_STUDIO_WIDGET main_screen_logo_define =
{
"logo",
GX_TYPE_ICON, /* widget type */
GX_ID_NONE, /* widget id */
#if defined(GX_WIDGET_USER_DATA)
0, /* user data */
#endif
GX_STYLE_BORDER_NONE|GX_STYLE_TRANSPARENT|GX_STYLE_HALIGN_LEFT|GX_STYLE_VALIGN_TOP, /* style flags */
0, /* status flags */
sizeof(GX_ICON), /* control block size */
GX_COLOR_ID_WIDGET_FILL, /* normal color id */
GX_COLOR_ID_SELECTED_FILL, /* selected color id */
GX_COLOR_ID_WIDGET_FILL, /* disabled color id */
gx_studio_icon_create, /* create function */
GX_NULL, /* drawing function override */
GX_NULL, /* event function override */
{10, 10, 198, 39}, /* widget size */
&main_screen_frame_transparent_define, /* next widget definition */
GX_NULL, /* no child widgets */
offsetof(MAIN_SCREEN_CONTROL_BLOCK, main_screen_logo), /* control block */
(void *) &main_screen_logo_properties /* extended properties */
};
GX_CONST GX_STUDIO_WIDGET main_screen_title_define =
{
"title",
GX_TYPE_PROMPT, /* widget type */
GX_ID_NONE, /* widget id */
#if defined(GX_WIDGET_USER_DATA)
0, /* user data */
#endif
GX_STYLE_BORDER_NONE|GX_STYLE_TRANSPARENT|GX_STYLE_TEXT_CENTER, /* style flags */
0, /* status flags */
sizeof(GX_PROMPT), /* control block size */
GX_COLOR_ID_WIDGET_FILL, /* normal color id */
GX_COLOR_ID_SELECTED_FILL, /* selected color id */
GX_COLOR_ID_WIDGET_FILL, /* disabled color id */
gx_studio_prompt_create, /* create function */
GX_NULL, /* drawing function override */
GX_NULL, /* event function override */
{247, 30, 335, 50}, /* widget size */
&main_screen_logo_define, /* next widget definition */
GX_NULL, /* no child widgets */
offsetof(MAIN_SCREEN_CONTROL_BLOCK, main_screen_title), /* control block */
(void *) &main_screen_title_properties /* extended properties */
};
GX_CONST GX_STUDIO_WIDGET main_screen_define =
{
"main_screen",
GX_TYPE_WINDOW, /* widget type */
GX_ID_NONE, /* widget id */
#if defined(GX_WIDGET_USER_DATA)
0, /* user data */
#endif
GX_STYLE_BORDER_NONE|GX_STYLE_TILE_WALLPAPER, /* style flags */
GX_STATUS_ACCEPTS_FOCUS, /* status flags */
sizeof(MAIN_SCREEN_CONTROL_BLOCK), /* control block size */
GX_COLOR_ID_WINDOW_FILL, /* normal color id */
GX_COLOR_ID_WINDOW_FILL, /* selected color id */
GX_COLOR_ID_WINDOW_FILL, /* disabled color id */
gx_studio_window_create, /* create function */
GX_NULL, /* drawing function override */
GX_NULL, /* event function override */
{0, 0, 639, 479}, /* widget size */
GX_NULL, /* next widget */
&main_screen_title_define, /* child widget */
0, /* control block */
(void *) &main_screen_properties /* extended properties */
};
GX_CONST GX_STUDIO_WIDGET_ENTRY demo_guix_scrollbar_widget_table[] =
{
{ &main_screen_define, (GX_WIDGET *) &main_screen },
{GX_NULL, GX_NULL}
};
static GX_WIDGET *gx_studio_nested_widget_create(GX_BYTE *control, GX_CONST GX_STUDIO_WIDGET *definition, GX_WIDGET *parent)
{
UINT status = GX_SUCCESS;
GX_WIDGET *widget = GX_NULL;
GX_VALUE list_count = 0;
GX_VALUE list_total_count = 0;
if(parent && (parent->gx_widget_type == GX_TYPE_MENU))
{
list_total_count = ((GX_MENU *)parent)->gx_menu_list_total_count;
}
while(definition && status == GX_SUCCESS)
{
if (definition->create_function)
{
if (definition->style & GX_STYLE_DYNAMICALLY_ALLOCATED)
{
status = gx_widget_allocate(&widget, definition->control_block_size);
if (status != GX_SUCCESS)
{
return GX_NULL;
}
}
else
{
if (control == GX_NULL)
{
return GX_NULL;
}
widget = (GX_WIDGET *) (control + definition->control_block_offset);
}
status = definition->create_function(definition, widget, parent);
if(list_count < list_total_count)
{
gx_menu_insert((GX_MENU *)parent, widget);
((GX_MENU *)parent)->gx_menu_list_total_count--;
list_count++;
}
if (status == GX_SUCCESS)
{
if (definition->widget_type != GX_TYPE_TEMPLATE)
{
#if defined(GUIX_5_4_0_COMPATIBILITY)
gx_widget_fill_color_set(widget, definition->normal_fill_color_id, definition->selected_fill_color_id);
#else
gx_widget_fill_color_set(widget, definition->normal_fill_color_id, definition->selected_fill_color_id, definition->disabled_fill_color_id);
#endif
}
if (!(definition->status & GX_STATUS_ACCEPTS_FOCUS))
{
gx_widget_status_remove(widget, GX_STATUS_ACCEPTS_FOCUS);
}
if (definition->draw_function)
{
gx_widget_draw_set(widget, definition->draw_function);
}
if (definition->event_function)
{
gx_widget_event_process_set(widget, definition->event_function);
}
#if defined(GX_WIDGET_USER_DATA)
widget->gx_widget_user_data = definition->user_data;
#endif
if (definition->child_widget)
{
gx_studio_nested_widget_create(control, definition->child_widget, widget);
}
}
definition = definition->next_widget;
}
}
return widget;
}
GX_WIDGET *gx_studio_widget_create(GX_BYTE *control, GX_CONST GX_STUDIO_WIDGET *definition, GX_WIDGET *parent)
{
GX_WIDGET *widget;
widget = gx_studio_nested_widget_create(control, definition, GX_NULL);
if (parent && widget)
{
gx_widget_attach(parent, widget);
}
return widget;
}
UINT gx_studio_named_widget_create(char *name, GX_WIDGET *parent, GX_WIDGET **new_widget)
{
UINT status = GX_FAILURE;
GX_CONST GX_STUDIO_WIDGET_ENTRY *entry = demo_guix_scrollbar_widget_table;
GX_WIDGET *widget = GX_NULL;
while(entry->widget_information)
{
if (!strcmp(name, entry->widget_information->widget_name))
{
widget = gx_studio_widget_create((GX_BYTE *) entry->widget, entry->widget_information, parent);
if (widget)
{
status = GX_SUCCESS;
}
break;
}
entry++;
}
if (new_widget)
{
*new_widget = widget;
}
return status;
}
UINT gx_studio_display_configure(USHORT display, UINT (*driver)(GX_DISPLAY *),
GX_UBYTE language, USHORT theme, GX_WINDOW_ROOT **return_root)
{
GX_CONST GX_THEME *theme_ptr;
GX_RECTANGLE size;
GX_STUDIO_DISPLAY_INFO *display_info = &demo_guix_scrollbar_display_table[display];
/* create the requested display */
gx_display_create(display_info->display,
display_info->name,
driver,
(GX_VALUE) display_info->x_resolution,
(GX_VALUE) display_info->y_resolution);
/* install the request theme */
if(display_info->theme_table)
{
theme_ptr = display_info->theme_table[theme];
if(theme_ptr)
{
gx_display_color_table_set(display_info->display, theme_ptr->theme_color_table, theme_ptr->theme_color_table_size);
/* install the color palette if required */
if (display_info->display->gx_display_driver_palette_set &&
theme_ptr->theme_palette != NULL)
{
display_info->display->gx_display_driver_palette_set(display_info->display, theme_ptr->theme_palette, theme_ptr->theme_palette_size);
}
gx_display_font_table_set(display_info->display, theme_ptr->theme_font_table, theme_ptr->theme_font_table_size);
gx_display_pixelmap_table_set(display_info->display, theme_ptr->theme_pixelmap_table, theme_ptr->theme_pixelmap_table_size);
gx_system_scroll_appearance_set(theme_ptr->theme_vertical_scroll_style, (GX_SCROLLBAR_APPEARANCE *) &theme_ptr->theme_vertical_scrollbar_appearance);
gx_system_scroll_appearance_set(theme_ptr->theme_horizontal_scroll_style, (GX_SCROLLBAR_APPEARANCE *) &theme_ptr->theme_horizontal_scrollbar_appearance);
}
}
/* Install the language table. */
if(display_info->language_table)
{
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);
gx_display_active_language_set(display_info->display, language);
}
/* Set screen rotation angle. */
display_info->display->gx_display_rotation_angle = display_info->rotation_angle;
/* create the canvas for this display */
gx_canvas_create(display_info->canvas,
display_info->canvas_name,
display_info->display,
GX_CANVAS_MANAGED | GX_CANVAS_VISIBLE,
display_info->x_resolution,
display_info->y_resolution,
display_info->canvas_memory,
display_info->canvas_memory_size);
/* Create the root window for this canvas */
gx_utility_rectangle_define(&size,
0, 0,
(GX_VALUE) (display_info->x_resolution - 1),
(GX_VALUE) (display_info->y_resolution - 1));
gx_window_root_create(display_info->root_window,
display_info->name,
display_info->canvas, GX_STYLE_NONE, 0, &size);
if (return_root)
{
*return_root = display_info->root_window;
}
return GX_SUCCESS;
}
#undef GUIX_STUDIO_GENERATED_FILE