HelloByeAll hace 5 años
padre
commit
3d7fa5dc32

+ 165 - 0
Examples/MainTask.c

@@ -0,0 +1,165 @@
+/*
+*********************************************************************************************************
+*	                                  
+*	模块名称 : GUI界面主函数
+*	文件名称 : MainTask.c
+*	版    本 : V1.0
+*	说    明 : OLCD界面
+*              
+*	修改记录 :
+*		版本号   日期         作者          说明
+*		V1.0    2020-11-15   Eric2013  	    首版    
+*                                     
+*	Copyright (C), 2020-2030, 安富莱电子 www.armfly.com
+*
+*********************************************************************************************************
+*/
+#include "MainTask.h"
+
+/*
+*********************************************************************************************************
+*                                             宏定义
+*********************************************************************************************************
+*/
+#define STM32_SCREEN_HANDLE 0x2000B000
+
+/*
+*********************************************************************************************************
+*                                               变量
+*********************************************************************************************************
+*/
+GX_WINDOW *pScreen;
+GX_WINDOW_ROOT *root;
+extern ULONG display_1_canvas_memory[512];
+
+uint8_t display_2_canvas_memory[2048];
+extern void lcd_address(uint8_t page, uint8_t column);
+extern void transfer_data(uint8_t *data, uint8_t len);
+
+/**
+ *@brief 向缓冲区画点
+ *@param  x,y 坐标(x = 0-127 | y = 0-127)
+ *@param  color 颜色 <目前只有黑:CBLACK 白:CWHITLE>
+ *@retval None
+ */
+void GuiDrawPoint(uint8_t x, uint8_t y, uint8_t color)
+{
+    uint16_t i = y % 8;
+    uint16_t page = y / 8;
+    /* 添加用户代码 */
+    if (color == 1)
+        display_2_canvas_memory[page * 128 + x] &= ~(color << i);
+    else
+    {
+        color = 1;
+        display_2_canvas_memory[page * 128 + x] |= color << i;
+    }
+}
+
+/*
+*********************************************************************************************************
+*	函 数 名: stm32_monochrome_buffer_toggle
+*	功能说明: 单色屏绘制,直接做整个屏的重绘
+*	形    参: 
+*	返 回 值: 无
+*********************************************************************************************************
+*/
+static void stm32_monochrome_buffer_toggle(GX_CANVAS *canvas, GX_RECTANGLE *dirty)
+{
+    uint8_t *p;
+
+    /* 防止警告 */
+    (void)canvas;
+    (void)dirty;
+
+    /* 获得OLED画布的地址 */
+    p = (uint8_t *)display_1_canvas_memory;
+
+    /* 将画布的内容绘制到OLED显存 */
+
+    for (int y = 0; y < 128; y++)
+    {
+        for (int x = 0; x < 128; x += 8)
+        {
+            GuiDrawPoint(x, y, (p[16 * y + x / 8] & (0x80)) >> 7);
+            GuiDrawPoint(x + 1, y, (p[16 * y + x / 8] & (0x40)) >> 6);
+            GuiDrawPoint(x + 2, y, (p[16 * y + x / 8] & (0x20)) >> 5);
+            GuiDrawPoint(x + 3, y, (p[16 * y + x / 8] & (0x10)) >> 4);
+            GuiDrawPoint(x + 4, y, (p[16 * y + x / 8] & (0x08)) >> 3);
+            GuiDrawPoint(x + 5, y, (p[16 * y + x / 8] & (0x04)) >> 2);
+            GuiDrawPoint(x + 6, y, (p[16 * y + x / 8] & (0x02)) >> 1);
+            GuiDrawPoint(x + 7, y, (p[16 * y + x / 8] & (0x01)) >> 0);
+        }
+    }
+
+    /* 将OLED显存的内容实际绘制到OLED */
+
+    for (int i = 0; i < 16; i++)
+    {
+        lcd_address(i + 1, 1);
+        transfer_data(&display_2_canvas_memory[i * 128], 128);
+    }
+}
+
+/*
+*********************************************************************************************************
+*	函 数 名: stm32_graphics_driver_setup_monochrome
+*	功能说明: 单色屏驱动接口
+*	形    参: 无
+*	返 回 值: 无
+*********************************************************************************************************
+*/
+UINT stm32_graphics_driver_setup_monochrome(GX_DISPLAY *display)
+{
+    _gx_display_driver_monochrome_setup(display, (VOID *)STM32_SCREEN_HANDLE, stm32_monochrome_buffer_toggle);
+
+    return (GX_SUCCESS);
+}
+
+/*
+*********************************************************************************************************
+*	函 数 名: MainTask
+*	功能说明: GUI主函数
+*	形    参: 无
+*	返 回 值: 无
+*********************************************************************************************************
+*/
+void MainTask(void)
+{
+	extern void lcd_init(void);
+	
+	lcd_init();
+	
+    /*初始化配置 */
+    gx_system_initialize();
+
+    /* 配置显示屏 */
+    gx_studio_display_configure(DISPLAY_1, stm32_graphics_driver_setup_monochrome,
+                                LANGUAGE_ENGLISH, DISPLAY_1_THEME_2, &root);
+    /* 创建窗口 */
+    gx_studio_named_widget_create("window", (GX_WIDGET *)root, (GX_WIDGET **)&pScreen);
+
+    /* 显示根窗口 */
+    gx_widget_show(root);
+
+    /* 启动GUIX */
+    gx_system_start();
+
+    while (1)
+    {
+        rt_thread_mdelay(20);
+    }
+}
+
+void gui_theme_switching(void)
+{
+    static USHORT theme_id;
+    theme_id = DISPLAY_1_THEME_2;
+
+    if (++theme_id >= DISPLAY_1_THEME_TABLE_SIZE)
+        theme_id = 0;
+
+    gx_studio_display_configure(DISPLAY_1, stm32_graphics_driver_setup_monochrome,
+                                LANGUAGE_ENGLISH, theme_id, &root);
+}
+/***************************** 安富莱电子 www.armfly.com (END OF FILE) *********************************/

+ 49 - 0
Examples/MainTask.h

@@ -0,0 +1,49 @@
+/*
+*********************************************************************************************************
+*	                                  
+*	模块名称 : GUI界面主函数
+*	文件名称 : MainTask.c
+*	版    本 : V1.0
+*	说    明 : GUI界面主函数
+*
+*		版本号   日期         作者            说明
+*		v1.0    2020-07-06  Eric2013  	      首版
+*
+*	Copyright (C), 2020-2030, 安富莱电子 www.armfly.com
+*
+*********************************************************************************************************
+*/
+
+#ifndef __MainTask_H
+#define __MainTask_H
+#include "main.h"
+//#include "bsp.h"
+#include "gx_user.h"
+#include "guiapp_resources.h"
+#include "guiapp_specifications.h"
+//#include "tx_api.h"
+#include "gx_system.h"
+#include "gx_display.h"
+#include "gx_utility.h"
+
+
+/*
+************************************************************************
+*						宏定义
+************************************************************************
+*/
+
+
+
+/*
+************************************************************************
+*						供外部文件调用
+************************************************************************
+*/
+extern void MainTask(void);
+extern void TOUCH_Calibration(uint8_t _PointCount);
+extern void gx_initconfig(void);
+
+#endif
+
+/***************************** 安富莱电子 www.armfly.com (END OF FILE) *********************************/

