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_INTERNAL_FLAGS_MASK 0X000F0000 87 #define ZOF_IF_REFERENCE 0x00010000 88 #define ZOF_IF_ALWAYSTOP 0x00020000 90 #define ZOF_TW_FLAG_MASK 0x00F00000 91 #define ZOF_TW_TROUNDCNS 0x00100000 92 #define ZOF_TW_BROUNDCNS 0x00200000 93 #define ZOF_TW_TBROUNDCNS 0x00300000 95 #define ZOF_TYPE_FLAG_MASK 0xFF000000 97 #define ZOF_TYPE_MASK 0xF0000000 98 #define ZOF_TYPE_NULL 0x00000000 99 #define ZOF_TYPE_DESKTOP 0x10000000 // fixed and only one. 100 #define ZOF_TYPE_LAUNCHER 0x20000000 // Since 5.0.0 101 #define ZOF_TYPE_NORMAL 0x30000000 102 #define ZOF_TYPE_HIGHER 0x40000000 103 #define ZOF_TYPE_DOCKER 0x50000000 // Since 5.0.0 104 #define ZOF_TYPE_SCREENLOCK 0x60000000 // Since 5.0.0; 105 #define ZOF_TYPE_GLOBAL 0x70000000 106 #define ZOF_TYPE_TOOLTIP 0x80000000 // Since 5.0.0; fixed and only one. 107 #define ZOF_TYPE_POPUPMENU 0x90000000 109 #define ZOF_TYPE_BOTTOMMOST ZOF_TYPE_LAUNCHER 110 #define ZOF_TYPE_TOPMOST ZOF_TYPE_TOOLTIP 112 #define ZOF_TF_FLAG_MASK 0x0F000000 113 #define ZOF_TF_MAINWIN 0x01000000 114 #define ZOF_TF_TOOLWIN 0x02000000 115 #define ZOF_TF_CONTROL 0x04000000 117 #define ZNIT_NULL (ZOF_TYPE_NULL) 118 #define ZNIT_POPUPMENU (ZOF_TYPE_POPUPMENU) 119 #define ZNIT_TOOLTIP (ZOF_TYPE_TOOLTIP | ZOF_TF_MAINWIN) 121 #define ZNIT_GLOBAL_MAINWIN (ZOF_TYPE_GLOBAL | ZOF_TF_MAINWIN) 122 #define ZNIT_GLOBAL_TOOLWIN (ZOF_TYPE_GLOBAL | ZOF_TF_TOOLWIN) 123 #define ZNIT_GLOBAL_CONTROL (ZOF_TYPE_GLOBAL | ZOF_TF_CONTROL) 125 #define ZNIT_SCREENLOCK_MAINWIN (ZOF_TYPE_SCREENLOCK | ZOF_TF_MAINWIN) 126 #define ZNIT_SCREENLOCK_TOOLWIN (ZOF_TYPE_SCREENLOCK | ZOF_TF_TOOLWIN) 127 #define ZNIT_SCREENLOCK_CONTROL (ZOF_TYPE_SCREENLOCK | ZOF_TF_CONTROL) 129 #define ZNIT_DOCKER_MAINWIN (ZOF_TYPE_DOCKER | ZOF_TF_MAINWIN) 130 #define ZNIT_DOCKER_TOOLWIN (ZOF_TYPE_DOCKER | ZOF_TF_TOOLWIN) 131 #define ZNIT_DOCKER_CONTROL (ZOF_TYPE_DOCKER | ZOF_TF_CONTROL) 133 #define ZNIT_HIGHER_MAINWIN (ZOF_TYPE_HIGHER | ZOF_TF_MAINWIN) 134 #define ZNIT_HIGHER_TOOLWIN (ZOF_TYPE_HIGHER | ZOF_TF_TOOLWIN) 135 #define ZNIT_HIGHER_CONTROL (ZOF_TYPE_HIGHER | ZOF_TF_CONTROL) 137 #define ZNIT_NORMAL_MAINWIN (ZOF_TYPE_NORMAL | ZOF_TF_MAINWIN) 138 #define ZNIT_NORMAL_TOOLWIN (ZOF_TYPE_NORMAL | ZOF_TF_TOOLWIN) 139 #define ZNIT_NORMAL_CONTROL (ZOF_TYPE_NORMAL | ZOF_TF_CONTROL) 141 #define ZNIT_LAUNCHER_MAINWIN (ZOF_TYPE_LAUNCHER | ZOF_TF_MAINWIN) 142 #define ZNIT_LAUNCHER_TOOLWIN (ZOF_TYPE_LAUNCHER | ZOF_TF_TOOLWIN) 143 #define ZNIT_LAUNCHER_CONTROL (ZOF_TYPE_LAUNCHER | ZOF_TF_CONTROL) 145 #define ZNIT_DESKTOP (ZOF_TYPE_DESKTOP) 147 #define ZNIF_VISIBLE (ZOF_VISIBLE) 148 #define ZNIF_DISABLED (ZOF_DISABLED) 149 #define ZNIF_MAXIMIZED (ZOF_MAXIMIZED) 150 #define ZNIF_MINIMIZED (ZOF_MINIMIZED) 153 #define ZNIT_TOPMOST_MAINWIN (ZNIT_HIGHER_MAINWIN) 154 #define ZNIT_TOPMOST_TOOLWIN (ZNIT_HIGHER_TOOLWIN) 155 #define ZNIT_TOPMOST_CONTROL (ZNIT_HIGHER_CONTROL) 157 typedef struct _CalcPosInfo {
182 #define g_rcScr (GetScreenRect()) 192 #define g_rcDesktop g_rcScr 196 #ifdef _MGRM_PROCESSES 226 #define mgIsServer (IsServer()) 253 #define LEN_LAYER_NAME 15 259 #define LEN_CLIENT_NAME 15 265 #define INV_LAYER_HANDLE 0 385 MG_EXPORT
int GUIAPI
InitGUI (
int argc,
const char *argv[]);
411 #define NAME_SELF_LAYER "" 417 #define NAME_TOPMOST_LAYER "" 423 #define NAME_DEF_LAYER "mginit" 425 #ifdef _MGRM_PROCESSES 480 const char* client_name,
481 int max_nr_highers,
int max_nr_normals);
528 GHANDLE layer_handle,
const char* layer_name);
548 GHANDLE layer_handle,
const char* layer_name);
574 GHANDLE layer_handle,
const char* layer_name);
644 #define LCO_NEW_CLIENT 1 645 #define LCO_DEL_CLIENT 2 655 #define LCO_NEW_LAYER 1 656 #define LCO_DEL_LAYER 2 657 #define LCO_JOIN_CLIENT 3 658 #define LCO_REMOVE_CLIENT 4 659 #define LCO_TOPMOST_CHANGED 5 660 #define LCO_ACTIVE_CHANGED 6 672 #define ZNOP_ALLOCATE 1 674 #define ZNOP_MOVE2TOP 3 677 #define ZNOP_MOVEWIN 6 678 #define ZNOP_SETACTIVE 7 680 #define ZNOP_ENABLEWINDOW 11 681 #define ZNOP_DISABLEWINDOW 12 682 #define ZNOP_STARTDRAG 13 683 #define ZNOP_CANCELDRAG 14 684 #define ZNOP_CHANGECAPTION 15 685 #define ZNOP_REGIONCHANGED 16 686 #define ZNOP_COMPOSITINGCHANGED 17 827 int def_nr_highers,
int def_nr_normals);
858 int max_nr_highers,
int max_nr_normals);
1035 #ifdef _MGSCHEMA_COMPOSITING 1114 #ifdef _MGSCHEMA_COMPOSITING 1178 MG_Layer* layer,
int idx_znode,
void** priv_data,
BOOL lock);
1202 #ifdef _MGSCHEMA_COMPOSITING 1254 MG_EXPORT
const ZNODEHEADER* GUIAPI ServerGetPopupMenuZNodeHeader (
1255 int idx_znode,
void** priv_data,
BOOL lock);
1279 #ifdef _MGSCHEMA_COMPOSITING 1290 #define RGN_OP_MASK 0x000F 1291 #define RGN_OP_SET 0x0000 1292 #define RGN_OP_INCLUDE 0x0001 1293 #define RGN_OP_EXCLUDE 0x0002 1294 #define RGN_OP_FLAG_ABS 0x0010 1389 int idx_znode,
void* priv_data);
1446 int op_code,
void* op_data,
BOOL notify);
1515 #ifdef _MGSCHEMA_COMPOSITING 1521 struct _CompositorCtxt;
1522 typedef struct _CompositorCtxt CompositorCtxt;
1535 CompositorCtxt* (*initialize) (
const char* name);
1541 void (*terminate) (CompositorCtxt* ctxt);
1547 void (*refresh) (CompositorCtxt* ctxt);
1554 void (*purge_ppp_data) (CompositorCtxt* ctxt,
int zidx,
void* data);
1561 void (*purge_win_data) (CompositorCtxt* ctxt,
MG_Layer* layer,
1562 int zidx,
void* data);
1568 void (*calc_mainwin_pos) (CompositorCtxt* ctxt,
MG_Layer* layer,
1569 DWORD zt_type,
int first_for_type, CALCPOSINFO* info);
1575 void (*on_layer_op) (CompositorCtxt* ctxt,
int layer_op,
1627 void (*on_dirty_screen) (CompositorCtxt* ctxt,
MG_Layer* layer,
1628 DWORD cause_type,
const RECT* rc_dirty);
1636 void (*on_showing_ppp) (CompositorCtxt* ctxt,
int zidx);
1643 void (*on_hiding_ppp) (CompositorCtxt* ctxt,
int zidx);
1651 void (*on_closed_menu) (CompositorCtxt* ctxt,
const RECT* rc_bound);
1659 void (*on_showing_win) (CompositorCtxt* ctxt,
MG_Layer* layer,
int zidx);
1666 void (*on_hiding_win) (CompositorCtxt* ctxt,
MG_Layer* layer,
int zidx);
1673 void (*on_raised_win) (CompositorCtxt* ctxt,
MG_Layer* layer,
int zidx);
1680 void (*on_changed_ct) (CompositorCtxt* ctxt,
MG_Layer* layer,
int zidx);
1687 void (*on_changed_rgn) (CompositorCtxt* ctxt,
MG_Layer* layer,
1688 int zidx,
const RECT* rc_org_bound);
1695 void (*on_moved_win) (CompositorCtxt* ctxt,
MG_Layer* layer,
1696 int zidx,
const RECT* rc_org);
1702 void (*on_maximizing_win) (CompositorCtxt* ctxt,
MG_Layer* layer,
int zidx);
1708 void (*on_minimizing_win) (CompositorCtxt* ctxt,
MG_Layer* layer,
int zidx);
1769 #define LEN_COMPOSITOR_NAME 15 1770 #define COMPSOR_NAME_DEFAULT "default" 1771 #define COMPSOR_NAME_FALLBACK "fallback" 1793 const char* name, CompositorCtxt** ctxt);
1795 #define COMPSOR_OPS_VERSION 1 1854 #define MAX_SYS_REQID 0x0023 1862 #define MAX_REQID 0x0030 1908 MG_EXPORT
int GUIAPI ClientRequestEx2 (
const REQUEST* request,
1909 const void* ex_data,
size_t ex_data_len,
int fd_to_send,
1910 void* result,
size_t len_rslt,
int* fd_received);
1939 const void* ex_data,
int ex_data_len,
1940 void* result,
int len_rslt)
1942 return ClientRequestEx2 (request, ex_data, ex_data_len, -1,
1943 result, len_rslt,
NULL);
1972 void* result,
int len_rslt)
2015 const void* reply,
int len,
int fd_to_send);
2049 typedef int (*
REQ_HANDLER) (
int cli,
int clifd,
void* buff,
size_t len);
2061 void* buff,
size_t len,
int fd_received);
2232 MG_EXPORT
int serv_accept (
int listenfd, pid_t *pidptr, uid_t *uidptr);
2254 MG_EXPORT
int cli_conn (
const char* name,
char project);
2256 #define SOCKERR_IO -1 2257 #define SOCKERR_CLOSED -2 2258 #define SOCKERR_INVARG -3 2259 #define SOCKERR_TIMEOUT -4 2260 #define SOCKERR_OK 0 2290 MG_EXPORT ssize_t sock_write_t (
int fd,
const void* buff,
size_t count,
2320 MG_EXPORT ssize_t
sock_read_t (
int fd,
void* buff,
size_t count,
2329 #define sock_write(fd, buff, count) sock_write_t(fd, buff, count, 0) 2337 #define sock_read(fd, buff, count) sock_read_t(fd, buff, count, 0) 2391 #define ReinitDesktop() ReinitDesktopEx (TRUE) 2409 #ifdef _USE_MINIGUIENTRY 2410 #define main_entry minigui_entry 2411 int minigui_entry (
int args,
const char* arg[]);
2413 #define main_entry main 2433 #define MiniGUIMain \ 2434 MiniGUIAppMain (int args, const char* argv[]); \ 2435 int main_entry (int args, const char* argv[]) \ 2438 if (InitGUI (args, argv) != 0) { \ 2441 iRet = MiniGUIAppMain (args, argv); \ 2442 TerminateGUI (iRet); \ 2452 #define IDM_DTI_FIRST (300) 2458 void* (*init) (
HDC dc_desktop);
2461 void (*deinit) (
void* context);
2464 void (*paint_desktop) (
void* context,
2465 HDC dc_desktop,
const RECT* inv_rc);
2468 void (*keyboard_handler) (
void* context,
2472 void (*mouse_handler) (
void* context,
2476 void (*customize_desktop_menu) (
void* context,
2477 HMENU hmenu,
int start_pos);
2480 void (*desktop_menucmd_handler) (
void* context,
int id);
2565 #ifndef _MGRM_PROCESSES 2567 #define DUMMY_LAYER_HANDLE (GHANDLE)(-1) 2583 const char* client_name,
int max_nr_highers,
int max_nr_normals)
2585 return DUMMY_LAYER_HANDLE;
2592 #ifdef _MGHAVE_MOUSECALIBRATE 2629 const POINT* dst_pts);
2656 #ifdef _MGMISC_ABOUTDLG 2663 #ifdef _MGRM_THREADS 2755 #define ETC_MAXLINE 1024 2761 #define ETC_FILENOTFOUND -1 2766 #define ETC_SECTIONNOTFOUND -2 2771 #define ETC_KEYNOTFOUND -3 2776 #define ETC_TMPFILEFAILED -4 2781 #define ETC_FILEIOFAILED -5 2786 #define ETC_INTCONV -6 2791 #define ETC_INVALIDOBJ -7 2796 #define ETC_READONLYOBJ -8 2831 #ifndef _MGINCORE_RES 2883 const char* pSection,
const char* pKey,
char* pValue,
int iLen);
2923 const char* pSection,
const char* pKey,
int* value);
2951 const char* pSection,
const char* pKey,
char* pValue);
2974 const char* pSection);
3075 const char* pKey,
char* pValue,
int iLen);
3085 const char* pKey,
int* pValue);
3097 #define SetValueToEtc(hEtc, pSection, pKey, pValue) \ 3098 GetValueFromEtc(hEtc, pSection, pKey, pValue, -1) 3118 const char* pSection,
BOOL bCreateNew);
3146 const char* pKey,
char* pValue,
int iLen);
3172 const char* pKey,
int* pValue);
3185 const char* pKey,
char* pValue);
3210 extern MG_EXPORT
GHANDLE hMgEtc;
3222 const char *pKey,
char *pValue,
int iLen)
3224 #ifndef _MGINCORE_RES 3242 const char* pKey,
int *value)
3244 #ifndef _MGINCORE_RES 3254 #ifdef _MGHAVE_CLIPBOARD 3265 #define LEN_CLIPBOARD_NAME 15 3270 #define NR_CLIPBOARDS 4 3276 #define CBNAME_TEXT ("text") 3289 #define CBERR_BADNAME 1 3295 #define CBERR_NOMEM 2 3301 #define CBOP_NORMAL 0 3306 #define CBOP_APPEND 1 3325 MG_EXPORT
int GUIAPI
CreateClipBoard (
const char* cb_name,
size_t size);
3366 void* data,
size_t n,
int cbop);
3398 void* data,
size_t n);
3418 int index,
unsigned char* byte);
3449 MG_EXPORT
void GUIAPI
Ping (
void);
3473 MG_EXPORT
void GUIAPI
Tone (
int frequency_hz,
int duration_ms);
3536 MG_EXPORT
char* GUIAPI
FixStrDup (
const char* str);
3550 MG_EXPORT
void GUIAPI
FreeFixStr (
char* str);
3559 #ifdef _MGHAVE_CURSOR 3597 #ifdef _MGSCHEMA_COMPOSITING 3621 int hotspot_x,
int hotspot_y);
3646 int hotspot_x,
int hotspot_y);
3676 const BYTE* pANDBits,
const BYTE* pXORBits,
int colornum);
3784 #ifdef _MGSCHEMA_COMPOSITING 3787 int hotspot_x,
int hotspot_y) {
3793 int hotspot_x,
int hotspot_y) {
3801 const BYTE* pANDBits,
const BYTE* pXORBits,
int colornum) {
3823 #define MAX_SYSCURSORINDEX 22 3831 #define IDC_PENCIL 2 3837 #define IDC_SIZENWSE 5 3839 #define IDC_SIZENESW 6 3841 #define IDC_SIZEWE 7 3843 #define IDC_SIZENS 8 3845 #define IDC_UPARROW 9 3855 #define IDC_RARROW 14 3857 #define IDC_COLOMN 15 3863 #define IDC_NODROP 18 3865 #define IDC_HAND_POINT 19 3867 #define IDC_HAND_SELECT 20 3869 #define IDC_SPLIT_HORZ 21 3871 #define IDC_SPLIT_VERT 22 3927 #ifdef _MGHAVE_CURSOR 4006 #define SetCursor(hcsr) SetCursorEx (hcsr, FALSE) 4023 #define SetDefaultCursor(hcsr) SetCursorEx (hcsr, TRUE) 4128 #define IDS_MGST_WINDOW 0 4134 #define IDS_MGST_START 1 4140 #define IDS_MGST_REFRESH 2 4146 #define IDS_MGST_CLOSEALLWIN 3 4152 #define IDS_MGST_ENDSESSION 4 4158 #define IDS_MGST_OPERATIONS 5 4164 #define IDS_MGST_MINIMIZE 6 4170 #define IDS_MGST_MAXIMIZE 7 4176 #define IDS_MGST_RESTORE 8 4182 #define IDS_MGST_CLOSE 9 4188 #define IDS_MGST_OK 10 4194 #define IDS_MGST_NEXT 11 4200 #define IDS_MGST_CANCEL 12 4206 #define IDS_MGST_PREV 13 4212 #define IDS_MGST_YES 14 4218 #define IDS_MGST_NO 15 4224 #define IDS_MGST_ABORT 16 4230 #define IDS_MGST_RETRY 17 4236 #define IDS_MGST_IGNORE 18 4242 #define IDS_MGST_ABOUTMG 19 4248 #define IDS_MGST_OPENFILE 20 4254 #define IDS_MGST_SAVEFILE 21 4260 #define IDS_MGST_COLORSEL 22 4266 #define IDS_MGST_SWITCHLAYER 23 4272 #define IDS_MGST_DELLAYER 24 4278 #define IDS_MGST_ERROR 25 4284 #define IDS_MGST_LOGO 26 4290 #define IDS_MGST_CURRPATH 27 4296 #define IDS_MGST_FILE 28 4302 #define IDS_MGST_LOCATION 29 4308 #define IDS_MGST_UP 30 4314 #define IDS_MGST_NAME 31 4320 #define IDS_MGST_SIZE 32 4326 #define IDS_MGST_ACCESSMODE 33 4332 #define IDS_MGST_LASTMODTIME 34 4338 #define IDS_MGST_OPEN 35 4344 #define IDS_MGST_FILENAME 36 4350 #define IDS_MGST_FILETYPE 37 4356 #define IDS_MGST_SHOWHIDEFILE 38 4362 #define IDS_MGST_NOTFOUND 39 4368 #define IDS_MGST_NR 40 4374 #define IDS_MGST_NW 41 4380 #define IDS_MGST_INFO 42 4386 #define IDS_MGST_R 43 4392 #define IDS_MGST_W 44 4398 #define IDS_MGST_WR 45 4404 #define IDS_MGST_SAVE 46 4410 #define IDS_MGST_FILEEXIST 47 4412 #define IDS_MGST_MAXNUM 47 4433 MG_EXPORT
const char* GUIAPI
GetSysText (
unsigned int id);
4501 extern MG_EXPORT
const char*
SysText [];
4516 #ifdef _MGCHARSET_UNICODE 4536 extern MG_EXPORT
const char** GUIAPI
GetSysTextInUTF8 (
const char* language);
4560 MG_EXPORT
char*
strnchr (
const char* s,
size_t n,
int c);
4578 MG_EXPORT
int substrlen (
const char* text,
int len,
int delimiter,
4740 MG_EXPORT
void *
mg_slice_copy(
size_t block_size,
const void *mem_block);
4760 MG_EXPORT
void mg_slice_free(
size_t block_size,
void *mem_block);
4785 void *mem_chain,
size_t next_offset);
4810 #define mg_slice_new(type) ((type*)mg_slice_alloc(sizeof (type))) 4837 #define mg_slice_new0(type) ((type*)mg_slice_alloc0(sizeof (type))) 4873 #define mg_slice_dup(type, mem) \ 4874 (1 ? (type*) mg_slice_copy (sizeof (type), (mem)) \ 4875 : ((void) ((type*) 0 == (mem)), (type*) 0)) 4899 #define mg_slice_delete(type, mem) \ 4901 if (1) mg_slice_free (sizeof (type), (mem)); \ 4902 else (void) ((type*) 0 == (mem)); \ 4929 #define mg_slice_delete_chain(type, mem_chain, next) \ 4931 if (1) mg_slice_free_chain_with_offset (sizeof (type), \ 4932 (mem_chain), G_STRUCT_OFFSET (type, next)); \ 4933 else (void) ((type*) 0 == (mem_chain)); \ 4936 #ifdef _MGDEVEL_MODE 4937 MG_EXPORT
void mg_slice_debug_tree_statistics(
void);
MG_EXPORT int GUIAPI GetClipBoardByte(const char *cb_name, int index, unsigned char *byte)
Get 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.
void(* ON_CHANGE_LAYER)(int op, MG_Layer *layer, MG_Client *client)
Type of layer change event callback.
struct _ZNODEINFO ZNODEINFO
MG_EXPORT const CompositorOps *GUIAPI ServerGetCompositorOps(const char *name)
Get the operations of a specific compositor.
MG_EXPORT void GUIAPI GetCursorPos(POINT *ppt)
Get 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)
Set position of the current cursor.
struct _ZNODEHEADER ZNODEHEADER
MG_EXPORT MG_Client * mgClients
The pointer to the array contains all clients' information.
unsigned char BYTE
A type definition for an 8-bit unsigned character (byte).
MG_EXPORT ON_TRYLOCK_CLIENT_REQ OnTrylockClientReq
Set to a function to lock a client request.
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)
Get an integer value from an etc section object.
#define LEN_LAYER_NAME
The maximum length of name of layer in MiniGUI-Processes.
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 JoinLayer(const char *layer_name, const char *client_name, int max_nr_highers, int max_nr_normals)
Joins to a layer.
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 ON_NEW_DEL_CLIENT OnNewDelClient
Set to a function to handle a comming in (going away) connection of client.
MG_EXPORT BOOL GUIAPI ServerRegisterCompositor(const char *name, const CompositorOps *ops)
Register a new compositor.
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 const char ** local_SysText
The pointer to the current localized system text array.
MG_EXPORT void GUIAPI GetOriginalMousePosition(int *x, int *y)
Get 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 BOOL GUIAPI ServerSetTopmostLayer(MG_Layer *layer)
Set topmost layer from the server.
MG_EXPORT BOOL GUIAPI ServerMoveClientToLayer(int cli, MG_Layer *dst_layer)
Move a client to the specified layer.
MG_EXPORT DESKTOPOPS *GUIAPI SetCustomDesktopOperationSet(DESKTOPOPS *usr_dsk_ops)
Set customer desktop operation set.
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.
static int GUIAPI ServerSendReply(int clifd, const void *reply, int len)
Sends the reply to the client.
MG_EXPORT BOOL GUIAPI MoveToLayer(BOOL handle_name, GHANDLE layer_handle, const char *layer_name)
Move current client to the specified layer.
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.
#define LEN_CLIENT_NAME
The maximum length of name of client in MiniGUI-Processes.
struct _MG_Layer MG_Layer
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 void mg_slice_free(size_t block_size, void *mem_block)
Free a block of memory.
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 int GUIAPI ServerGetPrevZNode(MG_Layer *layer, int idx_znode, int *cli)
Get the previous z-node in the specified layer from the server.
MG_EXPORT size_t GUIAPI GetClipBoardDataLen(const char *cb_name)
Get the length of the data of a clipboard.
void(* ON_ZNODE_OPERATION)(int op, int cli, int idx_znode)
Type of z-node operation callback.
MG_EXPORT HCURSOR GUIAPI LoadCursorFromPNGFile(const char *filename, int hotspot_x, int hotspot_y)
Loads a cursor from a PNG file.
struct _DESKTOPOPS DESKTOPOPS
MG_EXPORT BOOL GUIAPI SetTopmostLayer(BOOL handle_name, GHANDLE layer_handle, const char *layer_name)
Brings a layer to be the topmost one.
static int GetMgEtcIntValue(const char *pSection, const char *pKey, int *value)
Get integer value from MiniGUI configuration etc object.
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.
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.
GHANDLE HDC
Handle to device context.
MG_EXPORT void * mg_slice_alloc(size_t block_size)
Allocate a slice memory.
MG_EXPORT char ETCFILEPATH[]
The path name of MiniGUI configuration file.
MG_EXPORT BOOL GUIAPI SetTopmostClient(int cli)
Set topmost layer by a client identifier.
MG_EXPORT BOOL GUIAPI GetKeyStatus(UINT uKey)
Get a key or a mouse button status.
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 const char *GUIAPI GetSysText(unsigned int id)
Translates system text to localized text.
MG_EXPORT void * mgSharedRes
Contains the pointer to the shared resource of MiniGUI-Processes.
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 int GUIAPI UnloadEtcFile(GHANDLE hEtc)
Unloads an etc file.
MG_EXPORT char * strtrimall(char *src)
Deletes all space characters.
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.
#define TRUE
TRUE value, defined as 1 by MiniGUI.
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.
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)
Get integer value from a configuration file.
MG_EXPORT void GUIAPI GetClipCursor(RECT *prc)
Get the current cursor clipping rectangle.
GHANDLE HWND
Handle to main window or control.
MG_EXPORT BOOL GUIAPI RegisterRequestHandlerV1(int req_id, REQ_HANDLER_V1 your_handler_v1)
Registers a customized extended request handler of version 1.
MG_EXPORT int mgClientSize
The current size of the array mgClients.
MG_EXPORT void GUIAPI Ping(void)
Makes a beep sound.
void(* ON_NEW_DEL_CLIENT)(int op, int cli)
Type of client event callback.
const CompositorOps * __ex_compositor_get(const char *name, const CompositorOps *fallback_ops, int *version)
MG_EXPORT void GUIAPI MiniGUIPanic(int exitcode)
The panic of MiniGUI application.
struct GlobalRes * global_res
MG_EXPORT int GUIAPI GetValueFromEtcSec(GHANDLE hSect, const char *pKey, char *pValue, int iLen)
Get value from an etc section object.
MG_EXPORT int GUIAPI SetClipBoardData(const char *cb_name, void *data, size_t n, int cbop)
Set the data of a clipboard.
MG_EXPORT ON_ZNODE_OPERATION OnZNodeOperation
Set to a function to handle events of z-node.
MG_EXPORT int serv_accept(int listenfd, pid_t *pidptr, uid_t *uidptr)
Waits for a client connection to arrive, and accept it.
MG_EXPORT int GUIAPI GetValueFromEtc(GHANDLE hEtc, const char *pSection, const char *pKey, char *pValue, int iLen)
Get 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)
Get value from MiniGUI configuration etc object.
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 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)
Get 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)
Get 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)
Get termios structure of the original terminal before initializing MiniGUI.
MG_EXPORT int GUIAPI InitGUI(int argc, const char *argv[])
Initialize MiniGUI.
MG_EXPORT HCURSOR GUIAPI GetDefaultCursor(void)
Get the default cursor.
MG_EXPORT HCURSOR GUIAPI LoadCursorFromFile(const char *filename)
Loads a cursor from a M$ Windows cursor file.
MG_EXPORT const CompositorOps *GUIAPI ServerSelectCompositor(const char *name, CompositorCtxt **ctxt)
Select a compositor as the current compositor.
MG_EXPORT BOOL GUIAPI ServerStartup(int nr_globals, int def_nr_highers, int def_nr_normals)
Initializes the server of MiniGUI-Processes.
MG_EXPORT DWORD GUIAPI GetTickCount(void)
Retrieve the tick counts that have elapsed since MiniGUI was started.
MG_EXPORT BOOL GUIAPI IsServer(void)
Check whether the current process is the server of MiniGUI-Processes.
MG_EXPORT HCURSOR GUIAPI GetSystemCursor(int csrid)
Get the handle to a system cursor by its identifier.
static int ClientRequest(const REQUEST *request, void *result, int len_rslt)
Sends a request to the server and wait reply.
MG_EXPORT int GUIAPI GetSockFD2Server(void)
Get the file descriptor of the socket connected to the server.
MG_EXPORT HCURSOR GUIAPI GetCurrentCursor(void)
Get 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)
Set a value in a configuration file.
MG_EXPORT REQ_HANDLER_V1 GUIAPI GetRequestHandlerV1(int req_id)
Get the extended request handler by a request identifier.
MG_EXPORT ssize_t sock_read_t(int fd, void *buff, size_t count, DWORD timeout)
Reads data from socket.
MG_EXPORT BOOL GUIAPI SetMouseCalibrationParameters(const POINT *src_pts, const POINT *dst_pts)
Set the parameters for doing mouse calibration.
int(* REQ_HANDLER)(int cli, int clifd, void *buff, size_t len)
The prototype of a request handler (version 0).
MG_EXPORT int GUIAPI SetValueToEtcSec(GHANDLE hSect, const char *pKey, char *pValue)
Set the value in the etc section object.
MG_EXPORT int GUIAPI DestroyClipBoard(const char *cb_name)
Destroys a new clipboard.
MG_EXPORT const 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 void GUIAPI UpdateTopmostLayer(const RECT *dirty_rc)
Update topmost layer.
MG_EXPORT char * strnchr(const char *s, size_t n, int c)
Locates character in the first n characters of string s.
struct _CompositorOps CompositorOps
MG_EXPORT BOOL GUIAPI ServerDeleteLayer(MG_Layer *layer)
Delete a layer from the server.
MG_EXPORT REQ_HANDLER GUIAPI GetRequestHandler(int req_id)
Get the request handler by request identifier.
MG_EXPORT BOOL GUIAPI ServerReleaseWinZNodeHeader(MG_Layer *layer, int idx_znode)
Release z-node header of a specific window in the specified layer.
MG_EXPORT ON_CHANGE_LAYER OnChangeLayer
Set to a function to handle events of layers.
MG_EXPORT const char * SysText[]
Contains all text used by MiniGUI in English.
MG_EXPORT BOOL GUIAPI RegisterRequestHandler(int req_id, REQ_HANDLER your_handler)
Registers a customized request handler of version 0.
MG_EXPORT int cli_conn(const char *name, char project)
Used by clients to connect to a server.
unsigned int UINT
A type definition for unsigned integer.
MG_EXPORT DWORD GUIAPI GetShiftKeyStatus(void)
Get status of the shift keys.
int(* ON_TRYLOCK_CLIENT_REQ)(void)
Type of client request lock callback.
MG_EXPORT MG_Layer * mgLayers
The pointer to the array of layers.
MG_EXPORT void GUIAPI TerminateGUI(int not_used)
Terminate MiniGUI.
MG_EXPORT void GUIAPI DisableClientsOutput(void)
Disable all clients output.
MG_EXPORT int serv_listen(const char *name)
Creates a listen socket.
int(* ON_LOCK_CLIENT_REQ)(void)
Type of client request lock callback.
struct _MG_Client MG_Client
GHANDLE HMENU
Handle to menu.
MG_EXPORT int GUIAPI GetClientByPID(int pid)
Returns the client identifier from PID of a client.
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 GHANDLE GUIAPI LoadEtcFile(const char *pEtcFile)
Loads an etc file into memory.
MG_EXPORT MG_Layer * mgTopmostLayer
The pointer to the topmost layer.
MG_EXPORT ON_LOCK_CLIENT_REQ OnLockClientReq
Set to a function to lock a client request.
MG_EXPORT int GUIAPI SaveSectionToEtcFile(const char *pEtcFile, PETCSECTION psect)
Saves a section to an etc file.
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 RECT GUIAPI GetScreenRect(void)
Return the rectangle of the physical screen.
MG_EXPORT void GUIAPI GetKeyboardState(BYTE *kbd_state)
Get status of all keys on keyboard.
MG_EXPORT BOOL GUIAPI DeleteLayer(BOOL handle_name, GHANDLE layer_handle, const char *layer_name)
Deletes a specific layer.
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 RemoveSectionInEtc(GHANDLE hEtc, const char *pSection)
Removes a section in etc object.
void(* ON_UNLOCK_CLIENT_REQ)(void)
Type of client request unlock callback.
MG_EXPORT int GUIAPI ServerGetPopupMenusCount(void)
Get the number of popup menus shown on the screen.
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 ON_UNLOCK_CLIENT_REQ OnUnlockClientReq
Set to a function to unlock a client request.
MG_EXPORT BOOL GUIAPI ServerReleasePopupMenuZNodeHeader(int idx_znode)
Release the lock of the z-node header of the specific popup menu.
MG_EXPORT void *GUIAPI GetRequestHandlerEx(int req_id, int *version)
Get the request handler and the version by request identifier.
MG_EXPORT BOOL GUIAPI ServerUnregisterCompositor(const char *name)
Un-register a new compositor.