eGUI alias D4D  Release 3.0
Reference Manual
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
d4d_label.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_LABEL_H
47 #define __D4D_LABEL_H
48 
50 
51 /******************************************************************************
52 * D4D LABEL setting constants
53 *
54 */
60 #ifndef D4D_LBL_F_DEFAULT
61  #define D4D_LBL_F_DEFAULT (D4D_OBJECT_F_VISIBLE | D4D_OBJECT_F_ENABLED | D4D_OBJECT_F_FOCUSRECT)
62 #endif
63 
66 #ifndef D4D_LBL_TXT_PRTY_DEFAULT
67  #define D4D_LBL_TXT_PRTY_DEFAULT (D4D_ALIGN_H_CENTER_MASK | D4D_ALIGN_V_CENTER_MASK)
68 #endif
69 
72 #ifndef D4D_LBL_FNT_PRTY_DEFAULT
73  #define D4D_LBL_FNT_PRTY_DEFAULT ( 0 )
74 #endif
75 
79 /******************************************************************************
80 * Types
81 ******************************************************************************/
82 
83 
84 // label configuration (goes to ROM by default)
85 
86 typedef struct
87 {
88  D4D_STRING textBuff; // label text
89 } D4D_LABEL;
90 
91 
92 /******************************************************************************
93 * Macros
94 ******************************************************************************/
95 
96 // getting the LABEL structure from general OBJECT
97 #define D4D_GET_LABEL(pObj) ((D4D_LABEL*)((pObj)->pParam))
98 
99 /******************************************************************************
100 * D4D LABEL setting public macros
101 *
102 */
106 /**************************************************************************/
132 #define _D4D_DECLARE_LABEL(type, name, text, x, y, cx, cy, radius, pMargin, pRelations, flags, pScheme, fontId, pUser, pOnUsrMsg) \
133  static D4D_STR_PROPERTIES name##_strPrties = { D4D_LBL_FNT_PRTY_DEFAULT, D4D_LBL_TXT_PRTY_DEFAULT}; \
134  static type D4D_LABEL name##_params = \
135  { \
136  { text, D4D_TEXT_LEN(text), fontId, &name##_strPrties, D4D_OBJECT_MAX_TEXT_LEN(text), 0} /* textBuff */ \
137  }; \
138  \
139  D4D_DECLARE_OBJECT(type, name, x, y, cx, cy, radius, pMargin, pRelations, pOnUsrMsg, &d4d_labelSysFunc, &(name##_params), flags, pUser, pScheme)
140 
141 
142 /**************************************************************************/
165 #define D4D_DECLARE_LABEL(name, text, x, y, cx, cy, flags, pScheme, fontId, pUser, pOnUsrMsg) \
166  _D4D_DECLARE_LABEL(D4D_CONST, name, text, x, y, cx, cy, 0, NULL, NULL, flags, pScheme, fontId, pUser, pOnUsrMsg)
167 
168 /**************************************************************************/
187 #define D4D_DECLARE_STD_LABEL(name, text, x, y, cx, cy, fontId) \
188  D4D_DECLARE_LABEL(name, text, x, y, cx, cy, (D4D_LBL_F_DEFAULT) , NULL, fontId, NULL, NULL)
189 
190 // Rounded button definition
191 /**************************************************************************/
215 #define D4D_DECLARE_RLABEL(name, text, x, y, cx, cy, radius, flags, pScheme, fontId, pUser, pOnUsrMsg) \
216  _D4D_DECLARE_LABEL(D4D_CONST, name, text, x, y, cx, cy, radius, NULL, NULL, flags, pScheme, fontId, pUser, pOnUsrMsg)
217 
218 /**************************************************************************/
238 #define D4D_DECLARE_STD_RLABEL(name, text, x, y, cx, cy, radius, fontId) \
239  D4D_DECLARE_RLABEL(name, text, x, y, cx, cy, radius, (D4D_LBL_F_DEFAULT) , NULL, fontId, NULL, NULL)
240 
241 // IN RAM instantions macros
242 /**************************************************************************/
245 #define D4D_DECLARE_LABEL_INRAM(name, text, x, y, cx, cy, flags, pScheme, fontId, pUser, pOnUsrMsg) \
246  _D4D_DECLARE_LABEL(D4D_NO_CONST, name, text, x, y, cx, cy, 0, NULL, NULL, flags, pScheme, fontId, pUser, pOnUsrMsg)
247 
248 /**************************************************************************/
251 #define D4D_DECLARE_STD_LABEL_INRAM(name, text, x, y, cx, cy, font) \
252  D4D_DECLARE_LABEL_INRAM(name, text, x, y, cx, cy, (D4D_LBL_F_DEFAULT) , NULL, font, NULL, NULL)
253 
254 // Rounded button definition
255 /**************************************************************************/
258 #define D4D_DECLARE_RLABEL_INRAM(name, text, x, y, cx, cy, radius, flags, pScheme, fontId, pUser, pOnUsrMsg) \
259  _D4D_DECLARE_LABEL(D4D_NO_CONST, name, text, x, y, cx, cy, radius, NULL, NULL, flags, pScheme, fontId, pUser, pOnUsrMsg)
260 
261 /**************************************************************************/
264 #define D4D_DECLARE_STD_RLABEL_INRAM(name, text, x, y, cx, cy, radius, font) \
265  D4D_DECLARE_RLABEL_INRAM(name, text, x, y, cx, cy, radius, (D4D_LBL_F_DEFAULT) , NULL, font, NULL, NULL)
266 
268 /******************************************************************************
269 * Global variables
270 ******************************************************************************/
271 
272 
273 /******************************************************************************
274 * Global functions
275 ******************************************************************************/
276 
277 /*********************************************************
278 *
279 * Object API
280 *
281 *********************************************************/
282 
283 
284 
285 // Obsolete functions, replaced by any general
286 #define D4D_LabelSetText D4D_SetText
287 
288 
289 
290 
291 #endif /* __D4D_LABEL_H */
const D4D_OBJECT_SYS_FUNCTION d4d_labelSysFunc
Definition: d4d_label.c:54
The string type. This structure contains all properties about string in eGUI.
Definition: d4d_string.h:100
The object system function needed for each object - this is part of D4D_OBJECT main structure...
Definition: d4d_object.h:134
D4D_STRING textBuff
Definition: d4d_label.h:88