eGUI alias D4D  Release 3.0
Reference Manual
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
d4d.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_H
47 #define __D4D_H
48 
49 /******************************************************************************
50 * Includes
51 ******************************************************************************/
52 
53 /**************************************************************/
60 /**************************************************************/
65 #include "d4d_user_cfg.h"
66 #include "common_files/d4d_types.h"
67 #include "common_files/d4d_base.h"
71 #include "common_files/d4d_low.h"
72 #include "common_files/d4d_bmp.h"
73 #include "common_files/d4d_extsrc.h"
74 #include "common_files/d4d_font.h"
75 #include "common_files/d4d_math.h"
78 #include "common_files/d4d_mouse.h"
97 
98 
99 /******************************************************************************
100 * Constants
101 ******************************************************************************/
102 
103 /**************************************************************/
110 /******************************************************************************
111 * Types
112 ******************************************************************************/
113 
114 /******************************************************************************
115 * Global functions
116 ******************************************************************************/
117 
118 /**************************************************************/
124 /* General driver API */
125 D4D_BOOL D4D_Init(const D4D_SCREEN* pInitScreen);
126 void D4D_Poll(void);
128 void D4D_KeysChanged(D4D_KEYS keys);
129 void D4D_NewKeyEvent(D4D_KEY_SCANCODE scanCode);
130 void D4D_EnableSystemKeys(D4D_BOOL bEnable);
131 void D4D_TimeTickPut(void);
132 void D4D_FlushOutput(void);
133 
134 #ifdef D4D_LLD_TCH
136  void D4D_CheckTouchScreen(void);
137  void D4D_PutTouchScreen(D4D_BOOL touched, D4D_COOR x, D4D_COOR y);
138  void D4D_PutRawTouchScreen(D4D_BOOL touched, D4D_COOR x, D4D_COOR y);
139  void D4D_ClearTouchScreenEvents(void);
140  void D4D_CalibrateTouchScreen(void);
143 #else
144  #define D4D_GetTouchScreenCoordinates(pObject) ((D4D_POINT)d4d_point_zero)
145  #define D4D_CheckTouchScreen()
146  #define D4D_PutTouchScreen(touched, x, y)
147  #define D4D_PutRawTouchScreen(touched, x, y)
148  #define D4D_ClearTouchScreenEvents()
149  #define D4D_CalibrateTouchScreen()
150  #define D4D_SetTouchScreenCalibration(newCalib)
151  #define D4D_GetTouchScreenCalibration() ((D4D_TOUCHSCREEN_CALIB){ 0, 0, 0, 0, 0 })
152 #endif
153 /* screen API */
154 
155 
156 /* object API */
158 void D4D_FocusSet(const D4D_SCREEN* pScreen, D4D_OBJECT_PTR pObject);
159 void D4D_FocusNextObject(const D4D_SCREEN* pScreen, D4D_BOOL bInitialSearch);
160 void D4D_FocusPrevObject(const D4D_SCREEN* pScreen);
161 
162 /* Color Schemes */
166 void D4D_SetDefaultScheme(D4D_CLR_SCHEME* pScheme);
171 
172 /* general helpers */
173 void D4D_ClearKeysBuffer(void);
174 
175 void D4D_ClearScreen(D4D_COLOR color);
176 
178 
179 
180 
181 #define D4D_DrawBmp( ppt, pBmp, greyScale) D4D_DrawRBmpXY((ppt)->x, (ppt)->y, pBmp, greyScale, 0)
182 #define D4D_DrawBmpXY(x, y, pBmp, greyScale) D4D_DrawRBmpXY(x, y, pBmp, greyScale, 0)
183 
184 #if D4D_ROUND_CORNER_ENABLE != D4D_FALSE
185  void D4D_DrawRBmpRect(D4D_POINT* ppt, D4D_SIZE* psz, const D4D_BMP* pBmp, D4D_BMP_PROPERTIES bmpProp, D4D_COLOR colorBkgd, D4D_BOOL greyScale, D4D_COOR radius);
186 
187 #else
188  #define D4D_DrawRBmpRect(ppt, psz, pBmp, bmpProp, colorBkgd, greyScale, radius) D4D_DrawBmpRect(ppt, psz, pBmp, bmpProp, colorBkgd, greyScale)
189 
190 #endif
191 
192 #define D4D_DrawRBmp( ppt, pBmp, greyScale, radius) D4D_DrawRBmpXY((ppt)->x, (ppt)->y, pBmp, greyScale, radius)
193 void D4D_DrawRBmpXY(D4D_COOR x, D4D_COOR y, const D4D_BMP* pBmp, D4D_BOOL greyScale, D4D_COOR radius);
194 
195 void D4D_DrawBmpRect(D4D_POINT* ppt, D4D_SIZE* psz, const D4D_BMP* pBmp, D4D_BMP_PROPERTIES bmpProp, D4D_COLOR colorBkgd, D4D_BOOL greyScale);
196 
197 
198 D4D_SIZE D4D_GetBmpSize(const D4D_BMP* pBmp);
199 D4D_COOR D4D_GetBmpWidth(const D4D_BMP* pBmp);
200 D4D_COOR D4D_GetBmpHeight(const D4D_BMP* pBmp);
201 int D4D_GetBmpHeader(D4D_BMP* pBmp, void* pBuff, int max_size);
202 
203 void D4D_SetText(D4D_OBJECT_PTR pObject, D4D_TCHAR* pText);
208 
211 
212 Byte D4D_SprintDecU8(Byte val, D4D_TCHAR *pText, D4D_TCHAR fill);
213 Byte D4D_SprintDecS8(sByte val, D4D_TCHAR *pText, D4D_TCHAR fill);
214 Byte D4D_SprintDecU16(Word val, D4D_TCHAR *pText, D4D_TCHAR fill);
215 Byte D4D_SprintDecS16(sWord val, D4D_TCHAR *pText, D4D_TCHAR fill);
216 Byte D4D_SprintDecU32(LWord val, D4D_TCHAR *pText, D4D_TCHAR fill);
217 Byte D4D_SprintDecS32(sLWord val, D4D_TCHAR *pText, D4D_TCHAR fill);
218 
219 D4D_COLOR D4D_GetCrossColor(D4D_COLOR startColor, D4D_COLOR endColor, Byte value);
220 
221 
224 
225 
226 #endif /* __D4D_H */
227 
228 
229 
230 
231 
232 
233 
234 
235 
D4D_COLOR D4D_GetCrossColor(D4D_COLOR startColor, D4D_COLOR endColor, Byte value)
Compute cross color between two basic color in 256 steps.
Definition: d4d_scheme.c:243
D4D Driver check box object header file.
D4D_COLOR D4D_ObjectGetBckgColor(D4D_OBJECT *pObj, D4D_OBJECT_DRAWFLAGS draw)
Function return object current background color.
Definition: d4d_scheme.c:185
D4D_WCHAR D4D_TCHAR
Type definition of eGUI character (it depends on UNICODE setting if this is D4D_CHAR or D4D_WCHAR)...
Definition: d4d_types.h:284
Byte D4D_FONT
Definition: d4d_font.h:171
D4D Driver mouse functions header file.
D4D_COLOR D4D_ObjectGetBckgFillColor(D4D_OBJECT *pObj)
Function return object current fill background color.
Definition: d4d_scheme.c:225
D4D_COLOR D4D_ObjectGetForeColor(D4D_OBJECT *pObj, D4D_OBJECT_DRAWFLAGS draw)
Function return object current fore color.
Definition: d4d_scheme.c:161
D4D Driver label object header file.
signed long sLWord
Type definition of sLWord (signed 32-bit).
Definition: d4d_types.h:171
Type definition of eGUI touch screen calibration structure.
Definition: d4d_types.h:350
Type definition of eGUI point structure.
Definition: d4d_types.h:223
D4D Driver strings header file.
The string type. This structure contains all properties about string in eGUI.
Definition: d4d_string.h:100
D4D Driver label object header file.
D4D_COLOR D4D_ObjectGetForeFillColor(D4D_OBJECT *pObj)
Function return object current fill fore color.
Definition: d4d_scheme.c:208
D4D Driver menu object header file.
D4D Driver editBox object header file.
D4D_POINT D4D_SwapCoor(D4D_POINT point)
Function swap the point coordination.
Definition: d4d_base.c:534
D4D Driver math helper functions header file.
int D4D_GetBmpHeader(D4D_BMP *pBmp, void *pBuff, int max_size)
Function gets image file header.
Definition: d4d_bmp.c:515
Byte D4D_BMP_PROPERTIES
D4D_BMP_PROPERTIES type of image properties.
Definition: d4d_bmp.h:117
Byte D4D_KEYS
Type definition of eGUI keys - this is obsolete type that is kept just only for backward compatibilit...
Definition: d4d_types.h:301
D4D Driver extscr helper functions header file.
D4D Driver fonts header file.
D4D_POINT D4D_GetTouchScreenCoordinates(D4D_OBJECT *pObject)
D4D Driver object functions header file.
D4D Driver icon object header file.
D4D_BOOL D4D_Init(const D4D_SCREEN *pInitScreen)
Function inits the eGUI itself including all low level drivers.
Definition: d4d_base.c:122
void D4D_SetOrientation(D4D_ORIENTATION orient)
Set screen orientation function.
Definition: d4d_base.c:213
void D4D_CalibrateTouchScreen(void)
D4D_INDEX D4D_GetTextMaxLength(D4D_STRING *pString, D4D_COOR maxWidth)
The function find out the maximal text length that fits to maximal pixel width.
Definition: d4d_string.c:492
D4D Driver button object header file.
D4D Driver listBox object header file.
void D4D_ClearScreen(D4D_COLOR color)
Function readraw complete screen by one color.
D4D_TOUCHSCREEN_CALIB D4D_GetTouchScreenCalibration(void)
void D4D_PutRawTouchScreen(D4D_BOOL touched, D4D_COOR x, D4D_COOR y)
D4D Driver label object header file.
D4D_COOR D4D_GetBmpHeight(const D4D_BMP *pBmp)
Function gets information about bitmap height.
Definition: d4d_bmp.c:481
D4D Driver comboBox object header file.
void D4D_DrawBmpRect(D4D_POINT *ppt, D4D_SIZE *psz, const D4D_BMP *pBmp, D4D_BMP_PROPERTIES bmpProp, D4D_COLOR colorBkgd, D4D_BOOL greyScale)
Function draw the bitmap on the specify coordination into rectangle.
Definition: d4d_bmp.c:240
void D4D_ClearKeysBuffer(void)
Clear all rest information about pushed Keys in buffer.
Definition: d4d_base.c:244
D4D_COOR D4D_GetTextBuffWidthTab(D4D_STRING *text_buffer, D4D_TAB *pTab)
The function returns width of text in pixels, also with tab table.
Definition: d4d_string.c:403
void D4D_NewKeyEvent(D4D_KEY_SCANCODE scanCode)
Place to key event into key buffer.
Definition: d4d_base.c:347
Byte D4D_SprintDecU32(LWord val, D4D_TCHAR *pText, D4D_TCHAR fill)
The function convert decimal unsigned 32 bit number to string.
Definition: d4d_string.c:140
This is the main structure of the color scheme in the D4D. It contains all the necessary colors to ru...
Definition: d4d_scheme.h:578
D4D Driver core and base functions header file.
D4D_ORIENTATION
Type definition of eGUI display orientation.
Definition: d4d_types.h:341
Byte D4D_TEXT_PROPERTIES
The string text properties type. The masks are described here D4D BASE Defines masks of aligment prop...
Definition: d4d_string.h:90
void D4D_FocusNextObject(const D4D_SCREEN *pScreen, D4D_BOOL bInitialSearch)
The function change focus to the next object in the given screen.
Definition: d4d_screen.c:286
Byte D4D_COOR
Type definition of eGUI coordination variables.
Definition: d4d_types.h:219
D4D driver bmp decoder header file.
D4D Driver global types header file.
#define D4D_DrawRBmpRect(ppt,psz, pBmp, bmpProp, colorBkgd, greyScale, radius)
Definition: d4d.h:188
unsigned char Byte
Type definition of Byte (unsigned 8-bit).
Definition: d4d_types.h:151
void D4D_FocusPrevObject(const D4D_SCREEN *pScreen)
The function change focus to the previous object in the given screen.
Definition: d4d_screen.c:356
D4D_CLR_SCHEME * D4D_ScreenGetScheme(D4D_SCREEN *pScreen)
Byte D4D_SprintDecS8(sByte val, D4D_TCHAR *pText, D4D_TCHAR fill)
The function convert decimal signed 8 bit number to string.
Definition: d4d_string.c:311
D4D Driver gauge object header file.
void D4D_FocusSet(const D4D_SCREEN *pScreen, D4D_OBJECT_PTR pObject)
The function set the obejct focus to new object.
Definition: d4d_screen.c:430
void D4D_CheckTouchScreen(void)
D4D_INDEX D4D_GetTextLength(D4D_TCHAR *pText)
The function returns lenght of text.
Definition: d4d_string.c:329
D4D Driver label object header file.
void D4D_SetTextProperties(D4D_OBJECT_PTR pObject, D4D_TEXT_PROPERTIES property)
Function sets object text properties.
Definition: d4d_base.c:511
D4D_CLR_SCHEME * D4D_ObjectGetScheme(D4D_OBJECT *pObj)
Function return the pointer to current use object scheme of object.
Definition: d4d_scheme.c:109
D4D Driver progress_bar object header file.
unsigned long LWord
Type definition of LWord (unsigned 32-bit).
Definition: d4d_types.h:167
void D4D_SetDefaultScheme(D4D_CLR_SCHEME *pScheme)
Function sets the new default color scheme.
Definition: d4d_scheme.c:145
D4D_BMP eGUI main image structure.
Definition: d4d_bmp.h:100
void D4D_DrawRBmpXY(D4D_COOR x, D4D_COOR y, const D4D_BMP *pBmp, D4D_BOOL greyScale, D4D_COOR radius)
Function draw the bitmap on the specify coordination.
Definition: d4d_bmp.c:205
D4D_OBJECT_PTR D4D_GetFocusedObject(const D4D_SCREEN *pScreen)
The function returns pointer to object that is focused in given screen.
Definition: d4d_screen.c:266
D4D driver low level graphic function header file.
signed short sWord
Type definition of sWord (signed 16-bit).
Definition: d4d_types.h:163
void D4D_PutTouchScreen(D4D_BOOL touched, D4D_COOR x, D4D_COOR y)
D4D Driver slider object header file.
D4D Driver color scheme header file.
Type definition of eGUI tabulation structure.
Definition: d4d_types.h:253
D4D_CLR_SCHEME * D4D_GetDefaultScheme(void)
Function return the pointer to default color scheme.
Definition: d4d_scheme.c:133
LWord D4D_INDEX
Type definition of eGUI general index variables.
Definition: d4d_types.h:206
The object main structure type definition.
Definition: d4d_object.h:167
signed char sByte
Type definition of sByte (signed 8-bit).
Definition: d4d_types.h:155
Byte D4D_SprintDecS32(sLWord val, D4D_TCHAR *pText, D4D_TCHAR fill)
The function convert decimal signed 32 bit number to string.
Definition: d4d_string.c:181
D4D_COOR D4D_GetBmpWidth(const D4D_BMP *pBmp)
Function gets information about bitmap width.
Definition: d4d_bmp.c:450
Byte D4D_SprintDecS16(sWord val, D4D_TCHAR *pText, D4D_TCHAR fill)
The function convert decimal signed 16 bit number to string.
Definition: d4d_string.c:242
void D4D_KeysChanged(D4D_KEYS keys)
Place to keys buffer new keys events by binary mask.
Definition: d4d_base.c:272
void D4D_TimeTickPut(void)
Notify eGui about new tick tick occur.
Definition: d4d_base.c:234
void D4D_Poll(void)
Main eGUI function. Must be periodically called in main loop/task loop.
Definition: d4d_base.c:159
LWord D4D_BOOL
Type definition of eGUI boolean.
Definition: d4d_types.h:204
void D4D_FlushOutput(void)
Function force flush output to LCD.
Definition: d4d_base.c:563
Byte D4D_SprintDecU8(Byte val, D4D_TCHAR *pText, D4D_TCHAR fill)
The function convert decimal unsigned 8 bit number to string.
Definition: d4d_string.c:262
Type definition of eGUI size structure.
Definition: d4d_types.h:230
D4D driver screen header file.
void D4D_EnableSystemKeys(D4D_BOOL bEnable)
Function enable or disable handling system keys (ESC, UP/DOWN, LEFT/RIGHT) automatically.
Definition: d4d_base.c:256
D4D_COOR D4D_GetTextWidth(D4D_FONT ix, D4D_TCHAR *pText)
The function returns width of text in pixels.
Definition: d4d_string.c:357
D4D_SIZE D4D_GetBmpSize(const D4D_BMP *pBmp)
Function gets information about bitmap size.
Definition: d4d_bmp.c:418
void D4D_SetTouchScreenCalibration(D4D_TOUCHSCREEN_CALIB newCalib)
The screen structure type. The main screen structure that contains all needed data to run the eGUI sc...
Definition: d4d_screen.h:162
D4D Driver graph object header file.
void D4D_SetFontProperties(D4D_OBJECT_PTR pObject, D4D_FONT_PROPERTIES property)
Function sets object text font properties.
Definition: d4d_base.c:485
D4D Driver radio button object header file.
D4D Driver core and base functions header file.
Byte D4D_KEY_SCANCODE
Type definition of eGUI keys scan code.
Definition: d4d_types.h:304
Byte D4D_OBJECT_DRAWFLAGS
Drawing object flags type, handled to object in D4D_MSG_DRAW events.
Definition: d4d_base.h:359
LWord D4D_COLOR
Type definition of eGUI color variables.
Definition: d4d_types.h:262
Byte D4D_SprintDecU16(Word val, D4D_TCHAR *pText, D4D_TCHAR fill)
The function convert decimal unsigned 16 bit number to string.
Definition: d4d_string.c:201
void D4D_SetText(D4D_OBJECT_PTR pObject, D4D_TCHAR *pText)
The function change the text in main object text buffer.
Definition: d4d_string.c:573
D4D_COLOR D4D_GetGreyScale(D4D_COLOR color)
Compute the grayscale color.
Definition: d4d_scheme.c:333
D4D Driver picture object header file.
Byte D4D_FONT_PROPERTIES
Definition: d4d_font.h:116
void D4D_ClearTouchScreenEvents(void)
D4D_COOR D4D_GetLongerSide(D4D_SIZE *pSz)
Function returns longer side of size structure.
Definition: d4d_base.c:550
unsigned short Word
Type definition of Word (unsigned 16-bit).
Definition: d4d_types.h:159
D4D Driver groupBox object header file.