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

Macros

#define IDC_ARROW   0
 
#define IDC_IBEAM   1
 
#define IDC_PENCIL   2
 
#define IDC_CROSS   3
 
#define IDC_MOVE   4
 
#define IDC_SIZENWSE   5
 
#define IDC_SIZENESW   6
 
#define IDC_SIZEWE   7
 
#define IDC_SIZENS   8
 
#define IDC_UPARROW   9
 
#define IDC_NONE   10
 
#define IDC_HELP   11
 
#define IDC_BUSY   12
 
#define IDC_WAIT   13
 
#define IDC_RARROW   14
 
#define IDC_COLOMN   15
 
#define IDC_ROW   16
 
#define IDC_DRAG   17
 
#define IDC_NODROP   18
 
#define IDC_HAND_POINT   19
 
#define IDC_HAND_SELECT   20
 
#define IDC_SPLIT_HORZ   21
 
#define IDC_SPLIT_VERT   22
 
#define SetCursor(hcsr)   SetCursorEx (hcsr, FALSE)
 Changes the current cursor. More...
 
#define SetDefaultCursor(hcsr)   SetCursorEx (hcsr, TRUE)
 Changes the current cursor, and set it as the default cursor. More...
 

Functions

MG_EXPORT HCURSOR GUIAPI LoadCursorFromFile (const char *filename)
 Loads a cursor from a M$ Windows cursor file. More...
 
MG_EXPORT HCURSOR GUIAPI LoadCursorFromMem (const void *area)
 Loads a cursor from a memory area. More...
 
MG_EXPORT HCURSOR GUIAPI CreateCursor (int xhotspot, int yhotspot, int w, int h, const BYTE *pANDBits, const BYTE *pXORBits, int colornum)
 Creates a cursor from memory data. More...
 
MG_EXPORT HCURSOR GUIAPI CopyCursor (HCURSOR hcsr)
 Copies a cursor object. More...
 
MG_EXPORT BOOL GUIAPI DestroyCursor (HCURSOR hcsr)
 Destroys a cursor object. More...
 
MG_EXPORT HCURSOR GUIAPI GetSystemCursor (int csrid)
 Gets the handle to a system cursor by its identifier. More...
 
MG_EXPORT HCURSOR GUIAPI GetCurrentCursor (void)
 Gets the handle to the current cursor. More...
 
MG_EXPORT void GUIAPI ClipCursor (const RECT *prc)
 Clips the cursor range. More...
 
MG_EXPORT void GUIAPI GetClipCursor (RECT *prc)
 Gets the current cursor clipping rectangle. More...
 
MG_EXPORT void GUIAPI GetCursorPos (POINT *ppt)
 Gets position of the current cursor. More...
 
MG_EXPORT void GUIAPI SetCursorPos (int x, int y)
 Sets position of the current cursor. More...
 
MG_EXPORT HCURSOR GUIAPI SetCursorEx (HCURSOR hcsr, BOOL set_def)
 Changes the current cursor. More...
 
MG_EXPORT HCURSOR GUIAPI GetDefaultCursor (void)
 Gets the default cursor. More...
 
MG_EXPORT int GUIAPI ShowCursor (BOOL fShow)
 Shows or hides cursor. More...
 

Detailed Description

Macro Definition Documentation

#define IDC_ARROW   0

System arrow cursor index.

Definition at line 2745 of file minigui.h.

#define IDC_BUSY   12

System busy cursor index.

Definition at line 2769 of file minigui.h.

#define IDC_COLOMN   15

System colomn cursor index.

Definition at line 2775 of file minigui.h.

#define IDC_CROSS   3

System cross cursor index.

Definition at line 2751 of file minigui.h.

#define IDC_DRAG   17

System drag cursor index.

Definition at line 2779 of file minigui.h.

#define IDC_HAND_POINT   19

System hand point cursor index.

Definition at line 2783 of file minigui.h.

#define IDC_HAND_SELECT   20

System hand select cursor index.

Definition at line 2785 of file minigui.h.

#define IDC_HELP   11

System help cursor index.

Definition at line 2767 of file minigui.h.

#define IDC_IBEAM   1

System beam cursor index.

Definition at line 2747 of file minigui.h.

#define IDC_MOVE   4

System move cursor index.

Definition at line 2753 of file minigui.h.

#define IDC_NODROP   18

System nodrop cursor index.

Definition at line 2781 of file minigui.h.

#define IDC_NONE   10

System none cursor index.

Definition at line 2765 of file minigui.h.

#define IDC_PENCIL   2