+ 434 - 0
Examples/guiapp_resources.c

@@ -0,0 +1,434 @@
+/*******************************************************************************/
+/*  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   */
+/*  resource 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.0.0                                               */
+/*  Date (dd.mm.yyyy): 13.11.2020   Time (hh:mm): 10:10                        */
+/*******************************************************************************/
+
+
+#include "gx_api.h"
+#include "guiapp_resources.h"
+
+/* Color Table                                                                 */
+
+GX_CONST GX_COLOR display_1_theme_1_color_table[] =
+{
+    0x00000000,
+    0x00000000,
+    0x00000000,
+    0x00000001,
+    0x00000001,
+    0x00000001,
+    0x00000001,
+    0x00000000,
+    0x00000000,
+    0x00000000,
+    0x00000001,
+    0x00000000,
+    0x00000000,
+    0x00000001,
+    0x00000000,
+    0x00000000,
+    0x00000001,
+    0x00000000,
+    0x00000001,
+    0x00000000,
+    0x00000000,
+    0x00000001,
+    0x00000000,
+    0x00000001,
+    0x00000001,
+    0x00000001,
+    0x00000000,
+    0x00000001,
+    0x00000000
+};
+
+GX_CONST GX_COLOR display_1_theme_2_color_table[] =
+{
+    0x00000001,
+    0x00000001,
+    0x00000001,
+    0x00000000,
+    0x00000000,
+    0x00000000,
+    0x00000000,
+    0x00000001,
+    0x00000001,
+    0x00000001,
+    0x00000000,
+    0x00000001,
+    0x00000001,
+    0x00000000,
+    0x00000001,
+    0x00000001,
+    0x00000000,
+    0x00000001,
+    0x00000000,
+    0x00000001,
+    0x00000001,
+    0x00000000,
+    0x00000001,
+    0x00000000,
+    0x00000000,
+    0x00000000,
+    0x00000001,
+    0x00000000,
+    0x00000001
+};
+
+
+/* Font Table                                                                  */
+
+
+extern GX_FONT _gx_system_font_mono;
+GX_CONST GX_FONT *display_1_theme_1_font_table[] =
+{
+    &_gx_system_font_mono,
+    &_gx_system_font_mono,
+    &_gx_system_font_mono,
+    &_gx_system_font_mono
+};
+GX_CONST GX_FONT *display_1_theme_2_font_table[] =
+{
+    &_gx_system_font_mono,
+    &_gx_system_font_mono,
+    &_gx_system_font_mono,
+    &_gx_system_font_mono
+};
+
+/* Pixelmap data definitions                                                   */
+
+
+/* THEME_1_RADIO_ON pixelmap data                                              */
+
+static GX_CONST GX_UBYTE DISPLAY_1_THEME_1_RADIO_ON_pixelmap_data[64] =
+{
+    0x00, 0xf5, 0x5c, 0x00, 0x03, 0x7f, 0xfd, 0xc0, 0x0f, 0xfd, 0x7f, 0x70, 0x3f, 
+    0xd5, 0x57, 0xdc, 0x1f, 0x55, 0x55, 0xf4, 0xfd, 0x55, 0x55, 0x7f, 0x7d, 0x55, 
+    0x55, 0x7f, 0x75, 0x55, 0x55, 0x5d, 0x75, 0x55, 0x55, 0x5d, 0x7d, 0x55, 0x55, 
+    0x5f, 0xfd, 0x55, 0x55, 0x7f, 0x1f, 0x55, 0x55, 0xf4, 0x3f, 0xd5, 0x57, 0xdc, 
+    0x0f, 0xfd, 0x7f, 0x70, 0x03, 0x7f, 0xfd, 0xc0, 0x00, 0x35, 0x5c, 0x00
+};
+GX_CONST GX_PIXELMAP DISPLAY_1_THEME_1_RADIO_ON_pixelmap =
+{
+    0x00000001,                              /* major version                  */
+    0x00000000,                              /* minor version                  */
+    GX_PIXELMAP_TRANSPARENT,                 /* flags                          */
+    GX_COLOR_FORMAT_MONOCHROME,              /* Format                         */
+    (GX_UBYTE *) DISPLAY_1_THEME_1_RADIO_ON_pixelmap_data,
+    sizeof(DISPLAY_1_THEME_1_RADIO_ON_pixelmap_data),    /* the size of pixelmap_data*/
+    NULL,
+    0,                                       /* auxiliary data size            */
+    0x00,                                    /* used for transparent iamges    */
+    16,                                      /* width in pixel                 */
+    16                                       /* height in pixel                */
+};
+
+/* THEME_1_RADIO_OFF pixelmap data                                             */
+
+static GX_CONST GX_UBYTE DISPLAY_1_THEME_1_RADIO_OFF_pixelmap_data[64] =
+{
+    0x00, 0xd5, 0x54, 0x00, 0x01, 0x55, 0x55, 0x00, 0x05, 0x5f, 0xf5, 0x50, 0x15, 
+    0xff, 0xff, 0x50, 0x17, 0xff, 0xff, 0xd4, 0x57, 0xff, 0xff, 0xd5, 0x5f, 0xff, 
+    0xff, 0xf5, 0x5f, 0xff, 0xff, 0xf5, 0x5f, 0xff, 0xff, 0xf5, 0x5f, 0xff, 0xff, 
+    0xf5, 0x57, 0xff, 0xff, 0xd5, 0x17, 0xff, 0xff, 0xd4, 0x15, 0xff, 0xff, 0x50, 
+    0x05, 0x5f, 0xf5, 0x50, 0x01, 0x55, 0x55, 0xc0, 0x00, 0x15, 0x54, 0x00
+};
+GX_CONST GX_PIXELMAP DISPLAY_1_THEME_1_RADIO_OFF_pixelmap =
+{
+    0x00000001,                              /* major version                  */
+    0x00000000,                              /* minor version                  */
+    GX_PIXELMAP_TRANSPARENT,                 /* flags                          */
+    GX_COLOR_FORMAT_MONOCHROME,              /* Format                         */
+    (GX_UBYTE *) DISPLAY_1_THEME_1_RADIO_OFF_pixelmap_data,
+    sizeof(DISPLAY_1_THEME_1_RADIO_OFF_pixelmap_data),    /* the size of pixelmap_data*/
+    NULL,
+    0,                                       /* auxiliary data size            */
+    0x00,                                    /* used for transparent iamges    */
+    16,                                      /* width in pixel                 */
+    16                                       /* height in pixel                */
+};
+
+/* THEME_1_CHECKBOX_ON pixelmap data                                           */
+
+static GX_CONST GX_UBYTE DISPLAY_1_THEME_1_CHECKBOX_ON_pixelmap_data[32] =
+{
+    0x00, 0x00, 0x7f, 0xfc, 0x7f, 0xfe, 0x7f, 0xfe, 0x7f, 0xee, 0x7f, 0xce, 0x77, 
+    0x8e, 0x73, 0x1e, 0x72, 0x1e, 0x70, 0x3e, 0x78, 0x7c, 0x7d, 0xfc, 0x7f, 0xfc, 
+    0x7f, 0xfe, 0x3f, 0xc4, 0x00, 0x00
+};
+GX_CONST GX_PIXELMAP DISPLAY_1_THEME_1_CHECKBOX_ON_pixelmap =
+{
+    0x00000001,                              /* major version                  */
+    0x00000000,                              /* minor version                  */
+    0,                                       /* flags                          */
+    GX_COLOR_FORMAT_MONOCHROME,              /* Format                         */
+    (GX_UBYTE *) DISPLAY_1_THEME_1_CHECKBOX_ON_pixelmap_data,
+    sizeof(DISPLAY_1_THEME_1_CHECKBOX_ON_pixelmap_data),    /* the size of pixelmap_data*/
+    NULL,
+    0,                                       /* auxiliary data size            */
+    0x00,                                    /* used for transparent iamges    */
+    16,                                      /* width in pixel                 */
+    16                                       /* height in pixel                */
+};
+
+/* THEME_1_CHECKBOX_OFF pixelmap data                                          */
+
+static GX_CONST GX_UBYTE DISPLAY_1_THEME_1_CHECKBOX_OFF_pixelmap_data[32] =
+{
+    0x00, 0x00, 0x7f, 0xfc, 0x7f, 0xfe, 0x7f, 0xfc, 0x7f, 0xfc, 0x7f, 0xfc, 0x7f, 
+    0xfc, 0x7f, 0xfc, 0x7f, 0xfc, 0x7f, 0xfc, 0x7f, 0xfc, 0x7f, 0xfc, 0x7f, 0xfc, 
+    0x7f, 0xfc, 0x20, 0x00, 0x00, 0x00
+};
+GX_CONST GX_PIXELMAP DISPLAY_1_THEME_1_CHECKBOX_OFF_pixelmap =
+{
+    0x00000001,                              /* major version                  */
+    0x00000000,                              /* minor version                  */
+    0,                                       /* flags                          */
+    GX_COLOR_FORMAT_MONOCHROME,              /* Format                         */
+    (GX_UBYTE *) DISPLAY_1_THEME_1_CHECKBOX_OFF_pixelmap_data,
+    sizeof(DISPLAY_1_THEME_1_CHECKBOX_OFF_pixelmap_data),    /* the size of pixelmap_data*/
+    NULL,
+    0,                                       /* auxiliary data size            */
+    0x00,                                    /* used for transparent iamges    */
+    16,                                      /* width in pixel                 */
+    16                                       /* height in pixel                */
+};
+
+/* THEME_1_YXYL_LOGO pixelmap data                                             */
+
+static GX_CONST GX_UBYTE DISPLAY_1_THEME_1_YXYL_LOGO_pixelmap_data[785] =
+{
+    0xff, 0xff, 0xe7, 0xa1, 0xf3, 0xff, 0xff, 0xd7, 0xbd, 0xe7, 0xff, 0xff, 0xcf, 
+    0xcd, 0xdf, 0xff, 0xff, 0xc7, 0xdd, 0xd7, 0xff, 0xff, 0xc3, 0xe5, 0xd3, 0xff, 
+    0xff, 0xbf, 0xa5, 0xa3, 0xa1, 0xcf, 0xff, 0xff, 0xbb, 0x9d, 0xbb, 0x99, 0xcb, 
+    0xff, 0xff, 0xb7, 0x99, 0xc7, 0x99, 0xc7, 0xff, 0xff, 0xb3, 0x99, 0xd3, 0x95, 
+    0xc3, 0xff, 0xfb, 0xa1, 0x93, 0x91, 0xdf, 0x95, 0xbf, 0xff, 0xef, 0xb9, 0x03, 
+    0x91, 0xe3, 0x95, 0xbf, 0xff, 0xe7, 0xd9, 0xe7, 0x95, 0xbb, 0xff, 0xdf, 0xdd, 
+    0xef, 0x91, 0xbb, 0xff, 0xdb, 0xad, 0x03, 0xa9, 0xf3, 0x95, 0xb7, 0xff, 0xd7, 
+    0x9d, 0xab, 0x91, 0xfb, 0x91, 0xb7, 0xff, 0xd3, 0x99, 0xbb, 0x89, 0xfb, 0x91, 
+    0xb7, 0xff, 0xcf, 0x99, 0xc3, 0x01, 0xff, 0x91, 0xb7, 0xff, 0xcb, 0x95, 0xf7, 
+    0x01, 0xd7, 0x91, 0xb3, 0xff, 0xc7, 0x95, 0xf7, 0x89, 0xd3, 0x9d, 0xa7, 0xff, 
+    0xc7, 0x91, 0xfb, 0x89, 0xd3, 0xa5, 0x9f, 0xff, 0xc3, 0x95, 0xf3, 0x99, 0xcb, 
+    0xa9, 0x9b, 0xff, 0xbf, 0x95, 0xf7, 0x99, 0xd7, 0xa5, 0x93, 0xff, 0xbf, 0x91, 
+    0xff, 0x03, 0x89, 0xeb, 0x9d, 0x8f, 0xff, 0xbb, 0x95, 0xff, 0x0f, 0x03, 0x01, 
+    0x01, 0xf3, 0x95, 0x8f, 0xff, 0xbb, 0x91, 0xff, 0xff, 0x8b, 0x95, 0x8b, 0x97, 
+    0x95, 0xd3, 0x89, 0x9b, 0x0d, 0x01, 0x03, 0x03, 0x91, 0xe7, 0x89, 0x93, 0x89, 
+    0xab, 0x05, 0x01, 0xc7, 0x95, 0x07, 0x03, 0x8f, 0xa5, 0xcb, 0x8d, 0x93, 0x8d, 
+    0xff, 0x89, 0x8f, 0x8d, 0xa7, 0x8d, 0xc7, 0x91, 0x07, 0x03, 0x8b, 0xad, 0xc3, 
+    0x91, 0x93, 0x8d, 0xfb, 0x91, 0x8b, 0x91, 0xa3, 0x8d, 0xcb, 0x91, 0x03, 0x07, 
+    0x03, 0xb5, 0xbf, 0x91, 0x93, 0x8d, 0xfb, 0x91, 0x8b, 0x91, 0xa3, 0x8d, 0xcb, 
+    0x91, 0x03, 0x03, 0x95, 0x8f, 0x91, 0x9b, 0x89, 0x97, 0x91, 0x93, 0x8d, 0x9b, 
+    0x89, 0xaf, 0x89, 0x97, 0x91, 0x8b, 0xa5, 0x8f, 0x8d, 0x03, 0x89, 0xbf, 0x8d, 
+    0x03, 0x03, 0x8d, 0x9b, 0x8d, 0x8f, 0x9d, 0x8f, 0x91, 0x93, 0x8d, 0x93, 0x99, 
+    0x9b, 0x9d, 0x8f, 0x91, 0x8b, 0xa9, 0x8b, 0xa9, 0xb3, 0x91, 0x91, 0xb7, 0xa5, 
+    0x8b, 0x91, 0x93, 0x8d, 0x8f, 0xa5, 0x8f, 0xa5, 0x8b, 0x91, 0x8b, 0xa9, 0x8b, 
+    0xad, 0xaf, 0x91, 0x8d, 0xb7, 0xad, 0x07, 0x03, 0x91, 0x03, 0x89, 0x03, 0x8d, 
+    0x8b, 0xa9, 0x8b, 0xad, 0x07, 0x03, 0x91, 0x8b, 0xa5, 0x8f, 0xb1, 0xab, 0x91, 
+    0x8d, 0xb7, 0x91, 0x07, 0x03, 0x95, 0x03, 0xb5, 0x07, 0x03, 0x91, 0x07, 0x03, 
+    0x91, 0x8b, 0x91, 0x07, 0x03, 0x95, 0x03, 0x91, 0x8b, 0x91, 0xa3, 0x95, 0x07, 
+    0x03, 0x91, 0xab, 0x91, 0x8d, 0xb3, 0x91, 0x93, 0x8d, 0x03, 0xb5, 0x07, 0x03, 
+    0x8d, 0x07, 0x03, 0x91, 0x8f, 0x8d, 0x93, 0x8d, 0x03, 0x91, 0x8b, 0x91, 0xa3, 
+    0x8d, 0x93, 0x8d, 0xab, 0x91, 0x8d, 0xb3, 0x8d, 0x97, 0x8d, 0x03, 0xb5, 0x07, 
+    0x03, 0x8d, 0x03, 0x91, 0x8f, 0x8d, 0x97, 0x8d, 0x03, 0x91, 0x8b, 0x91, 0xa3, 
+    0x8d, 0x97, 0x8d, 0xa7, 0x91, 0x91, 0xaf, 0x8d, 0x97, 0x8d, 0x03, 0xb5, 0x07, 
+    0x03, 0xa1, 0x13, 0x01, 0x01, 0x03, 0x03, 0x8d, 0x97, 0x8d, 0x03, 0x91, 0x8b, 
+    0x91, 0xa3, 0x8d, 0x97, 0x8d, 0xa7, 0x91, 0x03, 0x8d, 0x9b, 0x8d, 0x03, 0x91, 
+    0x93, 0x8d, 0x03, 0x91, 0x93, 0x8d, 0x07, 0x03, 0x99, 0x07, 0x03, 0x8d, 0x03, 
+    0x91, 0x93, 0x8d, 0x03, 0x91, 0x8f, 0x8d, 0xa3, 0x8d, 0x97, 0x8d, 0xa3, 0x95, 
+    0x03, 0x95, 0x8f, 0x91, 0x07, 0x03, 0x91, 0x8b, 0x91, 0x03, 0x91, 0x93, 0x8d, 
+    0x07, 0x03, 0x95, 0x07, 0x03, 0x91, 0x07, 0x03, 0x91, 0x8b, 0x91, 0x03, 0x91, 
+    0x8f, 0x91, 0x8b, 0x8d, 0x03, 0x8d, 0x97, 0x8d, 0xa3, 0x91, 0x03, 0x07, 0x03, 
+    0xb5, 0x07, 0x03, 0xad, 0x07, 0x03, 0x91, 0x93, 0x8d, 0x8b, 0xad, 0x07, 0x03, 
+    0xb1, 0x07, 0x03, 0x95, 0x07, 0x03, 0xad, 0x03, 0x8d, 0x97, 0x8d, 0xa3, 0x91, 
+    0x03, 0x8b, 0xad, 0x8f, 0xa5, 0x8b, 0x91, 0x93, 0x8d, 0x8b, 0xa9, 0x8f, 0xad, 
+    0x07, 0x03, 0x99, 0x07, 0x03, 0xa9, 0x03, 0x8d, 0x97, 0x8d, 0x9f, 0x95, 0x03, 
+    0x8f, 0xa5, 0x97, 0x9d, 0x93, 0x8d, 0x93, 0x8d, 0x8f, 0xa1, 0x97, 0xa9, 0x8b, 
+    0x95, 0x8b, 0xa1, 0x07, 0x03, 0x8d, 0x97, 0x8d, 0x9f, 0x91, 0x07, 0x03, 0x97, 
+    0x95, 0xa7, 0x91, 0x97, 0x89, 0x9b, 0x05, 0x01, 0x9b, 0x91, 0xa7, 0x91, 0x0b, 
+    0x01, 0x01, 0x93, 0x8d, 0x97, 0x91, 0x93, 0x05, 0x01, 0x9b, 0x89, 0x9f, 0x95, 
+    0x07, 0x03, 0xff, 0xff, 0xff, 0xdb, 0x95, 0x8b, 0xff, 0x9b, 0x95, 0x9f, 0x01, 
+    0x9f, 0x0d, 0x03, 0x03, 0x01, 0xa7, 0x01, 0x9b, 0x95, 0x9b, 0x01, 0x9f, 0x8d, 
+    0x07, 0x01, 0x97, 0x95, 0x8f, 0xff, 0x9b, 0x95, 0x9f, 0x01, 0x9b, 0x99, 0x9f, 
+    0x01, 0x97, 0x95, 0x9f, 0x01, 0x9f, 0x95, 0x93, 0x95, 0x93, 0xff, 0xd3, 0x01, 
+    0x9f, 0x09, 0x03, 0x01, 0xab, 0x01, 0x97, 0x95, 0x9f, 0x01, 0x9f, 0x95, 0x8b, 
+    0x99, 0x97, 0xff, 0x97, 0x99, 0x9f, 0x01, 0x9b, 0x8d, 0x07, 0x01, 0xa3, 0x01, 
+    0x97, 0x99, 0x9b, 0x01, 0x9f, 0x95, 0x07, 0x03, 0x99, 0x9b, 0xff, 0x9f, 0x0d, 
+    0x03, 0x03, 0x01, 0xa3, 0x01, 0x9b, 0x05, 0x03, 0x91, 0x9f, 0x01, 0x97, 0x05, 
+    0x03, 0x8d, 0x9f, 0x01, 0x9f, 0x91, 0x8b, 0x95, 0x9f, 0xff, 0x9b, 0x01, 0x8b, 
+    0x05, 0x01, 0x9f, 0x01, 0x9b, 0x11, 0x03, 0x01, 0x03, 0x01, 0xa7, 0x01, 0x97, 
+    0x89, 0x0f, 0x03, 0x01, 0x01, 0x9b, 0x01, 0x9b, 0x99, 0x07, 0x03, 0x8d, 0xa7, 
+    0xff, 0x9b, 0x95, 0x9f, 0x01, 0xa3, 0x89, 0xa7, 0x01, 0x9b, 0x95, 0x9b, 0x01, 
+    0xa3, 0x89, 0x07, 0x01, 0xbf
+};
+GX_CONST GX_PIXELMAP DISPLAY_1_THEME_1_YXYL_LOGO_pixelmap =
+{
+    0x00000001,                              /* major version                  */
+    0x00000000,                              /* minor version                  */
+    GX_PIXELMAP_COMPRESSED|GX_PIXELMAP_TRANSPARENT,         /* flags           */
+    GX_COLOR_FORMAT_MONOCHROME,              /* Format                         */
+    (GX_UBYTE *) DISPLAY_1_THEME_1_YXYL_LOGO_pixelmap_data,
+    sizeof(DISPLAY_1_THEME_1_YXYL_LOGO_pixelmap_data),    /* the size of pixelmap_data*/
+    NULL,
+    0,                                       /* auxiliary data size            */
+    0x00,                                    /* used for transparent iamges    */
+    128,                                     /* width in pixel                 */
+    51                                       /* height in pixel                */
+};
+
+/* Pixelmap Table                                                              */
+
+
+GX_CONST GX_PIXELMAP *display_1_theme_1_pixelmap_table[] =
+{
+    GX_NULL,
+    &DISPLAY_1_THEME_1_RADIO_ON_pixelmap,
+    &DISPLAY_1_THEME_1_RADIO_OFF_pixelmap,
+    &DISPLAY_1_THEME_1_CHECKBOX_ON_pixelmap,
+    &DISPLAY_1_THEME_1_CHECKBOX_OFF_pixelmap,
+    &DISPLAY_1_THEME_1_YXYL_LOGO_pixelmap
+};
+GX_CONST GX_PIXELMAP *display_1_theme_2_pixelmap_table[] =
+{
+    GX_NULL,
+    &DISPLAY_1_THEME_1_RADIO_ON_pixelmap,
+    &DISPLAY_1_THEME_1_RADIO_OFF_pixelmap,
+    &DISPLAY_1_THEME_1_CHECKBOX_ON_pixelmap,
+    &DISPLAY_1_THEME_1_CHECKBOX_OFF_pixelmap,
+    &DISPLAY_1_THEME_1_YXYL_LOGO_pixelmap
+};
+
+/* String values                                                               */
+
+GX_CONST GX_UBYTE display_1_STRING_1_English[] = "text_view";
+GX_CONST GX_UBYTE display_1_STRING_2_English[] = "prompt";
+GX_CONST GX_UBYTE display_1_STRING_3_English[] = "www.armbbs.cn";
+GX_CONST GX_UBYTE display_1_STRING_4_English[] = "button";
+GX_CONST GX_UBYTE display_1_STRING_5_English[] = "ARMFLY";
+GX_CONST GX_UBYTE display_1_STRING_6_English[] = "The First Window";
+GX_CONST GX_UBYTE display_1_STRING_7_English[] = "The Second Window";
+GX_CONST GX_UBYTE display_1_STRING_8_English[] = "The Third Window";
+GX_CONST GX_UBYTE display_1_STRING_9_English[] = "armfly";
+GX_CONST GX_UBYTE display_1_STRING_10_English[] = "armbbs";
+
+/* String Table for display_1 language English                                 */
+
+GX_CONST GX_STRING display_1_English_string_table[11] =
+{
+    {GX_NULL, 0},
+    {(GX_CONST GX_CHAR *)display_1_STRING_1_English, sizeof(display_1_STRING_1_English) - 1},
+    {(GX_CONST GX_CHAR *)display_1_STRING_2_English, sizeof(display_1_STRING_2_English) - 1},
+    {(GX_CONST GX_CHAR *)display_1_STRING_3_English, sizeof(display_1_STRING_3_English) - 1},
+    {(GX_CONST GX_CHAR *)display_1_STRING_4_English, sizeof(display_1_STRING_4_English) - 1},
+    {(GX_CONST GX_CHAR *)display_1_STRING_5_English, sizeof(display_1_STRING_5_English) - 1},
+    {(GX_CONST GX_CHAR *)display_1_STRING_6_English, sizeof(display_1_STRING_6_English) - 1},
+    {(GX_CONST GX_CHAR *)display_1_STRING_7_English, sizeof(display_1_STRING_7_English) - 1},
+    {(GX_CONST GX_CHAR *)display_1_STRING_8_English, sizeof(display_1_STRING_8_English) - 1},
+    {(GX_CONST GX_CHAR *)display_1_STRING_9_English, sizeof(display_1_STRING_9_English) - 1},
+    {(GX_CONST GX_CHAR *)display_1_STRING_10_English, sizeof(display_1_STRING_10_English) - 1}
+};
+
+/*  Language Table                                                             */
+
+
+GX_CONST GX_STRING *display_1_language_table[1] = 
+{
+    display_1_English_string_table,
+};
+
+GX_THEME display_1_theme_1 =
+{
+    (GX_COLOR *) display_1_theme_1_color_table,
+    (GX_FONT **) display_1_theme_1_font_table,
+    (GX_PIXELMAP **) display_1_theme_1_pixelmap_table,
+    NULL,
+    {
+        20,                                  /* scroll width                   */
+        18,                                  /* 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_SCROLL_BUTTON,           /* scroll thumb color             */
+        GX_COLOR_ID_SCROLL_BUTTON,           /* scroll thumb border color      */
+        GX_COLOR_ID_SCROLL_BUTTON,           /* scroll button color            */
+    },
+    {
+        20,                                  /* scroll width                   */
+        18,                                  /* 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_SCROLL_BUTTON,           /* scroll thumb color             */
+        GX_COLOR_ID_CANVAS,                  /* scroll thumb border color      */
+        GX_COLOR_ID_SCROLL_BUTTON,           /* scroll button color            */
+    },
+    GX_SCROLLBAR_RELATIVE_THUMB|GX_SCROLLBAR_END_BUTTONS|GX_SCROLLBAR_VERTICAL,
+    GX_SCROLLBAR_RELATIVE_THUMB|GX_SCROLLBAR_END_BUTTONS|GX_SCROLLBAR_HORIZONTAL,
+    29,                                      /* color table size               */
+    4,                                       /* font table size                */
+    6,                                       /* pixelmap table size            */
+    0                                        /* palette size                   */
+
+};
+
+GX_THEME display_1_theme_2 =
+{
+    (GX_COLOR *) display_1_theme_2_color_table,
+    (GX_FONT **) display_1_theme_2_font_table,
+    (GX_PIXELMAP **) display_1_theme_2_pixelmap_table,
+    NULL,
+    {
+        20,                                  /* scroll width                   */
+        18,                                  /* 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_SCROLL_BUTTON,           /* scroll thumb color             */
+        GX_COLOR_ID_SCROLL_BUTTON,           /* scroll thumb border color      */
+        GX_COLOR_ID_SCROLL_BUTTON,           /* scroll button color            */
+    },
+    {
+        20,                                  /* scroll width                   */
+        18,                                  /* 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_SCROLL_BUTTON,           /* scroll thumb color             */
+        GX_COLOR_ID_CANVAS,                  /* scroll thumb border color      */
+        GX_COLOR_ID_SCROLL_BUTTON,           /* scroll button color            */
+    },
+    GX_SCROLLBAR_RELATIVE_THUMB|GX_SCROLLBAR_END_BUTTONS|GX_SCROLLBAR_VERTICAL,
+    GX_SCROLLBAR_RELATIVE_THUMB|GX_SCROLLBAR_END_BUTTONS|GX_SCROLLBAR_HORIZONTAL,
+    29,                                      /* color table size               */
+    4,                                       /* font table size                */
+    6,                                       /* pixelmap table size            */
+    0                                        /* palette size                   */
+
+};
+GX_CONST GX_THEME *display_1_theme_table[2] =
+{
+    &display_1_theme_1,
+    &display_1_theme_2
+};
+

