Samsung Internal API reference  2.0
Trusted user interface

Data Structures

struct  TEES_TUIScreenInfo
 Structure that represents information on the requested screen. More...
 
struct  TEES_TUITouchInfo
 Structure that represents information of touch event (touch position, touch type). More...
 
struct  TEES_TUIMTInfo
 Structure that represents information of touch event (touch position, touch type). More...
 
struct  TEES_TUI_MT_Info
 Structure that represents all the information of touch events. More...
 
struct  TEES_TUIImage
 Structure that represents properties of image and buffers. More...
 
struct  TEE_TUIImage
 Structure that defines a way to handle an image for label area and buttons. More...
 
union  TEE_TUIImage.__unnamed__
 
struct  TEE_TUIImage.__unnamed__.ref
 
struct  TEE_TUIImage.__unnamed__.object
 
struct  TEE_TUIScreenLabel
 Structure that defines the contents of the TA defined label area, which is provided to support TA branding and a TA defined message. More...
 
struct  TEE_TUIButton
 Structure that defines the content of a button. More...
 
struct  TEE_TUIScreenConfiguration
 Structure that enables configuration of a TUI screen. More...
 
struct  TEE_TUIScreenButtonInfo
 Structure that represents button information associated with a TUI screen for a given orientation. More...
 
struct  TEE_TUIScreenInfo
 Structure that represents screen information for a given orientation. More...
 
struct  TEE_TUIEntryField
 Structure that represents an entry field which acquires user inputs. More...
 

Macros

#define MT_INFO_MAX_EVENT   10
 
#define MIN_FONT_SIZE   20
 
#define MAX_FONT_SIZE   160
 
#define TEE_TUI_NUMBER_BUTTON_TYPES   6
 

Enumerations

enum  TEES_Result {
  TEES_SUCCESS = 0x00000000, TEES_ERROR_TUI_GENERIC = 0xFFFF0000, TEES_ERROR_TUI_CANCEL = 0xFFFF0002, TEES_ERROR_TUI_BAD_FORMAT = 0xFFFF0005,
  TEES_ERROR_TUI_INVAL_PARAM = 0xFFFF0006, TEES_ERROR_TUI_BAD_STATE = 0xFFFF0007, TEES_ERROR_NOT_IMPLEMENTED = 0xFFFF0009, TEES_ERROR_NOT_SUPPORTED = 0xFFFF000A,
  TEES_ERROR_TUI_OUT_OF_MEMORY = 0xFFFF000C, TEES_ERROR_TUI_BUSY = 0xFFFF000D, TEES_ERROR_SHORT_BUFFER = 0xFFFF0010, TEES_ERROR_TUI_TIMEOUT = 0xFFFF3001
}
 TEES result codes. More...
 
enum  TEES_TUITouchTypes { TEES_TOUCH_PRESSED, TEES_TOUCH_RELEASED }
 Internal, touch event type. More...
 
enum  TEES_bool { TEES_FALSE = 0, TEES_TRUE = 1 }
 Internal, bool type. More...
 
enum  TEE_TUIEntryFieldMode { TEE_TUI_HIDDEN_MODE = 0, TEE_TUI_CLEAR_MODE, TEE_TEMPRARY_CLEAR_MODE }
 Entry fields mode. More...
 
enum  TEE_TUIEntryFieldType { TEE_TUI_NUMERICAL = 0, TEE_TUI_ALPHANUMERICAL }
 Entry fields type. More...
 
enum  TEE_TUIScreenOrientation { TEE_TUI_PORTRAIT = 0, TEE_TUI_LANDSCAPE }
 Screen orientation. More...
 
enum  TEE_TUIButtonType {
  TEE_TUI_CORRECTION = 0, TEE_TUI_OK, TEE_TUI_CANCEL, TEE_TUI_VALIDATE,
  TEE_TUI_PREVIOUS, TEE_TUI_NEXT
}
 Button type. More...
 
enum  TEE_TUIImageSource { TEE_TUI_NO_SOURCE = 0, TEE_TUI_REF_SOURCE, TEE_TUI_OBJECT_SOURCE }
 Image source. More...
 

Functions

TEES_Result TEES_TUIGetScreenInfo (TEES_TUIScreenInfo *screenInfo)
 Retrieves information about the screen. More...
 
