MiniGUI API Reference (MiniGUI-Standalone)
v3.2.0
A mature and proven cross-platform GUI system for embedded and smart IoT devices
|
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... | |
#define IDC_HAND_POINT 19 |
#define IDC_HAND_SELECT 20 |
#define IDC_SIZENESW 6 |
#define IDC_SIZENWSE 5 |
#define IDC_SPLIT_HORZ 21 |
#define SetCursor | ( | hcsr | ) | SetCursorEx (hcsr, FALSE) |
Changes the current cursor.
This function changes the current cursor to be hcsr.
hcsr | The expected cursor handle. |
#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.
hcsr | The expected cursor handle. |
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.
prc | The clipping rectangle. |
Copies a cursor object.
This function copies the specified cursor.
hcsr | Handle to the cursor to be copied. |
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.
xhotspot | The x-coordinate of the hotspot. |
yhotspot | The y-coordinate of the hotspot. |
w | The width of the cursor. |
h | The height of the cursor. |
pANDBits | The pointer to AND bits of the cursor. |
pXORBits | The pointer to XOR bits of the cursor. |
colornum | The bit-per-pixel of XOR bits. |
Destroys a cursor object.
This function destroys a cursor object specified by hcsr.
hcsr | Handle to the cursor. |
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.
prc | The clipping rectangle will be saved to this rectangle. |
HCURSOR GUIAPI GetCurrentCursor | ( | void | ) |
Gets the handle to the current cursor.
This function retrives the current cursor and returns its handle.
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.
ppt | The position will be saved in this buffer. |
HCURSOR GUIAPI GetDefaultCursor | ( | void | ) |
Gets the default cursor.
This function gets the current default cursor.
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:
csrid | The identifier of the system cursor. |
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.
filename | The path name of the cursor file. |
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.
area | The pointer to the cursor data. |
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.
hcsr | The expected cursor handle. |
set_def | Indicates whether setting the cursor as the default cursor. |
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).
x | The x-corrdinate of the expected poistion. |
y | The y-corrdinate of the expected poistion. |
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.
fShow | Indicates show or hide the cursor. |