eGUI alias D4D  Release 3.0
Reference Manual
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
d4d_string.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_STRING_H
47 #define __D4D_STRING_H
48 
49 /******************************************************************************
50 * Includes
51 ******************************************************************************/
52 #include "common_files/d4d_font.h"
53 /******************************************************************************
54 * D4D STRING setting constants
55 *
56 */
62 #ifndef D4D_STR_TABLE_MAX_CNT
63  #define D4D_STR_TABLE_MAX_CNT 4
64 #endif
65 
68 /******************************************************************************
69 * Private constants - obsolete
70 ******************************************************************************/
71 // just for backward compatibility
72 #define D4D_TXT_PRTY_ALIGN_H_MASK D4D_ALIGN_H_MASK
73 #define D4D_TXT_PRTY_ALIGN_H_LEFT_MASK D4D_ALIGN_H_LEFT_MASK
74 #define D4D_TXT_PRTY_ALIGN_H_RIGHT_MASK D4D_ALIGN_H_RIGHT_MASK
75 #define D4D_TXT_PRTY_ALIGN_H_CENTER_MASK D4D_ALIGN_H_CENTER_MASK
76 
77 #define D4D_TXT_PRTY_ALIGN_V_MASK D4D_ALIGN_V_MASK
78 #define D4D_TXT_PRTY_ALIGN_V_TOP_MASK D4D_ALIGN_V_TOP_MASK
79 #define D4D_TXT_PRTY_ALIGN_V_BOTTOM_MASK D4D_ALIGN_V_BOTTOM_MASK
80 #define D4D_TXT_PRTY_ALIGN_V_CENTER_MASK D4D_ALIGN_V_CENTER_MASK
81 
82 /******************************************************************************
83 * D4D STRING setting types
84 *
85 */
91 
93 typedef struct D4D_STR_PROPERTIES_S
94 {
98 
100 typedef struct D4D_STRING_S
101 {
108 }D4D_STRING;
109 
112 /******************************************************************************
113 * Private types
114 ******************************************************************************/
115 
116 typedef struct
117 {
122 
123 /******************************************************************************
124 * D4D Object macros
125 *
126 */
130 /**************************************************************************/
141 #define D4D_DECLARE_STRING_TABLE_BEGIN D4D_DECLARE_USR_STRING_TABLE_BEGIN(d4d_StringTable)
142 
143 /**************************************************************************/
155 #define D4D_DECLARE_USR_STRING_TABLE_BEGIN(name) const D4D_STRING_TABLE name[] = {
156 
157 /**************************************************************************/
170 #define D4D_DECLARE_STRING(stringId, string_table) \
171  {stringId, (D4D_TCHAR**)string_table, (sizeof(string_table) / sizeof(D4D_TCHAR*))}, // string info will be replaced by string descriptor
172 
173 /**************************************************************************/
184 #define D4D_DECLARE_STRING_TABLE_END {0, NULL, 0} };
185 
186 /**************************************************************************/
198 #define D4D_DECLARE_TAB_TABLE_BEGIN(name) const D4D_COOR name[] = {
199 
200 /**************************************************************************/
212 #define D4D_DECLARE_TAB(tab) tab, // tab space in pixels
213 
214 /**************************************************************************/
225 #define D4D_DECLARE_TAB_TABLE_END 0 };
226 
227 #ifdef D4D_UNICODE
228  /**************************************************************************/
236  #define D4D_DEFSTR(str) L##str
237 #else
238  /**************************************************************************/
246  #define D4D_DEFSTR(str) str
247 #endif
248 
249 
250 /**************************************************************************/
265 #define D4D_IsDigit(x) (((x)>= '0') && ((x)<= '9'))
266 
268 /******************************************************************************
269 * Private macros
270 ******************************************************************************/
271 #define D4D_StringTable_GetCount(x) (sizeof(x) / sizeof(D4D_TCHAR*))
272 
273 /******************************************************************************
274 * Global variables
275 ******************************************************************************/
276 extern const D4D_STRING_TABLE d4d_StringTable[];
277 /******************************************************************************
278 * Global functions
279 ******************************************************************************/
281 void D4D_ChangeStringTable(LWord stringId);
283 void D4D_LCD_PrintStr(D4D_PRINT_DESC* p_StrDes);
284 #if D4D_EXTSRC_FILE_ENABLE != D4D_FALSE
285 
286 #endif
287 
288 #endif /* __D4D_STRING_H */
289 
290 
D4D_INDEX buffSize
size of text buffer array
Definition: d4d_string.h:103
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_TEXT_PROPERTIES text_properties
Text properties structure.
Definition: d4d_string.h:96
D4D_INDEX printLen
Length of string that should be used (printed).
Definition: d4d_string.h:106
The string type. This structure contains all properties about string in eGUI.
Definition: d4d_string.h:100
D4D_TCHAR * D4D_GetInternalStringPointer(const D4D_TCHAR *originTxt)
The function gets the real internal pointer to string.
Definition: d4d_string.c:108
D4D_FONT fontId
index of used font
Definition: d4d_string.h:104
D4D Driver fonts header file.
struct D4D_STR_PROPERTIES_S D4D_STR_PROPERTIES
The string properties type. This structure contains as Font as Text properties.
The string properties type. This structure contains as Font as Text properties.
Definition: d4d_string.h:93
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
D4D_INDEX stringId
Definition: d4d_string.h:118
unsigned char Byte
Type definition of Byte (unsigned 8-bit).
Definition: d4d_types.h:151
D4D_TCHAR ** stringTable
Definition: d4d_string.h:119
const D4D_STRING_TABLE d4d_StringTable[]
struct D4D_STRING_S D4D_STRING
The string type. This structure contains all properties about string in eGUI.
D4D_TCHAR * pText
pointer to text array
Definition: d4d_string.h:102
unsigned long LWord
Type definition of LWord (unsigned 32-bit).
Definition: d4d_types.h:167
D4D_STR_PROPERTIES * str_properties
pointer to string properties
Definition: d4d_string.h:105
LWord D4D_GetCurrentStringId(void)
LWord D4D_INDEX
Type definition of eGUI general index variables.
Definition: d4d_types.h:206
void D4D_LCD_PrintStr(D4D_PRINT_DESC *p_StrDes)
Definition: d4d_string.c:635
void D4D_ChangeStringTable(LWord stringId)
D4D_INDEX stringCount
Definition: d4d_string.h:120
D4D_FONT_PROPERTIES font_properties
Font properties structure.
Definition: d4d_string.h:95
Byte D4D_FONT_PROPERTIES
Definition: d4d_font.h:116
D4D_INDEX printOff
Offset of string that should be used (printed).
Definition: d4d_string.h:107