TEES_Result TEES_TUIOpenSession (void)
 Claims an exclusive access to TUI resources. More...
 
TEES_Result TEES_TUICloseSession (void)
 Releases TUI resources. More...
 
TEES_Result TEES_TUIDrawImage (TEES_TUIImage *image, uint32_t posX, uint32_t posY)
 Display an image on screen. More...
 
TEES_Result TEES_TUIGetTouchEvent (TEES_TUITouchInfo *touchInfo, uint32_t timeout)
 Get a touch event. More...
 
TEES_Result TEES_TUIGetMTEvent (TEES_TUI_MT_Info *touchInfo, uint32_t timeout)
 Get Multi touch event events. More...
 
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. More...
 
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. More...
 
TEES_Result TEES_TUIRefreshScreen (void)
 Refresh display controller. More...
 
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. More...
 
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. More...
 
TEES_Result TEES_TUIDrawImageToBuff (TEES_TUIImage *image, void *buff, uint32_t *buf_size)
 Unpack png picture to bitmap in buffer. More...
 
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. More...
 
TEE_Result TEE_TUICheckTextFormat (char *text, uint32_t *width, uint32_t *height, uint32_t *lastIndex)
 Check whether a given text can be rendered and retrieves information. More...
 
TEE_Result TEE_TUIGetScreenInfo (TEE_TUIScreenOrientation screenOrientation, uint32_t nbEntryFields, TEE_TUIScreenInfo *screenInfo)
 Retrieves information about the screen. More...
 
TEE_Result TEE_TUIInitSession (void)
 Claims an exclusive access to TUI resources. More...
 
TEE_Result TEE_TUICloseSession (void)
 Releases TUI resources. More...
 
TEE_Result TEE_TUIDisplayScreen (TEE_TUIScreenConfiguration *screenConfiguration, bool closeTUISession, TEE_TUIEntryField *entryFields, uint32_t entryFieldCount, TEE_TUIButtonType *selectedButton)
 Displays a TUI screen. More...
 

Detailed Description

Provides a set of functions to manipulate user interface.


Data Structure Documentation

struct TEES_TUIScreenInfo

Structure that represents information on the requested screen.

Data Fields
uint32_t blueBitsDepth

Available Blue bit depth.

uint32_t grayscaleBitsDepth

Available grayscale depth.

uint32_t greenBitsDepth

Available Green bit depth.

uint32_t heightInch

Height in pixels per inch.

uint32_t redBitsDepth

Available Red bit depth.

uint32_t resolution_height

Height of screen resolution.

uint32_t resolution_width

Width of screen resolution.

uint32_t widthInch

Width in pixels per inch.

struct TEES_TUITouchInfo

Structure that represents information of touch event (touch position, touch type).

Data Fields
TEES_TUITouchTypes touchType

indicates touch type.

uint32_t xPosition

the x-coordinate of touch event.

uint32_t yPosition

the y-coordinate of touch event.

struct TEES_TUIMTInfo

Structure that represents information of touch event (touch position, touch type).

Data Fields
uint8_t finger

the finger id of touch event.

TEES_TUITouchTypes touchType

indicates touch type.

uint32_t xPosition

the x-coordinate of touch event.

uint32_t yPosition

the y-coordinate of touch event.

struct TEES_TUI_MT_Info

Structure that represents all the information of touch events.

Data Fields
TEES_TUIMTInfo buf[10]

the information of touch events.

uint8_t num

the number of touch events.

struct TEES_TUIImage

Structure that represents properties of image and buffers.

Data Fields
uint32_t height

the image height in pixels.

void * imageBuf

buffer with the image in PNG format (RGBA).

size_t imageLength

buffer size.

uint32_t use_png_alpha

not used.

uint32_t width

the image width in pixels.

struct TEE_TUIImage

Structure that defines a way to handle an image for label area and buttons.

Data Fields
union TEE_TUIImage __unnamed__

union of image source

uint32_t height

the number of pixels of the height of the image.

TEE_TUIImageSource source

indicates the source of the image.

uint32_t width

the number of pixels of the width of the image.

union TEE_TUIImage.__unnamed__
Data Fields
__unnamed__ object