+ 60 - 0
Examples/guiapp_resources.h

@@ -0,0 +1,60 @@
+/*******************************************************************************/
+/*  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   */
+/*  resource 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.0.0                                               */
+/*  Date (dd.mm.yyyy): 13.11.2020   Time (hh:mm): 10:10                        */
+/*******************************************************************************/
+
+
+#ifndef _GUIAPP_DISPLAY_1_RESOURCES_H_
+#define _GUIAPP_DISPLAY_1_RESOURCES_H_
+
+#include "gx_api.h"
+
+/* Display and theme definitions                                               */
+
+#define DISPLAY_1 0
+#define DISPLAY_1_COLOR_FORMAT GX_COLOR_FORMAT_MONOCHROME
+#define DISPLAY_1_X_RESOLUTION 128
+#define DISPLAY_1_Y_RESOLUTION 128
+#define DISPLAY_1_THEME_1 0
+#define DISPLAY_1_THEME_2 1
+#define DISPLAY_1_THEME_TABLE_SIZE 2
+
+/* Language definitions                                                        */
+
+#define LANGUAGE_ENGLISH 0
+#define DISPLAY_1_LANGUAGE_TABLE_SIZE 1
+
+/* Color ID definitions                                                        */
+
+#define DISPLAY_1_COLOR_TABLE_SIZE 29
+
+/* Font ID definitions                                                         */
+
+#define DISPLAY_1_FONT_TABLE_SIZE 4
+
+/* Pixelmap ID definitions                                                     */
+
+#define GX_PIXELMAP_ID_YXYL_LOGO 5
+#define DISPLAY_1_PIXELMAP_TABLE_SIZE 6
+
+/* String Ids                                                                  */
+
+#define GX_STRING_ID_STRING_1 1
+#define GX_STRING_ID_STRING_2 2
+#define GX_STRING_ID_STRING_3 3
+#define GX_STRING_ID_STRING_4 4
+#define GX_STRING_ID_STRING_5 5
+#define GX_STRING_ID_STRING_6 6
+#define GX_STRING_ID_STRING_7 7
+#define GX_STRING_ID_STRING_8 8
+#define GX_STRING_ID_STRING_9 9
+#define GX_STRING_ID_STRING_10 10
+#define DISPLAY_1_STRING_TABLE_SIZE 11
+
+#endif                                       /* sentry                         */

