MiniGUI API Reference (MiniGUI-Processes)
v5.0.6
A mature and proven cross-platform GUI system for embedded and smart IoT devices
|
Go to the documentation of this file.
64 #ifndef _MGUI_MINIGUI_H
65 #define _MGUI_MINIGUI_H
68 #include <sys/types.h>
79 #define ZOF_STATUS_MASK 0x0000000F
80 #define ZOF_VISIBLE 0x00000001
81 #define ZOF_DISABLED 0x00000002
82 #define ZOF_MAXIMIZED 0x00000004 // Since 5.0.0
83 #define ZOF_MINIMIZED 0x00000008 // Since 5.0.0
86 #define ZOF_GESTURE_FLAGS_MASK 0X000000F0
87 #define ZOF_GF_SWIPE_HORZ 0x00000010
88 #define ZOF_GF_SWIPE_VERT 0x00000020
91 #define ZOF_INTERNAL_FLAGS_MASK 0X000F0000
92 #define ZOF_IF_REFERENCE 0x00010000
93 #define ZOF_IF_ALWAYSTOP 0x00020000
94 #define ZOF_IF_SPECIAL 0x00040000 // Since 5.0.6
96 #define ZOF_TW_FLAG_MASK 0x00F00000
97 #define ZOF_TW_TROUNDCNS 0x00100000
98 #define ZOF_TW_BROUNDCNS 0x00200000
99 #define ZOF_TW_TBROUNDCNS 0x00300000
101 #define ZOF_TYPE_FLAG_MASK 0xFF000000
103 #define ZOF_TYPE_MASK 0xF0000000
104 #define ZOF_TYPE_NULL 0x00000000
105 #define ZOF_TYPE_DESKTOP 0x10000000 // fixed and only one.
106 #define ZOF_TYPE_LAUNCHER 0x20000000 // Since 5.0.0
107 #define ZOF_TYPE_NORMAL 0x30000000
108 #define ZOF_TYPE_HIGHER 0x40000000
109 #define ZOF_TYPE_DOCKER 0x50000000 // Since 5.0.0
110 #define ZOF_TYPE_SCREENLOCK 0x60000000 // Since 5.0.0
111 #define ZOF_TYPE_GLOBAL 0x70000000
112 #define ZOF_TYPE_TOOLTIP 0x80000000 // Since 5.0.0
113 #define ZOF_TYPE_POPUPMENU 0x90000000
115 #define ZOF_TYPE_BOTTOMMOST ZOF_TYPE_LAUNCHER
116 #define ZOF_TYPE_TOPMOST ZOF_TYPE_TOOLTIP
118 #define ZOF_TF_FLAG_MASK 0x0F000000
119 #define ZOF_TF_MAINWIN 0x01000000
120 #define ZOF_TF_TOOLWIN 0x02000000
121 #define ZOF_TF_CONTROL 0x04000000
123 #define ZNIT_NULL (ZOF_TYPE_NULL)
124 #define ZNIT_POPUPMENU (ZOF_TYPE_POPUPMENU)
125 #define ZNIT_TOOLTIP (ZOF_TYPE_TOOLTIP | ZOF_TF_MAINWIN)
127 #define ZNIT_GLOBAL_MAINWIN (ZOF_TYPE_GLOBAL | ZOF_TF_MAINWIN)
128 #define ZNIT_GLOBAL_TOOLWIN (ZOF_TYPE_GLOBAL | ZOF_TF_TOOLWIN)
129 #define ZNIT_GLOBAL_CONTROL (ZOF_TYPE_GLOBAL | ZOF_TF_CONTROL)
131 #define ZNIT_SCREENLOCK_MAINWIN (ZOF_TYPE_SCREENLOCK | ZOF_TF_MAINWIN)
132 #define ZNIT_SCREENLOCK_TOOLWIN (ZOF_TYPE_SCREENLOCK | ZOF_TF_TOOLWIN)
133 #define ZNIT_SCREENLOCK_CONTROL (ZOF_TYPE_SCREENLOCK | ZOF_TF_CONTROL)
135 #define ZNIT_DOCKER_MAINWIN (ZOF_TYPE_DOCKER | ZOF_TF_MAINWIN)
136 #define ZNIT_DOCKER_TOOLWIN (ZOF_TYPE_DOCKER | ZOF_TF_TOOLWIN)
137 #define ZNIT_DOCKER_CONTROL (ZOF_TYPE_DOCKER | ZOF_TF_CONTROL)
139 #define ZNIT_HIGHER_MAINWIN (ZOF_TYPE_HIGHER | ZOF_TF_MAINWIN)
140 #define ZNIT_HIGHER_TOOLWIN (ZOF_TYPE_HIGHER | ZOF_TF_TOOLWIN)
141 #define ZNIT_HIGHER_CONTROL (ZOF_TYPE_HIGHER | ZOF_TF_CONTROL)
143 #define ZNIT_NORMAL_MAINWIN (ZOF_TYPE_NORMAL | ZOF_TF_MAINWIN)
144 #define ZNIT_NORMAL_TOOLWIN (ZOF_TYPE_NORMAL | ZOF_TF_TOOLWIN)
145 #define ZNIT_NORMAL_CONTROL (ZOF_TYPE_NORMAL | ZOF_TF_CONTROL)
147 #define ZNIT_LAUNCHER_MAINWIN (ZOF_TYPE_LAUNCHER | ZOF_TF_MAINWIN)
148 #define ZNIT_LAUNCHER_TOOLWIN (ZOF_TYPE_LAUNCHER | ZOF_TF_TOOLWIN)
149 #define ZNIT_LAUNCHER_CONTROL (ZOF_TYPE_LAUNCHER | ZOF_TF_CONTROL)
151 #define ZNIT_DESKTOP (ZOF_TYPE_DESKTOP)
153 #define ZNIF_VISIBLE (ZOF_VISIBLE)
154 #define ZNIF_DISABLED (ZOF_DISABLED)
155 #define ZNIF_MAXIMIZED (ZOF_MAXIMIZED)
156 #define ZNIF_MINIMIZED (ZOF_MINIMIZED)
159 #define ZNIT_TOPMOST_MAINWIN (ZNIT_HIGHER_MAINWIN)
160 #define ZNIT_TOPMOST_TOOLWIN (ZNIT_HIGHER_TOOLWIN)
161 #define ZNIT_TOPMOST_CONTROL (ZNIT_HIGHER_CONTROL)
163 typedef struct _CalcPosInfo {
188 #define g_rcScr (GetScreenRect())
198 #define g_rcDesktop g_rcScr
202 #ifdef _MGRM_PROCESSES
232 #define mgIsServer (IsServer())
259 #define LEN_LAYER_NAME 15
265 #define LEN_CLIENT_NAME 15
271 #define INV_LAYER_HANDLE 0
399 MG_EXPORT
int GUIAPI
InitGUI (
int argc,
const char *argv[]);
425 #define NAME_SELF_LAYER ""
431 #define NAME_TOPMOST_LAYER ""
437 #define NAME_DEF_LAYER "mginit"
439 #ifdef _MGRM_PROCESSES
494 const char* client_name,
495 int max_nr_highers,
int max_nr_normals);
542 GHANDLE layer_handle,
const char* layer_name);
562 GHANDLE layer_handle,
const char* layer_name);
590 GHANDLE layer_handle,
const char* layer_name);
660 #define LCO_NEW_CLIENT 1
661 #define LCO_DEL_CLIENT 2
671 #define LCO_NEW_LAYER 1
672 #define LCO_DEL_LAYER 2
673 #define LCO_JOIN_CLIENT 3
674 #define LCO_REMOVE_CLIENT 4
675 #define LCO_TOPMOST_CHANGED 5
676 #define LCO_ACTIVE_CHANGED 6
688 #define ZNOP_ALLOCATE 1
690 #define ZNOP_MOVE2TOP 3
693 #define ZNOP_MOVEWIN 6
694 #define ZNOP_SETACTIVE 7
696 #define ZNOP_ENABLEWINDOW 11
697 #define ZNOP_DISABLEWINDOW 12
698 #define ZNOP_STARTDRAG 13
699 #define ZNOP_CANCELDRAG 14
700 #define ZNOP_CHANGECAPTION 15
701 #define ZNOP_REGIONCHANGED 16
702 #define ZNOP_COMPOSITINGCHANGED 17
703 #define ZNOP_ICONCHANGED 18
844 int def_nr_highers,
int def_nr_normals);
875 int max_nr_highers,
int max_nr_normals);
1085 #ifdef _MGSCHEMA_COMPOSITING
1164 #ifdef _MGSCHEMA_COMPOSITING
1228 MG_Layer* layer,
int idx_znode,
void** priv_data,
BOOL lock);
1252 #ifdef _MGSCHEMA_COMPOSITING
1304 MG_EXPORT
const ZNODEHEADER* GUIAPI ServerGetPopupMenuZNodeHeader (
1305 int idx_znode,
void** priv_data,
BOOL lock);
1329 #ifdef _MGSCHEMA_COMPOSITING
1340 #define RGN_OP_MASK 0x000F
1341 #define RGN_OP_SET 0x0000
1342 #define RGN_OP_INCLUDE 0x0001
1343 #define RGN_OP_EXCLUDE 0x0002
1344 #define RGN_OP_FLAG_ABS 0x0010
1439 int idx_znode,
void* priv_data);
1496 int op_code,
void* op_data,
BOOL notify);
1567 #ifdef _MGSCHEMA_COMPOSITING
1573 struct _CompositorCtxt;
1574 typedef struct _CompositorCtxt CompositorCtxt;
1587 CompositorCtxt* (*initialize) (
const char* name);
1614 int zidx,
void* data);
1621 DWORD zt_type,
int first_for_type,
int cli, CALCPOSINFO* info);
1680 DWORD cause_type,
const RECT* rc_dirty);
1740 int zidx,
const RECT* rc_org_bound);
1748 int zidx,
const RECT* rc_org);
1755 int nr_layers,
void* combine_param);
1778 #define FCM_HORIZONTAL 0x0000
1779 #define FCM_VERTICAL 0x0001
1780 #define FCM_METHOD_MASK 0x00FF
1781 #define FCM_SCALE 0x0100
1858 #define LEN_COMPOSITOR_NAME 15
1859 #define COMPSOR_NAME_DEFAULT "default"
1860 #define COMPSOR_NAME_FALLBACK "fallback"
1882 const char* name, CompositorCtxt** ctxt);
1902 #define COMPSOR_OPS_VERSION 2
1961 #define MAX_SYS_REQID 0x0023
1969 #define MAX_REQID 0x0030
2015 MG_EXPORT
int GUIAPI ClientRequestEx2 (
const REQUEST* request,
2016 const void* ex_data,
size_t ex_data_len,
int fd_to_send,
2017 void* result,
size_t len_rslt,
int* fd_received);
2046 const void* ex_data,
int ex_data_len,
2047 void* result,
int len_rslt)
2049 return ClientRequestEx2 (request, ex_data, ex_data_len, -1,
2050 result, len_rslt,
NULL);
2079 void* result,
int len_rslt)
2122 const void* reply,
int len,
int fd_to_send);
2156 typedef int (*
REQ_HANDLER) (
int cli,
int clifd,
void* buff,
size_t len);
2168 void* buff,
size_t len,
int fd_received);
2339 MG_EXPORT
int serv_accept (
int listenfd, pid_t *pidptr, uid_t *uidptr);
2361 MG_EXPORT
int cli_conn (
const char* name,
char project);
2363 #define SOCKERR_IO -1
2364 #define SOCKERR_CLOSED -2
2365 #define SOCKERR_INVARG -3
2366 #define SOCKERR_TIMEOUT -4
2367 #define SOCKERR_OK 0
2397 MG_EXPORT ssize_t sock_write_t (
int fd,
const void* buff,
size_t count,
2427 MG_EXPORT ssize_t
sock_read_t (
int fd,
void* buff,
size_t count,
2436 #define sock_write(fd, buff, count) sock_write_t(fd, buff, count, 0)
2444 #define sock_read(fd, buff, count) sock_read_t(fd, buff, count, 0)
2498 #define ReinitDesktop() ReinitDesktopEx (TRUE)
2516 #ifdef _USE_MINIGUIENTRY
2517 #define main_entry minigui_entry
2518 int minigui_entry (
int args,
const char* arg[]);
2520 #define main_entry main
2540 #define MiniGUIMain \
2541 MiniGUIAppMain (int args, const char* argv[]); \
2542 int main_entry (int args, const char* argv[]) \
2545 if (InitGUI (args, argv) != 0) { \
2548 iRet = MiniGUIAppMain (args, argv); \
2549 TerminateGUI (iRet); \
2559 #define IDM_DTI_FIRST (300)
2565 void* (*init) (
HDC dc_desktop);
2572 HDC dc_desktop,
const RECT* inv_rc);
2584 HMENU hmenu,
int start_pos);
2672 #ifndef _MGRM_PROCESSES
2674 #define DUMMY_LAYER_HANDLE (GHANDLE)(-1)
2690 const char* client_name,
int max_nr_highers,
int max_nr_normals)
2692 return DUMMY_LAYER_HANDLE;
2699 #ifdef _MGHAVE_MOUSECALIBRATE
2736 const POINT* dst_pts);
2763 #ifdef _MGMISC_ABOUTDLG
2770 #ifdef _MGRM_THREADS
2862 #define ETC_MAXLINE 1024
2868 #define ETC_FILENOTFOUND -1
2873 #define ETC_SECTIONNOTFOUND -2
2878 #define ETC_KEYNOTFOUND -3
2883 #define ETC_TMPFILEFAILED -4
2888 #define ETC_FILEIOFAILED -5
2893 #define ETC_INTCONV -6
2898 #define ETC_INVALIDOBJ -7
2903 #define ETC_READONLYOBJ -8
2938 #ifndef _MGINCORE_RES
2990 const char* pSection,
const char* pKey,
char* pValue,
int iLen);
3030 const char* pSection,
const char* pKey,
int* value);
3058 const char* pSection,
const char* pKey,
char* pValue);
3081 const char* pSection);
3182 const char* pKey,
char* pValue,
int iLen);
3192 const char* pKey,
int* pValue);
3204 #define SetValueToEtc(hEtc, pSection, pKey, pValue) \
3205 GetValueFromEtc(hEtc, pSection, pKey, pValue, -1)
3225 const char* pSection,
BOOL bCreateNew);
3253 const char* pKey,
char* pValue,
int iLen);
3279 const char* pKey,
int* pValue);
3292 const char* pKey,
char* pValue);
3317 extern MG_EXPORT
GHANDLE hMgEtc;
3329 const char *pKey,
char *pValue,
int iLen)
3331 #ifndef _MGINCORE_RES
3348 static inline int GetMgEtcIntValue (
const char *pSection,
3349 const char* pKey,
int *value)
3351 #ifndef _MGINCORE_RES
3361 #ifdef _MGHAVE_CLIPBOARD
3372 #define LEN_CLIPBOARD_NAME 15
3377 #define NR_CLIPBOARDS 4
3383 #define CBNAME_TEXT ("text")
3396 #define CBERR_BADNAME 1
3402 #define CBERR_NOMEM 2
3408 #define CBOP_NORMAL 0
3413 #define CBOP_APPEND 1
3432 MG_EXPORT
int GUIAPI
CreateClipBoard (
const char* cb_name,
size_t size);
3473 void* data,
size_t n,
int cbop);
3505 void* data,
size_t n);
3525 int index,
unsigned char*
byte);
3556 MG_EXPORT
void GUIAPI
Ping (
void);
3580 MG_EXPORT
void GUIAPI
Tone (
int frequency_hz,
int duration_ms);
3643 MG_EXPORT
char* GUIAPI
FixStrDup (
const char* str);
3657 MG_EXPORT
void GUIAPI
FreeFixStr (
char* str);
3666 #ifdef _MGHAVE_CURSOR
3704 #ifdef _MGSCHEMA_COMPOSITING
3728 int hotspot_x,
int hotspot_y);
3753 int hotspot_x,
int hotspot_y);
3783 const BYTE* pANDBits,
const BYTE* pXORBits,
int colornum);
3891 #ifdef _MGSCHEMA_COMPOSITING
3894 int hotspot_x,
int hotspot_y) {
3900 int hotspot_x,
int hotspot_y) {
3908 const BYTE* pANDBits,
const BYTE* pXORBits,
int colornum) {
3930 #define MAX_SYSCURSORINDEX 22
3938 #define IDC_PENCIL 2
3944 #define IDC_SIZENWSE 5
3946 #define IDC_SIZENESW 6
3948 #define IDC_SIZEWE 7
3950 #define IDC_SIZENS 8
3952 #define IDC_UPARROW 9
3962 #define IDC_RARROW 14
3964 #define IDC_COLOMN 15
3970 #define IDC_NODROP 18
3972 #define IDC_HAND_POINT 19
3974 #define IDC_HAND_SELECT 20
3976 #define IDC_SPLIT_HORZ 21
3978 #define IDC_SPLIT_VERT 22
4034 #ifdef _MGHAVE_CURSOR
4113 #define SetCursor(hcsr) SetCursorEx (hcsr, FALSE)
4130 #define SetDefaultCursor(hcsr) SetCursorEx (hcsr, TRUE)
4235 #define IDS_MGST_WINDOW 0
4241 #define IDS_MGST_START 1
4247 #define IDS_MGST_REFRESH 2
4253 #define IDS_MGST_CLOSEALLWIN 3
4259 #define IDS_MGST_ENDSESSION 4
4265 #define IDS_MGST_OPERATIONS 5
4271 #define IDS_MGST_MINIMIZE 6
4277 #define IDS_MGST_MAXIMIZE 7
4283 #define IDS_MGST_RESTORE 8
4289 #define IDS_MGST_CLOSE 9
4295 #define IDS_MGST_OK 10
4301 #define IDS_MGST_NEXT 11
4307 #define IDS_MGST_CANCEL 12
4313 #define IDS_MGST_PREV 13
4319 #define IDS_MGST_YES 14
4325 #define IDS_MGST_NO 15
4331 #define IDS_MGST_ABORT 16
4337 #define IDS_MGST_RETRY 17
4343 #define IDS_MGST_IGNORE 18
4349 #define IDS_MGST_ABOUTMG 19
4355 #define IDS_MGST_OPENFILE 20
4361 #define IDS_MGST_SAVEFILE 21
4367 #define IDS_MGST_COLORSEL 22
4373 #define IDS_MGST_SWITCHLAYER 23
4379 #define IDS_MGST_DELLAYER 24
4385 #define IDS_MGST_ERROR 25
4391 #define IDS_MGST_LOGO 26
4397 #define IDS_MGST_CURRPATH 27
4403 #define IDS_MGST_FILE 28
4409 #define IDS_MGST_LOCATION 29
4415 #define IDS_MGST_UP 30
4421 #define IDS_MGST_NAME 31
4427 #define IDS_MGST_SIZE 32
4433 #define IDS_MGST_ACCESSMODE 33
4439 #define IDS_MGST_LASTMODTIME 34
4445 #define IDS_MGST_OPEN 35
4451 #define IDS_MGST_FILENAME 36
4457 #define IDS_MGST_FILETYPE 37
4463 #define IDS_MGST_SHOWHIDEFILE 38
4469 #define IDS_MGST_NOTFOUND 39
4475 #define IDS_MGST_NR 40
4481 #define IDS_MGST_NW 41
4487 #define IDS_MGST_INFO 42
4493 #define IDS_MGST_R 43
4499 #define IDS_MGST_W 44
4505 #define IDS_MGST_WR 45
4511 #define IDS_MGST_SAVE 46
4517 #define IDS_MGST_FILEEXIST 47
4519 #define IDS_MGST_MAXNUM 47
4540 MG_EXPORT
const char* GUIAPI
GetSysText (
unsigned int id);
4608 extern MG_EXPORT
const char*
SysText [];
4623 #ifdef _MGCHARSET_UNICODE
4643 extern MG_EXPORT
const char** GUIAPI
GetSysTextInUTF8 (
const char* language);
4667 MG_EXPORT
char*
strnchr (
const char* s,
size_t n,
int c);
4685 MG_EXPORT
int substrlen (
const char* text,
int len,
int delimiter,
4847 MG_EXPORT
void *
mg_slice_copy(
size_t block_size,
const void *mem_block);
4867 MG_EXPORT
void mg_slice_free(
size_t block_size,
void *mem_block);
4892 void *mem_chain,
size_t next_offset);
4917 #define mg_slice_new(type) ((type*)mg_slice_alloc(sizeof (type)))
4944 #define mg_slice_new0(type) ((type*)mg_slice_alloc0(sizeof (type)))
4980 #define mg_slice_dup(type, mem) \
4981 (1 ? (type*) mg_slice_copy (sizeof (type), (mem)) \
4982 : ((void) ((type*) 0 == (mem)), (type*) 0))
5006 #define mg_slice_delete(type, mem) \
5008 if (1) mg_slice_free (sizeof (type), (mem)); \
5009 else (void) ((type*) 0 == (mem)); \
5036 #define mg_slice_delete_chain(type, mem_chain, next) \
5038 if (1) mg_slice_free_chain_with_offset (sizeof (type), \
5039 (mem_chain), G_STRUCT_OFFSET (type, next)); \
5040 else (void) ((type*) 0 == (mem_chain)); \
5043 #ifdef _MGDEVEL_MODE
5044 MG_EXPORT
void mg_slice_debug_tree_statistics(
void);
MG_EXPORT void GUIAPI GetClipCursor(RECT *prc)
Get the current cursor clipping rectangle.
MG_EXPORT BOOL GUIAPI ServerSetPopupMenuZNodePrivateData(int idx_znode, void *priv_data)
Set the private data of the z-node of the specific popup menu.
MG_EXPORT BOOL GUIAPI ServerSetWinZNodePrivateData(MG_Layer *layer, int idx_znode, void *priv_data)
Set the private data of the z-node of a specific window in the specified layer.
MG_EXPORT void GUIAPI GetOriginalMousePosition(int *x, int *y)
Get the original mouse position.
void(* keyboard_handler)(void *context, int message, WPARAM wParam, LPARAM lParam)
MG_EXPORT void GUIAPI ExitGUISafely(int exitcode)
Exits your MiniGUI application safely.
void(* terminate)(CompositorCtxt *ctxt)
MG_EXPORT int serv_accept(int listenfd, pid_t *pidptr, uid_t *uidptr)
Waits for a client connection to arrive, and accept it.
#define NULL
A value indicates null pointer.
void(* ON_UNLOCK_CLIENT_REQ)(void)
Type of client request unlock callback.
MG_EXPORT int GUIAPI GetClipBoardByte(const char *cb_name, int index, unsigned char *byte)
Get a byte from a clipboard.
MG_EXPORT HCURSOR GUIAPI GetCurrentCursor(void)
Get the handle to the current cursor.
MG_EXPORT BOOL GUIAPI ServerRegisterCompositor(const char *name, const CompositorOps *ops)
Register a new compositor.
void(* on_showing_win)(CompositorCtxt *ctxt, MG_Layer *layer, int zidx)
#define LEN_CLIENT_NAME
The maximum length of name of client in MiniGUI-Processes.
DWORD_PTR DWORD
A unsigned long type definition for pointer precision.
MG_EXPORT GHANDLE GUIAPI FindSectionInEtc(GHANDLE hEtc, const char *pSection, BOOL bCreateNew)
Finds/Creates a section from an etc object.
MG_EXPORT BOOL GUIAPI SetMouseCalibrationParameters(const POINT *src_pts, const POINT *dst_pts)
Set the parameters for doing mouse calibration.
void(* calc_mainwin_pos)(CompositorCtxt *ctxt, MG_Layer *layer, DWORD zt_type, int first_for_type, int cli, CALCPOSINFO *info)
MG_EXPORT BOOL GUIAPI GetKeyStatus(UINT uKey)
Get a key or a mouse button status.
void(* on_raised_win)(CompositorCtxt *ctxt, MG_Layer *layer, int zidx)
const CompositorOps * __ex_compositor_get(const char *name, const CompositorOps *fallback_ops, int *version)
GHANDLE HWND
Handle to main window or control.
MG_EXPORT int GUIAPI ServerGetTopmostZNodeOfType(MG_Layer *layer, DWORD type, int *cli)
Get the topmost z-node in the specified layer for the specific window type from the server.
MG_EXPORT MG_Client * mgClients
The pointer to the array contains all clients' information.
MG_EXPORT MG_Layer * mgLayers
The pointer to the layer list.
GHANDLE HDC
Handle to device context.
const MG_EXPORT char ** local_SysText
The pointer to the current localized system text array.
MG_EXPORT GHANDLE GUIAPI JoinLayer(const char *layer_name, const char *client_name, int max_nr_highers, int max_nr_normals)
Joins to a layer.
int(* ON_TRYLOCK_CLIENT_REQ)(void)
Type of client request lock callback.
MG_EXPORT HWND GUIAPI OpenAboutDialog(HWND hHosting)
Opens or actives the 'About MiniGUI' dialog.
MG_EXPORT DWORD GUIAPI GetTickCount(void)
Retrieve the tick counts that have elapsed since MiniGUI was started.
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 HCURSOR GUIAPI GetSystemCursor(int csrid)
Get the handle to a system cursor by its identifier.
char name[LEN_LAYER_NAME+1]
const MG_EXPORT char * SysText[]
Contains all text used by MiniGUI in English.
BOOL(* merge_dirty_wpp)(CompositorCtxt *ctxt, MG_Layer *layer)
MG_EXPORT void GUIAPI GetKeyboardState(BYTE *kbd_state)
Get status of all keys on keyboard.
void(* transit_to_layer)(CompositorCtxt *ctxt, MG_Layer *to_layer)
MG_EXPORT int GUIAPI RemoveSectionInEtcFile(const char *pEtcFile, const char *pSection)
Removes a section in an etc file.
MG_EXPORT int GUIAPI GetIntValueFromEtcSec(GHANDLE hSect, const char *pKey, int *pValue)
Get an integer value from an etc section object.
MG_EXPORT void * mgSharedRes
Contains the pointer to the shared resource of MiniGUI-Processes.
MG_EXPORT DWORD GUIAPI GetShiftKeyStatus(void)
Get status of the shift keys.
MG_EXPORT BOOL GUIAPI ServerGetPopupMenuZNodeRegion(int idx_znode, DWORD rgn_ops, CLIPRGN *dst_rgn)
Get the z-node region of a specific popup menu in the current layer.
const MG_EXPORT char *GUIAPI GetSysText(unsigned int id)
Translates system text to localized text.
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.
MG_EXPORT BOOL GUIAPI RegisterRequestHandlerV1(int req_id, REQ_HANDLER_V1 your_handler_v1)
Registers a customized extended request handler of version 1.
UINT_PTR WPARAM
A type definition for the first message paramter.
void(* on_showing_ppp)(CompositorCtxt *ctxt, int zidx)
PVOID GHANDLE
General handle.
unsigned int UINT
A type definition for unsigned integer.
unsigned char BYTE
A type definition for an 8-bit unsigned character (byte).
MG_EXPORT int GUIAPI CreateClipBoard(const char *cb_name, size_t size)
Creates a new clipboard.
MG_EXPORT char *GUIAPI FixStrDup(const char *str)
Duplicates a length-fixed string.
unsigned int(* composite_layers)(CompositorCtxt *ctxt, MG_Layer *layers[], int nr_layers, void *combine_param)
MG_EXPORT size_t GUIAPI GetClipBoardDataLen(const char *cb_name)
Get the length of the data of a clipboard.
MG_EXPORT MG_Layer *GUIAPI ServerCreateLayer(const char *layer_name, int max_nr_highers, int max_nr_normals)
Create a new layer from the server.
struct GlobalRes * global_res
MG_EXPORT char * strnchr(const char *s, size_t n, int c)
Locates character in the first n characters of string s.
MG_EXPORT HCURSOR GUIAPI CopyCursor(HCURSOR hcsr)
Copies a cursor object.
GHANDLE HMENU
Handle to menu.
MG_EXPORT ON_TRYLOCK_CLIENT_REQ OnTrylockClientReq
Set to a function to lock a client request.
MG_EXPORT MG_Layer * mgTopmostLayer
The pointer to the topmost layer.
MG_EXPORT size_t mgSizeRes
Contains the length of shared resource of MiniGUI-Processes.
MG_EXPORT int GUIAPI SaveEtcToFile(GHANDLE hEtc, const char *file_name)
Saves an ETC object into a file.
void(* on_hiding_win)(CompositorCtxt *ctxt, MG_Layer *layer, int zidx)
void(* purge_ppp_data)(CompositorCtxt *ctxt, int zidx, void *data)
MG_EXPORT BOOL GUIAPI DestroyCursor(HCURSOR hcsr)
Destroys a cursor object.
MG_EXPORT BOOL GUIAPI ServerMoveClientToLayer(int cli, MG_Layer *dst_layer)
Move a client to the specified layer.
MG_EXPORT int GUIAPI UnloadEtcFile(GHANDLE hEtc)
Unloads an etc file.
MG_EXPORT void GUIAPI DesktopUpdateAllWindow(void)
Update all visible windows on the desktop.
struct _CombParamsFallback COMBPARAMS_FALLBACK
MG_EXPORT int serv_listen(const char *name)
Creates a listen socket.
MG_EXPORT REQ_HANDLER GUIAPI GetRequestHandler(int req_id)
Get the request handler by request identifier.
void(* on_layer_op)(CompositorCtxt *ctxt, int layer_op, MG_Layer *layer, MG_Client *client)
MG_EXPORT ON_LOCK_CLIENT_REQ OnLockClientReq
Set to a function to lock a client request.
const MG_EXPORT char **GUIAPI GetSysTextInUTF8(const char *language)
Get the localized system text array in UTF-8 for a specified language.
const MG_EXPORT char *GUIAPI ServerGetCurrentCompositor(const CompositorOps **ops, CompositorCtxt **ctxt)
Get the name and the context of the current compositor.
MG_EXPORT char *GUIAPI FixStrAlloc(int len)
Allocates a buffer for a length-fixed string.
struct _ZNODEHEADER ZNODEHEADER
MG_EXPORT ON_CHANGE_LAYER OnChangeLayer
Set to a function to handle events of layers.
MG_EXPORT void GUIAPI Tone(int frequency_hz, int duration_ms)
Makes a tone.
MG_EXPORT ON_NEW_DEL_CLIENT OnNewDelClient
Set to a function to handle a comming in (going away) connection of client.
MG_EXPORT void *GUIAPI GetRequestHandlerEx(int req_id, int *version)
Get the request handler and the version by request identifier.
int(* REQ_HANDLER)(int cli, int clifd, void *buff, size_t len)
The prototype of a request handler (version 0).
MG_EXPORT BOOL GUIAPI ServerReleasePopupMenuZNodeHeader(int idx_znode)
Release the lock of the z-node header of the specific popup menu.
int BOOL
A type definition for boolean value.
MG_EXPORT int GUIAPI GetIntValueFromEtcFile(const char *pEtcFile, const char *pSection, const char *pKey, int *value)
Get integer value from a configuration file.
struct _MG_Layer MG_Layer
MG_EXPORT BOOL GUIAPI ServerSetTopmostLayer(MG_Layer *layer)
Set topmost layer from the server.
MG_EXPORT int GUIAPI ServerSendReplyEx(int clifd, const void *reply, int len, int fd_to_send)
Sends a reply to the client.
MG_EXPORT int GUIAPI InitGUI(int argc, const char *argv[])
Initialize MiniGUI.
MG_EXPORT char ETCFILEPATH[]
The path name of MiniGUI configuration file.
MG_EXPORT int GUIAPI GetValueFromEtcSec(GHANDLE hSect, const char *pKey, char *pValue, int iLen)
Get value from an etc section object.
MG_EXPORT HCURSOR GUIAPI GetDefaultCursor(void)
Get the default cursor.
MG_EXPORT int mgClientSize
The current size of the array mgClients.
MG_EXPORT int GUIAPI GetValueFromEtcFile(const char *pEtcFile, const char *pSection, const char *pKey, char *pValue, int iLen)
Get value from a configuration file.
MG_EXPORT BOOL GUIAPI ServerDoZNodeOperation(MG_Layer *layer, int idx_znode, int op_code, void *op_data, BOOL notify)
Does an operation on the z-node in the specified layer from the server.
MG_EXPORT RECT GUIAPI GetScreenRect(void)
Return the rectangle of the physical screen.
const MG_EXPORT CompositorOps *GUIAPI ServerGetCompositorOps(const char *name)
Get the operations of a specific compositor.
MG_EXPORT ssize_t sock_read_t(int fd, void *buff, size_t count, DWORD timeout)
Reads data from socket.
MG_EXPORT BOOL GUIAPI ServerGetWinZNodeRegion(MG_Layer *layer, int idx_znode, DWORD rgn_ops, CLIPRGN *dst_rgn)
Get the z-node region of a specific window in the specified layer.
MG_EXPORT void mg_slice_free(size_t block_size, void *mem_block)
Free a block of memory.
MG_EXPORT REQ_HANDLER_V1 GUIAPI GetRequestHandlerV1(int req_id)
Get the extended request handler by a request identifier.
MG_EXPORT BOOL GUIAPI ServerStartup(int nr_globals, int def_nr_highers, int def_nr_normals)
Initializes the server of MiniGUI-Processes.
char name[LEN_CLIENT_NAME+1]
void(* on_moved_win)(CompositorCtxt *ctxt, MG_Layer *layer, int zidx, const RECT *rc_org)
void(* deinit)(void *context)
MG_EXPORT size_t GUIAPI GetClipBoardData(const char *cb_name, void *data, size_t n)
Get the data of a clipboard.
MG_EXPORT HCURSOR GUIAPI LoadCursorFromFile(const char *filename)
Loads a cursor from a M$ Windows cursor file.
MG_EXPORT BOOL GUIAPI DeleteLayer(BOOL handle_name, GHANDLE layer_handle, const char *layer_name)
Deletes a specific layer.
void(* on_changed_ct)(CompositorCtxt *ctxt, MG_Layer *layer, int zidx)
MG_EXPORT int cli_conn(const char *name, char project)
Used by clients to connect to a server.
MG_EXPORT HCURSOR GUIAPI LoadCursorFromPNGMem(const void *area, size_t size, int hotspot_x, int hotspot_y)
Loads a cursor from a memory area in PNG layout.
MG_EXPORT BOOL GUIAPI ServerGetZNodeInfo(MG_Layer *layer, int idx_znode, ZNODEINFO *znode_info)
Get the z-node information in the specified layer from the server.
MG_EXPORT int GUIAPI SetClipBoardData(const char *cb_name, void *data, size_t n, int cbop)
Set the data of a clipboard.
MG_EXPORT int GUIAPI GetSockFD2Server(void)
Get the file descriptor of the socket connected to the server.
MG_EXPORT char * strtrimall(char *src)
Deletes all space characters.
MG_EXPORT DESKTOPOPS *GUIAPI SetCustomDesktopOperationSet(DESKTOPOPS *usr_dsk_ops)
Set customer desktop operation set.
MG_EXPORT int GUIAPI ShowCursor(BOOL fShow)
Shows or hides cursor.
void(* ON_ZNODE_OPERATION)(int op, int cli, int idx_znode)
Type of z-node operation callback.
void(* on_closed_menu)(CompositorCtxt *ctxt, const RECT *rc_bound)
MG_EXPORT int GUIAPI GetValueFromEtc(GHANDLE hEtc, const char *pSection, const char *pKey, char *pValue, int iLen)
Get value from a configuration etc object.
void(* desktop_menucmd_handler)(void *context, int id)
MG_EXPORT void *GUIAPI GetOriginalTermIO(void)
Get termios structure of the original terminal before initializing MiniGUI.
BOOL(* reset_dirty_region)(CompositorCtxt *ctxt, MG_Layer *layer)
static int GetMgEtcValue(const char *pSection, const char *pKey, char *pValue, int iLen)
Get value from MiniGUI configuration etc object.
MG_EXPORT void GUIAPI MiniGUIPanic(int exitcode)
The panic of MiniGUI application.
void(* customize_desktop_menu)(void *context, HMENU hmenu, int start_pos)
MG_EXPORT HCURSOR GUIAPI LoadCursorFromPNGFile(const char *filename, int hotspot_x, int hotspot_y)
Loads a cursor from a PNG file.
MG_EXPORT BOOL GUIAPI ServerReleaseWinZNodeHeader(MG_Layer *layer, int idx_znode)
Release z-node header of a specific window in the specified layer.
int(* REQ_HANDLER_V1)(int cli, int clifd, void *buff, size_t len, int fd_received)
The prototype of an extended request handler (version 1).
MG_EXPORT void * mg_slice_alloc0(size_t block_size)
Allocate a slice memory and initialize the memory to zero.
MG_EXPORT MG_Layer * mgDefaultLayer
The pointer to the default layer.
MG_EXPORT void GUIAPI SetCursorPos(int x, int y)
Set position of the current cursor.
void(* ON_NEW_DEL_CLIENT)(int op, int cli)
Type of client event callback.
MG_EXPORT void GUIAPI TerminateGUI(int not_used)
Terminate MiniGUI.
void(* on_hiding_ppp)(CompositorCtxt *ctxt, int zidx)
BOOL(* merge_dirty_win)(CompositorCtxt *ctxt, MG_Layer *layer, int zidx)
MG_EXPORT void * mg_slice_alloc(size_t block_size)
Allocate a slice memory.
MG_EXPORT int GUIAPI GetIntValueFromEtc(GHANDLE hEtc, const char *pSection, const char *pKey, int *pValue)
Get the integer value from a configuration etc object.
MG_EXPORT int GUIAPI ServerGetPopupMenusCount(void)
Get the number of popup menus shown on the screen.
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 GHANDLE GUIAPI GetLayerInfo(const char *layer_name, int *nr_clients, BOOL *is_topmost, int *cli_active)
Get information of a layer by a client.
MG_EXPORT HCURSOR GUIAPI LoadCursorFromMem(const void *area)
Loads a cursor from a memory area.
MG_EXPORT ON_ZNODE_OPERATION OnZNodeOperation
Set to a function to handle events of z-node.
void(* purge_win_data)(CompositorCtxt *ctxt, MG_Layer *layer, int zidx, void *data)
MG_EXPORT void GUIAPI UpdateTopmostLayer(const RECT *dirty_rc)
Update topmost layer.
void(* on_changed_rgn)(CompositorCtxt *ctxt, MG_Layer *layer, int zidx, const RECT *rc_org_bound)
static int ClientRequest(const REQUEST *request, void *result, int len_rslt)
Sends a request to the server and wait reply.
MG_EXPORT BOOL GUIAPI IsServer(void)
Check whether the current process is the server of MiniGUI-Processes.
MG_EXPORT void GUIAPI DisableClientsOutput(void)
Disable all clients output.
MG_EXPORT int GUIAPI DestroyClipBoard(const char *cb_name)
Destroys a new clipboard.
static int GUIAPI ServerSendReply(int clifd, const void *reply, int len)
Sends the reply to the client.
#define LEN_LAYER_NAME
The maximum length of name of layer in MiniGUI-Processes.
MG_EXPORT BOOL GUIAPI ReinitDesktopEx(BOOL init_sys_text)
Re-initializes the desktop.
MG_EXPORT BOOL GUIAPI ServerDeleteLayer(MG_Layer *layer)
Delete a layer from the server.
MG_EXPORT void GUIAPI FreeFixStr(char *str)
Frees a length-fixed string.
MG_EXPORT int GUIAPI GetClientByPID(int pid)
Returns the client identifier from PID of a client.
MG_EXPORT int GUIAPI SetValueToEtcFile(const char *pEtcFile, const char *pSection, const char *pKey, char *pValue)
Set a value in a configuration file.
MG_EXPORT void GUIAPI GetCursorPos(POINT *ppt)
Get position of the current cursor.
int(* ON_LOCK_CLIENT_REQ)(void)
Type of client request lock callback.
void(* on_maximizing_win)(CompositorCtxt *ctxt, MG_Layer *layer, int zidx)
static int GUIAPI ClientRequestEx(const REQUEST *request, const void *ex_data, int ex_data_len, void *result, int len_rslt)
Sends a request to the server and wait reply.
MG_EXPORT BOOL GUIAPI RegisterRequestHandler(int req_id, REQ_HANDLER your_handler)
Registers a customized request handler of version 0.
void(* on_dirty_screen)(CompositorCtxt *ctxt, MG_Layer *layer, DWORD cause_type, const RECT *rc_dirty)
const MG_EXPORT ZNODEHEADER *GUIAPI ServerGetWinZNodeHeader(MG_Layer *layer, int idx_znode, void **priv_data, BOOL lock)
Get the pointer to the z-node header of a specific window in the specified layer.
MG_EXPORT BOOL GUIAPI SetTopmostLayer(BOOL handle_name, GHANDLE layer_handle, const char *layer_name)
Brings a layer to be the topmost one.
MG_EXPORT void GUIAPI Ping(void)
Makes a beep sound.
void(* mouse_handler)(void *context, int message, WPARAM wParam, LPARAM lParam)
void(* refresh)(CompositorCtxt *ctxt)
const MG_EXPORT CompositorOps *GUIAPI ServerSelectCompositor(const char *name, CompositorCtxt **ctxt)
Select a compositor as the current compositor.
MG_EXPORT GHANDLE GUIAPI LoadEtcFile(const char *pEtcFile)
Loads an etc file into memory.
MG_EXPORT int GUIAPI SetValueToEtcSec(GHANDLE hSect, const char *pKey, char *pValue)
Set the value in the etc section object.
MG_EXPORT BOOL GUIAPI SetTopmostClient(int cli)
Set topmost layer by a client identifier.
#define TRUE
TRUE value, defined as 1 by MiniGUI.
struct _DESKTOPOPS DESKTOPOPS
UINT_PTR LPARAM
A type definition for the second message paramter.
MG_EXPORT int GUIAPI RemoveSectionInEtc(GHANDLE hEtc, const char *pSection)
Removes a section in etc object.
void(* ON_CHANGE_LAYER)(int op, MG_Layer *layer, MG_Client *client)
Type of layer change event callback.
MG_EXPORT void * mg_slice_copy(size_t block_size, const void *mem_block)
Allocate and copy a slice.
struct _CompositorOps CompositorOps
BOOL(* merge_dirty_ppp)(CompositorCtxt *ctxt, MG_Layer *layer, int zidx)
GHANDLE HCURSOR
Handle to cursor.
void(* paint_desktop)(void *context, HDC dc_desktop, const RECT *inv_rc)
MG_EXPORT int GUIAPI ServerGetPrevZNode(MG_Layer *layer, int idx_znode, int *cli)
Get the previous z-node in the specified layer from the server.
BOOL(* refresh_dirty_region)(CompositorCtxt *ctxt, MG_Layer *layer)
MG_EXPORT HCURSOR GUIAPI SetCursorEx(HCURSOR hcsr, BOOL set_def)
Changes the current cursor.
MG_EXPORT int GUIAPI SaveSectionToEtcFile(const char *pEtcFile, PETCSECTION psect)
Saves a section to an etc file.
MG_EXPORT void GUIAPI ClipCursor(const RECT *prc)
Clips the cursor range.
MG_EXPORT int GUIAPI ServerGetNextZNode(MG_Layer *layer, int idx_znode, int *cli)
Get the next z-node in the specified layer from the server.
struct _ETCSECTION ETCSECTION
MG_EXPORT ON_UNLOCK_CLIENT_REQ OnUnlockClientReq
Set to a function to unlock a client request.
void(* on_minimizing_win)(CompositorCtxt *ctxt, MG_Layer *layer, int zidx)
struct _ZNODEINFO ZNODEINFO
MG_EXPORT BOOL GUIAPI ServerUnregisterCompositor(const char *name)
Un-register a new compositor.
MG_EXPORT BOOL GUIAPI MoveToLayer(BOOL handle_name, GHANDLE layer_handle, const char *layer_name)
Move current client to the specified layer.
struct _MG_Client MG_Client