NXP
/
rt1050_emwin_gui_demo
RT1050 GUI demo using emWin library
emwin/emWin_header/GUI_Type.h@0:dd702039127a, 2018-09-20 (annotated)
- Committer:
- alejandroRL
- Date:
- Thu Sep 20 19:16:34 2018 +0000
- Revision:
- 0:dd702039127a
emWin GUI Demo for RT1050
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
alejandroRL | 0:dd702039127a | 1 | /********************************************************************* |
alejandroRL | 0:dd702039127a | 2 | * SEGGER Microcontroller GmbH & Co. KG * |
alejandroRL | 0:dd702039127a | 3 | * Solutions for real time microcontroller applications * |
alejandroRL | 0:dd702039127a | 4 | ********************************************************************** |
alejandroRL | 0:dd702039127a | 5 | * * |
alejandroRL | 0:dd702039127a | 6 | * (c) 1996 - 2016 SEGGER Microcontroller GmbH & Co. KG * |
alejandroRL | 0:dd702039127a | 7 | * * |
alejandroRL | 0:dd702039127a | 8 | * Internet: www.segger.com Support: support@segger.com * |
alejandroRL | 0:dd702039127a | 9 | * * |
alejandroRL | 0:dd702039127a | 10 | ********************************************************************** |
alejandroRL | 0:dd702039127a | 11 | |
alejandroRL | 0:dd702039127a | 12 | ** emWin V5.38 - Graphical user interface for embedded applications ** |
alejandroRL | 0:dd702039127a | 13 | All Intellectual Property rights in the Software belongs to SEGGER. |
alejandroRL | 0:dd702039127a | 14 | emWin is protected by international copyright laws. Knowledge of the |
alejandroRL | 0:dd702039127a | 15 | source code may not be used to write a similar product. This file may |
alejandroRL | 0:dd702039127a | 16 | only be used in accordance with the following terms: |
alejandroRL | 0:dd702039127a | 17 | |
alejandroRL | 0:dd702039127a | 18 | The software has been licensed to NXP Semiconductors USA, Inc. whose |
alejandroRL | 0:dd702039127a | 19 | registered office is situated at 411 E. Plumeria Drive, San Jose, |
alejandroRL | 0:dd702039127a | 20 | CA 95134, USA solely for the purposes of creating libraries for |
alejandroRL | 0:dd702039127a | 21 | NXPs M0, M3/M4 and ARM7/9 processor-based devices, sublicensed and |
alejandroRL | 0:dd702039127a | 22 | distributed under the terms and conditions of the NXP End User License |
alejandroRL | 0:dd702039127a | 23 | Agreement. |
alejandroRL | 0:dd702039127a | 24 | Full source code is available at: www.segger.com |
alejandroRL | 0:dd702039127a | 25 | |
alejandroRL | 0:dd702039127a | 26 | We appreciate your understanding and fairness. |
alejandroRL | 0:dd702039127a | 27 | ---------------------------------------------------------------------- |
alejandroRL | 0:dd702039127a | 28 | Licensing information |
alejandroRL | 0:dd702039127a | 29 | |
alejandroRL | 0:dd702039127a | 30 | Licensor: SEGGER Microcontroller Systems LLC |
alejandroRL | 0:dd702039127a | 31 | Licensed to: NXP Semiconductors, 1109 McKay Dr, M/S 76, San Jose, CA 95131, USA |
alejandroRL | 0:dd702039127a | 32 | Licensed SEGGER software: emWin |
alejandroRL | 0:dd702039127a | 33 | License number: GUI-00186 |
alejandroRL | 0:dd702039127a | 34 | License model: emWin License Agreement, dated August 20th 2011 |
alejandroRL | 0:dd702039127a | 35 | Licensed product: - |
alejandroRL | 0:dd702039127a | 36 | Licensed platform: NXP's ARM 7/9, Cortex-M0,M3,M4 |
alejandroRL | 0:dd702039127a | 37 | Licensed number of seats: - |
alejandroRL | 0:dd702039127a | 38 | ---------------------------------------------------------------------- |
alejandroRL | 0:dd702039127a | 39 | File : GUI_Type.h |
alejandroRL | 0:dd702039127a | 40 | Purpose : Include file define the types used for GUI |
alejandroRL | 0:dd702039127a | 41 | ---------------------------END-OF-HEADER------------------------------ |
alejandroRL | 0:dd702039127a | 42 | |
alejandroRL | 0:dd702039127a | 43 | Attention : Do not modify this file ! If you do, you will not |
alejandroRL | 0:dd702039127a | 44 | be able do update to a later GUI version ! |
alejandroRL | 0:dd702039127a | 45 | |
alejandroRL | 0:dd702039127a | 46 | */ |
alejandroRL | 0:dd702039127a | 47 | |
alejandroRL | 0:dd702039127a | 48 | #ifndef GUITYPE_H_INCLUDED |
alejandroRL | 0:dd702039127a | 49 | #define GUITYPE_H_INCLUDED |
alejandroRL | 0:dd702039127a | 50 | |
alejandroRL | 0:dd702039127a | 51 | #include "LCD.h" |
alejandroRL | 0:dd702039127a | 52 | #include "GUIConf.h" |
alejandroRL | 0:dd702039127a | 53 | |
alejandroRL | 0:dd702039127a | 54 | /********************************************************************* |
alejandroRL | 0:dd702039127a | 55 | * |
alejandroRL | 0:dd702039127a | 56 | * Common types |
alejandroRL | 0:dd702039127a | 57 | */ |
alejandroRL | 0:dd702039127a | 58 | typedef const char * GUI_ConstString; |
alejandroRL | 0:dd702039127a | 59 | |
alejandroRL | 0:dd702039127a | 60 | typedef LCD_COLOR GUI_COLOR; |
alejandroRL | 0:dd702039127a | 61 | typedef LCD_LOGPALETTE GUI_LOGPALETTE; |
alejandroRL | 0:dd702039127a | 62 | typedef LCD_DRAWMODE GUI_DRAWMODE; |
alejandroRL | 0:dd702039127a | 63 | typedef LCD_RECT GUI_RECT; |
alejandroRL | 0:dd702039127a | 64 | |
alejandroRL | 0:dd702039127a | 65 | typedef struct { |
alejandroRL | 0:dd702039127a | 66 | void (* pfDraw) (int x0, |
alejandroRL | 0:dd702039127a | 67 | int y0, |
alejandroRL | 0:dd702039127a | 68 | int xsize, |
alejandroRL | 0:dd702039127a | 69 | int ysize, |
alejandroRL | 0:dd702039127a | 70 | const U8 * pPixel, |
alejandroRL | 0:dd702039127a | 71 | const LCD_LOGPALETTE * pLogPal, |
alejandroRL | 0:dd702039127a | 72 | int xMag, |
alejandroRL | 0:dd702039127a | 73 | int yMag); |
alejandroRL | 0:dd702039127a | 74 | GUI_COLOR (* pfIndex2Color)(LCD_PIXELINDEX Index); |
alejandroRL | 0:dd702039127a | 75 | void (* pfDrawHW)(int x0, |
alejandroRL | 0:dd702039127a | 76 | int y0, |
alejandroRL | 0:dd702039127a | 77 | int xsize, |
alejandroRL | 0:dd702039127a | 78 | int ysize, |
alejandroRL | 0:dd702039127a | 79 | const U8 * pPixel, |
alejandroRL | 0:dd702039127a | 80 | const LCD_LOGPALETTE * pLogPal, |
alejandroRL | 0:dd702039127a | 81 | int xMag, |
alejandroRL | 0:dd702039127a | 82 | int yMag); |
alejandroRL | 0:dd702039127a | 83 | const LCD_API_COLOR_CONV * pColorConvAPI; |
alejandroRL | 0:dd702039127a | 84 | } GUI_BITMAP_METHODS; |
alejandroRL | 0:dd702039127a | 85 | |
alejandroRL | 0:dd702039127a | 86 | typedef struct { |
alejandroRL | 0:dd702039127a | 87 | U16P XSize; |
alejandroRL | 0:dd702039127a | 88 | U16P YSize; |
alejandroRL | 0:dd702039127a | 89 | U16P BytesPerLine; |
alejandroRL | 0:dd702039127a | 90 | U16P BitsPerPixel; |
alejandroRL | 0:dd702039127a | 91 | const U8 * pData; |
alejandroRL | 0:dd702039127a | 92 | const GUI_LOGPALETTE * pPal; |
alejandroRL | 0:dd702039127a | 93 | const GUI_BITMAP_METHODS * pMethods; |
alejandroRL | 0:dd702039127a | 94 | } GUI_BITMAP; |
alejandroRL | 0:dd702039127a | 95 | |
alejandroRL | 0:dd702039127a | 96 | /* This structure may not be changed because the data that it |
alejandroRL | 0:dd702039127a | 97 | expects is read in binary form (via any kind of interface, |
alejandroRL | 0:dd702039127a | 98 | at runtime). |
alejandroRL | 0:dd702039127a | 99 | This structure should therefor not be changed. |
alejandroRL | 0:dd702039127a | 100 | */ |
alejandroRL | 0:dd702039127a | 101 | typedef struct { |
alejandroRL | 0:dd702039127a | 102 | U16 ID; |
alejandroRL | 0:dd702039127a | 103 | U16 Format; |
alejandroRL | 0:dd702039127a | 104 | U16 XSize; |
alejandroRL | 0:dd702039127a | 105 | U16 YSize; |
alejandroRL | 0:dd702039127a | 106 | U16 BytesPerLine; |
alejandroRL | 0:dd702039127a | 107 | U16 BitsPerPixel; |
alejandroRL | 0:dd702039127a | 108 | U16 NumColors; |
alejandroRL | 0:dd702039127a | 109 | U16 HasTrans; |
alejandroRL | 0:dd702039127a | 110 | } GUI_BITMAP_STREAM; |
alejandroRL | 0:dd702039127a | 111 | |
alejandroRL | 0:dd702039127a | 112 | typedef struct { |
alejandroRL | 0:dd702039127a | 113 | int Cmd; |
alejandroRL | 0:dd702039127a | 114 | U32 v; |
alejandroRL | 0:dd702039127a | 115 | void * p; |
alejandroRL | 0:dd702039127a | 116 | } GUI_BITMAPSTREAM_PARAM; |
alejandroRL | 0:dd702039127a | 117 | |
alejandroRL | 0:dd702039127a | 118 | typedef struct { |
alejandroRL | 0:dd702039127a | 119 | int XSize; |
alejandroRL | 0:dd702039127a | 120 | int YSize; |
alejandroRL | 0:dd702039127a | 121 | int BitsPerPixel; |
alejandroRL | 0:dd702039127a | 122 | int NumColors; |
alejandroRL | 0:dd702039127a | 123 | int HasTrans; |
alejandroRL | 0:dd702039127a | 124 | } GUI_BITMAPSTREAM_INFO; |
alejandroRL | 0:dd702039127a | 125 | |
alejandroRL | 0:dd702039127a | 126 | typedef void * (* GUI_BITMAPSTREAM_CALLBACK)(GUI_BITMAPSTREAM_PARAM * pParam); |
alejandroRL | 0:dd702039127a | 127 | |
alejandroRL | 0:dd702039127a | 128 | typedef struct { |
alejandroRL | 0:dd702039127a | 129 | int x,y; |
alejandroRL | 0:dd702039127a | 130 | U8 Pressed; |
alejandroRL | 0:dd702039127a | 131 | U8 Layer; |
alejandroRL | 0:dd702039127a | 132 | } GUI_PID_STATE; |
alejandroRL | 0:dd702039127a | 133 | |
alejandroRL | 0:dd702039127a | 134 | typedef struct { |
alejandroRL | 0:dd702039127a | 135 | int Key; |
alejandroRL | 0:dd702039127a | 136 | int Pressed; |
alejandroRL | 0:dd702039127a | 137 | } GUI_KEY_STATE; |
alejandroRL | 0:dd702039127a | 138 | |
alejandroRL | 0:dd702039127a | 139 | typedef struct { |
alejandroRL | 0:dd702039127a | 140 | int xPos; |
alejandroRL | 0:dd702039127a | 141 | int yPos; |
alejandroRL | 0:dd702039127a | 142 | int xSize; |
alejandroRL | 0:dd702039127a | 143 | int ySize; |
alejandroRL | 0:dd702039127a | 144 | int Delay; |
alejandroRL | 0:dd702039127a | 145 | } GUI_GIF_IMAGE_INFO; |
alejandroRL | 0:dd702039127a | 146 | |
alejandroRL | 0:dd702039127a | 147 | typedef struct { |
alejandroRL | 0:dd702039127a | 148 | int xSize; |
alejandroRL | 0:dd702039127a | 149 | int ySize; |
alejandroRL | 0:dd702039127a | 150 | int NumImages; |
alejandroRL | 0:dd702039127a | 151 | } GUI_GIF_INFO; |
alejandroRL | 0:dd702039127a | 152 | |
alejandroRL | 0:dd702039127a | 153 | typedef struct GUI_REGISTER_EXIT GUI_REGISTER_EXIT; |
alejandroRL | 0:dd702039127a | 154 | |
alejandroRL | 0:dd702039127a | 155 | struct GUI_REGISTER_EXIT { |
alejandroRL | 0:dd702039127a | 156 | void (* pfVoid)(void); |
alejandroRL | 0:dd702039127a | 157 | GUI_REGISTER_EXIT * pNext; |
alejandroRL | 0:dd702039127a | 158 | }; |
alejandroRL | 0:dd702039127a | 159 | |
alejandroRL | 0:dd702039127a | 160 | typedef struct { |
alejandroRL | 0:dd702039127a | 161 | void (* cbBegin)(void); |
alejandroRL | 0:dd702039127a | 162 | void (* cbEnd) (void); |
alejandroRL | 0:dd702039127a | 163 | } GUI_MULTIBUF_API; |
alejandroRL | 0:dd702039127a | 164 | |
alejandroRL | 0:dd702039127a | 165 | typedef struct { |
alejandroRL | 0:dd702039127a | 166 | void (* cbBeginEx)(int LayerIndex); |
alejandroRL | 0:dd702039127a | 167 | void (* cbEndEx) (int LayerIndex); |
alejandroRL | 0:dd702039127a | 168 | } GUI_MULTIBUF_API_EX; |
alejandroRL | 0:dd702039127a | 169 | |
alejandroRL | 0:dd702039127a | 170 | /********************************************************************* |
alejandroRL | 0:dd702039127a | 171 | * |
alejandroRL | 0:dd702039127a | 172 | * FONT structures |
alejandroRL | 0:dd702039127a | 173 | */ |
alejandroRL | 0:dd702039127a | 174 | |
alejandroRL | 0:dd702039127a | 175 | /* Translation list. Translates a character code into up to 2 |
alejandroRL | 0:dd702039127a | 176 | indices of images to display on top of each other; |
alejandroRL | 0:dd702039127a | 177 | 'á' -> index('a'), index('´') */ |
alejandroRL | 0:dd702039127a | 178 | typedef struct { |
alejandroRL | 0:dd702039127a | 179 | I16P c0; |
alejandroRL | 0:dd702039127a | 180 | I16P c1; |
alejandroRL | 0:dd702039127a | 181 | } GUI_FONT_TRANSLIST; |
alejandroRL | 0:dd702039127a | 182 | |
alejandroRL | 0:dd702039127a | 183 | typedef struct { |
alejandroRL | 0:dd702039127a | 184 | U16P FirstChar; |
alejandroRL | 0:dd702039127a | 185 | U16P LastChar; |
alejandroRL | 0:dd702039127a | 186 | const GUI_FONT_TRANSLIST * pList; |
alejandroRL | 0:dd702039127a | 187 | } GUI_FONT_TRANSINFO; |
alejandroRL | 0:dd702039127a | 188 | |
alejandroRL | 0:dd702039127a | 189 | typedef struct { |
alejandroRL | 0:dd702039127a | 190 | U8 XSize; |
alejandroRL | 0:dd702039127a | 191 | U8 XDist; |
alejandroRL | 0:dd702039127a | 192 | U8 BytesPerLine; |
alejandroRL | 0:dd702039127a | 193 | const unsigned char * pData; |
alejandroRL | 0:dd702039127a | 194 | } GUI_CHARINFO; |
alejandroRL | 0:dd702039127a | 195 | |
alejandroRL | 0:dd702039127a | 196 | typedef struct { |
alejandroRL | 0:dd702039127a | 197 | U8 XSize; |
alejandroRL | 0:dd702039127a | 198 | U8 YSize; |
alejandroRL | 0:dd702039127a | 199 | I8 XPos; |
alejandroRL | 0:dd702039127a | 200 | I8 YPos; |
alejandroRL | 0:dd702039127a | 201 | U8 XDist; |
alejandroRL | 0:dd702039127a | 202 | const unsigned char * pData; |
alejandroRL | 0:dd702039127a | 203 | } GUI_CHARINFO_EXT; |
alejandroRL | 0:dd702039127a | 204 | |
alejandroRL | 0:dd702039127a | 205 | typedef struct GUI_FONT_PROP { |
alejandroRL | 0:dd702039127a | 206 | U16P First; /* First character */ |
alejandroRL | 0:dd702039127a | 207 | U16P Last; /* Last character */ |
alejandroRL | 0:dd702039127a | 208 | const GUI_CHARINFO * paCharInfo; /* Address of first character */ |
alejandroRL | 0:dd702039127a | 209 | const struct GUI_FONT_PROP * pNext; /* Pointer to next */ |
alejandroRL | 0:dd702039127a | 210 | } GUI_FONT_PROP; |
alejandroRL | 0:dd702039127a | 211 | |
alejandroRL | 0:dd702039127a | 212 | typedef struct GUI_FONT_PROP_EXT { |
alejandroRL | 0:dd702039127a | 213 | U16P First; /* First character */ |
alejandroRL | 0:dd702039127a | 214 | U16P Last; /* Last character */ |
alejandroRL | 0:dd702039127a | 215 | const GUI_CHARINFO_EXT * paCharInfo; /* Address of first character */ |
alejandroRL | 0:dd702039127a | 216 | const struct GUI_FONT_PROP_EXT * pNext; /* Pointer to next */ |
alejandroRL | 0:dd702039127a | 217 | } GUI_FONT_PROP_EXT; |
alejandroRL | 0:dd702039127a | 218 | |
alejandroRL | 0:dd702039127a | 219 | typedef struct { |
alejandroRL | 0:dd702039127a | 220 | const unsigned char * pData; |
alejandroRL | 0:dd702039127a | 221 | const U8 * pTransData; |
alejandroRL | 0:dd702039127a | 222 | const GUI_FONT_TRANSINFO * pTrans; |
alejandroRL | 0:dd702039127a | 223 | U16P FirstChar; |
alejandroRL | 0:dd702039127a | 224 | U16P LastChar; |
alejandroRL | 0:dd702039127a | 225 | U8 XSize; |
alejandroRL | 0:dd702039127a | 226 | U8 XDist; |
alejandroRL | 0:dd702039127a | 227 | U8 BytesPerLine; |
alejandroRL | 0:dd702039127a | 228 | } GUI_FONT_MONO; |
alejandroRL | 0:dd702039127a | 229 | |
alejandroRL | 0:dd702039127a | 230 | /********************************************************************* |
alejandroRL | 0:dd702039127a | 231 | * |
alejandroRL | 0:dd702039127a | 232 | * FONT structures |
alejandroRL | 0:dd702039127a | 233 | * |
alejandroRL | 0:dd702039127a | 234 | * This structure is used when retrieving information about a font. |
alejandroRL | 0:dd702039127a | 235 | * It is designed for future expansion without incompatibilities. |
alejandroRL | 0:dd702039127a | 236 | */ |
alejandroRL | 0:dd702039127a | 237 | typedef struct { |
alejandroRL | 0:dd702039127a | 238 | U16 Flags; |
alejandroRL | 0:dd702039127a | 239 | U8 Baseline; |
alejandroRL | 0:dd702039127a | 240 | U8 LHeight; /* height of a small lower case character (a,x) */ |
alejandroRL | 0:dd702039127a | 241 | U8 CHeight; /* height of a small upper case character (A,X) */ |
alejandroRL | 0:dd702039127a | 242 | } GUI_FONTINFO; |
alejandroRL | 0:dd702039127a | 243 | |
alejandroRL | 0:dd702039127a | 244 | #define GUI_FONTINFO_FLAG_PROP (1 << 0) /* Is proportional */ |
alejandroRL | 0:dd702039127a | 245 | #define GUI_FONTINFO_FLAG_MONO (1 << 1) /* Is monospaced */ |
alejandroRL | 0:dd702039127a | 246 | #define GUI_FONTINFO_FLAG_AA (1 << 2) /* Is an antialiased font */ |
alejandroRL | 0:dd702039127a | 247 | #define GUI_FONTINFO_FLAG_AA2 (1 << 3) /* Is an antialiased font, 2bpp */ |
alejandroRL | 0:dd702039127a | 248 | #define GUI_FONTINFO_FLAG_AA4 (1 << 4) /* Is an antialiased font, 4bpp */ |
alejandroRL | 0:dd702039127a | 249 | #define GUI_FONTINFO_FLAG_PROPFRM (1 << 5) /* Is proportional, framed */ |
alejandroRL | 0:dd702039127a | 250 | |
alejandroRL | 0:dd702039127a | 251 | /********************************************************************* |
alejandroRL | 0:dd702039127a | 252 | * |
alejandroRL | 0:dd702039127a | 253 | * UNICODE Encoding |
alejandroRL | 0:dd702039127a | 254 | */ |
alejandroRL | 0:dd702039127a | 255 | typedef U16 tGUI_GetCharCode (const char * s); |
alejandroRL | 0:dd702039127a | 256 | typedef int tGUI_GetCharSize (const char * s); |
alejandroRL | 0:dd702039127a | 257 | typedef int tGUI_CalcSizeOfChar(U16 Char); |
alejandroRL | 0:dd702039127a | 258 | typedef int tGUI_Encode (char * s, U16 Char); |
alejandroRL | 0:dd702039127a | 259 | |
alejandroRL | 0:dd702039127a | 260 | typedef struct { |
alejandroRL | 0:dd702039127a | 261 | tGUI_GetCharCode * pfGetCharCode; |
alejandroRL | 0:dd702039127a | 262 | tGUI_GetCharSize * pfGetCharSize; |
alejandroRL | 0:dd702039127a | 263 | tGUI_CalcSizeOfChar * pfCalcSizeOfChar; |
alejandroRL | 0:dd702039127a | 264 | tGUI_Encode * pfEncode; |
alejandroRL | 0:dd702039127a | 265 | } GUI_UC_ENC_APILIST; |
alejandroRL | 0:dd702039127a | 266 | |
alejandroRL | 0:dd702039127a | 267 | /********************************************************************* |
alejandroRL | 0:dd702039127a | 268 | * |
alejandroRL | 0:dd702039127a | 269 | * FONT Encoding |
alejandroRL | 0:dd702039127a | 270 | */ |
alejandroRL | 0:dd702039127a | 271 | typedef int tGUI_GetLineDistX(const char * s, int Len); |
alejandroRL | 0:dd702039127a | 272 | typedef int tGUI_GetLineLen (const char * s, int MaxLen); |
alejandroRL | 0:dd702039127a | 273 | typedef void tGL_DispLine (const char * s, int Len); |
alejandroRL | 0:dd702039127a | 274 | |
alejandroRL | 0:dd702039127a | 275 | typedef struct { |
alejandroRL | 0:dd702039127a | 276 | tGUI_GetLineDistX * pfGetLineDistX; |
alejandroRL | 0:dd702039127a | 277 | tGUI_GetLineLen * pfGetLineLen; |
alejandroRL | 0:dd702039127a | 278 | tGL_DispLine * pfDispLine; |
alejandroRL | 0:dd702039127a | 279 | } tGUI_ENC_APIList; |
alejandroRL | 0:dd702039127a | 280 | |
alejandroRL | 0:dd702039127a | 281 | extern const tGUI_ENC_APIList GUI_ENC_APIList_SJIS; |
alejandroRL | 0:dd702039127a | 282 | extern const tGUI_ENC_APIList GUI_ENC_APIList_EXT; |
alejandroRL | 0:dd702039127a | 283 | |
alejandroRL | 0:dd702039127a | 284 | /********************************************************************* |
alejandroRL | 0:dd702039127a | 285 | * |
alejandroRL | 0:dd702039127a | 286 | * FONT methods |
alejandroRL | 0:dd702039127a | 287 | */ |
alejandroRL | 0:dd702039127a | 288 | typedef struct GUI_FONT GUI_FONT; |
alejandroRL | 0:dd702039127a | 289 | |
alejandroRL | 0:dd702039127a | 290 | typedef void GUI_DISPCHAR (U16 c); |
alejandroRL | 0:dd702039127a | 291 | typedef int GUI_GETCHARDISTX(U16P c, int * pSizeX); |
alejandroRL | 0:dd702039127a | 292 | typedef void GUI_GETFONTINFO (const GUI_FONT * pFont, GUI_FONTINFO * pfi); |
alejandroRL | 0:dd702039127a | 293 | typedef char GUI_ISINFONT (const GUI_FONT * pFont, U16 c); |
alejandroRL | 0:dd702039127a | 294 | typedef int GUI_GETCHARINFO (U16P c, GUI_CHARINFO_EXT * pInfo); |
alejandroRL | 0:dd702039127a | 295 | |
alejandroRL | 0:dd702039127a | 296 | #define DECLARE_FONT(Type) \ |
alejandroRL | 0:dd702039127a | 297 | void GUI##Type##_DispChar (U16P c); \ |
alejandroRL | 0:dd702039127a | 298 | int GUI##Type##_GetCharDistX(U16P c, int * pSizeX); \ |
alejandroRL | 0:dd702039127a | 299 | void GUI##Type##_GetFontInfo (const GUI_FONT * pFont, GUI_FONTINFO * pfi); \ |
alejandroRL | 0:dd702039127a | 300 | char GUI##Type##_IsInFont (const GUI_FONT * pFont, U16 c); \ |
alejandroRL | 0:dd702039127a | 301 | int GUI##Type##_GetCharInfo (U16P c, GUI_CHARINFO_EXT * pInfo) |
alejandroRL | 0:dd702039127a | 302 | |
alejandroRL | 0:dd702039127a | 303 | #if defined(__cplusplus) |
alejandroRL | 0:dd702039127a | 304 | extern "C" { /* Make sure we have C-declarations in C++ programs */ |
alejandroRL | 0:dd702039127a | 305 | #endif |
alejandroRL | 0:dd702039127a | 306 | |
alejandroRL | 0:dd702039127a | 307 | DECLARE_FONT(MONO); |
alejandroRL | 0:dd702039127a | 308 | DECLARE_FONT(PROP); |
alejandroRL | 0:dd702039127a | 309 | DECLARE_FONT(PROP_EXT); |
alejandroRL | 0:dd702039127a | 310 | DECLARE_FONT(PROP_FRM); |
alejandroRL | 0:dd702039127a | 311 | DECLARE_FONT(PROPAA); |
alejandroRL | 0:dd702039127a | 312 | DECLARE_FONT(PROP_AA2); |
alejandroRL | 0:dd702039127a | 313 | DECLARE_FONT(PROP_AA2_EXT); |
alejandroRL | 0:dd702039127a | 314 | DECLARE_FONT(PROP_AA4); |
alejandroRL | 0:dd702039127a | 315 | DECLARE_FONT(PROP_AA4_EXT); |
alejandroRL | 0:dd702039127a | 316 | |
alejandroRL | 0:dd702039127a | 317 | /* MONO: Monospaced fonts */ |
alejandroRL | 0:dd702039127a | 318 | #define GUI_FONTTYPE_MONO \ |
alejandroRL | 0:dd702039127a | 319 | GUIMONO_DispChar, \ |
alejandroRL | 0:dd702039127a | 320 | GUIMONO_GetCharDistX, \ |
alejandroRL | 0:dd702039127a | 321 | GUIMONO_GetFontInfo, \ |
alejandroRL | 0:dd702039127a | 322 | GUIMONO_IsInFont, \ |
alejandroRL | 0:dd702039127a | 323 | (GUI_GETCHARINFO *)0, \ |
alejandroRL | 0:dd702039127a | 324 | (tGUI_ENC_APIList*)0 |
alejandroRL | 0:dd702039127a | 325 | |
alejandroRL | 0:dd702039127a | 326 | /* PROP: Proportional fonts */ |
alejandroRL | 0:dd702039127a | 327 | #define GUI_FONTTYPE_PROP \ |
alejandroRL | 0:dd702039127a | 328 | GUIPROP_DispChar, \ |
alejandroRL | 0:dd702039127a | 329 | GUIPROP_GetCharDistX, \ |
alejandroRL | 0:dd702039127a | 330 | GUIPROP_GetFontInfo, \ |
alejandroRL | 0:dd702039127a | 331 | GUIPROP_IsInFont, \ |
alejandroRL | 0:dd702039127a | 332 | (GUI_GETCHARINFO *)0, \ |
alejandroRL | 0:dd702039127a | 333 | (tGUI_ENC_APIList*)0 |
alejandroRL | 0:dd702039127a | 334 | |
alejandroRL | 0:dd702039127a | 335 | /* PROP_EXT: Extended proportional fonts */ |
alejandroRL | 0:dd702039127a | 336 | #define GUI_FONTTYPE_PROP_EXT \ |
alejandroRL | 0:dd702039127a | 337 | GUIPROP_EXT_DispChar, \ |
alejandroRL | 0:dd702039127a | 338 | GUIPROP_EXT_GetCharDistX, \ |
alejandroRL | 0:dd702039127a | 339 | GUIPROP_EXT_GetFontInfo, \ |
alejandroRL | 0:dd702039127a | 340 | GUIPROP_EXT_IsInFont, \ |
alejandroRL | 0:dd702039127a | 341 | GUIPROP_EXT_GetCharInfo, \ |
alejandroRL | 0:dd702039127a | 342 | &GUI_ENC_APIList_EXT |
alejandroRL | 0:dd702039127a | 343 | |
alejandroRL | 0:dd702039127a | 344 | /* PROP_FRM: Extended proportional fonts, framed */ |
alejandroRL | 0:dd702039127a | 345 | #define GUI_FONTTYPE_PROP_FRM \ |
alejandroRL | 0:dd702039127a | 346 | GUIPROP_FRM_DispChar, \ |
alejandroRL | 0:dd702039127a | 347 | GUIPROP_FRM_GetCharDistX, \ |
alejandroRL | 0:dd702039127a | 348 | GUIPROP_FRM_GetFontInfo, \ |
alejandroRL | 0:dd702039127a | 349 | GUIPROP_FRM_IsInFont, \ |
alejandroRL | 0:dd702039127a | 350 | (GUI_GETCHARINFO *)0, \ |
alejandroRL | 0:dd702039127a | 351 | (tGUI_ENC_APIList*)0 |
alejandroRL | 0:dd702039127a | 352 | |
alejandroRL | 0:dd702039127a | 353 | /* PROP: Proportional fonts SJIS */ |
alejandroRL | 0:dd702039127a | 354 | #define GUI_FONTTYPE_PROP_SJIS \ |
alejandroRL | 0:dd702039127a | 355 | GUIPROP_DispChar, \ |
alejandroRL | 0:dd702039127a | 356 | GUIPROP_GetCharDistX, \ |
alejandroRL | 0:dd702039127a | 357 | GUIPROP_GetFontInfo, \ |
alejandroRL | 0:dd702039127a | 358 | GUIPROP_IsInFont, \ |
alejandroRL | 0:dd702039127a | 359 | (GUI_GETCHARINFO *)0, \ |
alejandroRL | 0:dd702039127a | 360 | &GUI_ENC_APIList_SJIS |
alejandroRL | 0:dd702039127a | 361 | |
alejandroRL | 0:dd702039127a | 362 | /* PROPAA: Proportional, antialiased fonts */ |
alejandroRL | 0:dd702039127a | 363 | #define GUI_FONTTYPE_PROPAA \ |
alejandroRL | 0:dd702039127a | 364 | GUIPROPAA_DispChar, \ |
alejandroRL | 0:dd702039127a | 365 | GUIPROPAA_GetCharDistX, \ |
alejandroRL | 0:dd702039127a | 366 | GUIPROPAA_GetFontInfo, \ |
alejandroRL | 0:dd702039127a | 367 | GUIPROPAA_IsInFont, \ |
alejandroRL | 0:dd702039127a | 368 | (GUI_GETCHARINFO *)0, \ |
alejandroRL | 0:dd702039127a | 369 | (tGUI_ENC_APIList*)0 |
alejandroRL | 0:dd702039127a | 370 | |
alejandroRL | 0:dd702039127a | 371 | /* PROP_AA2: Proportional, antialiased fonts, 2bpp */ |
alejandroRL | 0:dd702039127a | 372 | #define GUI_FONTTYPE_PROP_AA2 \ |
alejandroRL | 0:dd702039127a | 373 | GUIPROP_AA2_DispChar, \ |
alejandroRL | 0:dd702039127a | 374 | GUIPROP_AA2_GetCharDistX, \ |
alejandroRL | 0:dd702039127a | 375 | GUIPROP_AA2_GetFontInfo, \ |
alejandroRL | 0:dd702039127a | 376 | GUIPROP_AA2_IsInFont, \ |
alejandroRL | 0:dd702039127a | 377 | (GUI_GETCHARINFO *)0, \ |
alejandroRL | 0:dd702039127a | 378 | (tGUI_ENC_APIList*)0 |
alejandroRL | 0:dd702039127a | 379 | |
alejandroRL | 0:dd702039127a | 380 | /* PROP_AA2_EXT: Proportional, antialiased fonts, 2bpp, extended font information */ |
alejandroRL | 0:dd702039127a | 381 | #define GUI_FONTTYPE_PROP_AA2_EXT \ |
alejandroRL | 0:dd702039127a | 382 | GUIPROP_AA2_EXT_DispChar, \ |
alejandroRL | 0:dd702039127a | 383 | GUIPROP_EXT_GetCharDistX, \ |
alejandroRL | 0:dd702039127a | 384 | GUIPROP_EXT_GetFontInfo, \ |
alejandroRL | 0:dd702039127a | 385 | GUIPROP_EXT_IsInFont, \ |
alejandroRL | 0:dd702039127a | 386 | GUIPROP_EXT_GetCharInfo, \ |
alejandroRL | 0:dd702039127a | 387 | &GUI_ENC_APIList_EXT |
alejandroRL | 0:dd702039127a | 388 | |
alejandroRL | 0:dd702039127a | 389 | /* PROP_AA2: Proportional, antialiased fonts, 2bpp, SJIS encoding */ |
alejandroRL | 0:dd702039127a | 390 | #define GUI_FONTTYPE_PROP_AA2_SJIS \ |
alejandroRL | 0:dd702039127a | 391 | GUIPROP_AA2_DispChar, \ |
alejandroRL | 0:dd702039127a | 392 | GUIPROP_AA2_GetCharDistX, \ |
alejandroRL | 0:dd702039127a | 393 | GUIPROP_AA2_GetFontInfo, \ |
alejandroRL | 0:dd702039127a | 394 | GUIPROP_AA2_IsInFont, \ |
alejandroRL | 0:dd702039127a | 395 | (GUI_GETCHARINFO *)0, \ |
alejandroRL | 0:dd702039127a | 396 | &GUI_ENC_APIList_SJIS |
alejandroRL | 0:dd702039127a | 397 | |
alejandroRL | 0:dd702039127a | 398 | /* PROP_AA4: Proportional, antialiased fonts, 4bpp */ |
alejandroRL | 0:dd702039127a | 399 | #define GUI_FONTTYPE_PROP_AA4 \ |
alejandroRL | 0:dd702039127a | 400 | GUIPROP_AA4_DispChar, \ |
alejandroRL | 0:dd702039127a | 401 | GUIPROP_AA4_GetCharDistX, \ |
alejandroRL | 0:dd702039127a | 402 | GUIPROP_AA4_GetFontInfo, \ |
alejandroRL | 0:dd702039127a | 403 | GUIPROP_AA4_IsInFont, \ |
alejandroRL | 0:dd702039127a | 404 | (GUI_GETCHARINFO *)0, \ |
alejandroRL | 0:dd702039127a | 405 | (tGUI_ENC_APIList*)0 |
alejandroRL | 0:dd702039127a | 406 | |
alejandroRL | 0:dd702039127a | 407 | /* PROP_AA4_EXT: Proportional, antialiased fonts, 4bpp, extended font information */ |
alejandroRL | 0:dd702039127a | 408 | #define GUI_FONTTYPE_PROP_AA4_EXT \ |
alejandroRL | 0:dd702039127a | 409 | GUIPROP_AA4_EXT_DispChar, \ |
alejandroRL | 0:dd702039127a | 410 | GUIPROP_EXT_GetCharDistX, \ |
alejandroRL | 0:dd702039127a | 411 | GUIPROP_EXT_GetFontInfo, \ |
alejandroRL | 0:dd702039127a | 412 | GUIPROP_EXT_IsInFont, \ |
alejandroRL | 0:dd702039127a | 413 | GUIPROP_EXT_GetCharInfo, \ |
alejandroRL | 0:dd702039127a | 414 | &GUI_ENC_APIList_EXT |
alejandroRL | 0:dd702039127a | 415 | |
alejandroRL | 0:dd702039127a | 416 | /* PROP_AA4: Proportional, antialiased fonts, 4bpp, SJIS encoding */ |
alejandroRL | 0:dd702039127a | 417 | #define GUI_FONTTYPE_PROP_AA4_SJIS \ |
alejandroRL | 0:dd702039127a | 418 | GUIPROP_AA4_DispChar, \ |
alejandroRL | 0:dd702039127a | 419 | GUIPROP_AA4_GetCharDistX, \ |
alejandroRL | 0:dd702039127a | 420 | GUIPROP_AA4_GetFontInfo, \ |
alejandroRL | 0:dd702039127a | 421 | GUIPROP_AA4_IsInFont, \ |
alejandroRL | 0:dd702039127a | 422 | (GUI_GETCHARINFO *)0, \ |
alejandroRL | 0:dd702039127a | 423 | &GUI_ENC_APIList_SJIS |
alejandroRL | 0:dd702039127a | 424 | |
alejandroRL | 0:dd702039127a | 425 | #if defined(__cplusplus) |
alejandroRL | 0:dd702039127a | 426 | } |
alejandroRL | 0:dd702039127a | 427 | #endif |
alejandroRL | 0:dd702039127a | 428 | |
alejandroRL | 0:dd702039127a | 429 | struct GUI_FONT { |
alejandroRL | 0:dd702039127a | 430 | GUI_DISPCHAR * pfDispChar; |
alejandroRL | 0:dd702039127a | 431 | GUI_GETCHARDISTX * pfGetCharDistX; |
alejandroRL | 0:dd702039127a | 432 | GUI_GETFONTINFO * pfGetFontInfo; |
alejandroRL | 0:dd702039127a | 433 | GUI_ISINFONT * pfIsInFont; |
alejandroRL | 0:dd702039127a | 434 | GUI_GETCHARINFO * pfGetCharInfo; |
alejandroRL | 0:dd702039127a | 435 | const tGUI_ENC_APIList* pafEncode; |
alejandroRL | 0:dd702039127a | 436 | U8 YSize; |
alejandroRL | 0:dd702039127a | 437 | U8 YDist; |
alejandroRL | 0:dd702039127a | 438 | U8 XMag; |
alejandroRL | 0:dd702039127a | 439 | U8 YMag; |
alejandroRL | 0:dd702039127a | 440 | union { |
alejandroRL | 0:dd702039127a | 441 | const void * pFontData; |
alejandroRL | 0:dd702039127a | 442 | const GUI_FONT_MONO * pMono; |
alejandroRL | 0:dd702039127a | 443 | const GUI_FONT_PROP * pProp; |
alejandroRL | 0:dd702039127a | 444 | const GUI_FONT_PROP_EXT * pPropExt; |
alejandroRL | 0:dd702039127a | 445 | } p; |
alejandroRL | 0:dd702039127a | 446 | U8 Baseline; |
alejandroRL | 0:dd702039127a | 447 | U8 LHeight; /* Height of a small lower case character (a,x) */ |
alejandroRL | 0:dd702039127a | 448 | U8 CHeight; /* Height of a small upper case character (A,X) */ |
alejandroRL | 0:dd702039127a | 449 | }; |
alejandroRL | 0:dd702039127a | 450 | |
alejandroRL | 0:dd702039127a | 451 | /********************************************************************* |
alejandroRL | 0:dd702039127a | 452 | * |
alejandroRL | 0:dd702039127a | 453 | * Bitmap serialization (BMP) |
alejandroRL | 0:dd702039127a | 454 | */ |
alejandroRL | 0:dd702039127a | 455 | typedef void GUI_CALLBACK_VOID_U8_P(U8 Data, void * p); |
alejandroRL | 0:dd702039127a | 456 | |
alejandroRL | 0:dd702039127a | 457 | /********************************************************************* |
alejandroRL | 0:dd702039127a | 458 | * |
alejandroRL | 0:dd702039127a | 459 | * System independent font structures (SIF) |
alejandroRL | 0:dd702039127a | 460 | */ |
alejandroRL | 0:dd702039127a | 461 | typedef struct { |
alejandroRL | 0:dd702039127a | 462 | U32 ID; /* Font file ID */ |
alejandroRL | 0:dd702039127a | 463 | U16 YSize; /* Height of font */ |
alejandroRL | 0:dd702039127a | 464 | U16 YDist; /* Space of font Y */ |
alejandroRL | 0:dd702039127a | 465 | U16 Baseline; /* Index of baseline */ |
alejandroRL | 0:dd702039127a | 466 | U16 LHeight; /* Height of a small lower case character (a) */ |
alejandroRL | 0:dd702039127a | 467 | U16 CHeight; /* Height of a upper case character (A) */ |
alejandroRL | 0:dd702039127a | 468 | U16 NumAreas; /* Number of character areas */ |
alejandroRL | 0:dd702039127a | 469 | } GUI_SI_FONT; |
alejandroRL | 0:dd702039127a | 470 | |
alejandroRL | 0:dd702039127a | 471 | typedef struct { |
alejandroRL | 0:dd702039127a | 472 | U16 First; /* Index of first character */ |
alejandroRL | 0:dd702039127a | 473 | U16 Last; /* Index of last character */ |
alejandroRL | 0:dd702039127a | 474 | } GUI_SIF_CHAR_AREA; |
alejandroRL | 0:dd702039127a | 475 | |
alejandroRL | 0:dd702039127a | 476 | typedef struct { |
alejandroRL | 0:dd702039127a | 477 | U16 XSize; /* Size of bitmap data in X */ |
alejandroRL | 0:dd702039127a | 478 | U16 XDist; /* Number of pixels for increment cursor in X */ |
alejandroRL | 0:dd702039127a | 479 | U16 BytesPerLine; /* Number of bytes per line */ |
alejandroRL | 0:dd702039127a | 480 | U16 Dummy; |
alejandroRL | 0:dd702039127a | 481 | U32 OffData; /* Offset of pixel data */ |
alejandroRL | 0:dd702039127a | 482 | } GUI_SIF_CHARINFO; |
alejandroRL | 0:dd702039127a | 483 | |
alejandroRL | 0:dd702039127a | 484 | typedef struct { |
alejandroRL | 0:dd702039127a | 485 | U16 XSize; /* Size of bitmap data in X */ |
alejandroRL | 0:dd702039127a | 486 | U16 YSize; /* Size of bitmap data in X */ |
alejandroRL | 0:dd702039127a | 487 | I16 XOff; /* Display offset of bitmap data in X */ |
alejandroRL | 0:dd702039127a | 488 | I16 YOff; /* Display offset of bitmap data in Y */ |
alejandroRL | 0:dd702039127a | 489 | U16 XDist; /* Number of pixels for increment cursor in X */ |
alejandroRL | 0:dd702039127a | 490 | U16 Dummy; |
alejandroRL | 0:dd702039127a | 491 | U32 OffData; /* Offset of pixel data */ |
alejandroRL | 0:dd702039127a | 492 | } GUI_SIF_CHARINFO_EXT; |
alejandroRL | 0:dd702039127a | 493 | |
alejandroRL | 0:dd702039127a | 494 | typedef struct tGUI_SIF_APIList_struct { |
alejandroRL | 0:dd702039127a | 495 | GUI_DISPCHAR * pfDispChar; |
alejandroRL | 0:dd702039127a | 496 | GUI_GETCHARDISTX * pfGetCharDistX; |
alejandroRL | 0:dd702039127a | 497 | GUI_GETFONTINFO * pfGetFontInfo; |
alejandroRL | 0:dd702039127a | 498 | GUI_ISINFONT * pfIsInFont; |
alejandroRL | 0:dd702039127a | 499 | GUI_GETCHARINFO * pfGetCharInfo; |
alejandroRL | 0:dd702039127a | 500 | const tGUI_ENC_APIList* pafEncode; |
alejandroRL | 0:dd702039127a | 501 | } tGUI_SIF_APIList; |
alejandroRL | 0:dd702039127a | 502 | |
alejandroRL | 0:dd702039127a | 503 | #define GUI_SIF_TYPE tGUI_SIF_APIList |
alejandroRL | 0:dd702039127a | 504 | #define GUI_SIF_TYPE_PROP &GUI_SIF_APIList_Prop |
alejandroRL | 0:dd702039127a | 505 | #define GUI_SIF_TYPE_PROP_EXT &GUI_SIF_APIList_Prop_Ext |
alejandroRL | 0:dd702039127a | 506 | #define GUI_SIF_TYPE_PROP_FRM &GUI_SIF_APIList_Prop_Frm |
alejandroRL | 0:dd702039127a | 507 | #define GUI_SIF_TYPE_PROP_AA2 &GUI_SIF_APIList_Prop_AA2 |
alejandroRL | 0:dd702039127a | 508 | #define GUI_SIF_TYPE_PROP_AA4 &GUI_SIF_APIList_Prop_AA4 |
alejandroRL | 0:dd702039127a | 509 | #define GUI_SIF_TYPE_PROP_AA2_EXT &GUI_SIF_APIList_Prop_AA2_EXT |
alejandroRL | 0:dd702039127a | 510 | #define GUI_SIF_TYPE_PROP_AA4_EXT &GUI_SIF_APIList_Prop_AA4_EXT |
alejandroRL | 0:dd702039127a | 511 | |
alejandroRL | 0:dd702039127a | 512 | /********************************************************************* |
alejandroRL | 0:dd702039127a | 513 | * |
alejandroRL | 0:dd702039127a | 514 | * External binary font structures (XBF) |
alejandroRL | 0:dd702039127a | 515 | */ |
alejandroRL | 0:dd702039127a | 516 | typedef int GUI_XBF_GET_DATA_FUNC(U32 Off, U16 NumBytes, void * pVoid, void * pBuffer); |
alejandroRL | 0:dd702039127a | 517 | |
alejandroRL | 0:dd702039127a | 518 | typedef struct { |
alejandroRL | 0:dd702039127a | 519 | U16 First; /* First character of font */ |
alejandroRL | 0:dd702039127a | 520 | U16 Last; /* Last character of font */ |
alejandroRL | 0:dd702039127a | 521 | void * pVoid; /* Void pointer passed to GetData-function */ |
alejandroRL | 0:dd702039127a | 522 | GUI_XBF_GET_DATA_FUNC * pfGetData; /* Pointer to callback function */ |
alejandroRL | 0:dd702039127a | 523 | } GUI_XBF_DATA; |
alejandroRL | 0:dd702039127a | 524 | |
alejandroRL | 0:dd702039127a | 525 | typedef struct tGUI_XBF_APIList_struct { |
alejandroRL | 0:dd702039127a | 526 | GUI_DISPCHAR * pfDispChar; |
alejandroRL | 0:dd702039127a | 527 | GUI_GETCHARDISTX * pfGetCharDistX; |
alejandroRL | 0:dd702039127a | 528 | GUI_GETFONTINFO * pfGetFontInfo; |
alejandroRL | 0:dd702039127a | 529 | GUI_ISINFONT * pfIsInFont; |
alejandroRL | 0:dd702039127a | 530 | GUI_GETCHARINFO * pfGetCharInfo; |
alejandroRL | 0:dd702039127a | 531 | const tGUI_ENC_APIList* pafEncode; |
alejandroRL | 0:dd702039127a | 532 | } tGUI_XBF_APIList; |
alejandroRL | 0:dd702039127a | 533 | |
alejandroRL | 0:dd702039127a | 534 | #define GUI_XBF_TYPE tGUI_XBF_APIList |
alejandroRL | 0:dd702039127a | 535 | #define GUI_XBF_TYPE_PROP &GUI_XBF_APIList_Prop |
alejandroRL | 0:dd702039127a | 536 | #define GUI_XBF_TYPE_PROP_EXT &GUI_XBF_APIList_Prop_Ext |
alejandroRL | 0:dd702039127a | 537 | #define GUI_XBF_TYPE_PROP_FRM &GUI_XBF_APIList_Prop_Frm |
alejandroRL | 0:dd702039127a | 538 | #define GUI_XBF_TYPE_PROP_AA2_EXT &GUI_XBF_APIList_Prop_AA2_Ext |
alejandroRL | 0:dd702039127a | 539 | #define GUI_XBF_TYPE_PROP_AA4_EXT &GUI_XBF_APIList_Prop_AA4_Ext |
alejandroRL | 0:dd702039127a | 540 | |
alejandroRL | 0:dd702039127a | 541 | /********************************************************************* |
alejandroRL | 0:dd702039127a | 542 | * |
alejandroRL | 0:dd702039127a | 543 | * TrueType support (TTF) |
alejandroRL | 0:dd702039127a | 544 | */ |
alejandroRL | 0:dd702039127a | 545 | typedef struct { |
alejandroRL | 0:dd702039127a | 546 | const void * pData; /* Pointer to TTF font file in addressable memory area */ |
alejandroRL | 0:dd702039127a | 547 | U32 NumBytes; /* Size of file in bytes */ |
alejandroRL | 0:dd702039127a | 548 | } GUI_TTF_DATA; |
alejandroRL | 0:dd702039127a | 549 | |
alejandroRL | 0:dd702039127a | 550 | typedef struct { |
alejandroRL | 0:dd702039127a | 551 | GUI_TTF_DATA * pTTF; /* Pointer to GUI_TTF_DATA structure which contains location and size of font file */ |
alejandroRL | 0:dd702039127a | 552 | U32 aImageTypeBuffer[4]; /* Buffer for image type structure */ |
alejandroRL | 0:dd702039127a | 553 | int PixelHeight; /* Pixel height of new font. It means the height of the surrounding rectangle |
alejandroRL | 0:dd702039127a | 554 | * between the glyphs 'g' anf 'f'. Please notice that it is not the distance |
alejandroRL | 0:dd702039127a | 555 | * between two lines of text. With other words the value returned byGUI_GetFontSizeY() |
alejandroRL | 0:dd702039127a | 556 | * is not identically with this value. */ |
alejandroRL | 0:dd702039127a | 557 | int FaceIndex; /* Some font files can contain more than one font face. In case of more than one face |
alejandroRL | 0:dd702039127a | 558 | * this index specifies the zero based face index to be used to create the font. |
alejandroRL | 0:dd702039127a | 559 | * Usually 0. */ |
alejandroRL | 0:dd702039127a | 560 | } GUI_TTF_CS; |
alejandroRL | 0:dd702039127a | 561 | |
alejandroRL | 0:dd702039127a | 562 | /********************************************************************* |
alejandroRL | 0:dd702039127a | 563 | * |
alejandroRL | 0:dd702039127a | 564 | * Task synchronization |
alejandroRL | 0:dd702039127a | 565 | */ |
alejandroRL | 0:dd702039127a | 566 | typedef void (* GUI_SIGNAL_EVENT_FUNC) (void); |
alejandroRL | 0:dd702039127a | 567 | typedef void (* GUI_WAIT_EVENT_FUNC) (void); |
alejandroRL | 0:dd702039127a | 568 | typedef void (* GUI_WAIT_EVENT_TIMED_FUNC)(int Period); |
alejandroRL | 0:dd702039127a | 569 | |
alejandroRL | 0:dd702039127a | 570 | /********************************************************************* |
alejandroRL | 0:dd702039127a | 571 | * |
alejandroRL | 0:dd702039127a | 572 | * Memory management |
alejandroRL | 0:dd702039127a | 573 | */ |
alejandroRL | 0:dd702039127a | 574 | #ifndef GUI_HMEM |
alejandroRL | 0:dd702039127a | 575 | #define GUI_HMEM I32 |
alejandroRL | 0:dd702039127a | 576 | #endif |
alejandroRL | 0:dd702039127a | 577 | #define GUI_HMEM_NULL (0) |
alejandroRL | 0:dd702039127a | 578 | typedef GUI_HMEM GUI_HWIN; |
alejandroRL | 0:dd702039127a | 579 | typedef GUI_HMEM GUI_HSPRITE; |
alejandroRL | 0:dd702039127a | 580 | |
alejandroRL | 0:dd702039127a | 581 | /********************************************************************* |
alejandroRL | 0:dd702039127a | 582 | * |
alejandroRL | 0:dd702039127a | 583 | * Multi touch input |
alejandroRL | 0:dd702039127a | 584 | */ |
alejandroRL | 0:dd702039127a | 585 | #ifndef GUI_MTOUCH_MAX_NUM_POINTS |
alejandroRL | 0:dd702039127a | 586 | #define GUI_MTOUCH_MAX_NUM_POINTS 10 |
alejandroRL | 0:dd702039127a | 587 | #endif |
alejandroRL | 0:dd702039127a | 588 | |
alejandroRL | 0:dd702039127a | 589 | typedef struct { |
alejandroRL | 0:dd702039127a | 590 | I32 x; |
alejandroRL | 0:dd702039127a | 591 | I32 y; |
alejandroRL | 0:dd702039127a | 592 | U32 Id; |
alejandroRL | 0:dd702039127a | 593 | U16 Flags; |
alejandroRL | 0:dd702039127a | 594 | } GUI_MTOUCH_INPUT; |
alejandroRL | 0:dd702039127a | 595 | |
alejandroRL | 0:dd702039127a | 596 | typedef struct { |
alejandroRL | 0:dd702039127a | 597 | int LayerIndex; |
alejandroRL | 0:dd702039127a | 598 | unsigned NumPoints; |
alejandroRL | 0:dd702039127a | 599 | GUI_TIMER_TIME TimeStamp; |
alejandroRL | 0:dd702039127a | 600 | GUI_HMEM hInput; |
alejandroRL | 0:dd702039127a | 601 | } GUI_MTOUCH_EVENT; |
alejandroRL | 0:dd702039127a | 602 | |
alejandroRL | 0:dd702039127a | 603 | // |
alejandroRL | 0:dd702039127a | 604 | // Used for emWinSPY with reduced data types and array sizes |
alejandroRL | 0:dd702039127a | 605 | // |
alejandroRL | 0:dd702039127a | 606 | typedef struct { |
alejandroRL | 0:dd702039127a | 607 | U8 Layer; |
alejandroRL | 0:dd702039127a | 608 | U8 NumPoints; |
alejandroRL | 0:dd702039127a | 609 | I16 ax[5]; |
alejandroRL | 0:dd702039127a | 610 | I16 ay[5]; |
alejandroRL | 0:dd702039127a | 611 | U16 aId[5]; |
alejandroRL | 0:dd702039127a | 612 | U8 aFlags[5]; |
alejandroRL | 0:dd702039127a | 613 | } GUI_MTOUCH_STATE; |
alejandroRL | 0:dd702039127a | 614 | |
alejandroRL | 0:dd702039127a | 615 | typedef void (* T_GUI_MTOUCH_STOREEVENT)(GUI_MTOUCH_EVENT *, GUI_MTOUCH_INPUT * pInput); |
alejandroRL | 0:dd702039127a | 616 | |
alejandroRL | 0:dd702039127a | 617 | /********************************************************************* |
alejandroRL | 0:dd702039127a | 618 | * |
alejandroRL | 0:dd702039127a | 619 | * Hardware routines |
alejandroRL | 0:dd702039127a | 620 | */ |
alejandroRL | 0:dd702039127a | 621 | typedef struct { |
alejandroRL | 0:dd702039127a | 622 | // |
alejandroRL | 0:dd702039127a | 623 | // 8 Bit access |
alejandroRL | 0:dd702039127a | 624 | // |
alejandroRL | 0:dd702039127a | 625 | void (* pfWrite8_A0) (U8 Data); |
alejandroRL | 0:dd702039127a | 626 | void (* pfWrite8_A1) (U8 Data); |
alejandroRL | 0:dd702039127a | 627 | void (* pfWriteM8_A0) (U8 * pData, int NumItems); |
alejandroRL | 0:dd702039127a | 628 | void (* pfWriteM8_A1) (U8 * pData, int NumItems); |
alejandroRL | 0:dd702039127a | 629 | U8 (* pfRead8_A0) (void); |
alejandroRL | 0:dd702039127a | 630 | U8 (* pfRead8_A1) (void); |
alejandroRL | 0:dd702039127a | 631 | void (* pfReadM8_A0) (U8 * pData, int NumItems); |
alejandroRL | 0:dd702039127a | 632 | void (* pfReadM8_A1) (U8 * pData, int NumItems); |
alejandroRL | 0:dd702039127a | 633 | // |
alejandroRL | 0:dd702039127a | 634 | // 16 Bit access |
alejandroRL | 0:dd702039127a | 635 | // |
alejandroRL | 0:dd702039127a | 636 | void (* pfWrite16_A0) (U16 Data); |
alejandroRL | 0:dd702039127a | 637 | void (* pfWrite16_A1) (U16 Data); |
alejandroRL | 0:dd702039127a | 638 | void (* pfWriteM16_A0)(U16 * pData, int NumItems); |
alejandroRL | 0:dd702039127a | 639 | void (* pfWriteM16_A1)(U16 * pData, int NumItems); |
alejandroRL | 0:dd702039127a | 640 | U16 (* pfRead16_A0) (void); |
alejandroRL | 0:dd702039127a | 641 | U16 (* pfRead16_A1) (void); |
alejandroRL | 0:dd702039127a | 642 | void (* pfReadM16_A0) (U16 * pData, int NumItems); |
alejandroRL | 0:dd702039127a | 643 | void (* pfReadM16_A1) (U16 * pData, int NumItems); |
alejandroRL | 0:dd702039127a | 644 | // |
alejandroRL | 0:dd702039127a | 645 | // 32 Bit access |
alejandroRL | 0:dd702039127a | 646 | // |
alejandroRL | 0:dd702039127a | 647 | void (* pfWrite32_A0) (U32 Data); |
alejandroRL | 0:dd702039127a | 648 | void (* pfWrite32_A1) (U32 Data); |
alejandroRL | 0:dd702039127a | 649 | void (* pfWriteM32_A0)(U32 * pData, int NumItems); |
alejandroRL | 0:dd702039127a | 650 | void (* pfWriteM32_A1)(U32 * pData, int NumItems); |
alejandroRL | 0:dd702039127a | 651 | U32 (* pfRead32_A0) (void); |
alejandroRL | 0:dd702039127a | 652 | U32 (* pfRead32_A1) (void); |
alejandroRL | 0:dd702039127a | 653 | void (* pfReadM32_A0) (U32 * pData, int NumItems); |
alejandroRL | 0:dd702039127a | 654 | void (* pfReadM32_A1) (U32 * pData, int NumItems); |
alejandroRL | 0:dd702039127a | 655 | // |
alejandroRL | 0:dd702039127a | 656 | // SPI access |
alejandroRL | 0:dd702039127a | 657 | // |
alejandroRL | 0:dd702039127a | 658 | void (* pfSetCS) (U8 NotActive); |
alejandroRL | 0:dd702039127a | 659 | // |
alejandroRL | 0:dd702039127a | 660 | // Common routines |
alejandroRL | 0:dd702039127a | 661 | // |
alejandroRL | 0:dd702039127a | 662 | void (* pfFlushBuffer)(void); |
alejandroRL | 0:dd702039127a | 663 | } GUI_PORT_API; |
alejandroRL | 0:dd702039127a | 664 | |
alejandroRL | 0:dd702039127a | 665 | /********************************************************************* |
alejandroRL | 0:dd702039127a | 666 | * |
alejandroRL | 0:dd702039127a | 667 | * Send/Receive function for VNC and/or emWinSPY |
alejandroRL | 0:dd702039127a | 668 | */ |
alejandroRL | 0:dd702039127a | 669 | typedef int (* GUI_tSend) (const U8 * pData, int len, void * p); |
alejandroRL | 0:dd702039127a | 670 | typedef int (* GUI_tRecv) ( U8 * pData, int len, void * p); |
alejandroRL | 0:dd702039127a | 671 | |
alejandroRL | 0:dd702039127a | 672 | /********************************************************************* |
alejandroRL | 0:dd702039127a | 673 | * |
alejandroRL | 0:dd702039127a | 674 | * Memory allocation replacement for emWinSPY |
alejandroRL | 0:dd702039127a | 675 | */ |
alejandroRL | 0:dd702039127a | 676 | typedef void * (* GUI_tMalloc)(unsigned int); |
alejandroRL | 0:dd702039127a | 677 | typedef void (* GUI_tFree) (void *); |
alejandroRL | 0:dd702039127a | 678 | |
alejandroRL | 0:dd702039127a | 679 | #endif /* GUITYPE_H_INCLUDED */ |
alejandroRL | 0:dd702039127a | 680 | |
alejandroRL | 0:dd702039127a | 681 | /*************************** End of file ****************************/ |