STM32F769IDiscovery  1.00
uDANTE Audio Networking with STM32F7 DISCO board
WM_Intern.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 : WM_Intern.h
30 Purpose : Windows manager internal include
31 ----------------------------------------------------------------------
32 */
33 
34 #ifndef WM_INTERN_H /* Make sure we only include it once */
35 #define WM_INTERN_H /* Make sure we only include it once */
36 
37 #include "WM.h"
38 #include "GUI_Private.h"
39 
40 
41 #if defined(__cplusplus)
42 extern "C" { /* Make sure we have C-declarations in C++ programs */
43 #endif
44 
45 #if GUI_WINSUPPORT
46 
47 /*********************************************************************
48 *
49 * defines
50 *
51 **********************************************************************
52 
53  The following could be placed in a file of its own as it is not
54  used outside of the window manager
55 
56 */
57 /* Basic Windows status flags.
58  For module-internally use only !
59 */
60 #define WM_SF_HASTRANS WM_CF_HASTRANS
61 #define WM_SF_MEMDEV WM_CF_MEMDEV
62 #define WM_SF_MEMDEV_ON_REDRAW WM_CF_MEMDEV_ON_REDRAW
63 #define WM_SF_DISABLED WM_CF_DISABLED /* Disabled: Does not receive PID (mouse & touch) input */
64 #define WM_SF_ISVIS WM_CF_SHOW /* Is visible flag */
65 
66 #define WM_SF_STAYONTOP WM_CF_STAYONTOP
67 #define WM_SF_LATE_CLIP WM_CF_LATE_CLIP
68 #define WM_SF_ANCHOR_RIGHT WM_CF_ANCHOR_RIGHT
69 #define WM_SF_ANCHOR_BOTTOM WM_CF_ANCHOR_BOTTOM
70 #define WM_SF_ANCHOR_LEFT WM_CF_ANCHOR_LEFT
71 #define WM_SF_ANCHOR_TOP WM_CF_ANCHOR_TOP
72 
73 #define WM_SF_INVALID WM_CF_ACTIVATE /* We reuse this flag, as it is create only and Invalid is status only */
74 
75 #define WM_SF_CONST_OUTLINE WM_CF_CONST_OUTLINE /* Constant outline.*/
76 
77 #define WM_H2P(hWin) ((WM_Obj*)GUI_ALLOC_h2p(hWin))
78 
79 
80 #if GUI_DEBUG_LEVEL >= GUI_DEBUG_LEVEL_LOG_WARNINGS
81  #define WM_ASSERT_NOT_IN_PAINT() { if (WM__PaintCallbackCnt) \
82  GUI_DEBUG_ERROROUT("Function may not be called from within a paint event"); \
83  }
84 #else
85  #define WM_ASSERT_NOT_IN_PAINT()
86 #endif
87 
88 /*********************************************************************
89 *
90 * Data types & structures
91 *
92 **********************************************************************
93 */
94 typedef struct {
95  WM_HWIN hOld;
96  WM_HWIN hNew;
97 } WM_NOTIFY_CHILD_HAS_FOCUS_INFO;
98 
99 typedef struct WM_CRITICAL_HANDLE {
100  struct WM_CRITICAL_HANDLE * pNext;
101  volatile WM_HWIN hWin;
102 } WM_CRITICAL_HANDLE;
103 
104 /*********************************************************************
105 *
106 * Data (extern)
107 *
108 **********************************************************************
109 */
110 extern U32 WM__CreateFlags;
111 extern WM_HWIN WM__ahCapture[GUI_NUM_LAYERS];
112 extern WM_HWIN WM__ahWinFocus[GUI_NUM_LAYERS];
113 extern char WM__CaptureReleaseAuto;
114 extern WM_tfPollPID * WM_pfPollPID;
115 extern U8 WM__PaintCallbackCnt; /* Public for assertions only */
116 extern WM_HWIN WM__hCreateStatic;
117 
118 #if WM_SUPPORT_TRANSPARENCY
119  extern int WM__TransWindowCnt;
120  extern WM_HWIN WM__hATransWindow;
121 #endif
122 
123 #if WM_SUPPORT_DIAG
124  extern void (*WM__pfShowInvalid)(WM_HWIN hWin);
125 #endif
126 
127 extern WM_CRITICAL_HANDLE WM__aCHWinModal[GUI_NUM_LAYERS];
128 extern WM_CRITICAL_HANDLE WM__aCHWinLast[GUI_NUM_LAYERS];
129 extern int WM__ModalLayer;
130 
131 #if GUI_SUPPORT_MOUSE
132  extern WM_CRITICAL_HANDLE WM__aCHWinMouseOver[GUI_NUM_LAYERS];
133 #endif
134 
135 #ifdef WM_C
136  #define GUI_EXTERN
137 #else
138  #define GUI_EXTERN extern
139 #endif
140 
141 #if (GUI_NUM_LAYERS > 1)
142  GUI_EXTERN unsigned WM__TouchedLayer;
143  #define WM__TOUCHED_LAYER WM__TouchedLayer
144 #else
145  #define WM__TOUCHED_LAYER GUI_CURSOR_LAYER
146 #endif
147 
148 GUI_EXTERN U16 WM__NumWindows;
149 GUI_EXTERN U16 WM__NumInvalidWindows;
150 GUI_EXTERN WM_HWIN WM__FirstWin;
151 GUI_EXTERN WM_CRITICAL_HANDLE * WM__pFirstCriticalHandle;
152 
153 GUI_EXTERN WM_HWIN WM__ahDesktopWin[GUI_NUM_LAYERS];
154 GUI_EXTERN GUI_COLOR WM__aBkColor[GUI_NUM_LAYERS];
155 
156 #undef GUI_EXTERN
157 
158 /*********************************************************************
159 *
160 * Prototypes
161 *
162 **********************************************************************
163 */
164 void WM__ActivateClipRect (void);
165 int WM__ClipAtParentBorders (GUI_RECT * pRect, WM_HWIN hWin);
166 void WM__Client2Screen (const WM_Obj * pWin, GUI_RECT * pRect);
167 void WM__DeleteAssocTimer (WM_HWIN hWin);
168 void WM__DeleteSecure (WM_HWIN hWin);
169 void WM__DetachWindow (WM_HWIN hChild);
170 void WM__ForEachDesc (WM_HWIN hWin, WM_tfForEach * pcb, void * pData);
171 void WM__GetClientRectWin (const WM_Obj * pWin, GUI_RECT * pRect);
172 void WM__GetClientRectEx (WM_HWIN hWin, GUI_RECT * pRect);
173 WM_HWIN WM__GetFirstSibling (WM_HWIN hWin);
174 WM_HWIN WM__GetFocussedChild (WM_HWIN hWin);
175 int WM__GetHasFocus (WM_HWIN hWin);
176 WM_HWIN WM__GetLastSibling (WM_HWIN hWin);
177 WM_HWIN WM__GetPrevSibling (WM_HWIN hWin);
178 int WM__GetTopLevelLayer (WM_HWIN hWin);
179 int WM__GetWindowSizeX (const WM_Obj * pWin);
180 int WM__GetWindowSizeY (const WM_Obj * pWin);
181 void WM__InsertWindowIntoList (WM_HWIN hWin, WM_HWIN hParent);
182 void WM__Invalidate1Abs (WM_HWIN hWin, const GUI_RECT * pRect);
183 void WM__InvalidateAreaBelow (const GUI_RECT * pRect, WM_HWIN StopWin);
184 void WM__InvalidateRectEx (const GUI_RECT * pInvalidRect, WM_HWIN hParent, WM_HWIN hStop);
185 void WM__InvalidateTransAreaAbove(const GUI_RECT * pRect, WM_HWIN StopWin);
186 int WM__IntersectRect (GUI_RECT * pDest, const GUI_RECT * pr0, const GUI_RECT * pr1);
187 int WM__IsAncestor (WM_HWIN hChild, WM_HWIN hParent);
188 int WM__IsAncestorOrSelf (WM_HWIN hChild, WM_HWIN hParent);
189 int WM__IsChild (WM_HWIN hWin, WM_HWIN hParent);
190 int WM__IsEnabled (WM_HWIN hWin);
191 int WM__IsInModalArea (WM_HWIN hWin);
192 int WM__IsInWindow (WM_Obj * pWin, int x, int y);
193 int WM__IsWindow (WM_HWIN hWin);
194 void WM__LeaveIVRSearch (void);
195 void WM__MoveTo (WM_HWIN hWin, int x, int y);
196 void WM__MoveWindow (WM_HWIN hWin, int dx, int dy);
197 void WM__NotifyVisChanged (WM_HWIN hWin, GUI_RECT * pRect);
198 int WM__RectIsNZ (const GUI_RECT * pr);
199 void WM__RemoveWindowFromList (WM_HWIN hWin);
200 void WM__Screen2Client (const WM_Obj * pWin, GUI_RECT * pRect);
201 void WM__SelectTopLevelLayer (WM_HWIN hWin);
202 void WM__SendMsgNoData (WM_HWIN hWin, U8 MsgId);
203 void WM__SendMessage (WM_HWIN hWin, WM_MESSAGE * pm);
204 void WM__SendMessageIfEnabled (WM_HWIN hWin, WM_MESSAGE * pm);
205 void WM__SendMessageNoPara (WM_HWIN hWin, int MsgId);
206 void WM__SendPIDMessage (WM_HWIN hWin, WM_MESSAGE * pMsg);
207 int WM__SetScrollbarH (WM_HWIN hWin, int OnOff);
208 int WM__SetScrollbarV (WM_HWIN hWin, int OnOff);
209 void WM__UpdateChildPositions (WM_Obj * pObj, int dx0, int dy0, int dx1, int dy1);
210 void WM_PID__GetPrevState (GUI_PID_STATE * pPrevState, int Layer);
211 void WM_PID__SetPrevState (GUI_PID_STATE * pPrevState, int Layer);
212 void WM__SendTouchMessage (WM_HWIN hWin, WM_MESSAGE * pMsg);
213 
214 U16 WM_GetFlags (WM_HWIN hWin);
215 int WM__Paint (WM_HWIN hWin);
216 void WM__Paint1 (WM_HWIN hWin);
217 void WM__AddCriticalHandle (WM_CRITICAL_HANDLE * pCH);
218 void WM__RemoveCriticalHandle (WM_CRITICAL_HANDLE * pCH);
219 void WM__SetLastTouched (WM_HWIN hWin);
220 
221 #if WM_SUPPORT_STATIC_MEMDEV
222  void WM__InvalidateDrawAndDescs(WM_HWIN hWin);
223 #else
224  #define WM__InvalidateDrawAndDescs(hWin)
225 #endif
226 
227 /* Static memory devices */
228 #if (GUI_SUPPORT_MEMDEV)
229  typedef struct {
230  int xSize, ySize; // Size of bk window
231  } EFFECT_CONTEXT;
232 
233  int GUI_MEMDEV__CalcParaFadeIn (int Period, int TimeUsed);
234  void GUI_MEMDEV__ClipBK (EFFECT_CONTEXT * pContext);
235  void GUI_MEMDEV__RemoveStaticDevice(WM_HWIN hWin);
236  void GUI_MEMDEV__UndoClipBK (EFFECT_CONTEXT * pContext);
237 #endif
238 
239 void WM__InvalidateParent(const GUI_RECT * pInvalidRect, WM_HWIN hParent, WM_HWIN hStop);
240 void WM__InvalidateRect (const GUI_RECT * pInvalidRect, WM_HWIN hParent, WM_HWIN hStop, U16 Flags);
241 
242 WM_tfInvalidateParent WM__SetInvalidateParentFunc(WM_tfInvalidateParent pfInvalidateParentFunc);
243 WM_tfInvalidateDrawFunc WM__SetInvalidateDrawFunc (WM_tfInvalidateDrawFunc pfInvalidateDrawFunc);
244 WM_tfPaint1Func WM__SetPaint1Func (WM_tfPaint1Func pfPaint1Func);
245 
246 #endif /* GUI_WINSUPPORT */
247 
248 #if defined(__cplusplus)
249  }
250 #endif
251 
252 #endif /* WM_INTERN_H */
253 
254 /*************************** End of file ****************************/
#define GUI_EXTERN
Definition: GUI_Private.h:630
#define U32
Definition: Global.h:50
Definition: LCD.h:102
LCD_COLOR GUI_COLOR
Definition: GUI_Type.h:50
#define GUI_NUM_LAYERS
Definition: GUIConf.h:41
#define U16
Definition: Global.h:47
#define U8
Definition: Global.h:44