| Samsung Internal API reference 2.0

- Main Page
- Related Pages
- Modules
- Data Structures
- Files

- File List
- Globals

tees_tui.h
Go to the documentation of this file.
1
17 #ifndef __TEES_TUI_H__
18 #define __TEES_TUI_H__
19
20 #include <tee_internal_api.h>
21
22 #ifdef __cplusplus
23 extern "C" {
24 #endif
25
26 /**************************************************
27 * below for new api
28 ***************************************************/
29
31 typedef enum {
32 TEES_SUCCESS = 0x00000000,
33 TEES_ERROR_TUI_GENERIC = 0xFFFF0000,
34 TEES_ERROR_TUI_CANCEL = 0xFFFF0002,
35 TEES_ERROR_TUI_BAD_FORMAT = 0xFFFF0005,
36 TEES_ERROR_TUI_INVAL_PARAM = 0xFFFF0006,
37 TEES_ERROR_TUI_BAD_STATE = 0xFFFF0007,
38 TEES_ERROR_NOT_IMPLEMENTED = 0xFFFF0009,
39 TEES_ERROR_NOT_SUPPORTED = 0xFFFF000A,
40 TEES_ERROR_TUI_OUT_OF_MEMORY = 0xFFFF000C,
41 TEES_ERROR_TUI_BUSY = 0xFFFF000D,
42 TEES_ERROR_SHORT_BUFFER = 0xFFFF0010,
43 TEES_ERROR_TUI_TIMEOUT = 0xFFFF3001,
44 } TEES_Result;
45
49 typedef struct {
50 uint32_t grayscaleBitsDepth;
51 uint32_t redBitsDepth;
52 uint32_t greenBitsDepth;
53 uint32_t blueBitsDepth;
54 uint32_t widthInch;
55 uint32_t heightInch;
56 uint32_t resolution_width;
57 uint32_t resolution_height;
58 } TEES_TUIScreenInfo;
59
61 typedef enum {
62 TEES_TOUCH_PRESSED,
63 TEES_TOUCH_RELEASED,
64 } TEES_TUITouchTypes;
65
69 typedef struct {
70 uint32_t xPosition;
71 uint32_t yPosition;
72 TEES_TUITouchTypes touchType;
73 } TEES_TUITouchInfo;
74
78 #define MT_INFO_MAX_EVENT 10
79
83 typedef struct {
84 uint8_t finger;
85 uint32_t xPosition;
86 uint32_t yPosition;
87 TEES_TUITouchTypes touchType;
88 } TEES_TUIMTInfo;
89
93 typedef struct {
94 uint8_t num;
95 TEES_TUIMTInfo buf[MT_INFO_MAX_EVENT];
96 } __attribute__ ((packed)) TEES_TUI_MT_Info;
97
101 typedef struct {
102 void *imageBuf;
103 size_t imageLength;
104 uint32_t width;
105 uint32_t height;
106 uint32_t use_png_alpha;
107 } TEES_TUIImage;
108
110 enum TEES_bool {
111 TEES_FALSE = 0,
112 TEES_TRUE = 1,
113 };
114
126 TEES_Result TEES_TUIGetScreenInfo(TEES_TUIScreenInfo *screenInfo);
127
148 TEES_Result TEES_TUIOpenSession(void);
149
164 TEES_Result TEES_TUICloseSession(void);
165
180 TEES_Result TEES_TUIDrawImage(TEES_TUIImage *image,
181 uint32_t posX,
182 uint32_t posY);
183
200 TEES_Result TEES_TUIGetTouchEvent(TEES_TUITouchInfo *touchInfo,
201 uint32_t timeout);
202
220 TEES_Result TEES_TUIGetMTEvent(TEES_TUI_MT_Info *touchInfo,
221 uint32_t timeout);
222
226 #define MIN_FONT_SIZE 20
227
230 #define MAX_FONT_SIZE 160
231
252 TEES_Result TEES_TUICheckTextFormat(char *inputText,
253 uint32_t textSize,
254 uint32_t *width,
255 uint32_t *height,
256 uint32_t *lastIndex);
257
285 TEES_Result TEES_TUIPrintString(char *inputText,
286 uint32_t textSize,
287 uint32_t posX,
288 uint32_t posY,
289 uint8_t redColorValue,
290 uint8_t greenColorValue,
291 uint8_t blueColorValue,
292 bool rotation90);
293
294
307 TEES_Result TEES_TUIRefreshScreen(void);
308
324 TEES_Result TEES_TUIGetBuffer(uint32_t *buffer,
325 uint32_t posX,
326 uint32_t posY,
327 uint32_t W,
328 uint32_t H);
329
345 TEES_Result TEES_TUIDrawBuffer(uint32_t *buffer,
346 uint32_t posX,
347 uint32_t posY,
348 uint32_t W,
349 uint32_t H);
350
368 TEES_Result TEES_TUIDrawImageToBuff(TEES_TUIImage *image,
369 void *buff,
370 uint32_t *buf_size);
371
389 TEES_Result TEES_TUIDrawImageFromBuff(uint32_t posX,
390 uint32_t posY,
391 uint32_t W,
392 uint32_t H,
393 void *buff,
394 uint32_t buf_size);
395
396 #ifdef __cplusplus
397 }
398 #endif
399
400 #endif /* ! __TEES_TUI_H__ */
401
TEES_TUIImage::width
uint32_t width
Definition: tees_tui.h:104
TEES_TUIImage::height
uint32_t height
Definition: tees_tui.h:105
TEES_TUIScreenInfo::heightInch
uint32_t heightInch
Definition: tees_tui.h:55
TEES_TUITouchInfo::yPosition
uint32_t yPosition
Definition: tees_tui.h:71
TEES_TUIScreenInfo::redBitsDepth
uint32_t redBitsDepth
Definition: tees_tui.h:51
TEES_TUIScreenInfo::grayscaleBitsDepth
uint32_t grayscaleBitsDepth
Definition: tees_tui.h:50
TEES_TUICloseSession
TEES_Result TEES_TUICloseSession(void)
Releases TUI resources.
TEES_TUIScreenInfo::resolution_width
uint32_t resolution_width
Definition: tees_tui.h:56
TEES_TUIRefreshScreen
TEES_Result TEES_TUIRefreshScreen(void)
Refresh display controller.
TEES_TUI_MT_Info::num
uint8_t num
Definition: tees_tui.h:94
TEES_TUIGetScreenInfo
TEES_Result TEES_TUIGetScreenInfo(TEES_TUIScreenInfo *screenInfo)
Retrieves information about the screen.
TEES_TUIScreenInfo::widthInch
uint32_t widthInch
Definition: tees_tui.h:54
TEES_TUITouchInfo::xPosition
uint32_t xPosition
Definition: tees_tui.h:70
TEES_ERROR_NOT_SUPPORTED
Definition: tees_tui.h:39
TEES_Result
TEES_Result
TEES result codes.
Definition: tees_tui.h:31
TEES_TUIPrintString
TEES_Result TEES_TUIPrintString(char *inputText, uint32_t textSize, uint32_t posX, uint32_t posY, uint8_t redColorValue, uint8_t greenColorValue, uint8_t blueColorValue, bool rotation90)
Print string on the screen.
TEES_TRUE
Definition: tees_tui.h:112
TEES_TUIDrawImageFromBuff
TEES_Result TEES_TUIDrawImageFromBuff(uint32_t posX, uint32_t posY, uint32_t W, uint32_t H, void *buff, uint32_t buf_size)
Draw unpacked bitmap from buffer on display.
TEES_ERROR_TUI_BAD_FORMAT
Definition: tees_tui.h:35
TEES_ERROR_TUI_TIMEOUT
Definition: tees_tui.h:43
TEES_TUITouchTypes
TEES_TUITouchTypes
Internal, touch event type.
Definition: tees_tui.h:61
TEES_TUIImage::imageBuf
void * imageBuf
Definition: tees_tui.h:102
TEES_TUITouchInfo::touchType
TEES_TUITouchTypes touchType
Definition: tees_tui.h:72
TEES_TUICheckTextFormat
TEES_Result TEES_TUICheckTextFormat(char *inputText, uint32_t textSize, uint32_t *width, uint32_t *height, uint32_t *lastIndex)
Checks validity of the string and Retrieves its width and height.
TEES_ERROR_TUI_CANCEL
Definition: tees_tui.h:34
TEES_ERROR_TUI_GENERIC
Definition: tees_tui.h:33
TEES_SUCCESS
Definition: tees_tui.h:32
TEES_ERROR_SHORT_BUFFER
Definition: tees_tui.h:42
MT_INFO_MAX_EVENT
#define MT_INFO_MAX_EVENT
Definition: tees_tui.h:78
TEES_TUIImage::use_png_alpha
uint32_t use_png_alpha
Definition: tees_tui.h:106
TEES_TUIDrawImage
TEES_Result TEES_TUIDrawImage(TEES_TUIImage *image, uint32_t posX, uint32_t posY)
Display an image on screen.
TEES_TUIGetTouchEvent
TEES_Result TEES_TUIGetTouchEvent(TEES_TUITouchInfo *touchInfo, uint32_t timeout)
Get a touch event.
TEES_TUIOpenSession
TEES_Result TEES_TUIOpenSession(void)
Claims an exclusive access to TUI resources.
TEES_TUITouchInfo
Structure that represents information of touch event (touch position, touch type).
Definition: tees_tui.h:69
TEES_TUIGetBuffer
TEES_Result TEES_TUIGetBuffer(uint32_t *buffer, uint32_t posX, uint32_t posY, uint32_t W, uint32_t H)
Copy a rectangle from screen to buffer.
TEES_ERROR_TUI_BAD_STATE
Definition: tees_tui.h:37
TEES_TUIScreenInfo
Structure that represents information on the requested screen.
Definition: tees_tui.h:49
TEES_FALSE
Definition: tees_tui.h:111
TEES_TUIDrawImageToBuff
TEES_Result TEES_TUIDrawImageToBuff(TEES_TUIImage *image, void *buff, uint32_t *buf_size)
Unpack png picture to bitmap in buffer.
TEES_TUIMTInfo::xPosition
uint32_t xPosition
Definition: tees_tui.h:85
TEES_ERROR_TUI_BUSY
Definition: tees_tui.h:41
TEES_TUI_MT_Info
Structure that represents all the information of touch events.
Definition: tees_tui.h:93
TEES_TUIScreenInfo::blueBitsDepth
uint32_t blueBitsDepth
Definition: tees_tui.h:53
TEES_ERROR_NOT_IMPLEMENTED
Definition: tees_tui.h:38
TEES_ERROR_TUI_INVAL_PARAM
Definition: tees_tui.h:36
TEES_TUIMTInfo
Structure that represents information of touch event (touch position, touch type).
Definition: tees_tui.h:83
TEES_TOUCH_PRESSED
Definition: tees_tui.h:62
TEES_bool
TEES_bool
Internal, bool type.
Definition: tees_tui.h:110
TEES_TUIMTInfo::finger
uint8_t finger
Definition: tees_tui.h:84
TEES_ERROR_TUI_OUT_OF_MEMORY
Definition: tees_tui.h:40
TEES_TUIScreenInfo::resolution_height
uint32_t resolution_height
Definition: tees_tui.h:57
TEES_TUIMTInfo::touchType
TEES_TUITouchTypes touchType
Definition: tees_tui.h:87
TEES_TUIGetMTEvent
TEES_Result TEES_TUIGetMTEvent(TEES_TUI_MT_Info *touchInfo, uint32_t timeout)
Get Multi touch event events.
TEES_TOUCH_RELEASED
Definition: tees_tui.h:63
TEES_TUIScreenInfo::greenBitsDepth
uint32_t greenBitsDepth
Definition: tees_tui.h:52
TEES_TUIDrawBuffer
TEES_Result TEES_TUIDrawBuffer(uint32_t *buffer, uint32_t posX, uint32_t posY, uint32_t W, uint32_t H)
Copy a rectangle from buffer to screen.
TEES_TUIImage
Structure that represents properties of image and buffers.
Definition: tees_tui.h:101
TEES_TUIImage::imageLength
size_t imageLength
Definition: tees_tui.h:103
TEES_TUIMTInfo::yPosition
uint32_t yPosition
Definition: tees_tui.h:86