STM32F769IDiscovery  1.00
uDANTE Audio Networking with STM32F7 DISCO board
FRAMEWIN_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 : FRAMEWIN_Private.h
30 Purpose : FRAMEWIN private header file
31 --------------------END-OF-HEADER-------------------------------------
32 */
33 
34 #ifndef FRAMEWIN_PRIVATE_H
35 #define FRAMEWIN_PRIVATE_H
36 
37 #include "WM.h"
38 #include "FRAMEWIN.h"
39 #include "WIDGET.h"
40 #include "GUI_HOOK.h"
41 
42 #if GUI_WINSUPPORT
43 
44 /******************************************************************
45 *
46 * Config defaults
47 *
48 *******************************************************************
49 */
50 //
51 //Support for 3D effects
52 //
53 #ifndef FRAMEWIN_CLIENTCOLOR_DEFAULT
54  #if WIDGET_USE_FLEX_SKIN
55  #define FRAMEWIN_CLIENTCOLOR_DEFAULT GUI_WHITE
56  #else
57  #define FRAMEWIN_CLIENTCOLOR_DEFAULT 0xc0c0c0
58  #endif
59 #endif
60 
61 //
62 // Default for top frame size
63 //
64 #ifndef FRAMEWIN_TITLEHEIGHT_DEFAULT
65  #define FRAMEWIN_TITLEHEIGHT_DEFAULT 0
66 #endif
67 
68 //
69 // Default for left/right/top/bottom frame size
70 //
71 #ifndef FRAMEWIN_BORDER_DEFAULT
72  #define FRAMEWIN_BORDER_DEFAULT 3
73 #endif
74 
75 //
76 // Default for inner frame size
77 //
78 #ifndef FRAMEWIN_IBORDER_DEFAULT
79  #define FRAMEWIN_IBORDER_DEFAULT 1
80 #endif
81 
82 //
83 // Default font
84 //
85 #ifndef FRAMEWIN_DEFAULT_FONT
86  #if WIDGET_USE_FLEX_SKIN
87  #if WIDGET_USE_SCHEME_SMALL
88  #define FRAMEWIN_DEFAULT_FONT &GUI_Font13_1
89  #elif WIDGET_USE_SCHEME_MEDIUM
90  #define FRAMEWIN_DEFAULT_FONT &GUI_Font16_1
91  #elif WIDGET_USE_SCHEME_LARGE
92  #define FRAMEWIN_DEFAULT_FONT &GUI_Font24_1
93  #endif
94  #else
95  #if WIDGET_USE_SCHEME_SMALL
96  #define FRAMEWIN_DEFAULT_FONT &GUI_Font8_1
97  #elif WIDGET_USE_SCHEME_MEDIUM
98  #define FRAMEWIN_DEFAULT_FONT &GUI_Font13_1
99  #elif WIDGET_USE_SCHEME_LARGE
100  #define FRAMEWIN_DEFAULT_FONT &GUI_Font16_1
101  #endif
102  #endif
103 #endif
104 
105 //
106 // Default bar color when framewin is active
107 //
108 #ifndef FRAMEWIN_BARCOLOR_ACTIVE_DEFAULT
109  #define FRAMEWIN_BARCOLOR_ACTIVE_DEFAULT 0xFF0000
110 #endif
111 
112 //
113 // Default bar color when framewin is inactive
114 //
115 #ifndef FRAMEWIN_BARCOLOR_INACTIVE_DEFAULT
116  #define FRAMEWIN_BARCOLOR_INACTIVE_DEFAULT 0x404040
117 #endif
118 
119 //
120 // Default frame color
121 //
122 #ifndef FRAMEWIN_FRAMECOLOR_DEFAULT
123  #define FRAMEWIN_FRAMECOLOR_DEFAULT 0xAAAAAA
124 #endif
125 
126 //
127 // Default text color when framewin is active
128 //
129 #ifndef FRAMEWIN_TEXTCOLOR_INACTIVE_DEFAULT
130  #if WIDGET_USE_FLEX_SKIN
131  #define FRAMEWIN_TEXTCOLOR_INACTIVE_DEFAULT GUI_BLACK
132  #else
133  #define FRAMEWIN_TEXTCOLOR_INACTIVE_DEFAULT GUI_WHITE
134  #endif
135 #endif
136 
137 //
138 // Default text color when framewin is inactive
139 //
140 #ifndef FRAMEWIN_TEXTCOLOR_ACTIVE_DEFAULT
141  #if WIDGET_USE_FLEX_SKIN
142  #define FRAMEWIN_TEXTCOLOR_ACTIVE_DEFAULT GUI_BLACK
143  #else
144  #define FRAMEWIN_TEXTCOLOR_ACTIVE_DEFAULT GUI_WHITE
145  #endif
146 #endif
147 
148 //
149 // Default text alignment
150 //
151 #ifndef FRAMEWIN_TEXTALIGN_DEFAULT
152  #define FRAMEWIN_TEXTALIGN_DEFAULT GUI_TA_LEFT
153 #endif
154 
155 /*********************************************************************
156 *
157 * Object definition
158 *
159 **********************************************************************
160 */
161 typedef struct {
162  unsigned (* pfGetBordersize)(FRAMEWIN_Handle hObj, unsigned Index);
163  WIDGET_DRAW_ITEM_FUNC * pfDrawSkin;
164 } FRAMEWIN_SKIN_PRIVATE;
165 
166 typedef struct {
167  const GUI_FONT * pFont;
168  GUI_COLOR aBarColor[2];
169  GUI_COLOR aTextColor[2];
170  GUI_COLOR ClientColor;
171  FRAMEWIN_SKIN_PRIVATE SkinPrivate;
172  I16 TitleHeight;
173  I16 BorderSize;
174  I16 IBorderSize;
175  I16 TextAlign;
176 } FRAMEWIN_PROPS;
177 
178 typedef struct {
179  WIDGET Widget;
180  FRAMEWIN_PROPS Props;
181  WIDGET_SKIN const * pWidgetSkin;
182  WIDGET_DRAW_ITEM_FUNC * pfDrawItem; // Only for drawing the title bar...
183  WM_CALLBACK * cb;
184  WM_HWIN hClient;
185  WM_HWIN hMenu;
186  WM_HWIN hText;
187  GUI_RECT rRestore;
188  U16 Flags;
189  WM_HWIN hFocussedChild; // Handle to focussed child .. default none (0)
190  WM_DIALOG_STATUS * pDialogStatus;
191  GUI_HOOK * pFirstHook;
192 } FRAMEWIN_Obj;
193 
194 typedef struct {
195  I16 TitleHeight;
196  I16 MenuHeight;
197  GUI_RECT rClient;
198  GUI_RECT rTitleText;
199 } FRAMEWIN_POSITIONS;
200 
201 /*********************************************************************
202 *
203 * Macros for internal use
204 *
205 **********************************************************************
206 */
207 #if GUI_DEBUG_LEVEL >= GUI_DEBUG_LEVEL_CHECK_ALL
208  #define FRAMEWIN_INIT_ID(p) (p->Widget.DebugId = FRAMEWIN_ID)
209 #else
210  #define FRAMEWIN_INIT_ID(p)
211 #endif
212 
213 #if GUI_DEBUG_LEVEL >= GUI_DEBUG_LEVEL_CHECK_ALL
214  FRAMEWIN_Obj * FRAMEWIN_LockH(FRAMEWIN_Handle h);
215  #define FRAMEWIN_LOCK_H(h) FRAMEWIN_LockH(h)
216 #else
217  #define FRAMEWIN_LOCK_H(h) (FRAMEWIN_Obj *)GUI_LOCK_H(h)
218 #endif
219 
220 /*********************************************************************
221 *
222 * Public data (internal defaults)
223 *
224 **********************************************************************
225 */
226 extern FRAMEWIN_PROPS FRAMEWIN__DefaultProps;
227 
228 extern const WIDGET_SKIN FRAMEWIN__SkinClassic;
229 extern WIDGET_SKIN FRAMEWIN__Skin;
230 
231 extern const WIDGET_SKIN * FRAMEWIN__pSkinDefault;
232 
233 /*********************************************************************
234 *
235 * Private functions
236 *
237 **********************************************************************
238 */
239 void FRAMEWIN__CalcPositions (FRAMEWIN_Handle hObj, FRAMEWIN_POSITIONS * pPos);
240 int FRAMEWIN__CalcTitleHeight(FRAMEWIN_Obj * pObj);
241 void FRAMEWIN__UpdatePositions(FRAMEWIN_Handle hObj);
242 void FRAMEWIN__UpdateButtons (FRAMEWIN_Handle hObj, int OldHeight, int OldBorderSizeL, int OldBorderSizeR, int OldBorderSizeT);
243 void FRAMEWIN__GetTitleLimits (FRAMEWIN_Handle hObj, int * pxMin, int * pxMax);
244 unsigned FRAMEWIN__GetBorderSize (FRAMEWIN_Handle hObj, unsigned Index);
245 
246 #endif // GUI_WINSUPPORT
247 #endif // FRAMEWIN_PRIVATE_H
Definition: LCD.h:102
LCD_COLOR GUI_COLOR
Definition: GUI_Type.h:50
#define I16
Definition: Global.h:56
#define U16
Definition: Global.h:47