+ 421 - 0
Examples/guiapp_specifications.c

@@ -0,0 +1,421 @@
+/*******************************************************************************/
+/*  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.0.0                                               */
+/*  Date (dd.mm.yyyy): 13.11.2020   Time (hh:mm): 10:10                        */
+/*******************************************************************************/
+
+
+#define GUIX_STUDIO_GENERATED_FILE
+#include <stddef.h>
+#include "guiapp_resources.h"
+#include "guiapp_specifications.h"
+
+static GX_WIDGET *gx_studio_nested_widget_create(GX_BYTE *control, GX_CONST GX_STUDIO_WIDGET *definition, GX_WIDGET *parent);
+WINDOW_1_CONTROL_BLOCK window_1;
+WINDOW_CONTROL_BLOCK window;
+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[512];
+
+extern GX_CONST GX_THEME *display_1_theme_table[];
+extern GX_CONST GX_STRING *display_1_language_table[];
+
+GX_STUDIO_DISPLAY_INFO guiapp_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,
+    128,                                     /* x resolution                   */
+    128,                                     /* y resolution                   */
+    &display_1_control_block,
+    &display_1_canvas_control_block,
+    &display_1_root_window,
+    display_1_canvas_memory,                 /* canvas memory area             */
+    2048                                     /* canvas memory size in bytes    */
+    }
+};
+
+
+UINT gx_studio_text_button_create(GX_CONST GX_STUDIO_WIDGET *info, GX_WIDGET *control_block, GX_WIDGET *parent)
+{
+    UINT status;
+    GX_TEXT_BUTTON *button = (GX_TEXT_BUTTON *) control_block;
+    GX_TEXT_BUTTON_PROPERTIES *props = (GX_TEXT_BUTTON_PROPERTIES *) info->properties;
+    status = gx_text_button_create(button, info->widget_name, parent, props->string_id, info->style, info->widget_id, &info->size);
+    if (status == GX_SUCCESS)
+    {
+        gx_text_button_font_set(button, props->font_id);
+#if defined(GUIX_5_4_0_COMPATIBILITY)
+        gx_text_button_text_color_set(button, props->normal_text_color_id, props->selected_text_color_id);
+#else
+        gx_text_button_text_color_set(button, props->normal_text_color_id, props->selected_text_color_id, props->disabled_text_color_id);
+#endif
+    }
+    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;
+}
+GX_WINDOW_PROPERTIES window_1_properties =
+{
+    0                                        /* wallpaper pixelmap id          */
+};
+GX_TEXT_BUTTON_PROPERTIES window_1_button_properties =
+{
+    GX_STRING_ID_STRING_9,                   /* string id                      */
+    GX_FONT_ID_BUTTON,                       /* font id                        */
+    GX_COLOR_ID_BTN_TEXT,                    /* normal text color              */
+    GX_COLOR_ID_BTN_TEXT,                    /* selected text color            */
+    GX_COLOR_ID_DISABLED_TEXT                /* disabled text color            */
+};
+GX_PROMPT_PROPERTIES window_1_prompt_properties =
+{
+    GX_STRING_ID_STRING_10,                  /* 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_DISABLED_TEXT                /* disabled text color            */
+};
+
+GX_CONST GX_STUDIO_WIDGET window_1_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_ENABLED|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        */
+    {19, 6, 98, 29},                         /* widget size                    */
+    GX_NULL,                                 /* no next widget                 */
+    GX_NULL,                                 /* no child widgets               */ 
+    offsetof(WINDOW_1_CONTROL_BLOCK, window_1_prompt), /* control block        */
+    (void *) &window_1_prompt_properties     /* extended properties            */
+};
+
+GX_CONST GX_STUDIO_WIDGET window_1_button_define =
+{
+    "button",
+    GX_TYPE_TEXT_BUTTON,                     /* widget type                    */
+    GUI_ID_TextButton0,                      /* widget id                      */
+    #if defined(GX_WIDGET_USER_DATA)
+    0,                                       /* user data                      */
+    #endif
+    GX_STYLE_BORDER_RAISED|GX_STYLE_ENABLED|GX_STYLE_TEXT_CENTER,   /* style flags */
+    GX_STATUS_ACCEPTS_FOCUS,                 /* status flags                   */
+    sizeof(GX_TEXT_BUTTON),                  /* control block size             */
+    GX_COLOR_ID_BTN_LOWER,                   /* normal color id                */
+    GX_COLOR_ID_BTN_UPPER,                   /* selected color id              */
+    GX_COLOR_ID_DISABLED_FILL,               /* disabled color id              */
+    gx_studio_text_button_create,            /* create function                */
+    GX_NULL,                                 /* drawing function override      */
+    GX_NULL,                                 /* event function override        */
+    {21, 37, 100, 60},                       /* widget size                    */
+    &window_1_prompt_define,                 /* next widget definition         */
+    GX_NULL,                                 /* no child widgets               */ 
+    offsetof(WINDOW_1_CONTROL_BLOCK, window_1_button), /* control block        */
+    (void *) &window_1_button_properties     /* extended properties            */
+};
+
+GX_CONST GX_STUDIO_WIDGET window_1_define =
+{
+    "window_1",
+    GX_TYPE_WINDOW,                          /* widget type                    */
+    GUIX_ID_WINDOW0,                         /* widget id                      */
+    #if defined(GX_WIDGET_USER_DATA)
+    0,                                       /* user data                      */
+    #endif
+    GX_STYLE_BORDER_NONE|GX_STYLE_ENABLED,   /* style flags                    */
+    GX_STATUS_ACCEPTS_FOCUS,                 /* status flags                   */
+    sizeof(WINDOW_1_CONTROL_BLOCK),          /* control block size             */
+    GX_COLOR_ID_WINDOW_FILL,                 /* normal color id                */
+    GX_COLOR_ID_WINDOW_FILL,                 /* selected color id              */
+    GX_COLOR_ID_DISABLED_FILL,               /* disabled color id              */
+    gx_studio_window_create,                 /* create function                */
+    GX_NULL,                                 /* drawing function override      */
+    GX_NULL,                                 /* event function override        */
+    {0, 0, 127, 127},                        /* widget size                    */
+    GX_NULL,                                 /* next widget                    */
+    &window_1_button_define,                 /* child widget                   */
+    0,                                       /* control block                  */
+    (void *) &window_1_properties            /* extended properties            */
+};
+GX_WINDOW_PROPERTIES window_properties =
+{
+    GX_PIXELMAP_ID_YXYL_LOGO                 /* wallpaper pixelmap id          */
+};
+
+GX_CONST GX_STUDIO_WIDGET window_define =
+{
+    "window",
+    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_ENABLED,   /* style flags                    */
+    GX_STATUS_ACCEPTS_FOCUS,                 /* status flags                   */
+    sizeof(WINDOW_CONTROL_BLOCK),            /* control block size             */
+    GX_COLOR_ID_WINDOW_FILL,                 /* normal color id                */
+    GX_COLOR_ID_WINDOW_FILL,                 /* selected color id              */
+    GX_COLOR_ID_DISABLED_FILL,               /* disabled color id              */
+    gx_studio_window_create,                 /* create function                */
+    GX_NULL,                                 /* drawing function override      */
+    GX_NULL,                                 /* event function override        */
+    {0, 37, 127, 89},                        /* widget size                    */
+    GX_NULL,                                 /* next widget                    */
+    GX_NULL,                                 /* child widget                   */
+    0,                                       /* control block                  */
+    (void *) &window_properties              /* extended properties            */
+};
+GX_CONST GX_STUDIO_WIDGET_ENTRY guiapp_widget_table[] =
+{
+    { &window_1_define, (GX_WIDGET *) &window_1 },
+    { &window_define, (GX_WIDGET *) &window },
+    {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 = guiapp_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 = &guiapp_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);
+            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);
+        }
+    }
+
+
+/* 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

+ 157 - 0
Examples/guiapp_specifications.h

@@ -0,0 +1,157 @@
+/*******************************************************************************/
+/*  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.0.0                                               */
+/*  Date (dd.mm.yyyy): 13.11.2020   Time (hh:mm): 10:10                        */
+/*******************************************************************************/
+
+
+#ifndef _GUIAPP_SPECIFICATIONS_H_
+#define _GUIAPP_SPECIFICATIONS_H_
+
+#include "gx_api.h"
+
+/* Determine if C++ compiler is being used, if so use standard C.              */
+#ifdef __cplusplus
+extern   "C" {
+#endif
+
+/* Define widget ids                                                           */
+
+#define GUIX_ID_WINDOW0 1
+#define GUI_ID_TextButton0 2
+
+
+/* Define animation ids                                                        */
+
+#define GX_NEXT_ANIMATION_ID 1
+
+
+/* Define user event ids                                                       */
+
+#define GX_NEXT_USER_EVENT_ID GX_FIRST_USER_EVENT
+
+
+/* Declare properties structures for each utilized widget type                 */
+
+typedef struct GX_STUDIO_WIDGET_STRUCT
+{
+   GX_CHAR *widget_name;
+   USHORT  widget_type;
+   USHORT  widget_id;
+   #if defined(GX_WIDGET_USER_DATA)
+   INT   user_data;
+   #endif
+   ULONG style;
+   ULONG status;
+   ULONG control_block_size;
+   GX_RESOURCE_ID normal_fill_color_id;
+   GX_RESOURCE_ID selected_fill_color_id;
+   GX_RESOURCE_ID disabled_fill_color_id;
+   UINT (*create_function) (GX_CONST struct GX_STUDIO_WIDGET_STRUCT *, GX_WIDGET *, GX_WIDGET *);
+   void (*draw_function) (GX_WIDGET *);
+   UINT (*event_function) (GX_WIDGET *, GX_EVENT *);
+   GX_RECTANGLE size;
+   GX_CONST struct GX_STUDIO_WIDGET_STRUCT *next_widget;
+   GX_CONST struct GX_STUDIO_WIDGET_STRUCT *child_widget;
+   ULONG control_block_offset;
+   GX_CONST void *properties;
+} GX_STUDIO_WIDGET;
+
+typedef struct
+{
+    GX_CONST GX_STUDIO_WIDGET *widget_information;
+    GX_WIDGET        *widget;
+} GX_STUDIO_WIDGET_ENTRY;
+
+typedef struct
+{
+    GX_RESOURCE_ID string_id; 
+    GX_RESOURCE_ID font_id;
+    GX_RESOURCE_ID normal_text_color_id;
+    GX_RESOURCE_ID selected_text_color_id;
+    GX_RESOURCE_ID disabled_text_color_id;
+} GX_TEXT_BUTTON_PROPERTIES;
+
+typedef struct
+{
+    GX_RESOURCE_ID string_id;
+    GX_RESOURCE_ID font_id;
+    GX_RESOURCE_ID normal_text_color_id;
+    GX_RESOURCE_ID selected_text_color_id;
+    GX_RESOURCE_ID disabled_text_color_id;
+} GX_PROMPT_PROPERTIES;
+
+typedef struct
+{
+    GX_RESOURCE_ID wallpaper_id;
+} GX_WINDOW_PROPERTIES;
+
+
+/* Declare top-level control blocks                                            */
+
+typedef struct WINDOW_1_CONTROL_BLOCK_STRUCT
+{
+    GX_WINDOW_MEMBERS_DECLARE
+    GX_TEXT_BUTTON window_1_button;
+    GX_PROMPT window_1_prompt;
+} WINDOW_1_CONTROL_BLOCK;
+
+typedef struct WINDOW_CONTROL_BLOCK_STRUCT
+{
+    GX_WINDOW_MEMBERS_DECLARE
+} WINDOW_CONTROL_BLOCK;
+
+
+/* extern statically defined control blocks                                    */
+
+#ifndef GUIX_STUDIO_GENERATED_FILE
+extern WINDOW_1_CONTROL_BLOCK window_1;
+extern WINDOW_CONTROL_BLOCK window;
+#endif
+
+/* Declare event process functions, draw functions, and callback functions     */
+
+
+/* Declare the GX_STUDIO_DISPLAY_INFO structure                                */
+
+
+typedef struct GX_STUDIO_DISPLAY_INFO_STRUCT 
+{
+    GX_CONST GX_CHAR *name;
+    GX_CONST GX_CHAR *canvas_name;
+    GX_CONST GX_THEME **theme_table;
+    GX_CONST GX_STRING **language_table;
+    USHORT   theme_table_size;
+    USHORT   language_table_size;
+    UINT     string_table_size;
+    UINT     x_resolution;
+    UINT     y_resolution;
+    GX_DISPLAY *display;
+    GX_CANVAS  *canvas;
+    GX_WINDOW_ROOT *root_window;
+    GX_COLOR   *canvas_memory;
+    ULONG      canvas_memory_size;
+} GX_STUDIO_DISPLAY_INFO;
+
+
+/* Declare Studio-generated functions for creating top-level widgets           */
+
+UINT gx_studio_text_button_create(GX_CONST GX_STUDIO_WIDGET *info, GX_WIDGET *control_block, GX_WIDGET *parent);
+UINT gx_studio_prompt_create(GX_CONST GX_STUDIO_WIDGET *info, GX_WIDGET *control_block, GX_WIDGET *parent);
+UINT gx_studio_window_create(GX_CONST GX_STUDIO_WIDGET *info, GX_WIDGET *control_block, GX_WIDGET *parent);
+GX_WIDGET *gx_studio_widget_create(GX_BYTE *storage, GX_CONST GX_STUDIO_WIDGET *definition, GX_WIDGET *parent);
+UINT gx_studio_named_widget_create(char *name, GX_WIDGET *parent, GX_WIDGET **new_widget);
+UINT gx_studio_display_configure(USHORT display, UINT (*driver)(GX_DISPLAY *), GX_UBYTE language, USHORT theme, GX_WINDOW_ROOT **return_root);
+
+/* Determine if a C++ compiler is being used.  If so, complete the standard
+  C conditional started above.                                                 */
+#ifdef __cplusplus
+}
+#endif
+
+#endif                                       /* sentry                         */

