STM32F769IDiscovery  1.00
uDANTE Audio Networking with STM32F7 DISCO board
MENU_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 : MENU_Private.h
30 Purpose : Internal header file
31 ---------------------------END-OF-HEADER------------------------------
32 */
33 
34 #ifndef MENU_PRIVATE_H
35 #define MENU_PRIVATE_H
36 
37 #include "WIDGET.h"
38 #include "MENU.h"
39 #include "GUI_ARRAY.h"
40 
41 #if GUI_WINSUPPORT
42 
43 /*********************************************************************
44 *
45 * Defines
46 *
47 **********************************************************************
48 */
49 /*********************************************************************
50 *
51 * Status flags
52 */
53 #define MENU_SF_HORIZONTAL MENU_CF_HORIZONTAL
54 #define MENU_SF_VERTICAL MENU_CF_VERTICAL
55 #define MENU_SF_OPEN_ON_POINTEROVER MENU_CF_OPEN_ON_POINTEROVER
56 #define MENU_SF_CLOSE_ON_SECOND_CLICK MENU_CF_CLOSE_ON_SECOND_CLICK
57 #define MENU_SF_HIDE_DISABLED_SEL MENU_CF_HIDE_DISABLED_SEL
58 
59 #define MENU_SF_ACTIVE (1 << 6) // Internal flag only
60 #define MENU_SF_POPUP (1 << 7) // Internal flag only
61 #define MENU_SF_ARROW (1 << 8) // Internal flag only
62 
63 /*********************************************************************
64 *
65 * Types
66 *
67 **********************************************************************
68 */
69 //
70 // MENU_SKIN_PRIVATE
71 //
72 typedef struct {
73  WIDGET_DRAW_ITEM_FUNC * pfDrawSkin;
74 } MENU_SKIN_PRIVATE;
75 
76 //
77 // MENU_ITEM
78 //
79 typedef struct {
80  MENU_Handle hSubmenu;
81  U16 Id;
82  U16 Flags;
83  int TextWidth;
84  char acText[1];
85 } MENU_ITEM;
86 
87 //
88 // MENU_PROPS
89 //
90 typedef struct {
91  GUI_COLOR aTextColor[5];
92  GUI_COLOR aBkColor[5];
93  U8 aBorder[4];
94  const GUI_FONT * pFont;
95  MENU_SKIN_PRIVATE SkinPrivate;
96 } MENU_PROPS;
97 
98 //
99 // MENU_Obj
100 //
101 typedef struct {
102  WIDGET Widget;
103  MENU_PROPS Props;
104  GUI_ARRAY ItemArray;
105  WM_HWIN hOwner;
106  U16 Flags;
107  char IsSubmenuActive;
108  int Width;
109  int Height;
110  int Sel;
111  unsigned ArrowAreaWidth;
112  WIDGET_SKIN const * pWidgetSkin;
113 } MENU_Obj;
114 
115 /*********************************************************************
116 *
117 * Macros for internal use
118 *
119 **********************************************************************
120 */
121 #if GUI_DEBUG_LEVEL >= GUI_DEBUG_LEVEL_CHECK_ALL
122  #define MENU_INIT_ID(pObj) (pObj->Widget.DebugId = MENU_ID)
123 #else
124  #define MENU_INIT_ID(pObj)
125 #endif
126 
127 #if GUI_DEBUG_LEVEL >= GUI_DEBUG_LEVEL_CHECK_ALL
128  MENU_Obj * MENU_LockH(MENU_Handle hObj);
129  #define MENU_LOCK_H(hObj) MENU_LockH(hObj)
130 #else
131  #define MENU_LOCK_H(hObj) (MENU_Obj *)GUI_LOCK_H(hObj)
132 #endif
133 
134 /*********************************************************************
135 *
136 * Public data (internal defaults)
137 *
138 **********************************************************************
139 */
140 
141 extern MENU_PROPS MENU__DefaultProps;
142 extern const WIDGET_EFFECT * MENU__pDefaultEffect;
143 
144 extern const WIDGET_SKIN MENU__SkinClassic;
145 extern WIDGET_SKIN MENU__Skin;
146 
147 extern WIDGET_SKIN const * MENU__pSkinDefault;
148 
149 /*********************************************************************
150 *
151 * Private functions
152 *
153 **********************************************************************
154 */
155 int MENU__CalcMenuSizeX (MENU_Handle hObj);
156 int MENU__CalcMenuSizeY (MENU_Handle hObj);
157 int MENU__FindItem (MENU_Handle hObj, U16 ItemId, MENU_Handle* phMenu);
158 int MENU__GetEffectSize (MENU_Handle hObj);
159 int MENU__GetItemHeight (MENU_Handle hObj, unsigned Index);
160 int MENU__GetItemWidth (MENU_Handle hObj, unsigned Index);
161 unsigned MENU__GetNumItems (MENU_Obj * pObj);
162 int MENU__HasEffect (MENU_Handle hObj, MENU_Obj * pObj);
163 void MENU__InvalidateItem (MENU_Handle hObj, unsigned Index);
164 void MENU__RecalcTextWidthOfItems(MENU_Obj * pObj);
165 void MENU__ResizeMenu (MENU_Handle hObj);
166 int MENU__SendMenuMessage (MENU_Handle hObj, WM_HWIN hDestWin, U16 MsgType, U16 ItemId);
167 char MENU__SetItem (MENU_Handle hObj, unsigned Index, const MENU_ITEM_DATA* pItemData);
168 void MENU__SetItemFlags (MENU_Obj * pObj, unsigned Index, U16 Mask, U16 Flags);
169 
170 #endif // GUI_WINSUPPORT
171 #endif // MENU_PRIVATE_H
172 
173 /*************************** End of file ****************************/
LCD_COLOR GUI_COLOR
Definition: GUI_Type.h:50
#define U16
Definition: Global.h:47
#define U8
Definition: Global.h:44