MiniGUI API Reference (MiniGUI-Threads)  v3.2.0
A mature and proven cross-platform GUI system for embedded and smart IoT devices
Macros | Functions

Macros

#define LEN_CLIPBOARD_NAME   15
 The maximum length of the name of clipboard. More...
 
#define NR_CLIPBOARDS   4
 The maximum number of clipboard. More...
 
#define CBNAME_TEXT   ("text")
 The default clipboard name of text control. More...
 
#define CBERR_OK   0
 Operate clipboard success. More...
 
#define CBERR_BADNAME   1
 Bad name to clipboard. More...
 
#define CBERR_NOMEM   2
 No enough memory to clipboard. More...
 
#define CBOP_NORMAL   0
 Overwrite operation to clipboard. More...
 
#define CBOP_APPEND   1
 Append the new data to clipboarda after the old data. More...
 

Functions

MG_EXPORT int GUIAPI CreateClipBoard (const char *cb_name, size_t size)
 Creates a new clipboard. More...
 
MG_EXPORT int GUIAPI DestroyClipBoard (const char *cb_name)
 Destroys a new clipboard. More...
 
MG_EXPORT int GUIAPI SetClipBoardData (const char *cb_name, void *data, size_t n, int cbop)
 Sets the data of a clipboard. More...
 
MG_EXPORT size_t GUIAPI GetClipBoardDataLen (const char *cb_name)
 Gets the length of the data of a clipboard. More...
 
MG_EXPORT size_t GUIAPI GetClipBoardData (const char *cb_name, void *data, size_t n)
 Gets the data of a clipboard. More...
 
MG_EXPORT int GUIAPI GetClipBoardByte (const char *cb_name, int index, unsigned char *byte)
 Gets a byte from a clipboard. More...
 

Detailed Description

Macro Definition Documentation

#define CBERR_BADNAME   1

Bad name to clipboard.

See also
CreateClipBoard

Definition at line 2313 of file minigui.h.

#define CBERR_NOMEM   2

No enough memory to clipboard.

See also
CreateClipBoard

Definition at line 2319 of file minigui.h.

#define CBERR_OK   0

Operate clipboard success.

See also
CreateClipBoard

Definition at line 2307 of file minigui.h.

#define CBNAME_TEXT   ("text")

The default clipboard name of text control.

Definition at line 2300 of file minigui.h.

#define CBOP_APPEND   1

Append the new data to clipboarda after the old data.

Definition at line 2330 of file minigui.h.

#define CBOP_NORMAL   0

Overwrite operation to clipboard.

Definition at line 2325 of file minigui.h.

#define LEN_CLIPBOARD_NAME   15

The maximum length of the name of clipboard.

Definition at line 2289 of file minigui.h.

#define NR_CLIPBOARDS   4

The maximum number of clipboard.

Definition at line 2294 of file minigui.h.

Function Documentation

int GUIAPI CreateClipBoard ( const char *  cb_name,
size_t  size 
)

Creates a new clipboard.

This function creates a new clipboard with the name cb_name. MiniGUI itself creates a clipboard for text copying/pasting called CBNAME_TEXT.

Parameters
cb_nameThe name of the new clipboard.
sizeThe size of the clipboard.
Return values
CBERR_OKThe clipboard created.
CBERR_BADNAMEDuplicated clipboard name.
CBERR_NOMEMNo enough memory.
See also
DestroyClipBoard
int GUIAPI DestroyClipBoard ( const char *  cb_name)

Destroys a new clipboard.

This function destroys a clipboard with the name cb_name.

Parameters
cb_nameThe name of the clipboard.
Return values
CBERR_OKThe clipboard has been destroyed.
CBERR_BADNAMECan not find the clipboard with the name.
See also
CreateClipBoard
int GUIAPI GetClipBoardByte ( const char *  cb_name,
int  index,
unsigned char *  byte 
)

Gets a byte from a clipboard.

This function gets a byte from the clipboard named cb_name.

Parameters
cb_nameThe name of the clipboard.
indexThe index of the byte.
byteThe buffer saving the returned byte.
Return values
CBERR_OKSuccess.
CBERR_BADNAMEBad clipboard name.
CBERR_NOMEMThe index is beyond the data in the clipboard.
See also
GetClipBoardData
size_t GUIAPI GetClipBoardData ( const char *  cb_name,
void *  data,
size_t  n 
)

Gets the data of a clipboard.

This function gets the all data from the clipboard named cb_name.

Parameters
cb_nameThe name of the clipboard.
dataThe pointer to a buffer will save the data.
nThe length of the buffer.
Returns
The size of the data got if success, otherwise zero.
See also
GetClipBoardByte
size_t GUIAPI GetClipBoardDataLen ( const char *  cb_name)

Gets the length of the data of a clipboard.

This function gets the data length of the clipboard named cb_name.

Parameters
cb_nameThe name of the clipboard.
Returns
The size of the data if success, otherwise zero.
See also
GetClipBoardData
int GUIAPI SetClipBoardData ( const char *  cb_name,
void *  data,
size_t  n,
int  cbop 
)

Sets the data of a clipboard.

This function sets the data into the clipboard named cb_name.

Parameters
cb_nameThe name of the clipboard.
dataThe pointer to the data.
nThe length of the data.
cbopType of clipboard operations, can be one of the following values:
  • CBOP_NORMAL
    Overwrite the old data.
  • CBOP_APPEND
    Append the new data after the old data.
Return values
CBERR_OKSuccess.
CBERR_BADNAMEBad clipboard name.
CBERR_NOMEMNo enough memory.
See also
GetClipBoardDataLen, GetClipBoardData