64 #ifndef _MGUI_MINIGUI_H 65 #define _MGUI_MINIGUI_H 97 #define g_rcDesktop g_rcScr 101 #ifdef _MGRM_PROCESSES 108 #include <sys/types.h> 117 extern MG_EXPORT
BOOL mgIsServer;
128 extern MG_EXPORT
void* mgSharedRes;
138 extern MG_EXPORT
size_t mgSizeRes;
144 #define LEN_LAYER_NAME 14 150 #define LEN_CLIENT_NAME 14 156 #define INV_LAYER_HANDLE 0 161 typedef struct _MG_Client
164 char name [LEN_CLIENT_NAME + 1];
176 DWORD last_live_time;
181 struct _MG_Client* next;
183 struct _MG_Client* prev;
186 struct _MG_Layer* layer;
189 struct GlobalRes* global_res;
193 typedef struct _MG_Layer
196 char name [LEN_LAYER_NAME + 1];
204 MG_Client* cli_active;
207 struct _MG_Layer* next;
209 struct _MG_Layer* prev;
218 #define SCREEN_ATTR_ALPHA_CHANNEL 0x01 //alpha channel 219 #define SCREEN_ATTR_COLORKEY 0x02 //colorkey 220 #define SCREEN_ATTR_COLORSPACE 0x03 //colorspace 221 #define SCREEN_ATTR_ALPHA 0x04 222 #define SCREEN_NO_EXIST -99 //screen don't exist 230 extern MG_EXPORT
int mgClientSize;
242 extern MG_EXPORT MG_Client* mgClients;
250 extern MG_EXPORT MG_Layer* mgTopmostLayer;
258 extern MG_EXPORT MG_Layer* mgLayers;
283 MG_EXPORT
int GUIAPI
InitGUI (
int,
const char **);
305 #ifndef _MGRM_THREADS 334 #define MAX_NR_LISTEN_FD 5 342 #define POLLOUT 0x004 346 #define POLLERR 0x008 378 HWND hwnd,
void* context);
398 #ifdef _MGRM_PROCESSES 417 #define NAME_SELF_LAYER "" 423 #define NAME_TOPMOST_LAYER "" 429 #define NAME_DEF_LAYER "mginit" 465 MG_EXPORT
GHANDLE GUIAPI JoinLayer (
const char* layer_name,
466 const char* client_name,
467 int max_nr_topmosts,
int max_nr_normals);
493 MG_EXPORT
GHANDLE GUIAPI GetLayerInfo (
const char* layer_name,
494 int* nr_clients,
BOOL* is_topmost,
int* cli_active);
513 MG_EXPORT
BOOL GUIAPI SetTopmostLayer (
BOOL handle_name,
514 GHANDLE handle,
const char* name);
533 MG_EXPORT
BOOL GUIAPI DeleteLayer (
BOOL handle_name,
534 GHANDLE handle,
const char* layer_name);
557 typedef int (* ON_LOCK_CLIENT_REQ) (void);
566 typedef int (* ON_TRYLOCK_CLIENT_REQ) (void);
574 typedef void (* ON_UNLOCK_CLIENT_REQ) (void);
584 extern MG_EXPORT ON_LOCK_CLIENT_REQ OnLockClientReq;
594 extern MG_EXPORT ON_TRYLOCK_CLIENT_REQ OnTrylockClientReq;
603 extern MG_EXPORT ON_UNLOCK_CLIENT_REQ OnUnlockClientReq;
605 #define LCO_NEW_CLIENT 1 606 #define LCO_DEL_CLIENT 2 614 typedef void (* ON_NEW_DEL_CLIENT) (
int op,
int cli);
616 #define LCO_NEW_LAYER 1 617 #define LCO_DEL_LAYER 2 618 #define LCO_JOIN_CLIENT 3 619 #define LCO_REMOVE_CLIENT 4 620 #define LCO_TOPMOST_CHANGED 5 621 #define LCO_ACTIVE_CHANGED 6 630 typedef void (* ON_CHANGE_LAYER) (
int op, MG_Layer* layer,
633 #define ZNOP_ALLOCATE 1 635 #define ZNOP_MOVE2TOP 3 638 #define ZNOP_MOVEWIN 6 639 #define ZNOP_SETACTIVE 7 641 #define ZNOP_ENABLEWINDOW 11 642 #define ZNOP_DISABLEWINDOW 12 643 #define ZNOP_STARTDRAG 13 644 #define ZNOP_CANCELDRAG 14 645 #define ZNOP_CHANGECAPTION 15 653 typedef void (* ON_ZNODE_OPERATION) (
int op,
int cli,
int idx_znode);
678 extern MG_EXPORT ON_NEW_DEL_CLIENT OnNewDelClient;
709 extern MG_EXPORT ON_CHANGE_LAYER OnChangeLayer;
753 extern MG_EXPORT ON_ZNODE_OPERATION OnZNodeOperation;
781 MG_EXPORT
BOOL GUIAPI ServerStartup (
int nr_globals,
782 int def_nr_topmosts,
int def_nr_normals);
811 MG_EXPORT MG_Layer* GUIAPI ServerCreateLayer (
const char* layer_name,
812 int max_nr_topmosts,
int max_nr_normals);
828 MG_EXPORT
BOOL GUIAPI ServerSetTopmostLayer (MG_Layer* layer);
844 MG_EXPORT
BOOL GUIAPI ServerDeleteLayer (MG_Layer* layer);
870 MG_EXPORT
int GUIAPI ServerGetNextZNode (MG_Layer* layer,
int idx_znode,
873 #define ZNIT_DESKTOP 0x50000000 875 #define ZNIT_GLOBAL_MAINWIN 0x31000000 876 #define ZNIT_GLOBAL_TOOLWIN 0x32000000 877 #define ZNIT_GLOBAL_CONTROL 0x30000000 879 #define ZNIT_TOPMOST_MAINWIN 0x21000000 880 #define ZNIT_TOPMOST_TOOLWIN 0x22000000 881 #define ZNIT_TOPMOST_CONTROL 0x20000000 883 #define ZNIT_NORMAL_MAINWIN 0x11000000 884 #define ZNIT_NORMAL_TOOLWIN 0x12000000 885 #define ZNIT_NORMAL_CONTROL 0x10000000 887 #define ZNIT_NULL 0x00000000 889 #define ZNIF_VISIBLE 0x00000002 890 #define ZNIF_DISABLED 0x00000004 893 typedef struct _ZNODEINFO
967 MG_EXPORT
BOOL GUIAPI ServerGetZNodeInfo (MG_Layer* layer,
int idx_znode,
968 ZNODEINFO* znode_info);
1002 MG_EXPORT
BOOL GUIAPI ServerDoZNodeOperation (MG_Layer* layer,
int idx_znode,
1003 int op_code,
void* op_data,
BOOL notify);
1016 MG_EXPORT
int GUIAPI GetClientByPID (
int pid);
1034 MG_EXPORT
BOOL GUIAPI SetTopmostClient (
int cli);
1040 MG_EXPORT
void GUIAPI DisableClientsOutput (
void);
1048 MG_EXPORT
void GUIAPI UpdateTopmostLayer (
const RECT* dirty_rc);
1086 #define MAX_SYS_REQID 0x0020 1094 #define MAX_REQID 0x0030 1097 typedef struct _REQUEST {
1106 typedef REQUEST* PREQUEST;
1130 MG_EXPORT
int GUIAPI ClientRequestEx (
const REQUEST* request,
const void* ex_data,
1131 int ex_data_len,
void* result,
int len_rslt);
1155 static inline int ClientRequest (
const REQUEST* request,
1156 void* result,
int len_rslt)
1158 return ClientRequestEx (request,
NULL, 0, result, len_rslt);
1172 MG_EXPORT
int GUIAPI GetSockFD2Server (
void);
1191 MG_EXPORT
int GUIAPI ServerSendReply (
int clifd,
const void* reply,
int len);
1199 typedef int (* REQ_HANDLER) (
int cli,
int clifd,
void* buff,
size_t len);
1219 MG_EXPORT
BOOL GUIAPI RegisterRequestHandler (
int req_id, REQ_HANDLER your_handler);
1236 MG_EXPORT REQ_HANDLER GUIAPI GetRequestHandler (
int req_id);
1272 MG_EXPORT
int serv_listen (
const char* name);
1295 MG_EXPORT
int serv_accept (
int listenfd, pid_t *pidptr, uid_t *uidptr);
1317 MG_EXPORT
int cli_conn (
const char* name,
char project);
1319 #define SOCKERR_IO -1 1320 #define SOCKERR_CLOSED -2 1321 #define SOCKERR_INVARG -3 1322 #define SOCKERR_TIMEOUT -4 1323 #define SOCKERR_OK 0 1353 MG_EXPORT
int sock_write_t (
int fd,
const void* buff,
1354 int count,
unsigned int timeout);
1383 MG_EXPORT
int sock_read_t (
int fd,
void* buff,
int count,
unsigned int timeout);
1391 #define sock_write(fd, buff, count) sock_write_t(fd, buff, count, 0) 1399 #define sock_read(fd, buff, count) sock_read_t(fd, buff, count, 0) 1455 #define ReinitDesktop() ReinitDesktopEx (TRUE) 1473 #ifdef _USE_MINIGUIENTRY 1474 #define main_entry minigui_entry 1475 int minigui_entry (
int args,
const char* arg[]);
1477 #define main_entry main 1497 #define MiniGUIMain \ 1498 MiniGUIAppMain (int args, const char* argv[]); \ 1499 int main_entry (int args, const char* argv[]) \ 1502 if (InitGUI (args, argv) != 0) { \ 1505 iRet = MiniGUIAppMain (args, argv); \ 1506 TerminateGUI (iRet); \ 1516 #define IDM_DTI_FIRST (300) 1522 void* (*init) (void);
1525 void (*deinit) (
void* context);
1528 void (*paint_desktop) (
void* context,
1529 HDC dc_desktop,
const RECT* inv_rc);
1532 void (*keyboard_handler) (
void* context,
1536 void (*mouse_handler) (
void* context,
1540 void (*customize_desktop_menu) (
void* context,
1541 HMENU hmenu,
int start_pos);
1544 void (*desktop_menucmd_handler) (
void* context,
int id);
1631 #ifdef _MGHAVE_MOUSECALIBRATE 1668 const POINT* dst_pts);
1695 #ifdef _MGMISC_ABOUTDLG 1702 #ifdef _MGRM_THREADS 1794 #define ETC_MAXLINE 1024 1800 #define ETC_FILENOTFOUND -1 1805 #define ETC_SECTIONNOTFOUND -2 1810 #define ETC_KEYNOTFOUND -3 1815 #define ETC_TMPFILEFAILED -4 1820 #define ETC_FILEIOFAILED -5 1825 #define ETC_INTCONV -6 1830 #define ETC_INVALIDOBJ -7 1835 #define ETC_READONLYOBJ -8 1870 #ifndef _MGINCORE_RES 1922 const char* pSection,
const char* pKey,
char* pValue,
int iLen);
1962 const char* pSection,
const char* pKey,
int* value);
1990 const char* pSection,
const char* pKey,
char* pValue);
2013 const char* pSection);
2114 const char* pKey,
char* pValue,
int iLen);
2124 const char* pKey,
int* pValue);
2136 #define SetValueToEtc(hEtc, pSection, pKey, pValue) \ 2137 GetValueFromEtc(hEtc, pSection, pKey, pValue, -1) 2157 const char* pSection,
BOOL bCreateNew);
2185 const char* pKey,
char* pValue,
int iLen);
2211 const char* pKey,
int* pValue);
2224 const char* pKey,
char* pValue);
2249 extern MG_EXPORT
GHANDLE hMgEtc;
2261 const char *pKey,
char *pValue,
int iLen)
2263 #ifndef _MGINCORE_RES 2281 const char* pKey,
int *value)
2283 #ifndef _MGINCORE_RES 2293 #ifdef _MGHAVE_CLIPBOARD 2304 #define LEN_CLIPBOARD_NAME 15 2309 #define NR_CLIPBOARDS 4 2315 #define CBNAME_TEXT ("text") 2328 #define CBERR_BADNAME 1 2334 #define CBERR_NOMEM 2 2340 #define CBOP_NORMAL 0 2345 #define CBOP_APPEND 1 2364 MG_EXPORT
int GUIAPI
CreateClipBoard (
const char* cb_name,
size_t size);
2405 void* data,
size_t n,
int cbop);
2437 void* data,
size_t n);
2457 int index,
unsigned char* byte);
2488 MG_EXPORT
void GUIAPI
Ping (
void);
2512 MG_EXPORT
void GUIAPI
Tone (
int frequency_hz,
int duration_ms);
2575 MG_EXPORT
char* GUIAPI
FixStrDup (
const char* str);
2589 MG_EXPORT
void GUIAPI
FreeFixStr (
char* str);
2598 #ifdef _MGHAVE_CURSOR 2662 const BYTE* pANDBits,
const BYTE* pXORBits,
int colornum);
2767 const BYTE* pANDBits,
const BYTE* pXORBits,
int colornum) {
2789 #define MAX_SYSCURSORINDEX 22 2797 #define IDC_PENCIL 2 2803 #define IDC_SIZENWSE 5 2805 #define IDC_SIZENESW 6 2807 #define IDC_SIZEWE 7 2809 #define IDC_SIZENS 8 2811 #define IDC_UPARROW 9 2821 #define IDC_RARROW 14 2823 #define IDC_COLOMN 15 2829 #define IDC_NODROP 18 2831 #define IDC_HAND_POINT 19 2833 #define IDC_HAND_SELECT 20 2835 #define IDC_SPLIT_HORZ 21 2837 #define IDC_SPLIT_VERT 22 2893 #ifdef _MGHAVE_CURSOR 2972 #define SetCursor(hcsr) SetCursorEx (hcsr, FALSE) 2989 #define SetDefaultCursor(hcsr) SetCursorEx (hcsr, TRUE) 3094 #define IDS_MGST_WINDOW 0 3100 #define IDS_MGST_START 1 3106 #define IDS_MGST_REFRESH 2 3112 #define IDS_MGST_CLOSEALLWIN 3 3118 #define IDS_MGST_ENDSESSION 4 3124 #define IDS_MGST_OPERATIONS 5 3130 #define IDS_MGST_MINIMIZE 6 3136 #define IDS_MGST_MAXIMIZE 7 3142 #define IDS_MGST_RESTORE 8 3148 #define IDS_MGST_CLOSE 9 3154 #define IDS_MGST_OK 10 3160 #define IDS_MGST_NEXT 11 3166 #define IDS_MGST_CANCEL 12 3172 #define IDS_MGST_PREV 13 3178 #define IDS_MGST_YES 14 3184 #define IDS_MGST_NO 15 3190 #define IDS_MGST_ABORT 16 3196 #define IDS_MGST_RETRY 17 3202 #define IDS_MGST_IGNORE 18 3208 #define IDS_MGST_ABOUTMG 19 3214 #define IDS_MGST_OPENFILE 20 3220 #define IDS_MGST_SAVEFILE 21 3226 #define IDS_MGST_COLORSEL 22 3232 #define IDS_MGST_SWITCHLAYER 23 3238 #define IDS_MGST_DELLAYER 24 3244 #define IDS_MGST_ERROR 25 3250 #define IDS_MGST_LOGO 26 3256 #define IDS_MGST_CURRPATH 27 3262 #define IDS_MGST_FILE 28 3268 #define IDS_MGST_LOCATION 29 3274 #define IDS_MGST_UP 30 3280 #define IDS_MGST_NAME 31 3286 #define IDS_MGST_SIZE 32 3292 #define IDS_MGST_ACCESSMODE 33 3298 #define IDS_MGST_LASTMODTIME 34 3304 #define IDS_MGST_OPEN 35 3310 #define IDS_MGST_FILENAME 36 3316 #define IDS_MGST_FILETYPE 37 3322 #define IDS_MGST_SHOWHIDEFILE 38 3328 #define IDS_MGST_NOTFOUND 39 3334 #define IDS_MGST_NR 40 3340 #define IDS_MGST_NW 41 3346 #define IDS_MGST_INFO 42 3352 #define IDS_MGST_R 43 3358 #define IDS_MGST_W 44 3364 #define IDS_MGST_WR 45 3370 #define IDS_MGST_SAVE 46 3376 #define IDS_MGST_FILEEXIST 47 3378 #define IDS_MGST_MAXNUM 47 3399 MG_EXPORT
const char* GUIAPI
GetSysText (
unsigned int id);
3467 extern MG_EXPORT
const char*
SysText [];
3482 #ifdef _MGCHARSET_UNICODE 3502 extern MG_EXPORT
const char** GUIAPI
GetSysTextInUTF8 (
const char* language);
3526 MG_EXPORT
char*
strnchr (
const char* s,
size_t n,
int c);
3544 MG_EXPORT
int substrlen (
const char* text,
int len,
int delimiter,
3706 MG_EXPORT
void *
mg_slice_copy(
size_t block_size,
const void *mem_block);
3726 MG_EXPORT
void mg_slice_free(
size_t block_size,
void *mem_block);
3751 void *mem_chain,
size_t next_offset);
3776 #define mg_slice_new(type) ((type*)mg_slice_alloc(sizeof (type))) 3803 #define mg_slice_new0(type) ((type*)mg_slice_alloc0(sizeof (type))) 3839 #define mg_slice_dup(type, mem) \ 3840 (1 ? (type*) mg_slice_copy (sizeof (type), (mem)) \ 3841 : ((void) ((type*) 0 == (mem)), (type*) 0)) 3865 #define mg_slice_delete(type, mem) \ 3867 if (1) mg_slice_free (sizeof (type), (mem)); \ 3868 else (void) ((type*) 0 == (mem)); \ 3895 #define mg_slice_delete_chain(type, mem_chain, next) \ 3897 if (1) mg_slice_free_chain_with_offset (sizeof (type), \ 3898 (mem_chain), G_STRUCT_OFFSET (type, next)); \ 3899 else (void) ((type*) 0 == (mem_chain)); \ 3902 #ifdef _MGDEVEL_MODE 3903 MG_EXPORT
void mg_slice_debug_tree_statistics(
void);
MG_EXPORT int GUIAPI GetClipBoardByte(const char *cb_name, int index, unsigned char *byte)
Gets a byte from a clipboard.
MG_EXPORT GHANDLE GUIAPI FindSectionInEtc(GHANDLE hEtc, const char *pSection, BOOL bCreateNew)
Finds/Creates a section from an etc object.
MG_EXPORT void GUIAPI Tone(int frequency_hz, int duration_ms)
Makes a tone.
MG_EXPORT void GUIAPI GetCursorPos(POINT *ppt)
Gets position of the current cursor.
MG_EXPORT char *GUIAPI FixStrAlloc(int len)
Allocates a buffer for a length-fixed string.
int BOOL
A type definition for boolean value.
MG_EXPORT void GUIAPI SetCursorPos(int x, int y)
Sets position of the current cursor.
unsigned char BYTE
A type definition for an 8-bit unsigned character (byte).
MG_EXPORT int GUIAPI RemoveSectionInEtcFile(const char *pEtcFile, const char *pSection)
Removes a section in an etc file.
MG_EXPORT void GUIAPI DesktopUpdateAllWindow(void)
Update all visible windows on the desktop.
MG_EXPORT int GUIAPI GetIntValueFromEtcSec(GHANDLE hSect, const char *pKey, int *pValue)
Gets an integer value from an etc section object.
MG_EXPORT void mg_slice_free_chain_with_offset(size_t block_size, void *mem_chain, size_t next_offset)
Free a linked list of memory blocks.
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.
MG_EXPORT const char ** local_SysText
The pointer to the current localized system text array.
MG_EXPORT void GUIAPI GetOriginalMousePosition(int *x, int *y)
Gets the original mouse position.
MG_EXPORT HCURSOR GUIAPI CopyCursor(HCURSOR hcsr)
Copies a cursor object.
MG_EXPORT int GUIAPI CreateClipBoard(const char *cb_name, size_t size)
Creates a new clipboard.
MG_EXPORT DESKTOPOPS *GUIAPI SetCustomDesktopOperationSet(DESKTOPOPS *usr_dsk_ops)
Set customer desktop operation set.
MG_EXPORT void mg_slice_free(size_t block_size, void *mem_block)
Free a block of memory.
MG_EXPORT size_t GUIAPI GetClipBoardDataLen(const char *cb_name)
Gets the length of the data of a clipboard.
struct _DESKTOPOPS DESKTOPOPS
static int GetMgEtcIntValue(const char *pSection, const char *pKey, int *value)
Gets integer value from MiniGUI configuration etc object.
MG_EXPORT int GUIAPI SaveEtcToFile(GHANDLE hEtc, const char *file_name)
Saves an ETC object into a file.
GHANDLE HDC
Handle to device context.
MG_EXPORT void * mg_slice_alloc(size_t block_size)
Allocate a slice memory.
MG_EXPORT BOOL GUIAPI UnregisterListenFD(int fd)
Unregisters a being listened file descriptor.
MG_EXPORT char ETCFILEPATH[]
The path name of MiniGUI configuration file.
MG_EXPORT BOOL GUIAPI GetKeyStatus(UINT uKey)
Gets a key or a mouse button status.
MG_EXPORT const char *GUIAPI GetSysText(unsigned int id)
Translates system text to localized text.
MG_EXPORT int GUIAPI GetValueFromEtcFile(const char *pEtcFile, const char *pSection, const char *pKey, char *pValue, int iLen)
Gets value from a configuration file.
MG_EXPORT int GUIAPI UnloadEtcFile(GHANDLE hEtc)
Unloads an etc file.
MG_EXPORT char * strtrimall(char *src)
Deletes all space characters.
MG_EXPORT BOOL GUIAPI RegisterListenFD(int fd, int type, HWND hwnd, void *context)
Registers a listening file descriptor to MiniGUI-Lite.
#define TRUE
TRUE value, defined as 1 by MiniGUI.
MG_EXPORT HCURSOR GUIAPI LoadCursorFromMem(const void *area)
Loads a cursor from a memory area.
MG_EXPORT void GUIAPI FreeFixStr(char *str)
Frees a length-fixed string.
MG_EXPORT BOOL GUIAPI ReinitDesktopEx(BOOL init_sys_text)
Re-initializes the desktop.
MG_EXPORT int GUIAPI GetIntValueFromEtcFile(const char *pEtcFile, const char *pSection, const char *pKey, int *value)
Gets integer value from a configuration file.
MG_EXPORT void GUIAPI GetClipCursor(RECT *prc)
Gets the current cursor clipping rectangle.
GHANDLE HWND
Handle to main window or control.
MG_EXPORT void GUIAPI Ping(void)
Makes a beep sound.
MG_EXPORT void GUIAPI MiniGUIPanic(int exitcode)
The panic of MiniGUI application.
MG_EXPORT int GUIAPI GetValueFromEtcSec(GHANDLE hSect, const char *pKey, char *pValue, int iLen)
Gets value from an etc section object.
MG_EXPORT int GUIAPI SetClipBoardData(const char *cb_name, void *data, size_t n, int cbop)
Sets the data of a clipboard.
MG_EXPORT int GUIAPI GetValueFromEtc(GHANDLE hEtc, const char *pSection, const char *pKey, char *pValue, int iLen)
Gets value from a configuration etc object.
MG_EXPORT char *GUIAPI FixStrDup(const char *str)
Duplicates a length-fixed string.
MG_EXPORT void * mg_slice_copy(size_t block_size, const void *mem_block)
Allocate and copy a slice.
static int GetMgEtcValue(const char *pSection, const char *pKey, char *pValue, int iLen)
Gets value from MiniGUI configuration etc object.
MG_EXPORT size_t GUIAPI GetClipBoardData(const char *cb_name, void *data, size_t n)
Gets the data of a clipboard.
MG_EXPORT HCURSOR GUIAPI SetCursorEx(HCURSOR hcsr, BOOL set_def)
Changes the current cursor.
MG_EXPORT BOOL GUIAPI DestroyCursor(HCURSOR hcsr)
Destroys a cursor object.
GHANDLE HCURSOR
Handle to cursor.
#define NULL
A value indicates null pointer.
PVOID GHANDLE
General handle.
struct _ETCSECTION ETCSECTION
MG_EXPORT HWND GUIAPI OpenAboutDialog(HWND hHosting)
Opens or actives the 'About MiniGUI' dialog.
MG_EXPORT const char **GUIAPI GetSysTextInUTF8(const char *language)
Gets the localized system text array in UTF-8 for a specified language.
UINT_PTR LPARAM
A type definition for the second message paramter.
MG_EXPORT int GUIAPI GetIntValueFromEtc(GHANDLE hEtc, const char *pSection, const char *pKey, int *pValue)
Gets the integer value from a configuration etc object.
MG_EXPORT void * mg_slice_alloc0(size_t block_size)
Allocate a slice memory and initialize the memory to zero.
MG_EXPORT void *GUIAPI GetOriginalTermIO(void)
Gets termios structure of the original terminal before initializing MiniGUI.
MG_EXPORT HCURSOR GUIAPI GetDefaultCursor(void)
Gets the default cursor.
MG_EXPORT RECT g_rcScr
Contains the rectangle of the whole screen.
MG_EXPORT HCURSOR GUIAPI LoadCursorFromFile(const char *filename)
Loads a cursor from a M$ Windows cursor file.
MG_EXPORT int GUIAPI InitGUI(int, const char **)
Initialize MiniGUI.
MG_EXPORT DWORD GUIAPI GetTickCount(void)
Retrieves the tick counts that have elapsed since MiniGUI was started.
MG_EXPORT HCURSOR GUIAPI GetSystemCursor(int csrid)
Gets the handle to a system cursor by its identifier.
MG_EXPORT HCURSOR GUIAPI GetCurrentCursor(void)
Gets the handle to the current cursor.
MG_EXPORT int GUIAPI ShowCursor(BOOL fShow)
Shows or hides cursor.
MG_EXPORT int substrlen(const char *text, int len, int delimiter, int *nr_delim)
Locates a substring delimited by one or more delimiters in the first len characters of string text...
UINT_PTR WPARAM
A type definition for the first message paramter.
DWORD_PTR DWORD
A unsigned long type definition for pointer precision.
MG_EXPORT void GUIAPI ClipCursor(const RECT *prc)
Clips the cursor range.
MG_EXPORT void GUIAPI ExitGUISafely(int exitcode)
Exits your MiniGUI application safely.
MG_EXPORT int GUIAPI SetValueToEtcFile(const char *pEtcFile, const char *pSection, const char *pKey, char *pValue)
Sets a value in a configuration file.
MG_EXPORT BOOL GUIAPI SetMouseCalibrationParameters(const POINT *src_pts, const POINT *dst_pts)
Sets the parameters for doing mouse calibration.
MG_EXPORT int GUIAPI SetValueToEtcSec(GHANDLE hSect, const char *pKey, char *pValue)
Sets the value in the etc section object.
MG_EXPORT int GUIAPI DestroyClipBoard(const char *cb_name)
Destroys a new clipboard.
MG_EXPORT char * strnchr(const char *s, size_t n, int c)
Locates character in the first n characters of string s.
MG_EXPORT const char * SysText[]
Contains all text used by MiniGUI in English.
unsigned int UINT
A type definition for unsigned integer.
MG_EXPORT DWORD GUIAPI GetShiftKeyStatus(void)
Gets status of the shift keys.
MG_EXPORT void GUIAPI TerminateGUI(int not_used)
Terminate MiniGUI.
GHANDLE HMENU
Handle to menu.
MG_EXPORT GHANDLE GUIAPI LoadEtcFile(const char *pEtcFile)
Loads an etc file into memory.
MG_EXPORT int GUIAPI SaveSectionToEtcFile(const char *pEtcFile, PETCSECTION psect)
Saves a section to an etc file.
MG_EXPORT void GUIAPI GetKeyboardState(BYTE *kbd_state)
Gets status of all keys on keyboard.
MG_EXPORT int GUIAPI RemoveSectionInEtc(GHANDLE hEtc, const char *pSection)
Removes a section in etc object.