STM32F769IDiscovery  1.00
uDANTE Audio Networking with STM32F7 DISCO board
SLIDER.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 : SLIDER.h
30 Purpose : SLIDER include
31 --------------------END-OF-HEADER-------------------------------------
32 */
33 
34 #ifndef SLIDER_H
35 #define SLIDER_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 /************************************************************
54 *
55 * States
56 */
57 #define SLIDER_STATE_PRESSED WIDGET_STATE_USER0
58 
59 /************************************************************
60 *
61 * Create / Status flags
62 */
63 #define SLIDER_CF_HORIZONTAL 0
64 #define SLIDER_CF_VERTICAL WIDGET_CF_VERTICAL
65 
66 /************************************************************
67 *
68 * Skinning property indices
69 */
70 #define SLIDER_SKINFLEX_PI_PRESSED 0
71 #define SLIDER_SKINFLEX_PI_UNPRESSED 1
72 
73 /*********************************************************************
74 *
75 * Public Types
76 *
77 **********************************************************************
78 */
79 typedef WM_HMEM SLIDER_Handle;
80 
81 typedef struct {
82  GUI_COLOR aColorFrame[2];
83  GUI_COLOR aColorInner[2];
84  GUI_COLOR aColorShaft[3];
85  GUI_COLOR ColorTick;
86  GUI_COLOR ColorFocus;
87  int TickSize;
88  int ShaftSize;
89 } SLIDER_SKINFLEX_PROPS;
90 
91 typedef struct {
92  int Width;
93  int NumTicks;
94  int Size;
95  int IsPressed;
96  int IsVertical;
97 } SLIDER_SKINFLEX_INFO;
98 
99 /*********************************************************************
100 *
101 * Create functions
102 *
103 **********************************************************************
104 */
105 SLIDER_Handle SLIDER_Create (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int Id, int WinFlags, int SpecialFlags);
106 SLIDER_Handle SLIDER_CreateEx (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int WinFlags, int ExFlags, int Id);
107 SLIDER_Handle SLIDER_CreateUser (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int WinFlags, int ExFlags, int Id, int NumExtraBytes);
108 SLIDER_Handle SLIDER_CreateIndirect(const GUI_WIDGET_CREATE_INFO * pCreateInfo, WM_HWIN hWinParent, int x0, int y0, WM_CALLBACK * cb);
109 
110 /*********************************************************************
111 *
112 * The callback ...
113 *
114 * Do not call it directly ! It is only to be used from within an
115 * overwritten callback.
116 */
117 void SLIDER_Callback(WM_MESSAGE * pMsg);
118 
119 /*********************************************************************
120 *
121 * Member functions
122 *
123 **********************************************************************
124 */
125 void SLIDER_Dec (SLIDER_Handle hObj);
126 void SLIDER_EnableFocusRect(SLIDER_Handle hObj, int OnOff);
127 GUI_COLOR SLIDER_GetBarColor (SLIDER_Handle hObj);
128 GUI_COLOR SLIDER_GetBkColor (SLIDER_Handle hObj);
129 U8 SLIDER_GetFlag (SLIDER_Handle hObj, U8 Flag);
130 GUI_COLOR SLIDER_GetFocusColor (SLIDER_Handle hObj);
131 GUI_COLOR SLIDER_GetTickColor (SLIDER_Handle hObj);
132 int SLIDER_GetUserData (SLIDER_Handle hObj, void * pDest, int NumBytes);
133 int SLIDER_GetValue (SLIDER_Handle hObj);
134 void SLIDER_Inc (SLIDER_Handle hObj);
135 void SLIDER_SetBarColor (SLIDER_Handle hObj, GUI_COLOR Color);
136 void SLIDER_SetBkColor (SLIDER_Handle hObj, GUI_COLOR Color);
137 GUI_COLOR SLIDER_SetFocusColor (SLIDER_Handle hObj, GUI_COLOR Color);
138 void SLIDER_SetNumTicks (SLIDER_Handle hObj, int NumTicks);
139 void SLIDER_SetRange (SLIDER_Handle hObj, int Min, int Max);
140 void SLIDER_SetTickColor (SLIDER_Handle hObj, GUI_COLOR Color);
141 int SLIDER_SetUserData (SLIDER_Handle hObj, const void * pSrc, int NumBytes);
142 void SLIDER_SetValue (SLIDER_Handle hObj, int v);
143 void SLIDER_SetWidth (SLIDER_Handle hObj, int Width);
144 
145 /*********************************************************************
146 *
147 * Member functions: Skinning
148 *
149 **********************************************************************
150 */
151 void SLIDER_GetSkinFlexProps (SLIDER_SKINFLEX_PROPS * pProps, int Index);
152 void SLIDER_SetSkinClassic (SLIDER_Handle hObj);
153 void SLIDER_SetSkin (SLIDER_Handle hObj, WIDGET_DRAW_ITEM_FUNC * pfDrawSkin);
154 int SLIDER_DrawSkinFlex (const WIDGET_ITEM_DRAW_INFO * pDrawItemInfo);
155 void SLIDER_SetSkinFlexProps (const SLIDER_SKINFLEX_PROPS * pProps, int Index);
156 void SLIDER_SetDefaultSkinClassic(void);
157 WIDGET_DRAW_ITEM_FUNC * SLIDER_SetDefaultSkin(WIDGET_DRAW_ITEM_FUNC * pfDrawSkin);
158 
159 #define SLIDER_SKIN_FLEX SLIDER_DrawSkinFlex
160 
161 /*********************************************************************
162 *
163 * Global functions
164 *
165 **********************************************************************
166 */
167 GUI_COLOR SLIDER_GetDefaultBkColor (void);
168 GUI_COLOR SLIDER_GetDefaultBarColor (void);
169 GUI_COLOR SLIDER_GetDefaultFocusColor(void);
170 GUI_COLOR SLIDER_GetDefaultTickColor (void);
171 void SLIDER_SetDefaultBkColor (GUI_COLOR Color);
172 void SLIDER_SetDefaultBarColor (GUI_COLOR Color);
173 GUI_COLOR SLIDER_SetDefaultFocusColor(GUI_COLOR Color);
174 void SLIDER_SetDefaultTickColor (GUI_COLOR Color);
175 
176 #if defined(__cplusplus)
177  }
178 #endif
179 
180 #endif // GUI_WINSUPPORT
181 #endif // SLIDER_H
182 
183 /*************************** End of file ****************************/
LCD_COLOR GUI_COLOR
Definition: GUI_Type.h:50
#define U8
Definition: Global.h:44