TEE_TUI_OBJECT_SOURCE

__unnamed__ ref

TEE_TUI_REF_SOURCE

struct TEE_TUIImage.__unnamed__.ref
Data Fields
void * image

buffer containing the image.

size_t imageLength

buffer size.

struct TEE_TUIImage.__unnamed__.object
Data Fields
void * objectID

Object Identifier which refers to a Data Object

size_t objectIDLen

Object ID length.

uint32_t storageID

storage to use.

struct TEE_TUIScreenLabel

Structure that defines the contents of the TA defined label area, which is provided to support TA branding and a TA defined message.

Data Fields
TEE_TUIImage image

image to be put in the label area.

uint32_t imageXOffset

the x-coordinate for the top left corner of the image to display.

uint32_t imageYOffset

the y-coordinate for the top left corner of the image to display.

char * text

string to put in the label area.

uint8_t textColor[3]

defines the color of the text in RGB form.

uint32_t textXOffset

the x-coordinate for the top left corner of the text to render.

uint32_t textYOffset

the y-coordinate for the top left corner of the text to render.

struct TEE_TUIButton

Structure that defines the content of a button.

Data Fields
TEE_TUIImage image

image to associate with the button.

char * text

string to associate with the button.

struct TEE_TUIScreenConfiguration

Structure that enables configuration of a TUI screen.

Data Fields
TEE_TUIButton * buttons[6]

customizes the buttons compared to the default configuration.

TEE_TUIScreenLabel label

specifies the label of the screen.

bool requestedButtons[6]

specifies which buttons to be displayed.

TEE_TUIScreenOrientation screenOrientation

requested screen orientation.

struct TEE_TUIScreenButtonInfo

Structure that represents button information associated with a TUI screen for a given orientation.

Data Fields
uint32_t buttonHeight

The height in pixels of the button.

bool buttonImageCustom

if the image of the button can be customized. false otherwise.

char * buttonText

The value of the default label.

bool buttonTextCustom

true if the text of the button can be customized. false otherwise.

uint32_t buttonWidth

The width in pixels of the button.

struct TEE_TUIScreenInfo

Structure that represents screen information for a given orientation.

Data Fields
uint32_t blueBitsDepth

Available Blue bit depth.

TEE_TUIScreenButtonInfo buttonInfo[6]

Information defining the buttons of the screens.

uint32_t entryFieldLabelHeight

Height in pixels of the label of an entry field.

uint32_t entryFieldLabelWidth

Width in pixels of the label of an entry field.

uint32_t grayscaleBitsDepth

Available grayscale depth.

uint32_t greenBitsDepth

Available Green bit depth.

uint32_t heightInch

Height in pixels per inch.

uint8_t labelColor[3]

The RGB values of the default label canvas.

uint32_t labelHeight

Height in pixels of the label canvas.

uint32_t labelWidth

Width in pixels of the label canvas.

uint32_t maxEntryFieldLength

The maximum number of characters that can be entered within an entry field.

uint32_t maxEntryFields

Maximum number of entry fields that can be displayed on the screen.

uint32_t redBitsDepth

Available Red bit depth.

uint32_t widthInch

Width in pixels per inch.

struct TEE_TUIEntryField

Structure that represents an entry field which acquires user inputs.

Data Fields
char * buffer

Contains the input entered by the user.

size_t bufferLength

Contains the input entered by the user.

char * label

The label associated with the entry field.

uint32_t maxExpectedLength

The maximum number of characters expected for the entry field.

uint32_t minExpectedLength

The minimum number of characters expected for the entry field.

TEE_TUIEntryFieldMode mode

The mode to be used when displaying characters.

TEE_TUIEntryFieldType type

The type of inputs accepted by the entry field.

Macro Definition Documentation

#define MAX_FONT_SIZE   160

#include <tees_tui.h>

Font size value should be between min~Max. If not error should return.

#define MIN_FONT_SIZE   20

#include <tees_tui.h>

Font size value should be between min~Max. If not error should return.

#define MT_INFO_MAX_EVENT   10

#include <tees_tui.h>

It means maximum number of multi touch events in TEES_TUI_MT_Info.

#define TEE_TUI_NUMBER_BUTTON_TYPES   6

