eGUI alias D4D  Release 3.0
Reference Manual
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
d4d_picture.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_PICTURE_H
47 #define __D4D_PICTURE_H
48 
50 
51 /******************************************************************************
52 * D4D PICTURE setting constants
53 *
54 */
60 #ifndef D4D_PIC_F_DEFAULT
61  #define D4D_PIC_F_DEFAULT (D4D_OBJECT_F_VISIBLE | D4D_OBJECT_F_ENABLED)
62 #endif
63 
66 #ifndef D4D_PIC_PRTY_DEFAULT
67  #define D4D_PIC_PRTY_DEFAULT (D4D_ALIGN_H_CENTER_MASK | D4D_ALIGN_V_CENTER_MASK)
68 #endif
69 
72 /******************************************************************************
73 * Types
74 ******************************************************************************/
75 
76 // picture configuration (goes to ROM by default)
77 
78 typedef struct
79 {
80  const D4D_BMP* pBmp;
81 } D4D_PICTURE;
82 
83 
84 /******************************************************************************
85 * Macros
86 ******************************************************************************/
87 
88 // getting the PICTURE structure from general OBJECT
89 #define D4D_GET_PICTURE(pObj) ((D4D_PICTURE*)((pObj)->pParam))
90 
91 /******************************************************************************
92 * D4D PICTURE setting public macros
93 *
94 */
98 /**************************************************************************/
118 #define _D4D_DECLARE_PICTURE(type, name, x, y, cx, cy, radius, pMargin, pRelations, pBmp, flags, pUser, pOnUsrMsg) \
119  static type D4D_PICTURE name##_params = \
120  { \
121  pBmp /* pBmp */ \
122  }; \
123  \
124  D4D_DECLARE_OBJECT(type, name, x, y, cx, cy, radius, pMargin, pRelations, pOnUsrMsg, &d4d_pictSysFunc, &(name##_params), flags, pUser, NULL)
125 
126 /**************************************************************************/
143 #define D4D_DECLARE_PICTURE(name, x, y, cx, cy, pBmp, flags, pUser, pOnUsrMsg) \
144  _D4D_DECLARE_PICTURE(D4D_CONST, name, x, y, cx, cy, 0, NULL, NULL, pBmp, flags, pUser, pOnUsrMsg)
145 
146 /**************************************************************************/
160 #define D4D_DECLARE_STD_PICTURE(name, x, y, cx, cy, pBmp) \
161  D4D_DECLARE_PICTURE(name, x, y, cx, cy, pBmp, (D4D_PIC_F_DEFAULT), NULL, NULL)
162 
163 // Rounded button definition
164 /**************************************************************************/
182 #define D4D_DECLARE_RPICTURE(name, x, y, cx, cy, radius, pBmp, flags, pUser, pOnUsrMsg) \
183  _D4D_DECLARE_PICTURE(D4D_CONST, name, x, y, cx, cy, radius, NULL, NULL, pBmp, flags, pUser, pOnUsrMsg)
184 
185 /**************************************************************************/
200 #define D4D_DECLARE_STD_RPICTURE(name, x, y, cx, cy, radius, pBmp) \
201  D4D_DECLARE_RPICTURE(name, x, y, cx, cy, radius, pBmp, (D4D_PIC_F_DEFAULT), NULL, NULL)
202 
203 
204 //IN RAM instantions macros
205 /**************************************************************************/
208 #define D4D_DECLARE_PICTURE_INRAM(name, x, y, cx, cy, pBmp, flags, pUser, pOnUsrMsg) \
209  _D4D_DECLARE_PICTURE(D4D_NO_CONST, name, x, y, cx, cy, 0, NULL, NULL, pBmp, flags, pUser, pOnUsrMsg)
210 
211 /**************************************************************************/
214 #define D4D_DECLARE_STD_PICTURE_INRAM(name, x, y, cx, cy, pBmp) \
215  D4D_DECLARE_PICTURE_INRAM(name, x, y, cx, cy, pBmp, (D4D_PIC_F_DEFAULT), NULL, NULL)
216 
217 // Rounded button definition
218 /**************************************************************************/
221 #define D4D_DECLARE_RPICTURE_INRAM(name, x, y, cx, cy, radius, pBmp, flags, pUser, pOnUsrMsg) \
222  _D4D_DECLARE_PICTURE(D4D_NO_CONST, name, x, y, cx, cy, radius, NULL, NULL, pBmp, flags, pUser, pOnUsrMsg)
223 
224 /**************************************************************************/
227 #define D4D_DECLARE_STD_RPICTURE_INRAM(name, x, y, cx, cy, radius, pBmp) \
228  D4D_DECLARE_RPICTURE_INRAM(name, x, y, cx, cy, radius, pBmp, (D4D_PIC_F_DEFAULT), NULL, NULL)
229 
231 /******************************************************************************
232 * Global variables
233 ******************************************************************************/
234 
235 
236 
237 /******************************************************************************
238 * Global functions
239 ******************************************************************************/
240 
241 
242 
243 #endif /* __D4D_PICTURE_H */
const D4D_BMP * pBmp
Definition: d4d_picture.h:80
const D4D_OBJECT_SYS_FUNCTION d4d_pictSysFunc
Definition: d4d_picture.c:53
D4D_BMP eGUI main image structure.
Definition: d4d_bmp.h:100
The object system function needed for each object - this is part of D4D_OBJECT main structure...
Definition: d4d_object.h:134