STM32F769IDiscovery  1.00
uDANTE Audio Networking with STM32F7 DISCO board
RADIO_Private.h
Go to the documentation of this file.
1 /*********************************************************************
2 * SEGGER Microcontroller GmbH & Co. KG *
3 * Solutions for real time microcontroller applications *
4 **********************************************************************
5 * *
6 * (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
7 * *
8 * Internet: www.segger.com Support: support@segger.com *
9 * *
10 **********************************************************************
11 
12 ** emWin V5.28 - Graphical user interface for embedded applications **
13 All Intellectual Property rights in the Software belongs to SEGGER.
14 emWin is protected by international copyright laws. Knowledge of the
15 source code may not be used to write a similar product. This file may
16 only be used in accordance with the following terms:
17 
18 The software has been licensed to STMicroelectronics International
19 N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
20 les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
21 purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
22 troller products commercialized by Licensee only, sublicensed and dis_
23 tributed under the terms and conditions of the End User License Agree_
24 ment supplied by STMicroelectronics International N.V.
25 Full source code is available at: www.segger.com
26 
27 We appreciate your understanding and fairness.
28 ----------------------------------------------------------------------
29 File : RADIO_Private.h
30 Purpose : RADIO private header file
31 --------------------END-OF-HEADER-------------------------------------
32 */
33 
34 #ifndef RADIO_PRIVATE_H
35 #define RADIO_PRIVATE_H
36 
37 #include "WM.h"
38 
39 #if GUI_WINSUPPORT
40 
41 #include "RADIO.h"
42 #include "WIDGET.h"
43 #include "GUI_ARRAY.h"
44 
45 /*********************************************************************
46 *
47 * Defines
48 *
49 **********************************************************************
50 */
51 /* Define default image inactiv */
52 #ifndef RADIO_IMAGE0_DEFAULT
53  #define RADIO_IMAGE0_DEFAULT &RADIO__abmRadio[0]
54 #endif
55 
56 /* Define default image activ */
57 #ifndef RADIO_IMAGE1_DEFAULT
58  #define RADIO_IMAGE1_DEFAULT &RADIO__abmRadio[1]
59 #endif
60 
61 /* Define default image check */
62 #ifndef RADIO_IMAGE_CHECK_DEFAULT
63  #define RADIO_IMAGE_CHECK_DEFAULT &RADIO__bmCheck
64 #endif
65 
66 /* Define default font */
67 #ifndef RADIO_FONT_DEFAULT
68  #if WIDGET_USE_SCHEME_SMALL
69  #define RADIO_SPACING_DEFAULT 20
70  #define RADIO_FONT_DEFAULT &GUI_Font13_1
71  #elif WIDGET_USE_SCHEME_MEDIUM
72  #define RADIO_SPACING_DEFAULT 24
73  #define RADIO_FONT_DEFAULT &GUI_Font16_1
74  #elif WIDGET_USE_SCHEME_LARGE
75  #define RADIO_SPACING_DEFAULT 30
76  #define RADIO_FONT_DEFAULT &GUI_Font24_1
77  #endif
78 #endif
79 
80 /* Define vertical default spacing */
81 #ifndef RADIO_SPACING_DEFAULT
82  #define RADIO_SPACING_DEFAULT 20
83 #endif
84 
85 /* Define default text color */
86 #ifndef RADIO_DEFAULT_TEXT_COLOR
87  #define RADIO_DEFAULT_TEXT_COLOR GUI_BLACK
88 #endif
89 
90 /* Define default background color */
91 #ifndef RADIO_DEFAULT_BKCOLOR
92  #define RADIO_DEFAULT_BKCOLOR 0xC0C0C0
93 #endif
94 
95 #ifndef RADIO_FOCUSCOLOR_DEFAULT
96  #define RADIO_FOCUSCOLOR_DEFAULT GUI_BLACK
97 #endif
98 
99 #define RADIO_BORDER 2
100 
101 /*********************************************************************
102 *
103 * Object definition
104 *
105 **********************************************************************
106 */
107 typedef struct {
108  unsigned (* pfGetButtonSize)(RADIO_Handle hObj);
109  WIDGET_DRAW_ITEM_FUNC * pfDrawSkin;
110 } RADIO_SKIN_PRIVATE;
111 
112 typedef struct {
113  GUI_COLOR BkColor;
114  GUI_COLOR TextColor;
115  GUI_COLOR FocusColor;
116  const GUI_FONT * pFont;
117  const GUI_BITMAP * apBmRadio[2];
118  const GUI_BITMAP * pBmCheck;
119  RADIO_SKIN_PRIVATE SkinPrivate;
120 } RADIO_PROPS;
121 
122 typedef struct {
123  WIDGET Widget;
124  RADIO_PROPS Props;
125  WIDGET_SKIN const * pWidgetSkin;
126  GUI_ARRAY TextArray;
127  I16 Sel; /* current selection */
128  U16 Spacing;
129  U16 NumItems;
130  U8 GroupId;
131 } RADIO_Obj;
132 
133 /*********************************************************************
134 *
135 * Macros for internal use
136 *
137 **********************************************************************
138 */
139 #if GUI_DEBUG_LEVEL >= GUI_DEBUG_LEVEL_CHECK_ALL
140  #define RADIO_INIT_ID(p) p->Widget.DebugId = RADIO_ID
141 #else
142  #define RADIO_INIT_ID(p)
143 #endif
144 
145 #if GUI_DEBUG_LEVEL >= GUI_DEBUG_LEVEL_CHECK_ALL
146  RADIO_Obj * RADIO_LockH(RADIO_Handle h);
147  #define RADIO_LOCK_H(h) RADIO_LockH(h)
148 #else
149  #define RADIO_LOCK_H(h) (RADIO_Obj *)GUI_LOCK_H(h)
150 #endif
151 
152 /*********************************************************************
153 *
154 * Types
155 *
156 **********************************************************************
157 */
158 
159 typedef void tRADIO_SetValue(RADIO_Handle hObj, int v);
160 
161 /*********************************************************************
162 *
163 * Extern data
164 *
165 **********************************************************************
166 */
167 
168 extern RADIO_PROPS RADIO__DefaultProps;
169 
170 extern const WIDGET_SKIN RADIO__SkinClassic;
171 extern WIDGET_SKIN RADIO__Skin;
172 
173 extern WIDGET_SKIN const * RADIO__pSkinDefault;
174 
175 extern const GUI_BITMAP RADIO__abmRadio[2];
176 extern const GUI_BITMAP RADIO__bmCheck;
177 extern tRADIO_SetValue* RADIO__pfHandleSetValue;
178 
179 /*********************************************************************
180 *
181 * public functions (internal)
182 *
183 **********************************************************************
184 */
185 void RADIO__SetValue (RADIO_Handle hObj, int v);
186 unsigned RADIO__GetButtonSize(RADIO_Handle hObj);
187 
188 #endif /* GUI_WINSUPPORT */
189 #endif /* RADIO_PRIVATE_H */
190 
191 /************************* end of file ******************************/
LCD_COLOR GUI_COLOR
Definition: GUI_Type.h:50
#define I16
Definition: Global.h:56
#define U16
Definition: Global.h:47
#define U8
Definition: Global.h:44