STM32F769IDiscovery  1.00
uDANTE Audio Networking with STM32F7 DISCO board
SCROLLBAR.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 : SCROLLBAR.h
30 Purpose : SCROLLBAR include
31 --------------------END-OF-HEADER-------------------------------------
32 */
33 
34 #ifndef SCROLLBAR_H
35 #define SCROLLBAR_H
36 
37 #include "WM.h"
38 #include "DIALOG_Intern.h" /* Req. for Create indirect data structure */
39 #include "WIDGET.h"
40 
41 #if GUI_WINSUPPORT
42 
43 #if defined(__cplusplus)
44  extern "C" { /* Make sure we have C-declarations in C++ programs */
45 #endif
46 
47 /*********************************************************************
48 *
49 * Defines
50 *
51 **********************************************************************
52 */
53 #define SCROLLBAR_CI_THUMB 0
54 #define SCROLLBAR_CI_SHAFT 1
55 #define SCROLLBAR_CI_ARROW 2
56 
57 /*********************************************************************
58 *
59 * States
60 */
61 #define SCROLLBAR_STATE_PRESSED WIDGET_STATE_USER0
62 
63 /*********************************************************************
64 *
65 * Create / Status flags
66 */
67 #define SCROLLBAR_CF_VERTICAL WIDGET_CF_VERTICAL
68 #define SCROLLBAR_CF_FOCUSSABLE WIDGET_STATE_FOCUSSABLE
69 
70 /************************************************************
71 *
72 * Skinning property indices
73 */
74 #define SCROLLBAR_SKINFLEX_PI_PRESSED 0
75 #define SCROLLBAR_SKINFLEX_PI_UNPRESSED 1
76 
77 /*********************************************************************
78 *
79 * Public Types
80 *
81 **********************************************************************
82 */
83 typedef WM_HMEM SCROLLBAR_Handle;
84 
85 typedef struct {
86  GUI_COLOR aColorFrame[3];
87  GUI_COLOR aColorUpper[2];
88  GUI_COLOR aColorLower[2];
89  GUI_COLOR aColorShaft[2];
90  GUI_COLOR ColorArrow;
91  GUI_COLOR ColorGrasp;
92 } SCROLLBAR_SKINFLEX_PROPS;
93 
94 typedef struct {
95  int IsVertical;
96  int State;
97 } SCROLLBAR_SKINFLEX_INFO;
98 
99 /*********************************************************************
100 *
101 * Create functions
102 *
103 **********************************************************************
104 */
105 SCROLLBAR_Handle SCROLLBAR_Create (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int Id, int WinFlags, int SpecialFlags);
106 SCROLLBAR_Handle SCROLLBAR_CreateAttached(WM_HWIN hParent, int SpecialFlags);
107 SCROLLBAR_Handle SCROLLBAR_CreateEx (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int WinFlags, int ExFlags, int Id);
108 SCROLLBAR_Handle SCROLLBAR_CreateUser (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int WinFlags, int ExFlags, int Id, int NumExtraBytes);
109 SCROLLBAR_Handle SCROLLBAR_CreateIndirect(const GUI_WIDGET_CREATE_INFO * pCreateInfo, WM_HWIN hWinParent, int x0, int y0, WM_CALLBACK * cb);
110 
111 /*********************************************************************
112 *
113 * The callback ...
114 *
115 * Do not call it directly ! It is only to be used from within an
116 * overwritten callback.
117 */
118 void SCROLLBAR_Callback(WM_MESSAGE * pMsg);
119 
120 /*********************************************************************
121 *
122 * Member functions
123 *
124 **********************************************************************
125 */
126 
127 /* Methods changing properties */
128 
129 void SCROLLBAR_AddValue (SCROLLBAR_Handle hObj, int Add);
130 void SCROLLBAR_Dec (SCROLLBAR_Handle hObj);
131 void SCROLLBAR_Inc (SCROLLBAR_Handle hObj);
132 int SCROLLBAR_GetUserData(SCROLLBAR_Handle hObj, void * pDest, int NumBytes);
133 GUI_COLOR SCROLLBAR_SetColor (SCROLLBAR_Handle hObj, int Index, GUI_COLOR Color);
134 void SCROLLBAR_SetNumItems(SCROLLBAR_Handle hObj, int NumItems);
135 void SCROLLBAR_SetPageSize(SCROLLBAR_Handle hObj, int PageSize);
136 void SCROLLBAR_SetValue (SCROLLBAR_Handle hObj, int v);
137 int SCROLLBAR_SetWidth (SCROLLBAR_Handle hObj, int Width);
138 void SCROLLBAR_SetState (SCROLLBAR_Handle hObj, const WM_SCROLL_STATE* pState);
139 int SCROLLBAR_SetUserData(SCROLLBAR_Handle hObj, const void * pSrc, int NumBytes);
140 
141 /*********************************************************************
142 *
143 * Member functions: Skinning
144 *
145 **********************************************************************
146 */
147 void SCROLLBAR_GetSkinFlexProps (SCROLLBAR_SKINFLEX_PROPS * pProps, int Index);
148 void SCROLLBAR_SetSkinClassic (SCROLLBAR_Handle hObj);
149 void SCROLLBAR_SetSkin (SCROLLBAR_Handle hObj, WIDGET_DRAW_ITEM_FUNC * pfDrawSkin);
150 int SCROLLBAR_DrawSkinFlex (const WIDGET_ITEM_DRAW_INFO * pDrawItemInfo);
151 void SCROLLBAR_SetSkinFlexProps (const SCROLLBAR_SKINFLEX_PROPS * pProps, int Index);
152 void SCROLLBAR_SetDefaultSkinClassic(void);
153 WIDGET_DRAW_ITEM_FUNC * SCROLLBAR_SetDefaultSkin(WIDGET_DRAW_ITEM_FUNC * pfDrawSkin);
154 
155 #define SCROLLBAR_SKIN_FLEX SCROLLBAR_DrawSkinFlex
156 
157 /*********************************************************************
158 *
159 * Global functions
160 *
161 **********************************************************************
162 */
163 int SCROLLBAR_GetDefaultWidth(void);
164 int SCROLLBAR_GetThumbSizeMin(void);
165 GUI_COLOR SCROLLBAR_SetDefaultColor(GUI_COLOR Color, unsigned int Index); /* Not yet documented */
166 int SCROLLBAR_SetDefaultWidth(int DefaultWidth);
167 int SCROLLBAR_SetThumbSizeMin(int ThumbSizeMin);
168 
169 /*********************************************************************
170 *
171 * Query state
172 *
173 **********************************************************************
174 */
175 int SCROLLBAR_GetNumItems(SCROLLBAR_Handle hObj);
176 int SCROLLBAR_GetPageSize(SCROLLBAR_Handle hObj);
177 int SCROLLBAR_GetValue (SCROLLBAR_Handle hObj);
178 
179 /*********************************************************************
180 *
181 * Macros for compatibility
182 *
183 **********************************************************************
184 */
185 #define SCROLLBAR_BKCOLOR0_DEFAULT SCROLLBAR_COLOR_ARROW_DEFAULT
186 #define SCROLLBAR_BKCOLOR1_DEFAULT SCROLLBAR_COLOR_SHAFT_DEFAULT
187 #define SCROLLBAR_COLOR0_DEFAULT SCROLLBAR_COLOR_THUMB_DEFAULT
188 
189 #if defined(__cplusplus)
190  }
191 #endif
192 
193 #endif // GUI_WINSUPPORT
194 #endif // SCROLLBAR_H
195 
196 /*************************** End of file ****************************/
LCD_COLOR GUI_COLOR
Definition: GUI_Type.h:50