System pencil cursor index.

Definition at line 2749 of file minigui.h.

#define IDC_RARROW   14

System right arrow cursor index.

Definition at line 2773 of file minigui.h.

#define IDC_ROW   16

System row cursor index.

Definition at line 2777 of file minigui.h.

#define IDC_SIZENESW   6

System size northeast to southwest cursor index.

Definition at line 2757 of file minigui.h.

#define IDC_SIZENS   8

System north to south cursor index.

Definition at line 2761 of file minigui.h.

#define IDC_SIZENWSE   5

System size northwest to southeast cursor index.

Definition at line 2755 of file minigui.h.

#define IDC_SIZEWE   7

System west to east cursor index.

Definition at line 2759 of file minigui.h.

#define IDC_SPLIT_HORZ   21

System horizontal split cursor index.

Definition at line 2787 of file minigui.h.

#define IDC_SPLIT_VERT   22

System vertical cursor index.

Definition at line 2789 of file minigui.h.

#define IDC_UPARROW   9

System up arrow cursor index.

Definition at line 2763 of file minigui.h.

#define IDC_WAIT   13

System wait cursor index.

Definition at line 2771 of file minigui.h.

#define SetCursor (   hcsr)    SetCursorEx (hcsr, FALSE)

Changes the current cursor.

This function changes the current cursor to be hcsr.

Parameters
hcsrThe expected cursor handle.
Returns
The old cursor handle.
Note
This function defined as a macro calling SetCursorEx with passing set_def as FALSE.
See also
SetCursorEx, SetDefaultCursor

Definition at line 2880 of file minigui.h.

#define SetDefaultCursor (   hcsr)    SetCursorEx (hcsr, TRUE)

Changes the current cursor, and set it as the default cursor.

This function changes the current cursor to be hcsr, and set it as the default cursor.

Parameters
hcsrThe expected cursor handle.
Returns
The old cursor handle.
Note
This function defined as a macro calling SetCursorEx with passing set_def as TRUE.
See also
SetCursorEx, SetCursor

Definition at line 2897 of file minigui.h.

Function Documentation

void GUIAPI ClipCursor ( const RECT prc)

Clips the cursor range.

This function sets cursor's clipping rectangle. prc is the new clipping rectangle in screen coordinates. If prc is NULL, ClipCursor will disable cursor clipping.

Parameters
prcThe clipping rectangle.
Returns
None.
HCURSOR GUIAPI CopyCursor ( HCURSOR  hcsr)

Copies a cursor object.

This function copies the specified cursor.

Parameters
hcsrHandle to the cursor to be copied.
Returns
If the function succeeds, the return value is the handle to the duplicate cursor. If the function fails, the return value is 0.
HCURSOR GUIAPI CreateCursor ( int  xhotspot,
int  yhotspot,
int  w,
int  h,
const BYTE pANDBits,
const BYTE pXORBits,
int  colornum 
)

Creates a cursor from memory data.

This function creates a cursor from memory data rather than cursor file. xhotspot and yhotspot specify the hotpot of the cursor, w and h are the width and the height of the cursor respectively. pANDBits and pXORBits are AND bitmask and XOR bitmask of the cursor. MiniGUI currently support mono-color cursor and 16-color cursor, colornum specifies the cursor's color depth. For mono-color, it should be 1, and for 16-color cursor, it should be 4.

Parameters
xhotspotThe x-coordinate of the hotspot.
yhotspotThe y-coordinate of the hotspot.
wThe width of the cursor.
hThe height of the cursor.
pANDBitsThe pointer to AND bits of the cursor.
pXORBitsThe pointer to XOR bits of the cursor.
colornumThe bit-per-pixel of XOR bits.
Returns
Handle to the cursor, zero on error.
Note
MiniGUI only support 2-color or 16-color cursor.
BOOL GUIAPI DestroyCursor ( HCURSOR  hcsr)

Destroys a cursor object.

This function destroys a cursor object specified by hcsr.

Parameters
hcsrHandle to the cursor.
Returns
TRUE on success, otherwise FALSE.
void GUIAPI GetClipCursor ( RECT prc)

Gets the current cursor clipping rectangle.

This function copies the current clipping rectangle to a RECT pointed to by prc.

Parameters
prcThe clipping rectangle will be saved to this rectangle.
Returns
None.
HCURSOR GUIAPI GetCurrentCursor ( void  )

Gets the handle to the current cursor.

This function retrives the current cursor and returns its handle.

Returns
Handle to the current system cursor, zero means no current cursor.
void GUIAPI GetCursorPos ( POINT ppt)

