STM32F769IDiscovery  1.00
uDANTE Audio Networking with STM32F7 DISCO board
MULTIPAGE.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 : MULTIPAGE.h
30 Purpose : MULTIPAGE include
31 --------------------END-OF-HEADER-------------------------------------
32 */
33 
34 #ifndef MULTIPAGE_H
35 #define MULTIPAGE_H
36 
37 #include "WM.h"
38 #include "DIALOG.h" // Required for Create indirect data structure
39 
40 #if GUI_WINSUPPORT
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 * Create / Status flags
55 */
56 #define MULTIPAGE_ALIGN_LEFT (0 << 0)
57 #define MULTIPAGE_ALIGN_RIGHT (1 << 0)
58 #define MULTIPAGE_ALIGN_TOP (0 << 2)
59 #define MULTIPAGE_ALIGN_BOTTOM (1 << 2)
60 
61 #define MULTIPAGE_CF_ROTATE_CW WIDGET_CF_VERTICAL
62 
63 #define MULTIPAGE_CI_DISABLED 0
64 #define MULTIPAGE_CI_ENABLED 1
65 
66 #define MULTIPAGE_SKIN_FRAME_LEFT (1 << 0)
67 #define MULTIPAGE_SKIN_FRAME_RIGHT (1 << 1)
68 #define MULTIPAGE_SKIN_FRAME_TOP (1 << 2)
69 #define MULTIPAGE_SKIN_FRAME_BOTTOM (1 << 3)
70 #define MULTIPAGE_SKIN_FRAME_ALL (MULTIPAGE_SKIN_FRAME_LEFT | MULTIPAGE_SKIN_FRAME_RIGHT | MULTIPAGE_SKIN_FRAME_TOP | MULTIPAGE_SKIN_FRAME_BOTTOM)
71 
72 #define MULTIPAGE_SKINFLEX_PI_ENABLED 0
73 #define MULTIPAGE_SKINFLEX_PI_SELECTED 1
74 #define MULTIPAGE_SKINFLEX_PI_DISABLED 2
75 
76 #define SCROLLBAR_SIZE 32 // Defines the space for the scrollbar arrows
77 
78 #define MULTIPAGE_BI_SELECTED 0
79 #define MULTIPAGE_BI_UNSELECTED 1
80 #define MULTIPAGE_BI_DISABLED 2
81 #define MULTIPAGE_BI_MAX 3 // The defines above are used as array indices.
82 
83 /*********************************************************************
84 *
85 * Public Types
86 *
87 **********************************************************************
88 */
89 typedef WM_HMEM MULTIPAGE_Handle;
90 
91 typedef struct {
92  GUI_COLOR BkColor;
93  GUI_COLOR aBkUpper[2];
94  GUI_COLOR aBkLower[2];
95  GUI_COLOR FrameColor;
96  GUI_COLOR TextColor;
97 } MULTIPAGE_SKINFLEX_PROPS;
98 
99 typedef struct {
100  U8 SelSideBorderInc; // Number of pixels to add on both sides when drawing the selected item.
101  U8 SelTopBorderInc; // Number of pixels to add on top of selected items.
102 } MULTIPAGE_SKIN_PROPS;
103 
104 typedef struct {
105  #if GUI_SUPPORT_ROTATION
106  GUI_ROTATION * pRotation;
107  #endif
108  unsigned Align;
109  int Sel;
110  U16 State;
111  U8 FrameFlags; // Flags to let the drawing function know which parts of the frame to display.
112  U8 PageStatus;
113  GUI_DRAW_HANDLE * pDrawObj;
114 } MULTIPAGE_SKIN_INFO;
115 
116 /*********************************************************************
117 *
118 * Create functions
119 *
120 **********************************************************************
121 */
122 MULTIPAGE_Handle MULTIPAGE_Create (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int Id, int Flags, int SpecialFlags);
123 MULTIPAGE_Handle MULTIPAGE_CreateEx (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int WinFlags, int ExFlags, int Id);
124 MULTIPAGE_Handle MULTIPAGE_CreateUser (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int WinFlags, int ExFlags, int Id, int NumExtraBytes);
125 MULTIPAGE_Handle MULTIPAGE_CreateIndirect(const GUI_WIDGET_CREATE_INFO * pCreateInfo, WM_HWIN hWinParent, int x0, int y0, WM_CALLBACK * cb);
126 
127 /*********************************************************************
128 *
129 * The callback ...
130 *
131 * Do not call it directly ! It is only to be used from within an
132 * overwritten callback.
133 */
134 void MULTIPAGE_Callback(WM_MESSAGE * pMsg);
135 
136 /*********************************************************************
137 *
138 * Member functions
139 *
140 **********************************************************************
141 */
142 void MULTIPAGE_AddEmptyPage (MULTIPAGE_Handle hObj, WM_HWIN hWin ,const char * pText);
143 void MULTIPAGE_AddPage (MULTIPAGE_Handle hObj, WM_HWIN hWin ,const char * pText);
144 WM_HWIN MULTIPAGE_AttachWindow (MULTIPAGE_Handle hObj, unsigned Index, WM_HWIN hWin);
145 void MULTIPAGE_DeletePage (MULTIPAGE_Handle hObj, unsigned Index, int Delete);
146 void MULTIPAGE_DisablePage (MULTIPAGE_Handle hObj, unsigned Index);
147 void MULTIPAGE_EnablePage (MULTIPAGE_Handle hObj, unsigned Index);
148 void MULTIPAGE_EnableScrollbar(MULTIPAGE_Handle hObj, unsigned OnOff);
149 const GUI_FONT * MULTIPAGE_GetFont (MULTIPAGE_Handle hObj);
150 int MULTIPAGE_GetSelection (MULTIPAGE_Handle hObj);
151 int MULTIPAGE_GetPageText (MULTIPAGE_Handle hObj, unsigned Index, char * pBuffer, int MaxLen);
152 int MULTIPAGE_GetUserData (MULTIPAGE_Handle hObj, void * pDest, int NumBytes);
153 WM_HWIN MULTIPAGE_GetWindow (MULTIPAGE_Handle hObj, unsigned Index);
154 int MULTIPAGE_IsPageEnabled (MULTIPAGE_Handle hObj, unsigned Index);
155 void MULTIPAGE_SelectPage (MULTIPAGE_Handle hObj, unsigned Index);
156 void MULTIPAGE_SetAlign (MULTIPAGE_Handle hObj, unsigned Align);
157 int MULTIPAGE_SetBitmapEx (MULTIPAGE_Handle hObj, const GUI_BITMAP * pBitmap, int x, int y, int Index, int State);
158 int MULTIPAGE_SetBitmap (MULTIPAGE_Handle hObj, const GUI_BITMAP * pBitmap, int Index, int State);
159 void MULTIPAGE_SetBkColor (MULTIPAGE_Handle hObj, GUI_COLOR Color, unsigned Index);
160 void MULTIPAGE_SetFont (MULTIPAGE_Handle hObj, const GUI_FONT * pFont);
161 void MULTIPAGE_SetRotation (MULTIPAGE_Handle hObj, unsigned Rotation);
162 void MULTIPAGE_SetTabWidth (MULTIPAGE_Handle hObj, int Width, int Index);
163 void MULTIPAGE_SetTabHeight (MULTIPAGE_Handle hObj, int Height);
164 void MULTIPAGE_SetTextAlign (MULTIPAGE_Handle hObj, unsigned Align);
165 void MULTIPAGE_SetText (MULTIPAGE_Handle hObj, const char * pText, unsigned Index);
166 void MULTIPAGE_SetTextColor (MULTIPAGE_Handle hObj, GUI_COLOR Color, unsigned Index);
167 int MULTIPAGE_SetUserData (MULTIPAGE_Handle hObj, const void * pSrc, int NumBytes);
168 
169 /*********************************************************************
170 *
171 * Get/Set defaults
172 *
173 **********************************************************************
174 */
175 unsigned MULTIPAGE_GetDefaultAlign (void);
176 GUI_COLOR MULTIPAGE_GetDefaultBkColor (unsigned Index);
177 const GUI_FONT * MULTIPAGE_GetDefaultFont (void);
178 GUI_COLOR MULTIPAGE_GetDefaultTextColor (unsigned Index);
179 
180 void MULTIPAGE_SetDefaultAlign (unsigned Align);
181 void MULTIPAGE_SetDefaultBkColor (GUI_COLOR Color, unsigned Index);
182 void MULTIPAGE_SetDefaultBorderSizeX(unsigned Size);
183 void MULTIPAGE_SetDefaultBorderSizeY(unsigned Size);
184 void MULTIPAGE_SetDefaultFont (const GUI_FONT * pFont);
185 void MULTIPAGE_SetDefaultTextColor (GUI_COLOR Color, unsigned Index);
186 
187 void MULTIPAGE_SetEffectColor (unsigned Index, GUI_COLOR Color);
188 GUI_COLOR MULTIPAGE_GetEffectColor (unsigned Index);
189 int MULTIPAGE_GetNumEffectColors (void);
190 
191 /*********************************************************************
192 *
193 * Member functions: Skinning
194 *
195 **********************************************************************
196 */
197 int MULTIPAGE_DrawSkinFlex (const WIDGET_ITEM_DRAW_INFO * pDrawItemInfo);
198 void MULTIPAGE_GetSkinFlexProps (MULTIPAGE_SKINFLEX_PROPS * pProps, int Index);
199 WIDGET_DRAW_ITEM_FUNC * MULTIPAGE_SetDefaultSkin (WIDGET_DRAW_ITEM_FUNC * pfDrawSkin);
200 void MULTIPAGE_SetDefaultSkinClassic(void);
201 void MULTIPAGE_SetSkinClassic (MULTIPAGE_Handle hObj);
202 void MULTIPAGE_SetSkin (MULTIPAGE_Handle hObj, WIDGET_DRAW_ITEM_FUNC * pfDrawSkin);
203 void MULTIPAGE_SetSkinFlexProps (const MULTIPAGE_SKINFLEX_PROPS * pProps, int Index);
204 
205 #define MULTIPAGE_SKIN_FLEX MULTIPAGE_DrawSkinFlex
206 
207 #if defined(__cplusplus)
208  }
209 #endif
210 
211 #endif // GUI_WINSUPPORT
212 #endif // MULTIPAGE_H
213 
214 /*************************** End of file ****************************/
LCD_COLOR GUI_COLOR
Definition: GUI_Type.h:50
#define GUI_ROTATION
Definition: LCD.h:675
#define U16
Definition: Global.h:47
#define U8
Definition: Global.h:44