#include <tui.h>

Number of possible buttons on TUI screen.

Enumeration Type Documentation

#include <tui.h>

Button type.

Enumerator
TEE_TUI_CORRECTION 

Correction

TEE_TUI_OK 

OK

TEE_TUI_CANCEL 

Cancel

TEE_TUI_VALIDATE 

Validate

TEE_TUI_PREVIOUS 

Previous

TEE_TUI_NEXT 

Next

#include <tui.h>

Entry fields mode.

Enumerator
TEE_TUI_HIDDEN_MODE 

hidden

TEE_TUI_CLEAR_MODE 

clear

TEE_TEMPRARY_CLEAR_MODE 

temporary clear

#include <tui.h>

Entry fields type.

Enumerator
TEE_TUI_NUMERICAL 

numerical

TEE_TUI_ALPHANUMERICAL 

alphanumerical

#include <tui.h>

Image source.

Enumerator
TEE_TUI_NO_SOURCE 

No image is provided as input

TEE_TUI_REF_SOURCE 

The image source is provided as memory reference

TEE_TUI_OBJECT_SOURCE 

The image source is provided as a Data Object in the Trusted Storage

#include <tui.h>

Screen orientation.

Enumerator
TEE_TUI_PORTRAIT 

Portrait

TEE_TUI_LANDSCAPE 

Landscape

enum TEES_bool

#include <tees_tui.h>

Internal, bool type.

Enumerator
TEES_FALSE 

false

TEES_TRUE 

true

#include <tees_tui.h>

TEES result codes.

Enumerator
TEES_SUCCESS 

Scess

TEES_ERROR_TUI_GENERIC 

Generic error

TEES_ERROR_TUI_CANCEL 

Function was canceled

TEES_ERROR_TUI_BAD_FORMAT 

Bad format

TEES_ERROR_TUI_INVAL_PARAM 

Invalid parameter

TEES_ERROR_TUI_BAD_STATE 

Bad state

TEES_ERROR_NOT_IMPLEMENTED 

Not implemented

TEES_ERROR_NOT_SUPPORTED 

Not supported

TEES_ERROR_TUI_OUT_OF_MEMORY 

Out of memory

TEES_ERROR_TUI_BUSY 

Busy

TEES_ERROR_SHORT_BUFFER 

Short buffer

TEES_ERROR_TUI_TIMEOUT 

Timeout error

#include <tees_tui.h>

Internal, touch event type.

Enumerator
TEES_TOUCH_PRESSED 

Pressed

TEES_TOUCH_RELEASED 

Released

Function Documentation

TEE_Result TEE_TUICheckTextFormat ( char *  text,
uint32_t *  width,
uint32_t *  height,
uint32_t *  lastIndex 
)

#include <tui.h>

Check whether a given text can be rendered and retrieves information.

The TEE_TUICheckTextFormat function allows a TA to check whether a given text can be rendered by the current implementation and retrieves information about the size and width that is needed to render it. TEE_TUIInitSession does not have to be called before using this function.

Parameters
[in]textThe string to be checked.
[out]widthWidth in pixels needed to render the text.
[out]heightHeight in pixels needed to render the text.
[out]lastIndexIndicates the last character that has been checked. In case of success, it corresponds to the last character of the text string. In case of failure, it indicates the index of the character which causes the failure. The index starts at 0.
Return values
TEE_SUCCESSIn case of success
TEE_ERROR_NOT_SUPPORTEDIf at least one of the characters present in the text string cannot be rendered.
TEE_Result TEE_TUICloseSession ( void  )

#include <tui.h>

Releases TUI resources.

The TEE_TUICloseSession function releases TUI resources previously acquired. This function SHOULD be called as soon as possible after the last TUI screen of the TUI session has ended in order to avoid a bad user experience.

Return values
TEE_SUCCESSIn case of success
TEE_ERROR_BAD_STATEIf the current TA is not within a TUI session initially started by a successful call to TEE_TUIInitSession. In particular, it will be returned if a TUI session has been closed automatically because the TUI session timeout has been reached or if a TUI session has been closed due to an OS specific external event such as an incoming call.
TEE_ERROR_BUSYIf the TUI resources are currently in use, i.e. a TUI screen is displayed. This error code can only be returned by a TEE implementation supporting multi-threading within a TA and will occur when a thread tries to close a TUI session that is displaying a TUI screen in another thread.
TEE_Result TEE_TUIDisplayScreen ( TEE_TUIScreenConfiguration screenConfiguration,
bool  closeTUISession,
TEE_TUIEntryField entryFields,
uint32_t  entryFieldCount,
TEE_TUIButtonType selectedButton 
)

