Nuvoton / Mbed OS NuMaker-mbed-emWin-example
Committer:
csyang2
Date:
Wed Feb 27 14:34:09 2019 +0800
Revision:
1:c0f972361605
Add emWin related materials

Who changed what in which revision?

UserRevisionLine numberNew contents of line
csyang2 1:c0f972361605 1 /*********************************************************************
csyang2 1:c0f972361605 2 * SEGGER Software GmbH *
csyang2 1:c0f972361605 3 * Solutions for real time microcontroller applications *
csyang2 1:c0f972361605 4 **********************************************************************
csyang2 1:c0f972361605 5 * *
csyang2 1:c0f972361605 6 * (c) 1996 - 2018 SEGGER Microcontroller GmbH *
csyang2 1:c0f972361605 7 * *
csyang2 1:c0f972361605 8 * Internet: www.segger.com Support: support@segger.com *
csyang2 1:c0f972361605 9 * *
csyang2 1:c0f972361605 10 **********************************************************************
csyang2 1:c0f972361605 11
csyang2 1:c0f972361605 12 ** emWin V5.48 - Graphical user interface for embedded applications **
csyang2 1:c0f972361605 13 All Intellectual Property rights in the Software belongs to SEGGER.
csyang2 1:c0f972361605 14 emWin is protected by international copyright laws. Knowledge of the
csyang2 1:c0f972361605 15 source code may not be used to write a similar product. This file may
csyang2 1:c0f972361605 16 only be used in accordance with the following terms:
csyang2 1:c0f972361605 17
csyang2 1:c0f972361605 18 The software has been licensed by SEGGER Software GmbH to Nuvoton Technology Corporationat the address: No. 4, Creation Rd. III, Hsinchu Science Park, Taiwan
csyang2 1:c0f972361605 19 for the purposes of creating libraries for its
csyang2 1:c0f972361605 20 Arm Cortex-M and Arm9 32-bit microcontrollers, commercialized and distributed by Nuvoton Technology Corporation
csyang2 1:c0f972361605 21 under the terms and conditions of an End User
csyang2 1:c0f972361605 22 License Agreement supplied with the libraries.
csyang2 1:c0f972361605 23 Full source code is available at: www.segger.com
csyang2 1:c0f972361605 24
csyang2 1:c0f972361605 25 We appreciate your understanding and fairness.
csyang2 1:c0f972361605 26 ----------------------------------------------------------------------
csyang2 1:c0f972361605 27 Licensing information
csyang2 1:c0f972361605 28 Licensor: SEGGER Software GmbH
csyang2 1:c0f972361605 29 Licensed to: Nuvoton Technology Corporation, No. 4, Creation Rd. III, Hsinchu Science Park, 30077 Hsinchu City, Taiwan
csyang2 1:c0f972361605 30 Licensed SEGGER software: emWin
csyang2 1:c0f972361605 31 License number: GUI-00735
csyang2 1:c0f972361605 32 License model: emWin License Agreement, signed February 27, 2018
csyang2 1:c0f972361605 33 Licensed platform: Cortex-M and ARM9 32-bit series microcontroller designed and manufactured by or for Nuvoton Technology Corporation
csyang2 1:c0f972361605 34 ----------------------------------------------------------------------
csyang2 1:c0f972361605 35 Support and Update Agreement (SUA)
csyang2 1:c0f972361605 36 SUA period: 2018-03-26 - 2019-03-27
csyang2 1:c0f972361605 37 Contact to extend SUA: sales@segger.com
csyang2 1:c0f972361605 38 ----------------------------------------------------------------------
csyang2 1:c0f972361605 39 File : RADIO_Private.h
csyang2 1:c0f972361605 40 Purpose : RADIO private header file
csyang2 1:c0f972361605 41 --------------------END-OF-HEADER-------------------------------------
csyang2 1:c0f972361605 42 */
csyang2 1:c0f972361605 43
csyang2 1:c0f972361605 44 #ifndef RADIO_PRIVATE_H
csyang2 1:c0f972361605 45 #define RADIO_PRIVATE_H
csyang2 1:c0f972361605 46
csyang2 1:c0f972361605 47 #include "WM.h"
csyang2 1:c0f972361605 48
csyang2 1:c0f972361605 49 #if GUI_WINSUPPORT
csyang2 1:c0f972361605 50
csyang2 1:c0f972361605 51 #include "RADIO.h"
csyang2 1:c0f972361605 52 #include "WIDGET.h"
csyang2 1:c0f972361605 53 #include "GUI_ARRAY.h"
csyang2 1:c0f972361605 54
csyang2 1:c0f972361605 55 /*********************************************************************
csyang2 1:c0f972361605 56 *
csyang2 1:c0f972361605 57 * Defines
csyang2 1:c0f972361605 58 *
csyang2 1:c0f972361605 59 **********************************************************************
csyang2 1:c0f972361605 60 */
csyang2 1:c0f972361605 61 /* Define default image inactiv */
csyang2 1:c0f972361605 62 #ifndef RADIO_IMAGE0_DEFAULT
csyang2 1:c0f972361605 63 #define RADIO_IMAGE0_DEFAULT &RADIO__abmRadio[0]
csyang2 1:c0f972361605 64 #endif
csyang2 1:c0f972361605 65
csyang2 1:c0f972361605 66 /* Define default image activ */
csyang2 1:c0f972361605 67 #ifndef RADIO_IMAGE1_DEFAULT
csyang2 1:c0f972361605 68 #define RADIO_IMAGE1_DEFAULT &RADIO__abmRadio[1]
csyang2 1:c0f972361605 69 #endif
csyang2 1:c0f972361605 70
csyang2 1:c0f972361605 71 /* Define default image check */
csyang2 1:c0f972361605 72 #ifndef RADIO_IMAGE_CHECK_DEFAULT
csyang2 1:c0f972361605 73 #define RADIO_IMAGE_CHECK_DEFAULT &RADIO__bmCheck
csyang2 1:c0f972361605 74 #endif
csyang2 1:c0f972361605 75
csyang2 1:c0f972361605 76 /* Define default font */
csyang2 1:c0f972361605 77 #ifndef RADIO_FONT_DEFAULT
csyang2 1:c0f972361605 78 #if WIDGET_USE_SCHEME_SMALL
csyang2 1:c0f972361605 79 #define RADIO_SPACING_DEFAULT 20
csyang2 1:c0f972361605 80 #define RADIO_FONT_DEFAULT &GUI_Font13_1
csyang2 1:c0f972361605 81 #elif WIDGET_USE_SCHEME_MEDIUM
csyang2 1:c0f972361605 82 #define RADIO_SPACING_DEFAULT 24
csyang2 1:c0f972361605 83 #define RADIO_FONT_DEFAULT &GUI_Font16_1
csyang2 1:c0f972361605 84 #elif WIDGET_USE_SCHEME_LARGE
csyang2 1:c0f972361605 85 #define RADIO_SPACING_DEFAULT 30
csyang2 1:c0f972361605 86 #define RADIO_FONT_DEFAULT &GUI_Font24_1
csyang2 1:c0f972361605 87 #endif
csyang2 1:c0f972361605 88 #endif
csyang2 1:c0f972361605 89
csyang2 1:c0f972361605 90 /* Define vertical default spacing */
csyang2 1:c0f972361605 91 #ifndef RADIO_SPACING_DEFAULT
csyang2 1:c0f972361605 92 #define RADIO_SPACING_DEFAULT 20
csyang2 1:c0f972361605 93 #endif
csyang2 1:c0f972361605 94
csyang2 1:c0f972361605 95 /* Define default text color */
csyang2 1:c0f972361605 96 #ifndef RADIO_DEFAULT_TEXT_COLOR
csyang2 1:c0f972361605 97 #define RADIO_DEFAULT_TEXT_COLOR GUI_BLACK
csyang2 1:c0f972361605 98 #endif
csyang2 1:c0f972361605 99
csyang2 1:c0f972361605 100 /* Define default background color */
csyang2 1:c0f972361605 101 #ifndef RADIO_DEFAULT_BKCOLOR
csyang2 1:c0f972361605 102 #define RADIO_DEFAULT_BKCOLOR GUI_GRAY_C0
csyang2 1:c0f972361605 103 #endif
csyang2 1:c0f972361605 104
csyang2 1:c0f972361605 105 #ifndef RADIO_FOCUSCOLOR_DEFAULT
csyang2 1:c0f972361605 106 #define RADIO_FOCUSCOLOR_DEFAULT GUI_BLACK
csyang2 1:c0f972361605 107 #endif
csyang2 1:c0f972361605 108
csyang2 1:c0f972361605 109 #define RADIO_BORDER 2
csyang2 1:c0f972361605 110
csyang2 1:c0f972361605 111 /*********************************************************************
csyang2 1:c0f972361605 112 *
csyang2 1:c0f972361605 113 * Object definition
csyang2 1:c0f972361605 114 *
csyang2 1:c0f972361605 115 **********************************************************************
csyang2 1:c0f972361605 116 */
csyang2 1:c0f972361605 117 typedef struct {
csyang2 1:c0f972361605 118 unsigned (* pfGetButtonSize)(RADIO_Handle hObj);
csyang2 1:c0f972361605 119 WIDGET_DRAW_ITEM_FUNC * pfDrawSkin;
csyang2 1:c0f972361605 120 } RADIO_SKIN_PRIVATE;
csyang2 1:c0f972361605 121
csyang2 1:c0f972361605 122 typedef struct {
csyang2 1:c0f972361605 123 GUI_COLOR BkColor;
csyang2 1:c0f972361605 124 GUI_COLOR TextColor;
csyang2 1:c0f972361605 125 GUI_COLOR FocusColor;
csyang2 1:c0f972361605 126 const GUI_FONT * pFont;
csyang2 1:c0f972361605 127 const GUI_BITMAP * apBmRadio[2];
csyang2 1:c0f972361605 128 const GUI_BITMAP * pBmCheck;
csyang2 1:c0f972361605 129 RADIO_SKIN_PRIVATE SkinPrivate;
csyang2 1:c0f972361605 130 } RADIO_PROPS;
csyang2 1:c0f972361605 131
csyang2 1:c0f972361605 132 typedef struct {
csyang2 1:c0f972361605 133 WIDGET Widget;
csyang2 1:c0f972361605 134 RADIO_PROPS Props;
csyang2 1:c0f972361605 135 WIDGET_SKIN const * pWidgetSkin;
csyang2 1:c0f972361605 136 GUI_ARRAY TextArray;
csyang2 1:c0f972361605 137 I16 Sel; /* current selection */
csyang2 1:c0f972361605 138 U16 Spacing;
csyang2 1:c0f972361605 139 U16 NumItems;
csyang2 1:c0f972361605 140 U8 GroupId;
csyang2 1:c0f972361605 141 } RADIO_Obj;
csyang2 1:c0f972361605 142
csyang2 1:c0f972361605 143 /*********************************************************************
csyang2 1:c0f972361605 144 *
csyang2 1:c0f972361605 145 * Macros for internal use
csyang2 1:c0f972361605 146 *
csyang2 1:c0f972361605 147 **********************************************************************
csyang2 1:c0f972361605 148 */
csyang2 1:c0f972361605 149 #if GUI_DEBUG_LEVEL >= GUI_DEBUG_LEVEL_CHECK_ALL
csyang2 1:c0f972361605 150 #define RADIO_INIT_ID(p) p->Widget.DebugId = RADIO_ID
csyang2 1:c0f972361605 151 #else
csyang2 1:c0f972361605 152 #define RADIO_INIT_ID(p)
csyang2 1:c0f972361605 153 #endif
csyang2 1:c0f972361605 154
csyang2 1:c0f972361605 155 #if GUI_DEBUG_LEVEL >= GUI_DEBUG_LEVEL_CHECK_ALL
csyang2 1:c0f972361605 156 RADIO_Obj * RADIO_LockH(RADIO_Handle h);
csyang2 1:c0f972361605 157 #define RADIO_LOCK_H(h) RADIO_LockH(h)
csyang2 1:c0f972361605 158 #else
csyang2 1:c0f972361605 159 #define RADIO_LOCK_H(h) (RADIO_Obj *)GUI_LOCK_H(h)
csyang2 1:c0f972361605 160 #endif
csyang2 1:c0f972361605 161
csyang2 1:c0f972361605 162 /*********************************************************************
csyang2 1:c0f972361605 163 *
csyang2 1:c0f972361605 164 * Types
csyang2 1:c0f972361605 165 *
csyang2 1:c0f972361605 166 **********************************************************************
csyang2 1:c0f972361605 167 */
csyang2 1:c0f972361605 168
csyang2 1:c0f972361605 169 typedef void tRADIO_SetValue(RADIO_Handle hObj, int v);
csyang2 1:c0f972361605 170
csyang2 1:c0f972361605 171 /*********************************************************************
csyang2 1:c0f972361605 172 *
csyang2 1:c0f972361605 173 * Extern data
csyang2 1:c0f972361605 174 *
csyang2 1:c0f972361605 175 **********************************************************************
csyang2 1:c0f972361605 176 */
csyang2 1:c0f972361605 177
csyang2 1:c0f972361605 178 extern RADIO_PROPS RADIO__DefaultProps;
csyang2 1:c0f972361605 179
csyang2 1:c0f972361605 180 extern const WIDGET_SKIN RADIO__SkinClassic;
csyang2 1:c0f972361605 181 extern WIDGET_SKIN RADIO__Skin;
csyang2 1:c0f972361605 182
csyang2 1:c0f972361605 183 extern WIDGET_SKIN const * RADIO__pSkinDefault;
csyang2 1:c0f972361605 184
csyang2 1:c0f972361605 185 extern const GUI_BITMAP RADIO__abmRadio[2];
csyang2 1:c0f972361605 186 extern const GUI_BITMAP RADIO__bmCheck;
csyang2 1:c0f972361605 187 extern tRADIO_SetValue* RADIO__pfHandleSetValue;
csyang2 1:c0f972361605 188
csyang2 1:c0f972361605 189 /*********************************************************************
csyang2 1:c0f972361605 190 *
csyang2 1:c0f972361605 191 * public functions (internal)
csyang2 1:c0f972361605 192 *
csyang2 1:c0f972361605 193 **********************************************************************
csyang2 1:c0f972361605 194 */
csyang2 1:c0f972361605 195 void RADIO__SetValue (RADIO_Handle hObj, int v);
csyang2 1:c0f972361605 196 unsigned RADIO__GetButtonSize(RADIO_Handle hObj);
csyang2 1:c0f972361605 197
csyang2 1:c0f972361605 198 #endif /* GUI_WINSUPPORT */
csyang2 1:c0f972361605 199 #endif /* RADIO_PRIVATE_H */
csyang2 1:c0f972361605 200
csyang2 1:c0f972361605 201 /************************* end of file ******************************/