Gets position of the current cursor.

This function copies the current mouse cursor position to a POINT structure pointed to by ppt.

Parameters
pptThe position will be saved in this buffer.
Returns
None.
See also
SetCursorPos, POINT
HCURSOR GUIAPI GetDefaultCursor ( void  )

Gets the default cursor.

This function gets the current default cursor.

Returns
The current default cursor handle.
See also
SetCursorEx, SetDefaultCursor
HCURSOR GUIAPI GetSystemCursor ( int  csrid)

Gets the handle to a system cursor by its identifier.

MiniGUI creates (MAX_SYSCURSORINDEX + 1) system cursors for application. You can use GetSystemCursor to get the handle to these system cursors. The identifier can be one of the following:

  • IDC_ARROW
    Normal arrow cursor.
  • IDC_IBEAM
    'I' shaped beam cursor, indicate an input field.
  • IDC_PENCIL
    Pencil-shape cursor.
  • IDC_CROSS
    Cross cursor.
  • IDC_MOVE
    Moving cursor.
  • IDC_SIZENWSE
    Sizing cursor, along north-west and south-east.
  • IDC_SIZENESW
    Sizing cursor, along north-east and south-west.
  • IDC_SIZEWE
    Sizing cursor, along west and east.
  • IDC_SIZENS
    Sizing cursor, along north and south.
  • IDC_UPARROW
    Up arrow cursor.
  • IDC_NONE
    None cursor.
  • IDC_HELP
    Arrow with question.
  • IDC_BUSY
    Busy cursor.
  • IDC_WAIT
    Wait cursor.
  • IDC_RARROW
    Right arrow cursor.
  • IDC_COLOMN
    Cursor indicates column.
  • IDC_ROW
    Cursor indicates row.
  • IDC_DRAG
    Draging cursor.
  • IDC_NODROP
    No droping cursor.
  • IDC_HAND_POINT
    Hand point cursor.
  • IDC_HAND_SELECT
    Hand selection cursor.
  • IDC_SPLIT_HORZ
    Horizontal splitting cursor.
  • IDC_SPLIT_VERT
    Vertical splitting cursor.
Parameters
csridThe identifier of the system cursor.
Returns
Handle to the system cursor, otherwise zero.
HCURSOR GUIAPI LoadCursorFromFile ( const char *  filename)

Loads a cursor from a M$ Windows cursor file.

This function loads a cursor from M$ Windows *.cur file named filename and returns the handle to loaded cursor. The returned handle can be used by SetCursor to set new mouse cursor.

Parameters
filenameThe path name of the cursor file.
Returns
Handle to the cursor, zero on error.
Note
MiniGUI does not support 256-color or animation cursor.
See also
SetCursor
HCURSOR GUIAPI LoadCursorFromMem ( const void *  area)

Loads a cursor from a memory area.

This function loads a cursor from a memory area pointed to by area. The memory has the same layout as a M$ Windows CURSOR file. The returned handle can be used by SetCursor to set new mouse cursor.

Parameters
areaThe pointer to the cursor data.
Returns
Handle to the cursor, zero on error.
Note
MiniGUI does not support 256-color or animation cursor.
See also
SetCursor
HCURSOR GUIAPI SetCursorEx ( HCURSOR  hcsr,
BOOL  set_def 
)

Changes the current cursor.

This function changes the current cursor to be hcsr, and/or sets it to be the default cursor.

If you pass set_def as TRUE, the expected cursor will be the default cursor. The default cursor will be used when you move the cursor to the desktop.

Parameters
hcsrThe expected cursor handle.
set_defIndicates whether setting the cursor as the default cursor.
Returns
The old cursor handle.
See also
SetCursor, SetDefaultCursor, GetDefaultCursor
void GUIAPI SetCursorPos ( int  x,
int  y 
)

Sets position of the current cursor.

This function sets mouse cursor position with the given arguments: (x,y).

Parameters
xThe x-corrdinate of the expected poistion.
yThe y-corrdinate of the expected poistion.
Returns
None.
See also
GetCursorPos
int GUIAPI ShowCursor ( BOOL  fShow)

Shows or hides cursor.

This function shows or hides cursor according to the argument fShow. Show cursor when fShow is TRUE, and hide cursor when fShow is FALSE. MiniGUI maintains a showing count value. Calling ShowCursor once, the count will increase when fShow is TRUE, or decrease one when FALSE. When the count is less than 0, the cursor will disapear actually.

Parameters
fShowIndicates show or hide the cursor.
Returns
Cursor showing count value.