eGUI alias D4D  Release 3.0
Reference Manual
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
d4d_progress_bar.h
Go to the documentation of this file.
1 /**************************************************************************
2 *
3 * Copyright 2014 by Petr Gargulak. eGUI Community.
4 * Copyright 2009-2013 by Petr Gargulak. Freescale Semiconductor, Inc.
5 *
6 ***************************************************************************
7 * This program is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU Lesser General Public License Version 3
9 * or later (the "LGPL").
10 *
11 * As a special exception, the copyright holders of the eGUI project give you
12 * permission to link the eGUI sources with independent modules to produce an
13 * executable, regardless of the license terms of these independent modules,
14 * and to copy and distribute the resulting executable under terms of your
15 * choice, provided that you also meet, for each linked independent module,
16 * the terms and conditions of the license of that module.
17 * An independent module is a module which is not derived from or based
18 * on this library.
19 * If you modify the eGUI sources, you may extend this exception
20 * to your version of the eGUI sources, but you are not obligated
21 * to do so. If you do not wish to do so, delete this
22 * exception statement from your version.
23 *
24 * This program is distributed in the hope that it will be useful,
25 * but WITHOUT ANY WARRANTY; without even the implied warranty of
26 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
27 *
28 * You should have received a copy of the GNU General Public License
29 * and the GNU Lesser General Public License along with this program.
30 * If not, see <http://www.gnu.org/licenses/>.
31 *
32 ***************************************************************************/
46 #ifndef __D4D_PROGRESS_BAR_H
47 #define __D4D_PROGRESS_BAR_H
48 
50 /******************************************************************************
51 * D4D PROGRESS BAR setting constants
52 *
53 */
57 //********************* Progress Bar flags for button specific flags *****************
68  #define D4D_PRGRS_BAR_F_BAR_AUTOCOLOR 0x0100
69  #define D4D_PRGRS_BAR_F_TEXT_AUTOCOLOR 0x0200
70  #define D4D_PRGRS_BAR_F_BAR_SCALECOLOR 0x0400
71 
72  #define D4D_PRGRS_BAR_F_AUTOCOLOR (D4D_PRGRS_BAR_F_BAR_AUTOCOLOR | D4D_PRGRS_BAR_F_TEXT_AUTOCOLOR)
73 
77 #ifndef D4D_PRGRS_BAR_F_DEFAULT
78  #define D4D_PRGRS_BAR_F_DEFAULT (D4D_OBJECT_F_VISIBLE | D4D_OBJECT_F_ENABLED | D4D_PRGRS_BAR_F_BAR_AUTOCOLOR | D4D_PRGRS_BAR_F_BAR_SCALECOLOR)
79 #endif
80 
83 #ifndef D4D_PRGRS_BAR_BAR_OFF
84  #define D4D_PRGRS_BAR_BAR_OFF 3
85 #endif
86 
89 #ifndef D4D_COLOR_PRGRS_BAR_BAR_FORE
90  #define D4D_COLOR_PRGRS_BAR_BAR_FORE D4D_COLOR_DARK_GREEN
91 #endif
92 
95 #ifndef D4D_COLOR_PRGRS_BAR_BAR_END
96  #define D4D_COLOR_PRGRS_BAR_BAR_END D4D_COLOR_YELLOW
97 #endif
98 
101 #ifndef D4D_COLOR_PRGRS_BAR_BAR_BCKG
102  #define D4D_COLOR_PRGRS_BAR_BAR_BCKG D4D_COLOR_BRIGHT_GREY
103 #endif
104 
107 #ifndef D4D_COLOR_PRGRS_BAR_MAX_VAL
108  #define D4D_COLOR_PRGRS_BAR_MAX_VAL 100
109 #endif
110 
114 /******************************************************************************
115 * D4D PROGRESS_BAR setting public types
116 *
117 */
123 
125 /******************************************************************************
126 * Private Types
127 ******************************************************************************/
128 
129 
130 // progress_bar runtime data (always in RAM)
131 
132 typedef struct
133 {
134  D4D_PROGRESS_BAR_VALUE value; // current value
135  D4D_BOOL drawActiveOnly; // old Value
136  D4D_COLOR colorBar; // Color v Bar - can be changed
138 
139 // progress_bar configuration (in ROM by default)
140 
141 typedef struct
142 {
145 
146 
147 /******************************************************************************
148 * Macros
149 ******************************************************************************/
150 
151 // getting the PROGRESS_BAR structure from general OBJECT
152 #define D4D_GET_PROGRESS_BAR(pObj) ((D4D_PROGRESS_BAR*)((pObj)->pParam))
153 
154 /******************************************************************************
155 * D4D PROGRESS BAR setting public macros
156 *
157 */
161 /**************************************************************************/
181 #define _D4D_DECLARE_PROGRESS_BAR(type, name, x, y, cx, cy, radius, pMargin, pRelations, flags, pScheme, pUser, pOnUsrMsg) \
182  static D4D_PROGRESS_BAR_DATA name##_data = { 0, 0, D4D_COLOR_PRGRS_BAR_BAR_FORE}; \
183  static type D4D_PROGRESS_BAR name##_params = \
184  { \
185  &(name##_data) /* RAM-based data */ \
186  }; \
187  \
188  D4D_DECLARE_OBJECT(type, name, x, y, cx, cy, radius, pMargin, pRelations, pOnUsrMsg, &d4d_progress_barSysFunc, &(name##_params), flags, pUser, pScheme)
189 
190 
191 /**************************************************************************/
209 #define D4D_DECLARE_PROGRESS_BAR(name, x, y, cx, cy, radius, flags, pScheme, pUser, pOnUsrMsg) \
210  _D4D_DECLARE_PROGRESS_BAR(D4D_CONST, name, x, y, cx, cy, radius, NULL, NULL, flags, pScheme, pUser, pOnUsrMsg)
211 
212 /**************************************************************************/
226 #define D4D_DECLARE_STD_PROGRESS_BAR(name, x, y, cx, cy, radius) \
227  D4D_DECLARE_PROGRESS_BAR(name, x, y, cx, cy, radius, (D4D_PRGRS_BAR_F_DEFAULT), NULL, NULL, NULL)
228 
229 
230 // IN RAM instantions macros
231 /**************************************************************************/
234 #define D4D_DECLARE_PROGRESS_BAR_INRAM(name, x, y, cx, cy, radius, flags, pScheme, pUser, pOnUsrMsg) \
235  _D4D_DECLARE_PROGRESS_BAR( D4D_NO_CONST, name, x, y, cx, cy, radius, NULL, NULL, flags, pScheme, pUser, pOnUsrMsg)
236 
237 /**************************************************************************/
240 #define D4D_DECLARE_STD_PROGRESS_BAR_INRAM(name, x, y, cx, cy, radius) \
241  D4D_DECLARE_PROGRESS_BAR_INRAM(name, x, y, cx, cy, radius, (D4D_PRGRS_BAR_F_DEFAULT), NULL, NULL, NULL)
242 
245 /******************************************************************************
246 * Global functions
247 ******************************************************************************/
248 
249 /*********************************************************
250 *
251 * global functions
252 *
253 *********************************************************/
254 
258 
261 
262 
263 
264 #endif /* __D4D_PROGRESS_BAR_H */
265 
266 
267 
268 
269 
270 
271 
272 
273 
274 
275 
void D4D_PrgrsBarSetValue(D4D_OBJECT_PTR pThis, D4D_PROGRESS_BAR_VALUE value)
Byte D4D_PROGRESS_BAR_VALUE
Type definition of progress bar value type - this is standard type used for progress bar data input...
const D4D_OBJECT_SYS_FUNCTION d4d_progress_barSysFunc
unsigned char Byte
Type definition of Byte (unsigned 8-bit).
Definition: d4d_types.h:151
D4D_PROGRESS_BAR_VALUE D4D_PrgrsBarGetValue(D4D_OBJECT_PTR pThis)
void D4D_PrgrsBarChangeValue(D4D_OBJECT_PTR pThis, D4D_PROGRESS_BAR_VALUE incr)
D4D_PROGRESS_BAR_DATA * pData
The object main structure type definition.
Definition: d4d_object.h:167
The object system function needed for each object - this is part of D4D_OBJECT main structure...
Definition: d4d_object.h:134
LWord D4D_BOOL
Type definition of eGUI boolean.
Definition: d4d_types.h:204
D4D_COLOR D4D_PrgrsBarGetBarColor(D4D_OBJECT_PTR pThis)
LWord D4D_COLOR
Type definition of eGUI color variables.
Definition: d4d_types.h:262
void D4D_PrgrsBarSetBarColor(D4D_OBJECT_PTR pThis, D4D_COLOR color)
D4D_PROGRESS_BAR_VALUE value