MiniGUI API Reference (MiniGUI-Standalone)  v5.0.0
A mature and proven cross-platform GUI system for embedded and smart IoT devices
minigui.h
Go to the documentation of this file.
1 //
3 // IMPORTANT NOTICE
4 //
5 // The following open source license statement does not apply to any
6 // entity in the Exception List published by FMSoft.
7 //
8 // For more information, please visit:
9 //
10 // https://www.fmsoft.cn/exception-list
11 //
13 
57 /*
58  * $Id: minigui.h 13674 2010-12-06 06:45:01Z wanzheng $
59  *
60  * MiniGUI for Linux/uClinux, eCos, uC/OS-II, VxWorks,
61  * pSOS, ThreadX, NuCleus, OSE, and Win32.
62  */
63 
64 #ifndef _MGUI_MINIGUI_H
65  #define _MGUI_MINIGUI_H
66 
67 #include <stdio.h>
68 #include <sys/types.h>
69 
70 #ifdef __cplusplus
71 extern "C" {
72 #endif /* __cplusplus */
73 
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
84 
85 /* Since 5.0.0 */
86 #define ZOF_INTERNAL_FLAGS_MASK 0X000F0000
87 #define ZOF_IF_REFERENCE 0x00010000
88 #define ZOF_IF_ALWAYSTOP 0x00020000
89 
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
94 
95 #define ZOF_TYPE_FLAG_MASK 0xFF000000
96 
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
108 
109 #define ZOF_TYPE_BOTTOMMOST ZOF_TYPE_LAUNCHER
110 #define ZOF_TYPE_TOPMOST ZOF_TYPE_TOOLTIP
111 
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
116 
117 #define ZNIT_NULL (ZOF_TYPE_NULL)
118 #define ZNIT_POPUPMENU (ZOF_TYPE_POPUPMENU)
119 #define ZNIT_TOOLTIP (ZOF_TYPE_TOOLTIP | ZOF_TF_MAINWIN)
120 
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)
124 
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)
128 
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)
132 
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)
136 
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)
140 
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)
144 
145 #define ZNIT_DESKTOP (ZOF_TYPE_DESKTOP)
146 
147 #define ZNIF_VISIBLE (ZOF_VISIBLE)
148 #define ZNIF_DISABLED (ZOF_DISABLED)
149 #define ZNIF_MAXIMIZED (ZOF_MAXIMIZED) /* Since 5.2.0 */
150 #define ZNIF_MINIMIZED (ZOF_MINIMIZED) /* Since 5.2.0 */
151 
152 /* definitions for backward compatibility */
153 #define ZNIT_TOPMOST_MAINWIN (ZNIT_HIGHER_MAINWIN)
154 #define ZNIT_TOPMOST_TOOLWIN (ZNIT_HIGHER_TOOLWIN)
155 #define ZNIT_TOPMOST_CONTROL (ZNIT_HIGHER_CONTROL)
156 
157 typedef struct _CalcPosInfo {
158  DWORD style;
159  DWORD ex_style;
160  RECT rc;
161 } CALCPOSINFO;
162 
174 MG_EXPORT RECT GUIAPI GetScreenRect (void);
175 
182 #define g_rcScr (GetScreenRect())
183 
192 #define g_rcDesktop g_rcScr
193 
196 #ifdef _MGRM_PROCESSES
197 
215 MG_EXPORT BOOL GUIAPI IsServer(void);
216 
226 #define mgIsServer (IsServer())
227 
237 extern MG_EXPORT void* mgSharedRes;
238 
247 extern MG_EXPORT size_t mgSizeRes;
248 
253 #define LEN_LAYER_NAME 15
254 
259 #define LEN_CLIENT_NAME 15
260 
265 #define INV_LAYER_HANDLE 0
266 
267 struct _MG_Layer;
268 
270 typedef struct _MG_Client
271 {
273  char name [LEN_CLIENT_NAME + 1];
274 
276  pid_t pid;
278  uid_t uid;
280  int fd;
281 
283  BOOL has_dirty;
285  DWORD last_live_time;
287  DWORD dwAddData;
288 
290  struct _MG_Client* next;
292  struct _MG_Client* prev;
293 
295  struct _MG_Layer* layer;
296 
298  struct GlobalRes* global_res;
299 } MG_Client;
300 
302 typedef struct _MG_Layer
303 {
305  char name [LEN_LAYER_NAME + 1];
306 
308  DWORD dwAddData;
309 
311  MG_Client* cli_head;
313  MG_Client* cli_active;
314 
316  struct _MG_Layer* next;
318  struct _MG_Layer* prev;
319 
321  void* zorder_info;
323  int zorder_shmid;
324 } MG_Layer;
325 
332 extern MG_EXPORT int mgClientSize;
333 
344 extern MG_EXPORT MG_Client* mgClients;
345 
352 extern MG_EXPORT MG_Layer* mgTopmostLayer;
353 
360 extern MG_EXPORT MG_Layer* mgLayers;
361 
364 #endif /* _MGRM_PROCESSES */
365 
385 MG_EXPORT int GUIAPI InitGUI (int argc, const char *argv[]);
386 
394 MG_EXPORT void GUIAPI TerminateGUI (int not_used);
395 
405 MG_EXPORT void GUIAPI MiniGUIPanic (int exitcode);
406 
411 #define NAME_SELF_LAYER ""
412 
417 #define NAME_TOPMOST_LAYER ""
418 
423 #define NAME_DEF_LAYER "mginit"
424 
425 #ifdef _MGRM_PROCESSES
426 
479 MG_EXPORT GHANDLE GUIAPI JoinLayer (const char* layer_name,
480  const char* client_name,
481  int max_nr_highers, int max_nr_normals);
482 
507 MG_EXPORT GHANDLE GUIAPI GetLayerInfo (const char* layer_name,
508  int* nr_clients, BOOL* is_topmost, int* cli_active);
509 
527 MG_EXPORT BOOL GUIAPI SetTopmostLayer (BOOL handle_name,
528  GHANDLE layer_handle, const char* layer_name);
529 
547 MG_EXPORT BOOL GUIAPI DeleteLayer (BOOL handle_name,
548  GHANDLE layer_handle, const char* layer_name);
549 
573 MG_EXPORT BOOL GUIAPI MoveToLayer (BOOL handle_name,
574  GHANDLE layer_handle, const char* layer_name);
575 
597 typedef int (* ON_LOCK_CLIENT_REQ) (void);
598 
605 typedef int (* ON_TRYLOCK_CLIENT_REQ) (void);
606 
613 typedef void (* ON_UNLOCK_CLIENT_REQ) (void);
614 
623 extern MG_EXPORT ON_LOCK_CLIENT_REQ OnLockClientReq;
624 
633 extern MG_EXPORT ON_TRYLOCK_CLIENT_REQ OnTrylockClientReq;
642 extern MG_EXPORT ON_UNLOCK_CLIENT_REQ OnUnlockClientReq;
643 
644 #define LCO_NEW_CLIENT 1
645 #define LCO_DEL_CLIENT 2
646 
653 typedef void (* ON_NEW_DEL_CLIENT) (int op, int cli);
654 
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
661 
669 typedef void (* ON_CHANGE_LAYER) (int op, MG_Layer* layer,
670  MG_Client* client);
671 
672 #define ZNOP_ALLOCATE 1
673 #define ZNOP_FREE 2
674 #define ZNOP_MOVE2TOP 3
675 #define ZNOP_SHOW 4
676 #define ZNOP_HIDE 5
677 #define ZNOP_MOVEWIN 6
678 #define ZNOP_SETACTIVE 7
679 
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
687 
694 typedef void (* ON_ZNODE_OPERATION) (int op, int cli, int idx_znode);
695 
719 extern MG_EXPORT ON_NEW_DEL_CLIENT OnNewDelClient;
720 
750 extern MG_EXPORT ON_CHANGE_LAYER OnChangeLayer;
751 
798 extern MG_EXPORT ON_ZNODE_OPERATION OnZNodeOperation;
799 
826 MG_EXPORT BOOL GUIAPI ServerStartup (int nr_globals,
827  int def_nr_highers, int def_nr_normals);
828 
857 MG_EXPORT MG_Layer* GUIAPI ServerCreateLayer (const char* layer_name,
858  int max_nr_highers, int max_nr_normals);
859 
874 MG_EXPORT BOOL GUIAPI ServerSetTopmostLayer (MG_Layer* layer);
875 
890 MG_EXPORT BOOL GUIAPI ServerDeleteLayer (MG_Layer* layer);
891 
918 MG_EXPORT int GUIAPI ServerGetNextZNode (MG_Layer* layer, int idx_znode,
919  int* cli);
920 
949 MG_EXPORT int GUIAPI ServerGetPrevZNode (MG_Layer* layer, int idx_znode,
950  int* cli);
951 
953 typedef struct _ZNODEINFO {
1002  DWORD type;
1003 
1016  DWORD flags;
1017 
1019  const char* caption;
1020 
1022  RECT rc;
1023 
1025  HWND hwnd;
1030  HWND main_win;
1031 
1033  int cli;
1034 
1035 #ifdef _MGSCHEMA_COMPOSITING
1036 
1040  int ct;
1045  DWORD ct_arg;
1046 #endif
1047 
1051  void* priv_data;
1052 } ZNODEINFO;
1053 
1074 MG_EXPORT BOOL GUIAPI ServerGetZNodeInfo (MG_Layer* layer, int idx_znode,
1075  ZNODEINFO* znode_info);
1076 
1078 typedef struct _ZNODEHEADER {
1091  DWORD flags;
1092 
1094  const char* caption;
1095 
1097  HWND hwnd;
1098 
1103  HWND main_win;
1104 
1106  RECT rc;
1107 
1109  int cli;
1110 
1112  int lock_count;
1113 
1114 #ifdef _MGSCHEMA_COMPOSITING
1115 
1116  unsigned int changes;
1121  int ct;
1126  DWORD ct_arg;
1127 
1129  HDC mem_dc;
1130 
1132  unsigned int dirty_age;
1133 
1135  int nr_dirty_rcs;
1136 
1138  const RECT* dirty_rcs;
1139 #else
1140 
1141  unsigned int age;
1143  RECT dirty_rc;
1144 #endif
1145 } ZNODEHEADER;
1146 
1177 MG_EXPORT const ZNODEHEADER* GUIAPI ServerGetWinZNodeHeader (
1178  MG_Layer* layer, int idx_znode, void** priv_data, BOOL lock);
1179 
1202 #ifdef _MGSCHEMA_COMPOSITING
1203 MG_EXPORT BOOL GUIAPI ServerReleaseWinZNodeHeader (MG_Layer* layer,
1204  int idx_znode);
1205 #else /* not defined _MGSCHEMA_COMPOSITING */
1206 static inline BOOL GUIAPI ServerReleaseWinZNodeHeader (MG_Layer* layer,
1207  int idx_znode)
1208 {
1209  return TRUE;
1210 }
1211 #endif /* not defined _MGSCHEMA_COMPOSITING */
1212 
1227 MG_EXPORT int GUIAPI ServerGetPopupMenusCount (void);
1228 
1254 MG_EXPORT const ZNODEHEADER* GUIAPI ServerGetPopupMenuZNodeHeader (
1255  int idx_znode, void** priv_data, BOOL lock);
1256 
1279 #ifdef _MGSCHEMA_COMPOSITING
1280 MG_EXPORT BOOL GUIAPI ServerReleasePopupMenuZNodeHeader (int idx_znode);
1281 #else /* not defined _MGSCHEMA_COMPOSITING */
1282 static inline BOOL GUIAPI ServerReleasePopupMenuZNodeHeader (int idx_znode)
1283 {
1284  return TRUE;
1285 }
1286 #endif /* not defined _MGSCHEMA_COMPOSITING */
1287 
1288 typedef struct _CLIPRGN CLIPRGN;
1289 
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
1295 
1327 MG_EXPORT BOOL GUIAPI ServerGetWinZNodeRegion (MG_Layer* layer, int idx_znode,
1328  DWORD rgn_ops, CLIPRGN* dst_rgn);
1329 
1363 MG_EXPORT BOOL GUIAPI ServerGetPopupMenuZNodeRegion (int idx_znode,
1364  DWORD rgn_ops, CLIPRGN* dst_rgn);
1365 
1388 MG_EXPORT BOOL GUIAPI ServerSetWinZNodePrivateData (MG_Layer* layer,
1389  int idx_znode, void* priv_data);
1390 
1410 MG_EXPORT BOOL GUIAPI ServerSetPopupMenuZNodePrivateData (int idx_znode,
1411  void* priv_data);
1412 
1445 MG_EXPORT BOOL GUIAPI ServerDoZNodeOperation (MG_Layer* layer, int idx_znode,
1446  int op_code, void* op_data, BOOL notify);
1447 
1468 MG_EXPORT BOOL GUIAPI ServerMoveClientToLayer (int cli, MG_Layer* dst_layer);
1469 
1481 MG_EXPORT int GUIAPI GetClientByPID (int pid);
1482 
1499 MG_EXPORT BOOL GUIAPI SetTopmostClient (int cli);
1500 
1505 MG_EXPORT void GUIAPI DisableClientsOutput (void);
1506 
1513 MG_EXPORT void GUIAPI UpdateTopmostLayer (const RECT* dirty_rc);
1514 
1515 #ifdef _MGSCHEMA_COMPOSITING
1516 
1521 struct _CompositorCtxt;
1522 typedef struct _CompositorCtxt CompositorCtxt;
1523 
1524 struct _CLIPRGN;
1525 typedef struct _CLIPRGN CLIPRGN;
1526 
1530 typedef struct _CompositorOps {
1535  CompositorCtxt* (*initialize) (const char* name);
1536 
1541  void (*terminate) (CompositorCtxt* ctxt);
1542 
1547  void (*refresh) (CompositorCtxt* ctxt);
1548 
1554  void (*purge_ppp_data) (CompositorCtxt* ctxt, int zidx, void* data);
1555 
1561  void (*purge_win_data) (CompositorCtxt* ctxt, MG_Layer* layer,
1562  int zidx, void* data);
1563 
1568  void (*calc_mainwin_pos) (CompositorCtxt* ctxt, MG_Layer* layer,
1569  DWORD zt_type, int first_for_type, CALCPOSINFO* info);
1570 
1575  void (*on_layer_op) (CompositorCtxt* ctxt, int layer_op,
1576  MG_Layer* layer, MG_Client* client);
1577 
1584  BOOL (*reset_dirty_region) (CompositorCtxt* ctxt, MG_Layer* layer);
1585 
1592  BOOL (*merge_dirty_ppp) (CompositorCtxt* ctxt, MG_Layer* layer, int zidx);
1593 
1600  BOOL (*merge_dirty_win) (CompositorCtxt* ctxt, MG_Layer* layer, int zidx);
1601 
1608  BOOL (*merge_dirty_wpp) (CompositorCtxt* ctxt, MG_Layer* layer);
1609 
1614  BOOL (*refresh_dirty_region) (CompositorCtxt* ctxt, MG_Layer* layer);
1615 
1627  void (*on_dirty_screen) (CompositorCtxt* ctxt, MG_Layer* layer,
1628  DWORD cause_type, const RECT* rc_dirty);
1629 
1636  void (*on_showing_ppp) (CompositorCtxt* ctxt, int zidx);
1637 
1643  void (*on_hiding_ppp) (CompositorCtxt* ctxt, int zidx);
1644 
1651  void (*on_closed_menu) (CompositorCtxt* ctxt, const RECT* rc_bound);
1652 
1659  void (*on_showing_win) (CompositorCtxt* ctxt, MG_Layer* layer, int zidx);
1660 
1666  void (*on_hiding_win) (CompositorCtxt* ctxt, MG_Layer* layer, int zidx);
1667 
1673  void (*on_raised_win) (CompositorCtxt* ctxt, MG_Layer* layer, int zidx);
1674 
1680  void (*on_changed_ct) (CompositorCtxt* ctxt, MG_Layer* layer, int zidx);
1681 
1687  void (*on_changed_rgn) (CompositorCtxt* ctxt, MG_Layer* layer,
1688  int zidx, const RECT* rc_org_bound);
1689 
1695  void (*on_moved_win) (CompositorCtxt* ctxt, MG_Layer* layer,
1696  int zidx, const RECT* rc_org);
1697 
1702  void (*on_maximizing_win) (CompositorCtxt* ctxt, MG_Layer* layer, int zidx);
1703 
1708  void (*on_minimizing_win) (CompositorCtxt* ctxt, MG_Layer* layer, int zidx);
1709 
1710 } CompositorOps;
1711 
1731 MG_EXPORT const CompositorOps* GUIAPI ServerGetCompositorOps (const char* name);
1732 
1749 MG_EXPORT BOOL GUIAPI ServerRegisterCompositor (
1750  const char* name, const CompositorOps* ops);
1751 
1767 MG_EXPORT BOOL GUIAPI ServerUnregisterCompositor (const char* name);
1768 
1769 #define LEN_COMPOSITOR_NAME 15
1770 #define COMPSOR_NAME_DEFAULT "default"
1771 #define COMPSOR_NAME_FALLBACK "fallback"
1772 
1792 MG_EXPORT const CompositorOps* GUIAPI ServerSelectCompositor (
1793  const char* name, CompositorCtxt** ctxt);
1794 
1795 #define COMPSOR_OPS_VERSION 1
1796 
1813 const CompositorOps* __ex_compositor_get (const char* name,
1814  const CompositorOps* fallback_ops, int* version);
1815 
1816 #endif /* defined _MGSCHEMA_COMPOSITING */
1817 
1854 #define MAX_SYS_REQID 0x0023
1855 
1862 #define MAX_REQID 0x0030
1863 
1865 typedef struct _REQUEST {
1867  int id;
1869  const void* data;
1871  size_t len_data;
1872 } REQUEST;
1874 typedef REQUEST* PREQUEST;
1875 
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);
1911 
1938 static inline int GUIAPI ClientRequestEx (const REQUEST* request,
1939  const void* ex_data, int ex_data_len,
1940  void* result, int len_rslt)
1941 {
1942  return ClientRequestEx2 (request, ex_data, ex_data_len, -1,
1943  result, len_rslt, NULL);
1944 }
1945 
1971 static inline int ClientRequest (const REQUEST* request,
1972  void* result, int len_rslt)
1973 {
1974  return ClientRequestEx (request, NULL, 0, result, len_rslt);
1975 }
1976 
1988 MG_EXPORT int GUIAPI GetSockFD2Server (void);
1989 
2014 MG_EXPORT int GUIAPI ServerSendReplyEx (int clifd,
2015  const void* reply, int len, int fd_to_send);
2016 
2038 static inline int GUIAPI ServerSendReply (int clifd, const void* reply, int len)
2039 {
2040  return ServerSendReplyEx (clifd, reply, len, -1);
2041 }
2042 
2049 typedef int (* REQ_HANDLER) (int cli, int clifd, void* buff, size_t len);
2050 
2060 typedef int (* REQ_HANDLER_V1) (int cli, int clifd,
2061  void* buff, size_t len, int fd_received);
2062 
2081 MG_EXPORT BOOL GUIAPI RegisterRequestHandler (int req_id,
2082  REQ_HANDLER your_handler);
2083 
2105 MG_EXPORT BOOL GUIAPI RegisterRequestHandlerV1 (int req_id,
2106  REQ_HANDLER_V1 your_handler_v1);
2107 
2129 MG_EXPORT REQ_HANDLER GUIAPI GetRequestHandler (int req_id);
2130 
2152 MG_EXPORT REQ_HANDLER_V1 GUIAPI GetRequestHandlerV1 (int req_id);
2153 
2173 MG_EXPORT void* GUIAPI GetRequestHandlerEx (int req_id, int* version);
2174 
2209 MG_EXPORT int serv_listen (const char* name);
2210 
2232 MG_EXPORT int serv_accept (int listenfd, pid_t *pidptr, uid_t *uidptr);
2233 
2254 MG_EXPORT int cli_conn (const char* name, char project);
2255 
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
2261 
2290 MG_EXPORT ssize_t sock_write_t (int fd, const void* buff, size_t count,
2291  DWORD timeout);
2292 
2320 MG_EXPORT ssize_t sock_read_t (int fd, void* buff, size_t count,
2321  DWORD timeout);
2322 
2329 #define sock_write(fd, buff, count) sock_write_t(fd, buff, count, 0)
2330 
2337 #define sock_read(fd, buff, count) sock_read_t(fd, buff, count, 0)
2338 
2343 #endif /* _MGRM_PROCESSES */
2344 
2378 MG_EXPORT BOOL GUIAPI ReinitDesktopEx (BOOL init_sys_text);
2379 
2391 #define ReinitDesktop() ReinitDesktopEx (TRUE)
2392 
2407 MG_EXPORT void GUIAPI ExitGUISafely (int exitcode);
2408 
2409 #ifdef _USE_MINIGUIENTRY
2410  #define main_entry minigui_entry
2411  int minigui_entry (int args, const char* arg[]);
2412 #else
2413  #define main_entry main
2414 #endif /* _USE_MINIGUIENTRY */
2415 
2433 #define MiniGUIMain \
2434 MiniGUIAppMain (int args, const char* argv[]); \
2435 int main_entry (int args, const char* argv[]) \
2436 { \
2437  int iRet = 0; \
2438  if (InitGUI (args, argv) != 0) { \
2439  return 1; \
2440  } \
2441  iRet = MiniGUIAppMain (args, argv); \
2442  TerminateGUI (iRet); \
2443  return iRet; \
2444 } \
2445 int MiniGUIAppMain
2446 
2452 #define IDM_DTI_FIRST (300)
2453 
2455 typedef struct _DESKTOPOPS {
2456 
2458  void* (*init) (HDC dc_desktop);
2459 
2461  void (*deinit) (void* context);
2462 
2464  void (*paint_desktop) (void* context,
2465  HDC dc_desktop, const RECT* inv_rc);
2466 
2468  void (*keyboard_handler) (void* context,
2469  int message, WPARAM wParam, LPARAM lParam);
2470 
2472  void (*mouse_handler) (void* context,
2473  int message, WPARAM wParam, LPARAM lParam);
2474 
2476  void (*customize_desktop_menu) (void* context,
2477  HMENU hmenu, int start_pos);
2478 
2480  void (*desktop_menucmd_handler) (void* context, int id);
2481 } DESKTOPOPS;
2482 
2550 MG_EXPORT DESKTOPOPS* GUIAPI SetCustomDesktopOperationSet
2551  (DESKTOPOPS* usr_dsk_ops);
2552 
2563 MG_EXPORT void GUIAPI DesktopUpdateAllWindow (void);
2564 
2565 #ifndef _MGRM_PROCESSES
2566 
2567 #define DUMMY_LAYER_HANDLE (GHANDLE)(-1)
2568 
2582 static inline GHANDLE GUIAPI JoinLayer (const char* layer_name,
2583  const char* client_name, int max_nr_highers, int max_nr_normals)
2584 {
2585  return DUMMY_LAYER_HANDLE;
2586 }
2587 
2588 #endif /* not defined _MGRM_PROCESSES */
2589 
2592 #ifdef _MGHAVE_MOUSECALIBRATE
2593 
2628 MG_EXPORT BOOL GUIAPI SetMouseCalibrationParameters (const POINT* src_pts,
2629  const POINT* dst_pts);
2630 
2650 MG_EXPORT void GUIAPI GetOriginalMousePosition (int* x, int* y);
2651 
2654 #endif /* _MGHAVE_MOUSECALIBRATE */
2655 
2656 #ifdef _MGMISC_ABOUTDLG
2657 
2663 #ifdef _MGRM_THREADS
2664 
2679 MG_EXPORT void GUIAPI OpenAboutDialog (void);
2680 
2681 #else /* _MGRM_THREADS */
2682 
2700 MG_EXPORT HWND GUIAPI OpenAboutDialog (HWND hHosting);
2701 
2702 #endif /* _MGRM_THREADS */
2703 
2706 #endif /* _MGMISC_ABOUTDLG */
2707 
2755 #define ETC_MAXLINE 1024
2756 
2761 #define ETC_FILENOTFOUND -1
2762 
2766 #define ETC_SECTIONNOTFOUND -2
2767 
2771 #define ETC_KEYNOTFOUND -3
2772 
2776 #define ETC_TMPFILEFAILED -4
2777 
2781 #define ETC_FILEIOFAILED -5
2782 
2786 #define ETC_INTCONV -6
2787 
2791 #define ETC_INVALIDOBJ -7
2792 
2796 #define ETC_READONLYOBJ -8
2797 
2801 #define ETC_OK 0
2802 
2804 typedef struct _ETCSECTION
2805 {
2809  int key_nr;
2811  char *name;
2813  char** keys;
2815  char** values;
2816 } ETCSECTION;
2819 
2821 typedef struct _ETC_S
2822 {
2828  PETCSECTION sections;
2829 } ETC_S;
2830 
2831 #ifndef _MGINCORE_RES
2832 
2848 extern MG_EXPORT char ETCFILEPATH [];
2849 
2850 #endif /* !_MGINCORE_RES */
2851 
2882 MG_EXPORT int GUIAPI GetValueFromEtcFile (const char* pEtcFile,
2883  const char* pSection, const char* pKey, char* pValue, int iLen);
2884 
2922 MG_EXPORT int GUIAPI GetIntValueFromEtcFile (const char* pEtcFile,
2923  const char* pSection, const char* pKey, int* value);
2924 
2950 MG_EXPORT int GUIAPI SetValueToEtcFile (const char* pEtcFile,
2951  const char* pSection, const char* pKey, char* pValue);
2952 
2973 MG_EXPORT int GUIAPI RemoveSectionInEtcFile (const char* pEtcFile,
2974  const char* pSection);
2975 
2994 MG_EXPORT int GUIAPI SaveSectionToEtcFile (const char* pEtcFile,
2995  PETCSECTION psect);
3010 MG_EXPORT GHANDLE GUIAPI LoadEtcFile (const char * pEtcFile);
3011 
3029 MG_EXPORT int GUIAPI SaveEtcToFile (GHANDLE hEtc, const char* file_name);
3030 
3044 MG_EXPORT int GUIAPI UnloadEtcFile (GHANDLE hEtc);
3045 
3074 MG_EXPORT int GUIAPI GetValueFromEtc (GHANDLE hEtc, const char* pSection,
3075  const char* pKey, char* pValue, int iLen);
3076 
3084 MG_EXPORT int GUIAPI GetIntValueFromEtc (GHANDLE hEtc, const char* pSection,
3085  const char* pKey, int* pValue);
3086 
3097 #define SetValueToEtc(hEtc, pSection, pKey, pValue) \
3098  GetValueFromEtc(hEtc, pSection, pKey, pValue, -1)
3099 
3117 MG_EXPORT GHANDLE GUIAPI FindSectionInEtc (GHANDLE hEtc,
3118  const char* pSection, BOOL bCreateNew);
3119 
3145 MG_EXPORT int GUIAPI GetValueFromEtcSec (GHANDLE hSect,
3146  const char* pKey, char* pValue, int iLen);
3147 
3171 MG_EXPORT int GUIAPI GetIntValueFromEtcSec (GHANDLE hSect,
3172  const char* pKey, int* pValue);
3173 
3184 MG_EXPORT int GUIAPI SetValueToEtcSec (GHANDLE hSect,
3185  const char* pKey, char* pValue);
3186 
3207 MG_EXPORT int GUIAPI RemoveSectionInEtc (GHANDLE hEtc, const char* pSection);
3208 
3209 /* global MiniGUI etc file object */
3210 extern MG_EXPORT GHANDLE hMgEtc;
3211 
3221 static inline int GetMgEtcValue(const char* pSection,
3222  const char *pKey, char *pValue, int iLen)
3223 {
3224 #ifndef _MGINCORE_RES
3225  if (!hMgEtc)
3226  return GetValueFromEtcFile (ETCFILEPATH, pSection, pKey, pValue, iLen);
3227 #endif /* !_MGINCORE_RES */
3228 
3229  return GetValueFromEtc (hMgEtc, pSection, pKey, pValue, iLen);
3230 }
3231 
3241 static inline int GetMgEtcIntValue (const char *pSection,
3242  const char* pKey, int *value)
3243 {
3244 #ifndef _MGINCORE_RES
3245  if (!hMgEtc)
3246  return GetIntValueFromEtcFile (ETCFILEPATH, pSection, pKey, value);
3247 #endif /* !_MGINCORE_RES */
3248 
3249  return GetIntValueFromEtc (hMgEtc, pSection, pKey, value);
3250 }
3251 
3254 #ifdef _MGHAVE_CLIPBOARD
3255 
3265 #define LEN_CLIPBOARD_NAME 15
3266 
3270 #define NR_CLIPBOARDS 4
3271 
3276 #define CBNAME_TEXT ("text")
3277 
3283 #define CBERR_OK 0
3284 
3289 #define CBERR_BADNAME 1
3290 
3295 #define CBERR_NOMEM 2
3296 
3301 #define CBOP_NORMAL 0
3302 
3306 #define CBOP_APPEND 1
3307 
3325 MG_EXPORT int GUIAPI CreateClipBoard (const char* cb_name, size_t size);
3326 
3340 MG_EXPORT int GUIAPI DestroyClipBoard (const char* cb_name);
3341 
3365 MG_EXPORT int GUIAPI SetClipBoardData (const char* cb_name,
3366  void* data, size_t n, int cbop);
3367 
3380 MG_EXPORT size_t GUIAPI GetClipBoardDataLen (const char* cb_name);
3381 
3397 MG_EXPORT size_t GUIAPI GetClipBoardData (const char* cb_name,
3398  void* data, size_t n);
3399 
3417 MG_EXPORT int GUIAPI GetClipBoardByte (const char* cb_name,
3418  int index, unsigned char* byte);
3419 
3422 #endif /* _MGHAVE_CLIPBOARD */
3423 
3442 MG_EXPORT DWORD GUIAPI GetTickCount (void);
3443 
3449 MG_EXPORT void GUIAPI Ping (void);
3450 
3456 #define Beep Ping
3457 
3473 MG_EXPORT void GUIAPI Tone (int frequency_hz, int duration_ms);
3474 
3482 MG_EXPORT void* GUIAPI GetOriginalTermIO (void);
3483 
3517 MG_EXPORT char* GUIAPI FixStrAlloc (int len);
3518 
3536 MG_EXPORT char* GUIAPI FixStrDup (const char* str);
3537 
3550 MG_EXPORT void GUIAPI FreeFixStr (char* str);
3551 
3559 #ifdef _MGHAVE_CURSOR
3560 
3577 MG_EXPORT HCURSOR GUIAPI LoadCursorFromFile (const char* filename);
3578 
3595 MG_EXPORT HCURSOR GUIAPI LoadCursorFromMem (const void* area);
3596 
3597 #ifdef _MGSCHEMA_COMPOSITING
3598 
3620 MG_EXPORT HCURSOR GUIAPI LoadCursorFromPNGFile (const char* filename,
3621  int hotspot_x, int hotspot_y);
3622 
3645 MG_EXPORT HCURSOR GUIAPI LoadCursorFromPNGMem (const void* area, size_t size,
3646  int hotspot_x, int hotspot_y);
3647 
3648 #endif /* _MGSCHEMA_COMPOSITING */
3649 
3675 MG_EXPORT HCURSOR GUIAPI CreateCursor (int xhotspot, int yhotspot, int w, int h,
3676  const BYTE* pANDBits, const BYTE* pXORBits, int colornum);
3677 
3690 MG_EXPORT HCURSOR GUIAPI CopyCursor (HCURSOR hcsr);
3691 
3702 MG_EXPORT BOOL GUIAPI DestroyCursor (HCURSOR hcsr);
3703 
3762 MG_EXPORT HCURSOR GUIAPI GetSystemCursor (int csrid);
3763 
3772 MG_EXPORT HCURSOR GUIAPI GetCurrentCursor (void);
3773 
3774 #else /* _MGHAVE_CURSOR */
3775 
3776 static inline HCURSOR LoadCursorFromFile (const char* filename) {
3777  return (HCURSOR)0;
3778 }
3779 
3780 static inline HCURSOR GUIAPI LoadCursorFromMem (const void* area) {
3781  return (HCURSOR)0;
3782 }
3783 
3784 #ifdef _MGSCHEMA_COMPOSITING
3785 static inline
3786 HCURSOR LoadCursorFromPNGFile(const char* filename,
3787  int hotspot_x, int hotspot_y) {
3788  return (HCURSOR)0;
3789 }
3790 
3791 static inline
3792 HCURSOR GUIAPI LoadCursorFromPNGMem(const void* area, size_t size,
3793  int hotspot_x, int hotspot_y) {
3794  return (HCURSOR)0;
3795 }
3796 
3797 #endif
3798 
3799 static inline
3800 HCURSOR CreateCursor (int xhotspot, int yhotspot, int w, int h,
3801  const BYTE* pANDBits, const BYTE* pXORBits, int colornum) {
3802  return (HCURSOR)0;
3803 }
3804 
3805 static inline HCURSOR GUIAPI CopyCursor (HCURSOR hcsr) {
3806  return (HCURSOR)0;
3807 }
3808 
3809 static inline BOOL DestroyCursor (HCURSOR hcsr) {
3810  return TRUE;
3811 }
3812 
3813 static inline HCURSOR GetSystemCursor (int csrid) {
3814  return (HCURSOR)0;
3815 }
3816 
3817 static inline HCURSOR GUIAPI GetCurrentCursor (void) {
3818  return (HCURSOR)0;
3819 }
3820 
3821 #endif /* !_MGHAVE_CURSOR */
3822 
3823 #define MAX_SYSCURSORINDEX 22
3824 
3825 /* System cursor index. */
3827 #define IDC_ARROW 0
3828 
3829 #define IDC_IBEAM 1
3830 
3831 #define IDC_PENCIL 2
3832 
3833 #define IDC_CROSS 3
3834 
3835 #define IDC_MOVE 4
3836 
3837 #define IDC_SIZENWSE 5
3838 
3839 #define IDC_SIZENESW 6
3840 
3841 #define IDC_SIZEWE 7
3842 
3843 #define IDC_SIZENS 8
3844 
3845 #define IDC_UPARROW 9
3846 
3847 #define IDC_NONE 10
3848 
3849 #define IDC_HELP 11
3850 
3851 #define IDC_BUSY 12
3852 
3853 #define IDC_WAIT 13
3854 
3855 #define IDC_RARROW 14
3856 
3857 #define IDC_COLOMN 15
3858 
3859 #define IDC_ROW 16
3860 
3861 #define IDC_DRAG 17
3862 
3863 #define IDC_NODROP 18
3864 
3865 #define IDC_HAND_POINT 19
3866 
3867 #define IDC_HAND_SELECT 20
3868 
3869 #define IDC_SPLIT_HORZ 21
3870 
3871 #define IDC_SPLIT_VERT 22
3872 
3884 MG_EXPORT void GUIAPI ClipCursor (const RECT* prc);
3885 
3896 MG_EXPORT void GUIAPI GetClipCursor (RECT* prc);
3897 
3910 MG_EXPORT void GUIAPI GetCursorPos (POINT* ppt);
3911 
3925 MG_EXPORT void GUIAPI SetCursorPos (int x, int y);
3926 
3927 #ifdef _MGHAVE_CURSOR
3928 
3946 MG_EXPORT HCURSOR GUIAPI SetCursorEx (HCURSOR hcsr, BOOL set_def);
3947 
3958 MG_EXPORT HCURSOR GUIAPI GetDefaultCursor (void);
3959 
3974 MG_EXPORT int GUIAPI ShowCursor (BOOL fShow);
3975 
3976 #else /* _MGHAVE_CURSOR */
3977 
3978 static inline HCURSOR SetCursorEx(HCURSOR hcsr, BOOL set_def) {
3979  return (HCURSOR)0;
3980 }
3981 
3982 static inline HCURSOR GetDefaultCursor(void) {
3983  return (HCURSOR)0;
3984 }
3985 
3986 static inline int GUIAPI ShowCursor (BOOL fShow) {
3987  return 0;
3988 }
3989 
3990 #endif /* !_MGHAVE_CURSOR */
3991 
4006 #define SetCursor(hcsr) SetCursorEx (hcsr, FALSE)
4007 
4023 #define SetDefaultCursor(hcsr) SetCursorEx (hcsr, TRUE)
4024 
4057 MG_EXPORT BOOL GUIAPI GetKeyStatus (UINT uKey);
4058 
4099 MG_EXPORT DWORD GUIAPI GetShiftKeyStatus (void);
4100 
4115 MG_EXPORT void GUIAPI GetKeyboardState (BYTE* kbd_state);
4116 
4128 #define IDS_MGST_WINDOW 0
4129 
4134 #define IDS_MGST_START 1
4135 
4140 #define IDS_MGST_REFRESH 2
4141 
4146 #define IDS_MGST_CLOSEALLWIN 3
4147 
4152 #define IDS_MGST_ENDSESSION 4
4153 
4158 #define IDS_MGST_OPERATIONS 5
4159 
4164 #define IDS_MGST_MINIMIZE 6
4165 
4170 #define IDS_MGST_MAXIMIZE 7
4171 
4176 #define IDS_MGST_RESTORE 8
4177 
4182 #define IDS_MGST_CLOSE 9
4183 
4188 #define IDS_MGST_OK 10
4189 
4194 #define IDS_MGST_NEXT 11
4195 
4200 #define IDS_MGST_CANCEL 12
4201 
4206 #define IDS_MGST_PREV 13
4207 
4212 #define IDS_MGST_YES 14
4213 
4218 #define IDS_MGST_NO 15
4219 
4224 #define IDS_MGST_ABORT 16
4225 
4230 #define IDS_MGST_RETRY 17
4231 
4236 #define IDS_MGST_IGNORE 18
4237 
4242 #define IDS_MGST_ABOUTMG 19
4243 
4248 #define IDS_MGST_OPENFILE 20
4249 
4254 #define IDS_MGST_SAVEFILE 21
4255 
4260 #define IDS_MGST_COLORSEL 22
4261 
4266 #define IDS_MGST_SWITCHLAYER 23
4267 
4272 #define IDS_MGST_DELLAYER 24
4273 
4278 #define IDS_MGST_ERROR 25
4279 
4284 #define IDS_MGST_LOGO 26
4285 
4290 #define IDS_MGST_CURRPATH 27
4291 
4296 #define IDS_MGST_FILE 28
4297 
4302 #define IDS_MGST_LOCATION 29
4303 
4308 #define IDS_MGST_UP 30
4309 
4314 #define IDS_MGST_NAME 31
4315 
4320 #define IDS_MGST_SIZE 32
4321 
4326 #define IDS_MGST_ACCESSMODE 33
4327 
4332 #define IDS_MGST_LASTMODTIME 34
4333 
4338 #define IDS_MGST_OPEN 35
4339 
4344 #define IDS_MGST_FILENAME 36
4345 
4350 #define IDS_MGST_FILETYPE 37
4351 
4356 #define IDS_MGST_SHOWHIDEFILE 38
4357 
4362 #define IDS_MGST_NOTFOUND 39
4363 
4368 #define IDS_MGST_NR 40
4369 
4374 #define IDS_MGST_NW 41
4375 
4380 #define IDS_MGST_INFO 42
4381 
4386 #define IDS_MGST_R 43
4387 
4392 #define IDS_MGST_W 44
4393 
4398 #define IDS_MGST_WR 45
4399 
4404 #define IDS_MGST_SAVE 46
4405 
4410 #define IDS_MGST_FILEEXIST 47
4411 
4412 #define IDS_MGST_MAXNUM 47
4413 
4433 MG_EXPORT const char* GUIAPI GetSysText (unsigned int id);
4434 
4501 extern MG_EXPORT const char* SysText [];
4502 
4514 extern MG_EXPORT const char** local_SysText;
4515 
4516 #ifdef _MGCHARSET_UNICODE
4517 
4536 extern MG_EXPORT const char** GUIAPI GetSysTextInUTF8 (const char* language);
4537 
4538 #endif /* _MGCHARSET_UNICODE */
4539 
4560 MG_EXPORT char* strnchr (const char* s, size_t n, int c);
4561 
4578 MG_EXPORT int substrlen (const char* text, int len, int delimiter,
4579  int* nr_delim);
4580 
4593 MG_EXPORT char * strtrimall (char* src);
4594 
4703 MG_EXPORT void *mg_slice_alloc(size_t block_size);
4704 
4721 MG_EXPORT void *mg_slice_alloc0(size_t block_size);
4722 
4740 MG_EXPORT void *mg_slice_copy(size_t block_size, const void *mem_block);
4741 
4760 MG_EXPORT void mg_slice_free(size_t block_size, void *mem_block);
4761 
4784 MG_EXPORT void mg_slice_free_chain_with_offset(size_t block_size,
4785  void *mem_chain, size_t next_offset);
4786 
4810 #define mg_slice_new(type) ((type*)mg_slice_alloc(sizeof (type)))
4811 
4837 #define mg_slice_new0(type) ((type*)mg_slice_alloc0(sizeof (type)))
4838 
4839 /* MemoryBlockType *
4840  * mg_slice_dup (MemoryBlockType,
4841  * MemoryBlockType *mem_block);
4842  * mg_slice_delete (MemoryBlockType,
4843  * MemoryBlockType *mem_block);
4844  * mg_slice_delete_chain (MemoryBlockType,
4845  * MemoryBlockType *first_chain_block,
4846  * memory_block_next_field);
4847  * pseudo prototypes for the macro definitions following below.
4848  */
4849 
4873 #define mg_slice_dup(type, mem) \
4874  (1 ? (type*) mg_slice_copy (sizeof (type), (mem)) \
4875  : ((void) ((type*) 0 == (mem)), (type*) 0))
4876 
4899 #define mg_slice_delete(type, mem) \
4900  do { \
4901  if (1) mg_slice_free (sizeof (type), (mem)); \
4902  else (void) ((type*) 0 == (mem)); \
4903  } while(0)
4904 
4929 #define mg_slice_delete_chain(type, mem_chain, next) \
4930  do { \
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)); \
4934  } while(0)
4935 
4936 #ifdef _MGDEVEL_MODE
4937 MG_EXPORT void mg_slice_debug_tree_statistics(void);
4938 #endif
4939 
4946 #ifdef __cplusplus
4947 }
4948 #endif /* __cplusplus */
4949 
4950 #endif /* _MGUI_MINIGUI_H */
4951 
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.
MG_EXPORT void GUIAPI GetCursorPos(POINT *ppt)
Get position of the current cursor.
int key_nr
Definition: minigui.h:2809
Definition: common.h:966
MG_EXPORT char *GUIAPI FixStrAlloc(int len)
Allocates a buffer for a length-fixed string.
int BOOL
A type definition for boolean value.
Definition: common.h:343
MG_EXPORT void GUIAPI SetCursorPos(int x, int y)
Set position of the current cursor.
unsigned char BYTE
A type definition for an 8-bit unsigned character (byte).
Definition: common.h:460
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.
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)
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 DESKTOPOPS *GUIAPI SetCustomDesktopOperationSet(DESKTOPOPS *usr_dsk_ops)
Set customer desktop operation set.
Definition: common.h:936
char ** values
Definition: minigui.h:2815
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)
Get the length of the data of a clipboard.
struct _DESKTOPOPS DESKTOPOPS
static int GetMgEtcIntValue(const char *pSection, const char *pKey, int *value)
Get integer value from MiniGUI configuration etc object.
Definition: minigui.h:3241
MG_EXPORT int GUIAPI SaveEtcToFile(GHANDLE hEtc, const char *file_name)
Saves an ETC object into a file.
GHANDLE HDC
Handle to device context.
Definition: common.h:412
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 GetKeyStatus(UINT uKey)
Get a key or a mouse button status.
MG_EXPORT const char *GUIAPI GetSysText(unsigned int id)
Translates system text to localized text.
static GHANDLE GUIAPI JoinLayer(const char *layer_name, const char *client_name, int max_nr_highers, int max_nr_normals)
The dummy replacement of the same function for MiniGUI-Processes.
Definition: minigui.h:2582
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.
#define TRUE
TRUE value, defined as 1 by MiniGUI.
Definition: common.h:358
MG_EXPORT HCURSOR GUIAPI LoadCursorFromMem(const void *area)
Loads a cursor from a memory area.
ETCSECTION * PETCSECTION
Definition: minigui.h:2818
MG_EXPORT void GUIAPI FreeFixStr(char *str)
Frees a length-fixed string.
struct _ETC_S ETC_S
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.
Definition: common.h:407
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)
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.
int sect_nr_alloc
Definition: minigui.h:2824
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.
int key_nr_alloc
Definition: minigui.h:2807
static int GetMgEtcValue(const char *pSection, const char *pKey, char *pValue, int iLen)
Get value from MiniGUI configuration etc object.
Definition: minigui.h:3221
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.
Definition: common.h:422
int section_nr
Definition: minigui.h:2826
#define NULL
A value indicates null pointer.
Definition: common.h:369
PVOID GHANDLE
General handle.
Definition: common.h:402
struct _ETCSECTION ETCSECTION
MG_EXPORT HWND GUIAPI OpenAboutDialog(HWND hHosting)
Opens or actives the &#39;About MiniGUI&#39; dialog.
Definition: gdi.h:788
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.
Definition: common.h:712
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.
PETCSECTION sections
Definition: minigui.h:2828
MG_EXPORT DWORD GUIAPI GetTickCount(void)
Retrieve the tick counts that have elapsed since MiniGUI was started.
MG_EXPORT HCURSOR GUIAPI GetSystemCursor(int csrid)
Get the handle to a system cursor by its identifier.
MG_EXPORT HCURSOR GUIAPI GetCurrentCursor(void)
Get the handle to the current cursor.
MG_EXPORT int GUIAPI ShowCursor(BOOL fShow)
Shows or hides cursor.
char ** keys
Definition: minigui.h:2813
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.
Definition: common.h:706
DWORD_PTR DWORD
A unsigned long type definition for pointer precision.
Definition: common.h:604
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 BOOL GUIAPI SetMouseCalibrationParameters(const POINT *src_pts, const POINT *dst_pts)
Set the parameters for doing mouse calibration.
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 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.
Definition: common.h:664
MG_EXPORT DWORD GUIAPI GetShiftKeyStatus(void)
Get status of the shift keys.
char * name
Definition: minigui.h:2811
MG_EXPORT void GUIAPI TerminateGUI(int not_used)
Terminate MiniGUI.
GHANDLE HMENU
Handle to menu.
Definition: common.h:432
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 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 int GUIAPI RemoveSectionInEtc(GHANDLE hEtc, const char *pSection)
Removes a section in etc object.