#include <tui.h>

Displays a TUI screen.

The TEE_TUIDisplayScreen function displays a TUI screen. The display order of the requested entry fields is from top to bottom. This function is cancellable, i.e., if the current task's cancelled flag is set and the TA has unmasked the effects of cancellation, then this function returns earlier than the requested timeout with the error code TEE_ERROR_CANCEL. In a given session, once the first call to TEE_TUIDisplayScreen has been made and if the parameter closeTUISession was set to false, the screen will not be handed back to the REE until TEE_TUICloseSession is called. When not displaying a particular TEE_TUIDisplayScreen the TEE MAY continue to display the current TUI screen or MAY display a screen indicating a security TUI session is in progress. Input events that occurred before the call to TEE_TUIDisplayScreen SHALL be ignored. Note that all in and out parameters, as well as the buffers they refer to, MUST NOT reside in shared memory.

Parameters
[in]screenConfigurationConfigures the label of the screen and optionally the buttons of the screen.
[in]closeTUISessionIf true the TUI session is automatically closed when exiting the function.
[in]entryFields,entryFieldCountArray of entry fields. It contains the entry fields to display on the screen and enables input from the user by filling the buffer field of the corresponding TEE_TUIEntryField structure. It is ignored if entryFieldCount is set to 0.
[out]selectedButtonIn case of success, it indicates which button has been selected by the user to exit the TUI screen.
Return values
TEE_SUCCESSIn case of success.
TEE_ERROR_OUT_OF_MEMORYIf the system ran out of resources.
TEE_ERROR_ITEM_NOT_FOUNDIf at least one image provided by the TA refers to a storage denoted by a storageID which does not exist or if the corresponding Object Identifier cannot be found in the storage.
TEE_ERROR_ACCESS_CONFLICTIf at least one image provided by the TA refers to a Data Object in the Trusted Storage and an access right conflict was detected while opening the object.
TEE_ERROR_BAD_FORMATIf at least one input image is not compliant with PNG format.
TEE_ERROR_BAD_STATEIf the current TA is not within a TUI session initially started by a successful call to TEE_TUIInitSession. In particular, it will be returned if a TUI session has been closed automatically because the TUI session timeout has been reached or if a TUI session has been closed due to an OS specific external event such as an incoming call.
TEE_ERROR_BUSYIf the TUI resources are currently in use, i.e. a TUI screen is displayed. This error code can only be returned by a TEE implementation supporting multi-threading within a TA and will occur when a thread tries to display a TUI screen while a TUI screen is already displayed.
TEE_ERROR_CANCELIf the operation has been cancelled while a TUI screen is currently displayed.
  • The current UI session acquired by TEE_TUIInitSession is automatically closed as if TEE_TUICloseSession had been called.
  • The implementation MAY have started to fill out entry fields. In that case, entry fields will be returned with the last values entered by the user and it is up to the TA as to how it makes use of these.
TEE_ERROR_EXTERNAL_CANCELIf the operation has been cancelled by an external event which occurred in the REE while a TUI screen is currently displayed.
  • The current UI session acquired by TEE_TUIInitSession is automatically closed as if TEE_TUICloseSession had been called.
  • The implementation MAY have started to fill out entry fields. In that case, entry fields MAY be returned with the last values entered by the user and it is up to the TA as to how it makes use of these.
TEE_Result TEE_TUIGetScreenInfo ( TEE_TUIScreenOrientation  screenOrientation,
uint32_t  nbEntryFields,
TEE_TUIScreenInfo screenInfo 
)

#include <tui.h>

Retrieves information about the screen.

The TEE_TUIGetScreenInfo function retrieves information about the screen depending on its orientation and the number of required entry fields. TEE_TUIInitSession does not have to be called before using this function.

