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

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)
 Set the data of a clipboard. More...
 
MG_EXPORT size_t GUIAPI GetClipBoardDataLen (const char *cb_name)
 Get the length of the data of a clipboard. More...
 
MG_EXPORT size_t GUIAPI GetClipBoardData (const char *cb_name, void *data, size_t n)
 Get the data of a clipboard. More...
 
MG_EXPORT int GUIAPI GetClipBoardByte (const char *cb_name, int index, unsigned char *byte)
 Get a byte from a clipboard. More...
 

Detailed Description

Macro Definition Documentation

◆ CBERR_BADNAME

#define CBERR_BADNAME   1

Bad name to clipboard.

See also
CreateClipBoard

Definition at line 3396 of file minigui.h.

◆ CBERR_NOMEM

#define CBERR_NOMEM   2

No enough memory to clipboard.

See also
CreateClipBoard

Definition at line 3402 of file minigui.h.

◆ CBERR_OK

#define CBERR_OK   0

Operate clipboard success.

See also
CreateClipBoard

Definition at line 3390 of file minigui.h.

◆ CBNAME_TEXT

#define CBNAME_TEXT   ("text")

The default clipboard name of text control.

Definition at line 3383 of file minigui.h.

◆ CBOP_APPEND

#define CBOP_APPEND   1

Append the new data to clipboarda after the old data.

Definition at line 3413 of file minigui.h.

◆ CBOP_NORMAL

#define CBOP_NORMAL   0

Overwrite operation to clipboard.

Definition at line 3408 of file minigui.h.

◆ LEN_CLIPBOARD_NAME

#define LEN_CLIPBOARD_NAME   15

The maximum length of the name of clipboard.

Definition at line 3372 of file minigui.h.

◆ NR_CLIPBOARDS

#define NR_CLIPBOARDS   4

The maximum number of clipboard.

Definition at line 3377 of file minigui.h.

Function Documentation

◆ CreateClipBoard()

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

◆ 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

◆ GetClipBoardByte()

int GUIAPI GetClipBoardByte ( const char *  cb_name,
int  index,
unsigned char *  byte 
)

Get 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

◆ GetClipBoardData()

size_t GUIAPI GetClipBoardData ( const char *  cb_name,
void *  data,
size_t  n 
)

Get 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

◆ GetClipBoardDataLen()

size_t GUIAPI GetClipBoardDataLen ( const char *  cb_name)

Get 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

◆ SetClipBoardData()

int GUIAPI SetClipBoardData ( const char *  cb_name,
void *  data,
size_t  n,
int  cbop 
)

Set 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