STM32F769IDiscovery  1.00
uDANTE Audio Networking with STM32F7 DISCO board
FRAMEWIN.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.h
30 Purpose : Frame window include
31 --------------------END-OF-HEADER-------------------------------------
32 */
33 
34 #ifndef FRAMEWIN_H
35 #define FRAMEWIN_H
36 
37 #include "WM.h"
38 #include "WIDGET.h" /* Req. for WIDGET_DRAW_ITEM_FUNC */
39 #if GUI_WINSUPPORT
40 #include "DIALOG_Intern.h" /* Req. for Create indirect data structure */
41 
42 #if defined(__cplusplus)
43  extern "C" { /* Make sure we have C-declarations in C++ programs */
44 #endif
45 
46 /*********************************************************************
47 *
48 * Defines
49 *
50 **********************************************************************
51 */
52 /*********************************************************************
53 *
54 * Configuration
55 */
56 #ifndef FRAMEWIN_ALLOW_DRAG_ON_FRAME
57  #define FRAMEWIN_ALLOW_DRAG_ON_FRAME 1
58 #endif
59 
60 /*********************************************************************
61 *
62 * Color indices
63 */
64 #define FRAMEWIN_CI_INACTIVE 0
65 #define FRAMEWIN_CI_ACTIVE 1
66 
67 /*********************************************************************
68 *
69 * Create / Status flags
70 */
71 #define FRAMEWIN_CF_ACTIVE (1<<3)
72 #define FRAMEWIN_CF_MOVEABLE (1<<4)
73 #define FRAMEWIN_CF_TITLEVIS (1<<5)
74 #define FRAMEWIN_CF_MINIMIZED (1<<6)
75 #define FRAMEWIN_CF_MAXIMIZED (1<<7)
76 #define FRAMEWIN_CF_DRAGGING (1<<8)
77 
78 #define FRAMEWIN_SF_ACTIVE FRAMEWIN_CF_ACTIVE
79 #define FRAMEWIN_SF_MOVEABLE FRAMEWIN_CF_MOVEABLE
80 #define FRAMEWIN_SF_TITLEVIS FRAMEWIN_CF_TITLEVIS
81 #define FRAMEWIN_SF_MINIMIZED FRAMEWIN_CF_MINIMIZED
82 #define FRAMEWIN_SF_MAXIMIZED FRAMEWIN_CF_MAXIMIZED
83 #define FRAMEWIN_SF_DRAGGING FRAMEWIN_CF_DRAGGING
84 
85 /*********************************************************************
86 *
87 * BUTTON Flags
88 */
89 #define FRAMEWIN_BUTTON_RIGHT (1<<0)
90 #define FRAMEWIN_BUTTON_LEFT (1<<1)
91 
92 /*********************************************************************
93 *
94 * Skinning property indices
95 */
96 #define FRAMEWIN_SKINFLEX_PI_ACTIVE 0
97 #define FRAMEWIN_SKINFLEX_PI_INACTIVE 1
98 
99 /*********************************************************************
100 *
101 * Getting border size
102 */
103 #define FRAMEWIN_BORDERSIZE_T 0
104 #define FRAMEWIN_BORDERSIZE_L 1
105 #define FRAMEWIN_BORDERSIZE_B 2
106 #define FRAMEWIN_BORDERSIZE_R 3
107 
108 /*********************************************************************
109 *
110 * Types
111 *
112 **********************************************************************
113 */
114 typedef WM_HMEM FRAMEWIN_Handle;
115 
116 typedef struct {
117  GUI_COLOR aColorFrame[3];
118  GUI_COLOR aColorTitle[2];
119  int Radius;
120  int SpaceX;
121  int BorderSizeL;
122  int BorderSizeR;
123  int BorderSizeT;
124  int BorderSizeB;
125 } FRAMEWIN_SKINFLEX_PROPS;
126 
127 /*********************************************************************
128 *
129 * Create functions
130 *
131 **********************************************************************
132 */
133 FRAMEWIN_Handle FRAMEWIN_Create (const char * pTitle, WM_CALLBACK * cb, int Flags, int x0, int y0, int xSize, int ySize);
134 FRAMEWIN_Handle FRAMEWIN_CreateAsChild (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, const char * pText, WM_CALLBACK * cb, int Flags);
135 FRAMEWIN_Handle FRAMEWIN_CreateEx (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int WinFlags, int ExFlags, int Id, const char * pTitle, WM_CALLBACK * cb);
136 FRAMEWIN_Handle FRAMEWIN_CreateUser (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int WinFlags, int ExFlags, int Id, const char * pTitle, WM_CALLBACK * cb, int NumExtraBytes);
137 FRAMEWIN_Handle FRAMEWIN_CreateIndirect(const GUI_WIDGET_CREATE_INFO * pCreateInfo, WM_HWIN hWinParent, int x0, int y0, WM_CALLBACK * cb);
138 
139 /*********************************************************************
140 *
141 * The callback ...
142 *
143 * Do not call it directly ! It is only to be used from within an
144 * overwritten callback.
145 */
146 void FRAMEWIN_Callback(WM_MESSAGE * pMsg);
147 
148 /*********************************************************************
149 *
150 * Standard member functions
151 *
152 **********************************************************************
153 */
154 #define FRAMEWIN_EnableMemdev(hObj) WM_EnableMemdev(hObj)
155 #define FRAMEWIN_DisableMemdev(hObj) WM_DisableMemdev(hObj)
156 #define FRAMEWIN_Delete(hObj) WM_DeleteWindow(hObj)
157 #define FRAMEWIN_Paint(hObj) WM_Paint(hObj)
158 #define FRAMEWIN_Invalidate(hObj) WM_InvalidateWindow(hObj)
159 
160 WM_HWIN FRAMEWIN_AddButton (FRAMEWIN_Handle hObj, int Flags, int Off, int Id);
161 WM_HWIN FRAMEWIN_AddCloseButton(FRAMEWIN_Handle hObj, int Flags, int Off);
162 WM_HWIN FRAMEWIN_AddMaxButton (FRAMEWIN_Handle hObj, int Flags, int Off);
163 void FRAMEWIN_AddMenu (FRAMEWIN_Handle hObj, WM_HWIN hMenu);
164 WM_HWIN FRAMEWIN_AddMinButton (FRAMEWIN_Handle hObj, int Flags, int Off);
165 
166 void FRAMEWIN_Minimize (FRAMEWIN_Handle hObj);
167 void FRAMEWIN_Maximize (FRAMEWIN_Handle hObj);
168 void FRAMEWIN_Restore (FRAMEWIN_Handle hObj);
169 
170 /*********************************************************************
171 *
172 * Member functions: Set Properties
173 *
174 **********************************************************************
175 */
176 void FRAMEWIN_SetActive (FRAMEWIN_Handle hObj, int State);
177 void FRAMEWIN_SetBarColor (FRAMEWIN_Handle hObj, unsigned Index, GUI_COLOR Color);
178 void FRAMEWIN_SetBorderSize (FRAMEWIN_Handle hObj, unsigned Size);
179 void FRAMEWIN_SetClientColor (FRAMEWIN_Handle hObj, GUI_COLOR Color);
180 void FRAMEWIN_SetFont (FRAMEWIN_Handle hObj, const GUI_FONT * pFont);
181 void FRAMEWIN_SetMoveable (FRAMEWIN_Handle hObj, int State);
182 void FRAMEWIN_SetOwnerDraw (FRAMEWIN_Handle hObj, WIDGET_DRAW_ITEM_FUNC * pfDrawItem);
183 void FRAMEWIN_SetResizeable (FRAMEWIN_Handle hObj, int State);
184 void FRAMEWIN_SetText (FRAMEWIN_Handle hObj, const char* s);
185 void FRAMEWIN_SetTextAlign (FRAMEWIN_Handle hObj, int Align);
186 void FRAMEWIN_SetTextColor (FRAMEWIN_Handle hObj, GUI_COLOR Color);
187 void FRAMEWIN_SetTextColorEx (FRAMEWIN_Handle hObj, unsigned Index, GUI_COLOR Color);
188 void FRAMEWIN_SetTitleVis (FRAMEWIN_Handle hObj, int Show);
189 int FRAMEWIN_SetTitleHeight (FRAMEWIN_Handle hObj, int Height);
190 int FRAMEWIN_SetUserData (FRAMEWIN_Handle hObj, const void * pSrc, int NumBytes);
191 
192 /*********************************************************************
193 *
194 * Member functions: Skinning
195 *
196 **********************************************************************
197 */
198 void FRAMEWIN_GetSkinFlexProps (FRAMEWIN_SKINFLEX_PROPS * pProps, int Index);
199 void FRAMEWIN_SetSkinClassic (FRAMEWIN_Handle hObj);
200 void FRAMEWIN_SetSkin (FRAMEWIN_Handle hObj, WIDGET_DRAW_ITEM_FUNC * pfDrawSkin);
201 int FRAMEWIN_DrawSkinFlex (const WIDGET_ITEM_DRAW_INFO * pDrawItemInfo);
202 void FRAMEWIN_SetSkinFlexProps (const FRAMEWIN_SKINFLEX_PROPS * pProps, int Index);
203 void FRAMEWIN_SetDefaultSkinClassic(void);
204 WIDGET_DRAW_ITEM_FUNC * FRAMEWIN_SetDefaultSkin(WIDGET_DRAW_ITEM_FUNC * pfDrawSkin);
205 
206 #define FRAMEWIN_SKIN_FLEX FRAMEWIN_DrawSkinFlex
207 
208 /*********************************************************************
209 *
210 * Member functions: Get Properties
211 *
212 **********************************************************************
213 */
214 const GUI_FONT * FRAMEWIN_GetFont(FRAMEWIN_Handle hObj);
215 
216 int FRAMEWIN_GetActive (FRAMEWIN_Handle hObj);
217 int FRAMEWIN_GetTitleHeight (FRAMEWIN_Handle hObj);
218 GUI_COLOR FRAMEWIN_GetBarColor (FRAMEWIN_Handle hObj, unsigned Index);
219 int FRAMEWIN_GetBorderSize (FRAMEWIN_Handle hObj);
220 int FRAMEWIN_GetBorderSizeEx(FRAMEWIN_Handle hObj, unsigned Edge);
221 void FRAMEWIN_GetText (FRAMEWIN_Handle hObj, char * pBuffer, int MaxLen);
222 int FRAMEWIN_GetTextAlign (FRAMEWIN_Handle hObj);
223 int FRAMEWIN_GetUserData (FRAMEWIN_Handle hObj, void * pDest, int NumBytes);
224 int FRAMEWIN_IsMinimized (FRAMEWIN_Handle hObj);
225 int FRAMEWIN_IsMaximized (FRAMEWIN_Handle hObj);
226 
227 /*********************************************************************
228 *
229 * Global functions
230 *
231 **********************************************************************
232 */
233 GUI_COLOR FRAMEWIN_GetDefaultBarColor (unsigned Index);
234 int FRAMEWIN_GetDefaultBorderSize (void);
235 int FRAMEWIN_GetDefaultTitleHeight(void);
236 GUI_COLOR FRAMEWIN_GetDefaultClientColor(void);
237 const GUI_FONT * FRAMEWIN_GetDefaultFont (void);
238 GUI_COLOR FRAMEWIN_GetDefaultTextColor (unsigned Index);
239 int FRAMEWIN_OwnerDraw (const WIDGET_ITEM_DRAW_INFO * pDrawItemInfo);
240 void FRAMEWIN_SetDefaultBarColor (unsigned Index, GUI_COLOR Color);
241 void FRAMEWIN_SetDefaultBorderSize (int DefaultBorderSize);
242 void FRAMEWIN_SetDefaultTitleHeight(int DefaultTitleHeight);
243 void FRAMEWIN_SetDefaultClientColor(GUI_COLOR Color);
244 void FRAMEWIN_SetDefaultFont (const GUI_FONT * pFont);
245 int FRAMEWIN_SetDefaultTextAlign (int TextAlign);
246 void FRAMEWIN_SetDefaultTextColor (unsigned Index, GUI_COLOR Color);
247 
248 /*********************************************************************
249 *
250 * Macros for compatibility
251 *
252 **********************************************************************
253 */
254 #define FRAMEWIN_SetDefaultCaptionSize(Height) FRAMEWIN_SetDefaultTitleHeight(Height)
255 #define FRAMEWIN_GetDefaultCaptionSize() FRAMEWIN_GetDefaultTitleHeight()
256 #define FRAMEWIN_CreateButton(hObj, Flags, Off, Id) FRAMEWIN_AddButton(hObj, Flags, Off, Id)
257 #define FRAMEWIN_CreateCloseButton(hObj, Flags, Off) FRAMEWIN_AddCloseButton(hObj, Flags, Off)
258 #define FRAMEWIN_CreateMaxButton(hObj, Flags, Off) FRAMEWIN_AddMaxButton(hObj, Flags, Off)
259 #define FRAMEWIN_CreateMinButton(hObj, Flags, Off) FRAMEWIN_AddMinButton(hObj, Flags, Off)
260 
261 #if defined(__cplusplus)
262  }
263 #endif
264 
265 #endif // GUI_WINSUPPORT
266 #endif // FRAMEWIN_H
267 
268 /*************************** End of file ****************************/
LCD_COLOR GUI_COLOR
Definition: GUI_Type.h:50