Parameters
[in]screenOrientationDefines for which orientation screen information is requested.
[in]nbEntryFieldsDefines how many entry fields are requested.
[out]screenInfoReturns information on the requested screen for a given orientation.
Return values
TEE_SUCCESSIn case of success
TEE_ERROR_NOT_SUPPORTEDif the requested number of entry fields is not supported. In that case, the field maxEntryFields of the screenInfo output parameter is set to the maximum number of entry fields supported for the given orientation.
TEE_Result TEE_TUIInitSession ( void  )

#include <tui.h>

Claims an exclusive access to TUI resources.

The TEE_TUIInitSession function claims an exclusive access to TUI resources for the current TA. Control of screen and keyboard MAY be taken over by the TEE at this stage. This just reserves the ability to use the TUI for this particular TA and will notify other TAs that this reservation has been made and the resource is busy (i.e. those other TAs will receive TEE_ERROR_BUSY when attempting this operation). As a limited resource, the TUI session will be closed automatically whenever the TA does not display a TUI screen to interact with the user for a period of time. This period of time is equal to the value of the property gpd.tee.tui.session.timeout. This function MUST be called before a screen can be displayed with TEE_TUIDisplayScreen.

Return values
TEE_SUCCESSIn case of success.
TEE_ERROR_BUSYIf the TUI resources cannot be reserved.
TEE_ERROR_OUT_OF_MEMORYIf the system ran out of resources.
TEES_Result TEES_TUICheckTextFormat ( char *  inputText,
uint32_t  textSize,
uint32_t *  width,
uint32_t *  height,
uint32_t *  lastIndex 
)

#include <tees_tui.h>

Checks validity of the string and Retrieves its width and height.

The TEES_TUICheckTextFormat function retrieves information about the string such as width, height needed to be displayed on the screen. If the string is not valid or the string with the size as textSize can not be displayed on the screen, this function returns error. If string length exceeds the screen boundary, this function returns error and lastIndex has the index of the character causing the error in the string.

Parameters
[in]inputTextpointer to input string to be checked in this function
[in]textSizesize of the text. The range is 20 to 160 pixels
[out]widthwidth in pixels needed to render the text
[out]heightheight in pixels needed to render the text
[out]lastIndexindicates the last character that has been checked
Return values
TEES_SUCCESSIn case of success
TEES_ERROR_TUI_INVAL_PARAMif parameters are not correct
TEES_Result TEES_TUICloseSession ( void  )

#include <tees_tui.h>

Releases TUI resources.

The TEES_TUICloseSession function releases TUI resources previously acquired. This function SHOULD be called as soon as possible after the last TUI screen of the TUI session has ended in order to avoid a bad user experience.

Return values
TEES_SUCCESSIn case of success
TEES_ERROR_TUI_BAD_STATEIf the current TA is not within a TUI session initially started by a successful call to TEES_TUIOpenSession. In particular, it will be returned if a TUI session has been closed automatically because the TUI session timeout has been reached or if a TUI session has been closed due to an OS specific external event such as an incoming call.
TEES_Result TEES_TUIDrawBuffer ( uint32_t *  buffer,
uint32_t  posX,
uint32_t  posY,
uint32_t  W,
uint32_t  H 
)

#include <tees_tui.h>

Copy a rectangle from buffer to screen.

The TEES_TUIDrawBuffer function copies a rectangle from buffer to screen

Parameters
[in]bufferwith the image in format PNG (RGBA)
[in]posX,posYcoordinates top left pixels of the rectangle
[in]W,Hwidth and height of the rectangle
Return values
TEES_SUCCESSIn case of success.
TEES_ERROR_TUI_BAD_STATEIf TUI session is not opened.
TEES_ERROR_TUI_BUSYIf some TUI function is called at moment.
TEES_ERROR_TUI_GENERICIf mutex unlock error has happened.
TEES_ERROR_TUI_INVAL_PARAMIf wrong values were passed to function.
TEES_Result TEES_TUIDrawImage ( TEES_TUIImage image,
uint32_t  posX,
uint32_t  posY 
)

#include <tees_tui.h>

Display an image on screen.

The TEES_TUIDrawImage function displays an image on screen.