+ 13 - 4
SConscript

@@ -5,11 +5,20 @@ import rtconfig
 cwd     = GetCurrentDir()
 src     = Glob('Source/common/src/*.c')
 CPPPATH = [cwd + 'Source/common/inc']
-LOCAL_CCFLAGS = ''
 
-if GetDepend(['PKG_USING_AZUREGUIX']):
-    src += Glob('Port/gx_system_rtos_bind_rtthread.c')
 
-group = DefineGroup('GUIX/Source', src, depend = ['PKG_USING_AZUREGUIX'], CPPPATH = CPPPATH, LOCAL_CCFLAGS = LOCAL_CCFLAGS)
+src += Glob('Port/gx_system_rtos_bind_rtthread.c')
+
+group = DefineGroup('GUIX/Source', src, depend = ['PKG_USING_AZUREGUIX'], CPPPATH = CPPPATH)
+
+cwd     = GetCurrentDir()
+src     = Glob('Port/gx_user.h')
+CPPPATH = [cwd + 'Port']
+group = DefineGroup('GUIX/Port', src, depend = ['PKG_USING_AZUREGUIX'], CPPPATH = CPPPATH)
+
+cwd     = GetCurrentDir()
+src     = Glob('Examples/*.c')
+CPPPATH = [cwd + 'Examples']
+group = DefineGroup('GUIX/Examples', src, depend = ['PKG_USING_AZUREGUIX'], CPPPATH = CPPPATH)
 
 Return('group')