Parameters
[in]imageis a pointer to properties of image and buffers
[in]posX,posYcoordinates top left pixels of the image
Return values
TEES_SUCCESSIn case of success.
TEES_ERROR_TUI_BAD_FORMATinput image is not compliant with PNG format.
TEES_ERROR_TUI_INVAL_PARAMinput pointer type parateter is invalid or null or out of area.
TEES_ERROR_TUI_OUT_OF_MEMORY: internal memory allocation fail.
TEES_ERROR_TUI_BAD_STATE: unable to get a session state
TEES_Result TEES_TUIDrawImageFromBuff ( uint32_t  posX,
uint32_t  posY,
uint32_t  W,
uint32_t  H,
void *  buff,
uint32_t  buf_size 
)

#include <tees_tui.h>

Draw unpacked bitmap from buffer on display.

The TEES_TUIDrawImageFromBuff draws bitmap from buffer on display. Bitmap shall be unpacked using TEES_TUIDrawImageToBuff

Parameters
[in]posX,posY- coordinates on display to draw picture
[in]W,H- picture width and heigth
[in]buff- buffer with picture
[in]buf_size- buffer size
Return values
TEES_SUCCESSIn case of success.
TEES_ERROR_TUI_BAD_STATEIf TUI session is not opened.
TEES_ERROR_TUI_BUSYIf some TUI function is called at moment.
TEES_ERROR_TUI_INVAL_PARAMIf wrong values were passed to function.
TEES_ERROR_SHORT_BUFFERIf buffer size is small
TEES_Result TEES_TUIDrawImageToBuff ( TEES_TUIImage image,
void *  buff,
uint32_t *  buf_size 
)

#include <tees_tui.h>

Unpack png picture to bitmap in buffer.

The TEES_TUIDrawImageToBuff unpacks png picture to bitmap in buffer. image->width, image->height returns current image size This function doesn't need TEES_TUIOpenSession call.

Parameters
[in]imageis a pointer to properties of image and buffers
[in]buffis a pointer to buffer
[in]buf_sizeis a pointer to buffer size, returns required buffer size if income value is low
Return values
TEES_SUCCESSIn case of success.
TEES_ERROR_TUI_BAD_STATEIf TUI session is not opened.
TEES_ERROR_TUI_BUSYIf some TUI function is called at moment.
TEES_ERROR_TUI_INVAL_PARAMIf wrong values were passed to function.
TEES_ERROR_SHORT_BUFFERIf buffer size is small
TEES_Result TEES_TUIGetBuffer ( uint32_t *  buffer,
uint32_t  posX,
uint32_t  posY,
uint32_t  W,
uint32_t  H 
)

#include <tees_tui.h>

Copy a rectangle from screen to buffer.

The TEES_TUIGetBuffer function copies a rectangle from screen to buffer.

Parameters
[in]bufferis a pointer to buffer
[in]posX,posYcoordinates top left pixels of the rectangle
[in]W,Hwidth and height of the rectangle
Return values
TEES_SUCCESSIn case of success.
TEES_ERROR_TUI_BAD_STATEIf TUI session is not opened.
TEES_ERROR_TUI_BUSYIf some TUI function is called at moment.
TEES_ERROR_TUI_GENERICIf mutex unlock error has happened.
TEES_ERROR_TUI_INVAL_PARAMIf wrong values were passed to function.
TEES_Result TEES_TUIGetMTEvent ( TEES_TUI_MT_Info touchInfo,
uint32_t  timeout 
)

#include <tees_tui.h>

Get Multi touch event events.

At a given time, TA wait and get touch events. If there's no input events from device, an error is returned. A zero timeout means this function waits for a maximum time. Multiple touch events up to maximum 10 may be returned.

Parameters
[out]touchInfois a pointer to information of MT event
[in]timeoutis a specified time to wait for an incoming event
Return values
TEES_SUCCESS: In case of success.
TEES_ERROR_TUI_TIMEOUT: there is no event to return within the timeout
TEES_ERROR_TUI_CANCEL: session was closed by external request
TEES_ERROR_TUI_BAD_STATE: all other reasons
TEES_ERROR_TUI_INVAL_PARAMinput pointer type parameter is null
TEES_Result TEES_TUIGetScreenInfo ( TEES_TUIScreenInfo screenInfo)

#include <tees_tui.h>

Retrieves information about the screen.

The TEES_TUIGetScreenInfo function retrieves information about the screen TEES_TUIOpenSession does not have to be called before using this function.

Parameters
[out]screenInforeturns information on the requested screen screenInfo->width and screenInfo->height information is based on PORTRAIT MODE only
Return values
TEES_SUCCESSIn case of success
TEES_ERROR_TUI_INVAL_PARAMif out parameter is null, error returned.
TEES_Result TEES_TUIGetTouchEvent ( TEES_TUITouchInfo touchInfo,
uint32_t  timeout 
)

#include <tees_tui.h>

Get a touch event.

Deprecated:
Use TEES_TUIGetMTEvent() instead At a given time, TA wait and get a touch event If there's no input events from device, an error is returned. A zero timeout means this function waits for a maximum time.
Parameters
[out]touchInfois a pointer to information of touch event (touch position, touch type)
[in]timeoutis a specified time to wait for an incoming event
Return values
TEES_SUCCESS: In case of success.
TEES_ERROR_TUI_TIMEOUT: there is no event to return within the timeout
TEES_ERROR_TUI_CANCEL: session was closed by external request
TEES_ERROR_TUI_BAD_STATE: all other reasons
TEES_ERROR_TUI_INVAL_PARAMinput pointer type parateter is null
TEES_Result TEES_TUIOpenSession ( void  )

#include <tees_tui.h>

Claims an exclusive access to TUI resources.

The TEES_TUIOpenSession function claims an exclusive access to TUI resources for the current TA. This just reserves the ability to use the TUI for this particular TA and will notify other TAs that this reservation has been made and the resource is busy (i.e. those other TAs will receive TEES_ERROR_BUSY when attempting this operation). As a limited resource, the TUI session will be closed automatically whenever the TA does not display a TUI screen to interact with the user for a period of time. This period of time is equal to the value of the property gpd.tee.tui.session.timeout. This function MUST be called before a screen can be displayed with TEES_TUIDrawImage. This function MUST be called before TEES_TUIGetTouchEvent.

Return values
TEES_SUCCESSIn case of success.
TEES_ERROR_TUI_BUSYIf the TUI resources cannot be reserved. for example session has already opened before, this error type is returned
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 
)

#include <tees_tui.h>

Print string on the screen.

The TEES_TUIPrintString function prints input string on the screen.

Parameters
[in]inputTextpointer to the input text string to be displayed on the screen
[in]textSizesize of the text string. The range is 20 to 160 pixels
[in]posX,posYcoordinates top left pixels of the image
[in]redColorValue,greenColorValue,blueColorValuecolor values for the text string. The range for each parameter is 0x00 to 0xFF
[in]rotation90if this parameter is true, the text string is rotated to 90 degree on the screen
Return values
TEES_SUCCESSIn case of success.
TEES_ERROR_TUI_BUSYIf the TUI resources cannot be reserved. For example session has already opened before, this error type is returned
TEES_ERROR_TUI_BAD_STATEIf the current TA is not within a TUI session initially started by a successful call to TEES_TUIOpenSession. In particular, it will be returned if a TUI session has been closed automatically because the TUI session timeout has been reached or if a TUI session has been closed due to an OS specific external event such as an incoming call.
TEES_ERROR_TUI_INVAL_PARAMif parameters are not correct
TEES_ERROR_TUI_BAD_FORMATinput text string is not valid
TEES_ERROR_TUI_OUT_OF_MEMORY: internal memory allocation fail.
TEES_ERROR_NOT_SUPPORTEDif there is a problem in font engine in TUI
TEES_ERROR_TUI_GENERICother exceptional cases that are not defined as error message
TEES_Result TEES_TUIRefreshScreen ( void  )

#include <tees_tui.h>

Refresh display controller.

The TEES_TUIRefreshScreen function refreshes display controller after frame buffer changing.

Return values
TEES_SUCCESSIn case of success
TEE_ERROR_GENERICIf ioctl to display driver returned error.
TEES_ERROR_TUI_BAD_STATEIf TUI session is not opened.
TEES_ERROR_TUI_BUSYIf some TUI function is called at moment.
TEES_ERROR_TUI_GENERICIf mutex unlock error has happened.