MiniGUI API Reference (MiniGUI-Threads)  v5.0.6
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.6 */
86 #define ZOF_GESTURE_FLAGS_MASK 0X000000F0
87 #define ZOF_GF_SWIPE_HORZ 0x00000010
88 #define ZOF_GF_SWIPE_VERT 0x00000020
89 
90 /* Since 5.0.0 */
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
95 
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
100 
101 #define ZOF_TYPE_FLAG_MASK 0xFF000000
102 
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
114 
115 #define ZOF_TYPE_BOTTOMMOST ZOF_TYPE_LAUNCHER
116 #define ZOF_TYPE_TOPMOST ZOF_TYPE_TOOLTIP
117 
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
122 
123 #define ZNIT_NULL (ZOF_TYPE_NULL)
124 #define ZNIT_POPUPMENU (ZOF_TYPE_POPUPMENU)
125 #define ZNIT_TOOLTIP (ZOF_TYPE_TOOLTIP | ZOF_TF_MAINWIN)
126 
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)
130 
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)
134 
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)
138 
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)
142 
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)
146 
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)
150 
151 #define ZNIT_DESKTOP (ZOF_TYPE_DESKTOP)
152 
153 #define ZNIF_VISIBLE (ZOF_VISIBLE)
154 #define ZNIF_DISABLED (ZOF_DISABLED)
155 #define ZNIF_MAXIMIZED (ZOF_MAXIMIZED) /* Since 5.2.0 */
156 #define ZNIF_MINIMIZED (ZOF_MINIMIZED) /* Since 5.2.0 */
157 
158 /* definitions for backward compatibility */
159 #define ZNIT_TOPMOST_MAINWIN (ZNIT_HIGHER_MAINWIN)
160 #define ZNIT_TOPMOST_TOOLWIN (ZNIT_HIGHER_TOOLWIN)
161 #define ZNIT_TOPMOST_CONTROL (ZNIT_HIGHER_CONTROL)
162 
163 typedef struct _CalcPosInfo {
164  DWORD style;
165  DWORD ex_style;
166  RECT rc;
167 } CALCPOSINFO;
168 
180 MG_EXPORT RECT GUIAPI GetScreenRect (void);
181 
188 #define g_rcScr (GetScreenRect())
189 
198 #define g_rcDesktop g_rcScr
199 
202 #ifdef _MGRM_PROCESSES
203 
221 MG_EXPORT BOOL GUIAPI IsServer(void);
222 
232 #define mgIsServer (IsServer())
233 
243 extern MG_EXPORT void* mgSharedRes;
244 
253 extern MG_EXPORT size_t mgSizeRes;
254 
259 #define LEN_LAYER_NAME 15
260 
265 #define LEN_CLIENT_NAME 15
266 
271 #define INV_LAYER_HANDLE 0
272 
273 struct _MG_Layer;
274 
276 typedef struct _MG_Client
277 {
279  char name [LEN_CLIENT_NAME + 1];
280 
282  pid_t pid;
284  uid_t uid;
286  int fd;
287 
289  BOOL has_dirty;
291  DWORD last_live_time;
293  DWORD dwAddData;
294 
296  struct _MG_Client* next;
298  struct _MG_Client* prev;
299 
301  struct _MG_Layer* layer;
302 
304  struct GlobalRes* global_res;
305 } MG_Client;
306 
308 typedef struct _MG_Layer
309 {
311  char name [LEN_LAYER_NAME + 1];
312 
314  DWORD dwAddData;
315 
317  MG_Client* cli_head;
319  MG_Client* cli_active;
320 
322  struct _MG_Layer* next;
324  struct _MG_Layer* prev;
325 
327  void* zorder_info;
329  int zorder_shmid;
330 } MG_Layer;
331 
338 extern MG_EXPORT int mgClientSize;
339 
350 extern MG_EXPORT MG_Client* mgClients;
351 
358 extern MG_EXPORT MG_Layer* mgTopmostLayer;
359 
366 extern MG_EXPORT MG_Layer* mgDefaultLayer;
367 
374 extern MG_EXPORT MG_Layer* mgLayers;
375 
378 #endif /* _MGRM_PROCESSES */
379 
399 MG_EXPORT int GUIAPI InitGUI (int argc, const char *argv[]);
400 
408 MG_EXPORT void GUIAPI TerminateGUI (int not_used);
409 
419 MG_EXPORT void GUIAPI MiniGUIPanic (int exitcode);
420 
425 #define NAME_SELF_LAYER ""
426 
431 #define NAME_TOPMOST_LAYER ""
432 
437 #define NAME_DEF_LAYER "mginit"
438 
439 #ifdef _MGRM_PROCESSES
440 
493 MG_EXPORT GHANDLE GUIAPI JoinLayer (const char* layer_name,
494  const char* client_name,
495  int max_nr_highers, int max_nr_normals);
496 
521 MG_EXPORT GHANDLE GUIAPI GetLayerInfo (const char* layer_name,
522  int* nr_clients, BOOL* is_topmost, int* cli_active);
523 
541 MG_EXPORT BOOL GUIAPI SetTopmostLayer (BOOL handle_name,
542  GHANDLE layer_handle, const char* layer_name);
543 
561 MG_EXPORT BOOL GUIAPI DeleteLayer (BOOL handle_name,
562  GHANDLE layer_handle, const char* layer_name);
563 
589 MG_EXPORT BOOL GUIAPI MoveToLayer (BOOL handle_name,
590  GHANDLE layer_handle, const char* layer_name);
591 
613 typedef int (* ON_LOCK_CLIENT_REQ) (void);
614 
621 typedef int (* ON_TRYLOCK_CLIENT_REQ) (void);
622 
629 typedef void (* ON_UNLOCK_CLIENT_REQ) (void);
630 
639 extern MG_EXPORT ON_LOCK_CLIENT_REQ OnLockClientReq;
640 
649 extern MG_EXPORT ON_TRYLOCK_CLIENT_REQ OnTrylockClientReq;
658 extern MG_EXPORT ON_UNLOCK_CLIENT_REQ OnUnlockClientReq;
659 
660 #define LCO_NEW_CLIENT 1
661 #define LCO_DEL_CLIENT 2
662 
669 typedef void (* ON_NEW_DEL_CLIENT) (int op, int cli);
670 
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
677 
685 typedef void (* ON_CHANGE_LAYER) (int op, MG_Layer* layer,
686  MG_Client* client);
687 
688 #define ZNOP_ALLOCATE 1
689 #define ZNOP_FREE 2
690 #define ZNOP_MOVE2TOP 3
691 #define ZNOP_SHOW 4
692 #define ZNOP_HIDE 5
693 #define ZNOP_MOVEWIN 6
694 #define ZNOP_SETACTIVE 7
695 
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 /* reserved for future */
704 
711 typedef void (* ON_ZNODE_OPERATION) (int op, int cli, int idx_znode);
712 
736 extern MG_EXPORT ON_NEW_DEL_CLIENT OnNewDelClient;
737 
767 extern MG_EXPORT ON_CHANGE_LAYER OnChangeLayer;
768 
815 extern MG_EXPORT ON_ZNODE_OPERATION OnZNodeOperation;
816 
843 MG_EXPORT BOOL GUIAPI ServerStartup (int nr_globals,
844  int def_nr_highers, int def_nr_normals);
845 
874 MG_EXPORT MG_Layer* GUIAPI ServerCreateLayer (const char* layer_name,
875  int max_nr_highers, int max_nr_normals);
876 
891 MG_EXPORT BOOL GUIAPI ServerSetTopmostLayer (MG_Layer* layer);
892 
907 MG_EXPORT BOOL GUIAPI ServerDeleteLayer (MG_Layer* layer);
908 
939 MG_EXPORT int GUIAPI ServerGetTopmostZNodeOfType (MG_Layer* layer, DWORD type,
940  int* cli);
941 
968 MG_EXPORT int GUIAPI ServerGetNextZNode (MG_Layer* layer, int idx_znode,
969  int* cli);
970 
999 MG_EXPORT int GUIAPI ServerGetPrevZNode (MG_Layer* layer, int idx_znode,
1000  int* cli);
1001 
1003 typedef struct _ZNODEINFO {
1052  DWORD type;
1053 
1066  DWORD flags;
1067 
1069  const char* caption;
1070 
1072  RECT rc;
1073 
1075  HWND hwnd;
1080  HWND main_win;
1081 
1083  int cli;
1084 
1085 #ifdef _MGSCHEMA_COMPOSITING
1086 
1090  int ct;
1095  DWORD ct_arg;
1096 #endif
1097 
1101  void* priv_data;
1102 } ZNODEINFO;
1103 
1124 MG_EXPORT BOOL GUIAPI ServerGetZNodeInfo (MG_Layer* layer, int idx_znode,
1125  ZNODEINFO* znode_info);
1126 
1128 typedef struct _ZNODEHEADER {
1141  DWORD flags;
1142 
1144  const char* caption;
1145 
1147  HWND hwnd;
1148 
1153  HWND main_win;
1154 
1156  RECT rc;
1157 
1159  int cli;
1160 
1162  int lock_count;
1163 
1164 #ifdef _MGSCHEMA_COMPOSITING
1165 
1166  unsigned int changes;
1171  int ct;
1176  DWORD ct_arg;
1177 
1179  HDC mem_dc;
1180 
1182  unsigned int dirty_age;
1183 
1185  int nr_dirty_rcs;
1186 
1188  const RECT* dirty_rcs;
1189 #else
1190 
1191  unsigned int age;
1193  RECT dirty_rc;
1194 #endif
1195 } ZNODEHEADER;
1196 
1227 MG_EXPORT const ZNODEHEADER* GUIAPI ServerGetWinZNodeHeader (
1228  MG_Layer* layer, int idx_znode, void** priv_data, BOOL lock);
1229 
1252 #ifdef _MGSCHEMA_COMPOSITING
1253 MG_EXPORT BOOL GUIAPI ServerReleaseWinZNodeHeader (MG_Layer* layer,
1254  int idx_znode);
1255 #else /* not defined _MGSCHEMA_COMPOSITING */
1256 static inline BOOL GUIAPI ServerReleaseWinZNodeHeader (MG_Layer* layer,
1257  int idx_znode)
1258 {
1259  return TRUE;
1260 }
1261 #endif /* not defined _MGSCHEMA_COMPOSITING */
1262 
1277 MG_EXPORT int GUIAPI ServerGetPopupMenusCount (void);
1278 
1304 MG_EXPORT const ZNODEHEADER* GUIAPI ServerGetPopupMenuZNodeHeader (
1305  int idx_znode, void** priv_data, BOOL lock);
1306 
1329 #ifdef _MGSCHEMA_COMPOSITING
1330 MG_EXPORT BOOL GUIAPI ServerReleasePopupMenuZNodeHeader (int idx_znode);
1331 #else /* not defined _MGSCHEMA_COMPOSITING */
1332 static inline BOOL GUIAPI ServerReleasePopupMenuZNodeHeader (int idx_znode)
1333 {
1334  return TRUE;
1335 }
1336 #endif /* not defined _MGSCHEMA_COMPOSITING */
1337 
1338 typedef struct _CLIPRGN CLIPRGN;
1339 
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
1345 
1377 MG_EXPORT BOOL GUIAPI ServerGetWinZNodeRegion (MG_Layer* layer, int idx_znode,
1378  DWORD rgn_ops, CLIPRGN* dst_rgn);
1379 
1413 MG_EXPORT BOOL GUIAPI ServerGetPopupMenuZNodeRegion (int idx_znode,
1414  DWORD rgn_ops, CLIPRGN* dst_rgn);
1415 
1438 MG_EXPORT BOOL GUIAPI ServerSetWinZNodePrivateData (MG_Layer* layer,
1439  int idx_znode, void* priv_data);
1440 
1460 MG_EXPORT BOOL GUIAPI ServerSetPopupMenuZNodePrivateData (int idx_znode,
1461  void* priv_data);
1462 
1495 MG_EXPORT BOOL GUIAPI ServerDoZNodeOperation (MG_Layer* layer, int idx_znode,
1496  int op_code, void* op_data, BOOL notify);
1497 
1520 MG_EXPORT BOOL GUIAPI ServerMoveClientToLayer (int cli, MG_Layer* dst_layer);
1521 
1533 MG_EXPORT int GUIAPI GetClientByPID (int pid);
1534 
1551 MG_EXPORT BOOL GUIAPI SetTopmostClient (int cli);
1552 
1557 MG_EXPORT void GUIAPI DisableClientsOutput (void);
1558 
1565 MG_EXPORT void GUIAPI UpdateTopmostLayer (const RECT* dirty_rc);
1566 
1567 #ifdef _MGSCHEMA_COMPOSITING
1568 
1573 struct _CompositorCtxt;
1574 typedef struct _CompositorCtxt CompositorCtxt;
1575 
1576 struct _CLIPRGN;
1577 typedef struct _CLIPRGN CLIPRGN;
1578 
1582 typedef struct _CompositorOps {
1587  CompositorCtxt* (*initialize) (const char* name);
1588 
1593  void (*terminate) (CompositorCtxt* ctxt);
1594 
1599  void (*refresh) (CompositorCtxt* ctxt);
1600 
1606  void (*purge_ppp_data) (CompositorCtxt* ctxt, int zidx, void* data);
1607 
1613  void (*purge_win_data) (CompositorCtxt* ctxt, MG_Layer* layer,
1614  int zidx, void* data);
1615 
1620  void (*calc_mainwin_pos) (CompositorCtxt* ctxt, MG_Layer* layer,
1621  DWORD zt_type, int first_for_type, int cli, CALCPOSINFO* info);
1622 
1627  void (*on_layer_op) (CompositorCtxt* ctxt, int layer_op,
1628  MG_Layer* layer, MG_Client* client);
1629 
1636  BOOL (*reset_dirty_region) (CompositorCtxt* ctxt, MG_Layer* layer);
1637 
1644  BOOL (*merge_dirty_ppp) (CompositorCtxt* ctxt, MG_Layer* layer, int zidx);
1645 
1652  BOOL (*merge_dirty_win) (CompositorCtxt* ctxt, MG_Layer* layer, int zidx);
1653 
1660  BOOL (*merge_dirty_wpp) (CompositorCtxt* ctxt, MG_Layer* layer);
1661 
1666  BOOL (*refresh_dirty_region) (CompositorCtxt* ctxt, MG_Layer* layer);
1667 
1679  void (*on_dirty_screen) (CompositorCtxt* ctxt, MG_Layer* layer,
1680  DWORD cause_type, const RECT* rc_dirty);
1681 
1688  void (*on_showing_ppp) (CompositorCtxt* ctxt, int zidx);
1689 
1695  void (*on_hiding_ppp) (CompositorCtxt* ctxt, int zidx);
1696 
1703  void (*on_closed_menu) (CompositorCtxt* ctxt, const RECT* rc_bound);
1704 
1711  void (*on_showing_win) (CompositorCtxt* ctxt, MG_Layer* layer, int zidx);
1712 
1718  void (*on_hiding_win) (CompositorCtxt* ctxt, MG_Layer* layer, int zidx);
1719 
1725  void (*on_raised_win) (CompositorCtxt* ctxt, MG_Layer* layer, int zidx);
1726 
1732  void (*on_changed_ct) (CompositorCtxt* ctxt, MG_Layer* layer, int zidx);
1733 
1739  void (*on_changed_rgn) (CompositorCtxt* ctxt, MG_Layer* layer,
1740  int zidx, const RECT* rc_org_bound);
1741 
1747  void (*on_moved_win) (CompositorCtxt* ctxt, MG_Layer* layer,
1748  int zidx, const RECT* rc_org);
1749 
1754  unsigned int (*composite_layers) (CompositorCtxt* ctxt, MG_Layer* layers[],
1755  int nr_layers, void* combine_param);
1756 
1762  void (*transit_to_layer) (CompositorCtxt* ctxt, MG_Layer* to_layer);
1763 
1768  void (*on_maximizing_win) (CompositorCtxt* ctxt, MG_Layer* layer, int zidx);
1769 
1774  void (*on_minimizing_win) (CompositorCtxt* ctxt, MG_Layer* layer, int zidx);
1775 
1776 } CompositorOps;
1777 
1778 #define FCM_HORIZONTAL 0x0000
1779 #define FCM_VERTICAL 0x0001
1780 #define FCM_METHOD_MASK 0x00FF
1781 #define FCM_SCALE 0x0100
1782 
1784 typedef struct _CombParamsFallback {
1792  unsigned int method;
1793 
1795  float percent;
1796 
1798  float scale;
1799 } COMBPARAMS_FALLBACK;
1800 
1820 MG_EXPORT const CompositorOps* GUIAPI ServerGetCompositorOps (const char* name);
1821 
1838 MG_EXPORT BOOL GUIAPI ServerRegisterCompositor (
1839  const char* name, const CompositorOps* ops);
1840 
1856 MG_EXPORT BOOL GUIAPI ServerUnregisterCompositor (const char* name);
1857 
1858 #define LEN_COMPOSITOR_NAME 15
1859 #define COMPSOR_NAME_DEFAULT "default"
1860 #define COMPSOR_NAME_FALLBACK "fallback"
1861 
1881 MG_EXPORT const CompositorOps* GUIAPI ServerSelectCompositor (
1882  const char* name, CompositorCtxt** ctxt);
1883 
1899 MG_EXPORT const char* GUIAPI ServerGetCurrentCompositor (
1900  const CompositorOps** ops, CompositorCtxt** ctxt);
1901 
1902 #define COMPSOR_OPS_VERSION 2
1903 
1920 const CompositorOps* __ex_compositor_get (const char* name,
1921  const CompositorOps* fallback_ops, int* version);
1922 
1923 #endif /* defined _MGSCHEMA_COMPOSITING */
1924 
1961 #define MAX_SYS_REQID 0x0023
1962 
1969 #define MAX_REQID 0x0030
1970 
1972 typedef struct _REQUEST {
1974  int id;
1976  const void* data;
1978  size_t len_data;
1979 } REQUEST;
1981 typedef REQUEST* PREQUEST;
1982 
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);
2018 
2045 static inline int GUIAPI ClientRequestEx (const REQUEST* request,
2046  const void* ex_data, int ex_data_len,
2047  void* result, int len_rslt)
2048 {
2049  return ClientRequestEx2 (request, ex_data, ex_data_len, -1,
2050  result, len_rslt, NULL);
2051 }
2052 
2078 static inline int ClientRequest (const REQUEST* request,
2079  void* result, int len_rslt)
2080 {
2081  return ClientRequestEx (request, NULL, 0, result, len_rslt);
2082 }
2083 
2095 MG_EXPORT int GUIAPI GetSockFD2Server (void);
2096 
2121 MG_EXPORT int GUIAPI ServerSendReplyEx (int clifd,
2122  const void* reply, int len, int fd_to_send);
2123 
2145 static inline int GUIAPI ServerSendReply (int clifd, const void* reply, int len)
2146 {
2147  return ServerSendReplyEx (clifd, reply, len, -1);
2148 }
2149 
2156 typedef int (* REQ_HANDLER) (int cli, int clifd, void* buff, size_t len);
2157 
2167 typedef int (* REQ_HANDLER_V1) (int cli, int clifd,
2168  void* buff, size_t len, int fd_received);
2169 
2188 MG_EXPORT BOOL GUIAPI RegisterRequestHandler (int req_id,
2189  REQ_HANDLER your_handler);
2190 
2212 MG_EXPORT BOOL GUIAPI RegisterRequestHandlerV1 (int req_id,
2213  REQ_HANDLER_V1 your_handler_v1);
2214 
2236 MG_EXPORT REQ_HANDLER GUIAPI GetRequestHandler (int req_id);
2237 
2259 MG_EXPORT REQ_HANDLER_V1 GUIAPI GetRequestHandlerV1 (int req_id);
2260 
2280 MG_EXPORT void* GUIAPI GetRequestHandlerEx (int req_id, int* version);
2281 
2316 MG_EXPORT int serv_listen (const char* name);
2317 
2339 MG_EXPORT int serv_accept (int listenfd, pid_t *pidptr, uid_t *uidptr);
2340 
2361 MG_EXPORT int cli_conn (const char* name, char project);
2362 
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
2368 
2397 MG_EXPORT ssize_t sock_write_t (int fd, const void* buff, size_t count,
2398  DWORD timeout);
2399 
2427 MG_EXPORT ssize_t sock_read_t (int fd, void* buff, size_t count,
2428  DWORD timeout);
2429 
2436 #define sock_write(fd, buff, count) sock_write_t(fd, buff, count, 0)
2437 
2444 #define sock_read(fd, buff, count) sock_read_t(fd, buff, count, 0)
2445 
2450 #endif /* _MGRM_PROCESSES */
2451 
2485 MG_EXPORT BOOL GUIAPI ReinitDesktopEx (BOOL init_sys_text);
2486 
2498 #define ReinitDesktop() ReinitDesktopEx (TRUE)
2499 
2514 MG_EXPORT void GUIAPI ExitGUISafely (int exitcode);
2515 
2516 #ifdef _USE_MINIGUIENTRY
2517  #define main_entry minigui_entry
2518  int minigui_entry (int args, const char* arg[]);
2519 #else
2520  #define main_entry main
2521 #endif /* _USE_MINIGUIENTRY */
2522 
2540 #define MiniGUIMain \
2541 MiniGUIAppMain (int args, const char* argv[]); \
2542 int main_entry (int args, const char* argv[]) \
2543 { \
2544  int iRet = 0; \
2545  if (InitGUI (args, argv) != 0) { \
2546  return 1; \
2547  } \
2548  iRet = MiniGUIAppMain (args, argv); \
2549  TerminateGUI (iRet); \
2550  return iRet; \
2551 } \
2552 int MiniGUIAppMain
2553 
2559 #define IDM_DTI_FIRST (300)
2560 
2562 typedef struct _DESKTOPOPS {
2563 
2565  void* (*init) (HDC dc_desktop);
2566 
2568  void (*deinit) (void* context);
2569 
2571  void (*paint_desktop) (void* context,
2572  HDC dc_desktop, const RECT* inv_rc);
2573 
2575  void (*keyboard_handler) (void* context,
2576  int message, WPARAM wParam, LPARAM lParam);
2577 
2579  void (*mouse_handler) (void* context,
2580  int message, WPARAM wParam, LPARAM lParam);
2581 
2583  void (*customize_desktop_menu) (void* context,
2584  HMENU hmenu, int start_pos);
2585 
2587  void (*desktop_menucmd_handler) (void* context, int id);
2588 } DESKTOPOPS;
2589 
2657 MG_EXPORT DESKTOPOPS* GUIAPI SetCustomDesktopOperationSet
2658  (DESKTOPOPS* usr_dsk_ops);
2659 
2670 MG_EXPORT void GUIAPI DesktopUpdateAllWindow (void);
2671 
2672 #ifndef _MGRM_PROCESSES
2673 
2674 #define DUMMY_LAYER_HANDLE (GHANDLE)(-1)
2675 
2689 static inline GHANDLE GUIAPI JoinLayer (const char* layer_name,
2690  const char* client_name, int max_nr_highers, int max_nr_normals)
2691 {
2692  return DUMMY_LAYER_HANDLE;
2693 }
2694 
2695 #endif /* not defined _MGRM_PROCESSES */
2696 
2699 #ifdef _MGHAVE_MOUSECALIBRATE
2700 
2735 MG_EXPORT BOOL GUIAPI SetMouseCalibrationParameters (const POINT* src_pts,
2736  const POINT* dst_pts);
2737 
2757 MG_EXPORT void GUIAPI GetOriginalMousePosition (int* x, int* y);
2758 
2761 #endif /* _MGHAVE_MOUSECALIBRATE */
2762 
2763 #ifdef _MGMISC_ABOUTDLG
2764 
2770 #ifdef _MGRM_THREADS
2771 
2786 MG_EXPORT void GUIAPI OpenAboutDialog (void);
2787 
2788 #else /* _MGRM_THREADS */
2789 
2807 MG_EXPORT HWND GUIAPI OpenAboutDialog (HWND hHosting);
2808 
2809 #endif /* _MGRM_THREADS */
2810 
2813 #endif /* _MGMISC_ABOUTDLG */
2814 
2862 #define ETC_MAXLINE 1024
2863 
2868 #define ETC_FILENOTFOUND -1
2869 
2873 #define ETC_SECTIONNOTFOUND -2
2874 
2878 #define ETC_KEYNOTFOUND -3
2879 
2883 #define ETC_TMPFILEFAILED -4
2884 
2888 #define ETC_FILEIOFAILED -5
2889 
2893 #define ETC_INTCONV -6
2894 
2898 #define ETC_INVALIDOBJ -7
2899 
2903 #define ETC_READONLYOBJ -8
2904 
2908 #define ETC_OK 0
2909 
2911 typedef struct _ETCSECTION
2912 {
2916  int key_nr;
2918  char *name;
2920  char** keys;
2922  char** values;
2923 } ETCSECTION;
2926 
2928 typedef struct _ETC_S
2929 {
2936 } ETC_S;
2937 
2938 #ifndef _MGINCORE_RES
2939 
2955 extern MG_EXPORT char ETCFILEPATH [];
2956 
2957 #endif /* !_MGINCORE_RES */
2958 
2989 MG_EXPORT int GUIAPI GetValueFromEtcFile (const char* pEtcFile,
2990  const char* pSection, const char* pKey, char* pValue, int iLen);
2991 
3029 MG_EXPORT int GUIAPI GetIntValueFromEtcFile (const char* pEtcFile,
3030  const char* pSection, const char* pKey, int* value);
3031 
3057 MG_EXPORT int GUIAPI SetValueToEtcFile (const char* pEtcFile,
3058  const char* pSection, const char* pKey, char* pValue);
3059 
3080 MG_EXPORT int GUIAPI RemoveSectionInEtcFile (const char* pEtcFile,
3081  const char* pSection);
3082 
3101 MG_EXPORT int GUIAPI SaveSectionToEtcFile (const char* pEtcFile,
3102  PETCSECTION psect);
3117 MG_EXPORT GHANDLE GUIAPI LoadEtcFile (const char * pEtcFile);
3118 
3136 MG_EXPORT int GUIAPI SaveEtcToFile (GHANDLE hEtc, const char* file_name);
3137 
3151 MG_EXPORT int GUIAPI UnloadEtcFile (GHANDLE hEtc);
3152 
3181 MG_EXPORT int GUIAPI GetValueFromEtc (GHANDLE hEtc, const char* pSection,
3182  const char* pKey, char* pValue, int iLen);
3183 
3191 MG_EXPORT int GUIAPI GetIntValueFromEtc (GHANDLE hEtc, const char* pSection,
3192  const char* pKey, int* pValue);
3193 
3204 #define SetValueToEtc(hEtc, pSection, pKey, pValue) \
3205  GetValueFromEtc(hEtc, pSection, pKey, pValue, -1)
3206 
3224 MG_EXPORT GHANDLE GUIAPI FindSectionInEtc (GHANDLE hEtc,
3225  const char* pSection, BOOL bCreateNew);
3226 
3252 MG_EXPORT int GUIAPI GetValueFromEtcSec (GHANDLE hSect,
3253  const char* pKey, char* pValue, int iLen);
3254 
3278 MG_EXPORT int GUIAPI GetIntValueFromEtcSec (GHANDLE hSect,
3279  const char* pKey, int* pValue);
3280 
3291 MG_EXPORT int GUIAPI SetValueToEtcSec (GHANDLE hSect,
3292  const char* pKey, char* pValue);
3293 
3314 MG_EXPORT int GUIAPI RemoveSectionInEtc (GHANDLE hEtc, const char* pSection);
3315 
3316 /* global MiniGUI etc file object */
3317 extern MG_EXPORT GHANDLE hMgEtc;
3318 
3328 static inline int GetMgEtcValue(const char* pSection,
3329  const char *pKey, char *pValue, int iLen)
3330 {
3331 #ifndef _MGINCORE_RES
3332  if (!hMgEtc)
3333  return GetValueFromEtcFile (ETCFILEPATH, pSection, pKey, pValue, iLen);
3334 #endif /* !_MGINCORE_RES */
3335 
3336  return GetValueFromEtc (hMgEtc, pSection, pKey, pValue, iLen);
3337 }
3338 
3348 static inline int GetMgEtcIntValue (const char *pSection,
3349  const char* pKey, int *value)
3350 {
3351 #ifndef _MGINCORE_RES
3352  if (!hMgEtc)
3353  return GetIntValueFromEtcFile (ETCFILEPATH, pSection, pKey, value);
3354 #endif /* !_MGINCORE_RES */
3355 
3356  return GetIntValueFromEtc (hMgEtc, pSection, pKey, value);
3357 }
3358 
3361 #ifdef _MGHAVE_CLIPBOARD
3362 
3372 #define LEN_CLIPBOARD_NAME 15
3373 
3377 #define NR_CLIPBOARDS 4
3378 
3383 #define CBNAME_TEXT ("text")
3384 
3390 #define CBERR_OK 0
3391 
3396 #define CBERR_BADNAME 1
3397 
3402 #define CBERR_NOMEM 2
3403 
3408 #define CBOP_NORMAL 0
3409 
3413 #define CBOP_APPEND 1
3414 
3432 MG_EXPORT int GUIAPI CreateClipBoard (const char* cb_name, size_t size);
3433 
3447 MG_EXPORT int GUIAPI DestroyClipBoard (const char* cb_name);
3448 
3472 MG_EXPORT int GUIAPI SetClipBoardData (const char* cb_name,
3473  void* data, size_t n, int cbop);
3474 
3487 MG_EXPORT size_t GUIAPI GetClipBoardDataLen (const char* cb_name);
3488 
3504 MG_EXPORT size_t GUIAPI GetClipBoardData (const char* cb_name,
3505  void* data, size_t n);
3506 
3524 MG_EXPORT int GUIAPI GetClipBoardByte (const char* cb_name,
3525  int index, unsigned char* byte);
3526 
3529 #endif /* _MGHAVE_CLIPBOARD */
3530 
3549 MG_EXPORT DWORD GUIAPI GetTickCount (void);
3550 
3556 MG_EXPORT void GUIAPI Ping (void);
3557 
3563 #define Beep Ping
3564 
3580 MG_EXPORT void GUIAPI Tone (int frequency_hz, int duration_ms);
3581 
3589 MG_EXPORT void* GUIAPI GetOriginalTermIO (void);
3590 
3624 MG_EXPORT char* GUIAPI FixStrAlloc (int len);
3625 
3643 MG_EXPORT char* GUIAPI FixStrDup (const char* str);
3644 
3657 MG_EXPORT void GUIAPI FreeFixStr (char* str);
3658 
3666 #ifdef _MGHAVE_CURSOR
3667 
3684 MG_EXPORT HCURSOR GUIAPI LoadCursorFromFile (const char* filename);
3685 
3702 MG_EXPORT HCURSOR GUIAPI LoadCursorFromMem (const void* area);
3703 
3704 #ifdef _MGSCHEMA_COMPOSITING
3705 
3727 MG_EXPORT HCURSOR GUIAPI LoadCursorFromPNGFile (const char* filename,
3728  int hotspot_x, int hotspot_y);
3729 
3752 MG_EXPORT HCURSOR GUIAPI LoadCursorFromPNGMem (const void* area, size_t size,
3753  int hotspot_x, int hotspot_y);
3754 
3755 #endif /* _MGSCHEMA_COMPOSITING */
3756 
3782 MG_EXPORT HCURSOR GUIAPI CreateCursor (int xhotspot, int yhotspot, int w, int h,
3783  const BYTE* pANDBits, const BYTE* pXORBits, int colornum);
3784 
3797 MG_EXPORT HCURSOR GUIAPI CopyCursor (HCURSOR hcsr);
3798 
3809 MG_EXPORT BOOL GUIAPI DestroyCursor (HCURSOR hcsr);
3810 
3869 MG_EXPORT HCURSOR GUIAPI GetSystemCursor (int csrid);
3870 
3879 MG_EXPORT HCURSOR GUIAPI GetCurrentCursor (void);
3880 
3881 #else /* _MGHAVE_CURSOR */
3882 
3883 static inline HCURSOR LoadCursorFromFile (const char* filename) {
3884  return (HCURSOR)0;
3885 }
3886 
3887 static inline HCURSOR GUIAPI LoadCursorFromMem (const void* area) {
3888  return (HCURSOR)0;
3889 }
3890 
3891 #ifdef _MGSCHEMA_COMPOSITING
3892 static inline
3893 HCURSOR LoadCursorFromPNGFile(const char* filename,
3894  int hotspot_x, int hotspot_y) {
3895  return (HCURSOR)0;
3896 }
3897 
3898 static inline
3899 HCURSOR GUIAPI LoadCursorFromPNGMem(const void* area, size_t size,
3900  int hotspot_x, int hotspot_y) {
3901  return (HCURSOR)0;
3902 }
3903 
3904 #endif
3905 
3906 static inline
3907 HCURSOR CreateCursor (int xhotspot, int yhotspot, int w, int h,
3908  const BYTE* pANDBits, const BYTE* pXORBits, int colornum) {
3909  return (HCURSOR)0;
3910 }
3911 
3912 static inline HCURSOR GUIAPI CopyCursor (HCURSOR hcsr) {
3913  return (HCURSOR)0;
3914 }
3915 
3916 static inline BOOL DestroyCursor (HCURSOR hcsr) {
3917  return TRUE;
3918 }
3919 
3920 static inline HCURSOR GetSystemCursor (int csrid) {
3921  return (HCURSOR)0;
3922 }
3923 
3924 static inline HCURSOR GUIAPI GetCurrentCursor (void) {
3925  return (HCURSOR)0;
3926 }
3927 
3928 #endif /* !_MGHAVE_CURSOR */
3929 
3930 #define MAX_SYSCURSORINDEX 22
3931 
3932 /* System cursor index. */
3934 #define IDC_ARROW 0
3935 
3936 #define IDC_IBEAM 1
3937 
3938 #define IDC_PENCIL 2
3939 
3940 #define IDC_CROSS 3
3941 
3942 #define IDC_MOVE 4
3943 
3944 #define IDC_SIZENWSE 5
3945 
3946 #define IDC_SIZENESW 6
3947 
3948 #define IDC_SIZEWE 7
3949 
3950 #define IDC_SIZENS 8
3951 
3952 #define IDC_UPARROW 9
3953 
3954 #define IDC_NONE 10
3955 
3956 #define IDC_HELP 11
3957 
3958 #define IDC_BUSY 12
3959 
3960 #define IDC_WAIT 13
3961 
3962 #define IDC_RARROW 14
3963 
3964 #define IDC_COLOMN 15
3965 
3966 #define IDC_ROW 16
3967 
3968 #define IDC_DRAG 17
3969 
3970 #define IDC_NODROP 18
3971 
3972 #define IDC_HAND_POINT 19
3973 
3974 #define IDC_HAND_SELECT 20
3975 
3976 #define IDC_SPLIT_HORZ 21
3977 
3978 #define IDC_SPLIT_VERT 22
3979 
3991 MG_EXPORT void GUIAPI ClipCursor (const RECT* prc);
3992 
4003 MG_EXPORT void GUIAPI GetClipCursor (RECT* prc);
4004 
4017 MG_EXPORT void GUIAPI GetCursorPos (POINT* ppt);
4018 
4032 MG_EXPORT void GUIAPI SetCursorPos (int x, int y);
4033 
4034 #ifdef _MGHAVE_CURSOR
4035 
4053 MG_EXPORT HCURSOR GUIAPI SetCursorEx (HCURSOR hcsr, BOOL set_def);
4054 
4065 MG_EXPORT HCURSOR GUIAPI GetDefaultCursor (void);
4066 
4081 MG_EXPORT int GUIAPI ShowCursor (BOOL fShow);
4082 
4083 #else /* _MGHAVE_CURSOR */
4084 
4085 static inline HCURSOR SetCursorEx(HCURSOR hcsr, BOOL set_def) {
4086  return (HCURSOR)0;
4087 }
4088 
4089 static inline HCURSOR GetDefaultCursor(void) {
4090  return (HCURSOR)0;
4091 }
4092 
4093 static inline int GUIAPI ShowCursor (BOOL fShow) {
4094  return 0;
4095 }
4096 
4097 #endif /* !_MGHAVE_CURSOR */
4098 
4113 #define SetCursor(hcsr) SetCursorEx (hcsr, FALSE)
4114 
4130 #define SetDefaultCursor(hcsr) SetCursorEx (hcsr, TRUE)
4131 
4164 MG_EXPORT BOOL GUIAPI GetKeyStatus (UINT uKey);
4165 
4206 MG_EXPORT DWORD GUIAPI GetShiftKeyStatus (void);
4207 
4222 MG_EXPORT void GUIAPI GetKeyboardState (BYTE* kbd_state);
4223 
4235 #define IDS_MGST_WINDOW 0
4236 
4241 #define IDS_MGST_START 1
4242 
4247 #define IDS_MGST_REFRESH 2
4248 
4253 #define IDS_MGST_CLOSEALLWIN 3
4254 
4259 #define IDS_MGST_ENDSESSION 4
4260 
4265 #define IDS_MGST_OPERATIONS 5
4266 
4271 #define IDS_MGST_MINIMIZE 6
4272 
4277 #define IDS_MGST_MAXIMIZE 7
4278 
4283 #define IDS_MGST_RESTORE 8
4284 
4289 #define IDS_MGST_CLOSE 9
4290 
4295 #define IDS_MGST_OK 10
4296 
4301 #define IDS_MGST_NEXT 11
4302 
4307 #define IDS_MGST_CANCEL 12
4308 
4313 #define IDS_MGST_PREV 13
4314 
4319 #define IDS_MGST_YES 14
4320 
4325 #define IDS_MGST_NO 15
4326 
4331 #define IDS_MGST_ABORT 16
4332 
4337 #define IDS_MGST_RETRY 17
4338 
4343 #define IDS_MGST_IGNORE 18
4344 
4349 #define IDS_MGST_ABOUTMG 19
4350 
4355 #define IDS_MGST_OPENFILE 20
4356 
4361 #define IDS_MGST_SAVEFILE 21
4362 
4367 #define IDS_MGST_COLORSEL 22
4368 
4373 #define IDS_MGST_SWITCHLAYER 23
4374 
4379 #define IDS_MGST_DELLAYER 24
4380 
4385 #define IDS_MGST_ERROR 25
4386 
4391 #define IDS_MGST_LOGO 26
4392 
4397 #define IDS_MGST_CURRPATH 27
4398 
4403 #define IDS_MGST_FILE 28
4404 
4409 #define IDS_MGST_LOCATION 29
4410 
4415 #define IDS_MGST_UP 30
4416 
4421 #define IDS_MGST_NAME 31
4422 
4427 #define IDS_MGST_SIZE 32
4428 
4433 #define IDS_MGST_ACCESSMODE 33
4434 
4439 #define IDS_MGST_LASTMODTIME 34
4440 
4445 #define IDS_MGST_OPEN 35
4446 
4451 #define IDS_MGST_FILENAME 36
4452 
4457 #define IDS_MGST_FILETYPE 37
4458 
4463 #define IDS_MGST_SHOWHIDEFILE 38
4464 
4469 #define IDS_MGST_NOTFOUND 39
4470 
4475 #define IDS_MGST_NR 40
4476 
4481 #define IDS_MGST_NW 41
4482 
4487 #define IDS_MGST_INFO 42
4488 
4493 #define IDS_MGST_R 43
4494 
4499 #define IDS_MGST_W 44
4500 
4505 #define IDS_MGST_WR 45
4506 
4511 #define IDS_MGST_SAVE 46
4512 
4517 #define IDS_MGST_FILEEXIST 47
4518 
4519 #define IDS_MGST_MAXNUM 47
4520 
4540 MG_EXPORT const char* GUIAPI GetSysText (unsigned int id);
4541 
4608 extern MG_EXPORT const char* SysText [];
4609 
4621 extern MG_EXPORT const char** local_SysText;
4622 
4623 #ifdef _MGCHARSET_UNICODE
4624 
4643 extern MG_EXPORT const char** GUIAPI GetSysTextInUTF8 (const char* language);
4644 
4645 #endif /* _MGCHARSET_UNICODE */
4646 
4667 MG_EXPORT char* strnchr (const char* s, size_t n, int c);
4668 
4685 MG_EXPORT int substrlen (const char* text, int len, int delimiter,
4686  int* nr_delim);
4687 
4700 MG_EXPORT char * strtrimall (char* src);
4701 
4810 MG_EXPORT void *mg_slice_alloc(size_t block_size);
4811 
4828 MG_EXPORT void *mg_slice_alloc0(size_t block_size);
4829 
4847 MG_EXPORT void *mg_slice_copy(size_t block_size, const void *mem_block);
4848 
4867 MG_EXPORT void mg_slice_free(size_t block_size, void *mem_block);
4868 
4891 MG_EXPORT void mg_slice_free_chain_with_offset(size_t block_size,
4892  void *mem_chain, size_t next_offset);
4893 
4917 #define mg_slice_new(type) ((type*)mg_slice_alloc(sizeof (type)))
4918 
4944 #define mg_slice_new0(type) ((type*)mg_slice_alloc0(sizeof (type)))
4945 
4946 /* MemoryBlockType *
4947  * mg_slice_dup (MemoryBlockType,
4948  * MemoryBlockType *mem_block);
4949  * mg_slice_delete (MemoryBlockType,
4950  * MemoryBlockType *mem_block);
4951  * mg_slice_delete_chain (MemoryBlockType,
4952  * MemoryBlockType *first_chain_block,
4953  * memory_block_next_field);
4954  * pseudo prototypes for the macro definitions following below.
4955  */
4956 
4980 #define mg_slice_dup(type, mem) \
4981  (1 ? (type*) mg_slice_copy (sizeof (type), (mem)) \
4982  : ((void) ((type*) 0 == (mem)), (type*) 0))
4983 
5006 #define mg_slice_delete(type, mem) \
5007  do { \
5008  if (1) mg_slice_free (sizeof (type), (mem)); \
5009  else (void) ((type*) 0 == (mem)); \
5010  } while(0)
5011 
5036 #define mg_slice_delete_chain(type, mem_chain, next) \
5037  do { \
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)); \
5041  } while(0)
5042 
5043 #ifdef _MGDEVEL_MODE
5044 MG_EXPORT void mg_slice_debug_tree_statistics(void);
5045 #endif
5046 
5053 #ifdef __cplusplus
5054 }
5055 #endif /* __cplusplus */
5056 
5057 #endif /* _MGUI_MINIGUI_H */
5058 
GetClipCursor
MG_EXPORT void GUIAPI GetClipCursor(RECT *prc)
Get the current cursor clipping rectangle.
_POINT
Definition: common.h:966
GetOriginalMousePosition
MG_EXPORT void GUIAPI GetOriginalMousePosition(int *x, int *y)
Get the original mouse position.
_DESKTOPOPS::keyboard_handler
void(* keyboard_handler)(void *context, int message, WPARAM wParam, LPARAM lParam)
Definition: minigui.h:2575
ExitGUISafely
MG_EXPORT void GUIAPI ExitGUISafely(int exitcode)
Exits your MiniGUI application safely.
NULL
#define NULL
A value indicates null pointer.
Definition: common.h:369
GetClipBoardByte
MG_EXPORT int GUIAPI GetClipBoardByte(const char *cb_name, int index, unsigned char *byte)
Get a byte from a clipboard.
GetCurrentCursor
MG_EXPORT HCURSOR GUIAPI GetCurrentCursor(void)
Get the handle to the current cursor.
DWORD
DWORD_PTR DWORD
A unsigned long type definition for pointer precision.
Definition: common.h:604
FindSectionInEtc
MG_EXPORT GHANDLE GUIAPI FindSectionInEtc(GHANDLE hEtc, const char *pSection, BOOL bCreateNew)
Finds/Creates a section from an etc object.
_ETC_S::section_nr
int section_nr
Definition: minigui.h:2933
SetMouseCalibrationParameters
MG_EXPORT BOOL GUIAPI SetMouseCalibrationParameters(const POINT *src_pts, const POINT *dst_pts)
Set the parameters for doing mouse calibration.
GetKeyStatus
MG_EXPORT BOOL GUIAPI GetKeyStatus(UINT uKey)
Get a key or a mouse button status.
HWND
GHANDLE HWND
Handle to main window or control.
Definition: common.h:407
HDC
GHANDLE HDC
Handle to device context.
Definition: common.h:412
local_SysText
const MG_EXPORT char ** local_SysText
The pointer to the current localized system text array.
GetTickCount
MG_EXPORT DWORD GUIAPI GetTickCount(void)
Retrieve the tick counts that have elapsed since MiniGUI was started.
CreateCursor
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.
GetSystemCursor
MG_EXPORT HCURSOR GUIAPI GetSystemCursor(int csrid)
Get the handle to a system cursor by its identifier.
SysText
const MG_EXPORT char * SysText[]
Contains all text used by MiniGUI in English.
GetKeyboardState
MG_EXPORT void GUIAPI GetKeyboardState(BYTE *kbd_state)
Get status of all keys on keyboard.
OpenAboutDialog
MG_EXPORT void GUIAPI OpenAboutDialog(void)
Opens or actives the 'About MiniGUI' dialog.
RemoveSectionInEtcFile
MG_EXPORT int GUIAPI RemoveSectionInEtcFile(const char *pEtcFile, const char *pSection)
Removes a section in an etc file.
GetIntValueFromEtcSec
MG_EXPORT int GUIAPI GetIntValueFromEtcSec(GHANDLE hSect, const char *pKey, int *pValue)
Get an integer value from an etc section object.
GetShiftKeyStatus
MG_EXPORT DWORD GUIAPI GetShiftKeyStatus(void)
Get status of the shift keys.
GetSysText
const MG_EXPORT char *GUIAPI GetSysText(unsigned int id)
Translates system text to localized text.
substrlen
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.
WPARAM
UINT_PTR WPARAM
A type definition for the first message paramter.
Definition: common.h:706
GHANDLE
PVOID GHANDLE
General handle.
Definition: common.h:402
UINT
unsigned int UINT
A type definition for unsigned integer.
Definition: common.h:664
BYTE
unsigned char BYTE
A type definition for an 8-bit unsigned character (byte).
Definition: common.h:460
CreateClipBoard
MG_EXPORT int GUIAPI CreateClipBoard(const char *cb_name, size_t size)
Creates a new clipboard.
FixStrDup
MG_EXPORT char *GUIAPI FixStrDup(const char *str)
Duplicates a length-fixed string.
GetClipBoardDataLen
MG_EXPORT size_t GUIAPI GetClipBoardDataLen(const char *cb_name)
Get the length of the data of a clipboard.
_RECT
Definition: common.h:936
_DESKTOPOPS
Definition: minigui.h:2562
strnchr
MG_EXPORT char * strnchr(const char *s, size_t n, int c)
Locates character in the first n characters of string s.
CopyCursor
MG_EXPORT HCURSOR GUIAPI CopyCursor(HCURSOR hcsr)
Copies a cursor object.
HMENU
GHANDLE HMENU
Handle to menu.
Definition: common.h:432
SaveEtcToFile
MG_EXPORT int GUIAPI SaveEtcToFile(GHANDLE hEtc, const char *file_name)
Saves an ETC object into a file.
DestroyCursor
MG_EXPORT BOOL GUIAPI DestroyCursor(HCURSOR hcsr)
Destroys a cursor object.
UnloadEtcFile
MG_EXPORT int GUIAPI UnloadEtcFile(GHANDLE hEtc)
Unloads an etc file.
DesktopUpdateAllWindow
MG_EXPORT void GUIAPI DesktopUpdateAllWindow(void)
Update all visible windows on the desktop.
GetSysTextInUTF8
const MG_EXPORT char **GUIAPI GetSysTextInUTF8(const char *language)
Get the localized system text array in UTF-8 for a specified language.
FixStrAlloc
MG_EXPORT char *GUIAPI FixStrAlloc(int len)
Allocates a buffer for a length-fixed string.
Tone
MG_EXPORT void GUIAPI Tone(int frequency_hz, int duration_ms)
Makes a tone.
BOOL
int BOOL
A type definition for boolean value.
Definition: common.h:343
GetIntValueFromEtcFile
MG_EXPORT int GUIAPI GetIntValueFromEtcFile(const char *pEtcFile, const char *pSection, const char *pKey, int *value)
Get integer value from a configuration file.
InitGUI
MG_EXPORT int GUIAPI InitGUI(int argc, const char *argv[])
Initialize MiniGUI.
_ETC_S
Definition: minigui.h:2928
ETCFILEPATH
MG_EXPORT char ETCFILEPATH[]
The path name of MiniGUI configuration file.
GetValueFromEtcSec
MG_EXPORT int GUIAPI GetValueFromEtcSec(GHANDLE hSect, const char *pKey, char *pValue, int iLen)
Get value from an etc section object.
GetDefaultCursor
MG_EXPORT HCURSOR GUIAPI GetDefaultCursor(void)
Get the default cursor.
GetValueFromEtcFile
MG_EXPORT int GUIAPI GetValueFromEtcFile(const char *pEtcFile, const char *pSection, const char *pKey, char *pValue, int iLen)
Get value from a configuration file.
GetScreenRect
MG_EXPORT RECT GUIAPI GetScreenRect(void)
Return the rectangle of the physical screen.
mg_slice_free
MG_EXPORT void mg_slice_free(size_t block_size, void *mem_block)
Free a block of memory.
PETCSECTION
ETCSECTION * PETCSECTION
Definition: minigui.h:2925
_DESKTOPOPS::deinit
void(* deinit)(void *context)
Definition: minigui.h:2568
GetClipBoardData
MG_EXPORT size_t GUIAPI GetClipBoardData(const char *cb_name, void *data, size_t n)
Get the data of a clipboard.
_ETCSECTION::values
char ** values
Definition: minigui.h:2922
_ETCSECTION::name
char * name
Definition: minigui.h:2918
LoadCursorFromFile
MG_EXPORT HCURSOR GUIAPI LoadCursorFromFile(const char *filename)
Loads a cursor from a M$ Windows cursor file.
SetClipBoardData
MG_EXPORT int GUIAPI SetClipBoardData(const char *cb_name, void *data, size_t n, int cbop)
Set the data of a clipboard.
strtrimall
MG_EXPORT char * strtrimall(char *src)
Deletes all space characters.
SetCustomDesktopOperationSet
MG_EXPORT DESKTOPOPS *GUIAPI SetCustomDesktopOperationSet(DESKTOPOPS *usr_dsk_ops)
Set customer desktop operation set.
ShowCursor
MG_EXPORT int GUIAPI ShowCursor(BOOL fShow)
Shows or hides cursor.
GetValueFromEtc
MG_EXPORT int GUIAPI GetValueFromEtc(GHANDLE hEtc, const char *pSection, const char *pKey, char *pValue, int iLen)
Get value from a configuration etc object.
_DESKTOPOPS::desktop_menucmd_handler
void(* desktop_menucmd_handler)(void *context, int id)
Definition: minigui.h:2587
GetOriginalTermIO
MG_EXPORT void *GUIAPI GetOriginalTermIO(void)
Get termios structure of the original terminal before initializing MiniGUI.
_ETC_S::sections
PETCSECTION sections
Definition: minigui.h:2935
GetMgEtcValue
static int GetMgEtcValue(const char *pSection, const char *pKey, char *pValue, int iLen)
Get value from MiniGUI configuration etc object.
Definition: minigui.h:3328
MiniGUIPanic
MG_EXPORT void GUIAPI MiniGUIPanic(int exitcode)
The panic of MiniGUI application.
_DESKTOPOPS::customize_desktop_menu
void(* customize_desktop_menu)(void *context, HMENU hmenu, int start_pos)
Definition: minigui.h:2583
mg_slice_alloc0
MG_EXPORT void * mg_slice_alloc0(size_t block_size)
Allocate a slice memory and initialize the memory to zero.
SetCursorPos
MG_EXPORT void GUIAPI SetCursorPos(int x, int y)
Set position of the current cursor.
TerminateGUI
MG_EXPORT void GUIAPI TerminateGUI(int not_used)
Terminate MiniGUI.
mg_slice_alloc
MG_EXPORT void * mg_slice_alloc(size_t block_size)
Allocate a slice memory.
GetIntValueFromEtc
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_slice_free_chain_with_offset
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.
_ETCSECTION::key_nr
int key_nr
Definition: minigui.h:2916
LoadCursorFromMem
MG_EXPORT HCURSOR GUIAPI LoadCursorFromMem(const void *area)
Loads a cursor from a memory area.
_ETC_S::sect_nr_alloc
int sect_nr_alloc
Definition: minigui.h:2931
_ETCSECTION::keys
char ** keys
Definition: minigui.h:2920
_ETCSECTION
Definition: minigui.h:2911
DestroyClipBoard
MG_EXPORT int GUIAPI DestroyClipBoard(const char *cb_name)
Destroys a new clipboard.
ReinitDesktopEx
MG_EXPORT BOOL GUIAPI ReinitDesktopEx(BOOL init_sys_text)
Re-initializes the desktop.
FreeFixStr
MG_EXPORT void GUIAPI FreeFixStr(char *str)
Frees a length-fixed string.
_CLIPRGN
Definition: gdi.h:780
SetValueToEtcFile
MG_EXPORT int GUIAPI SetValueToEtcFile(const char *pEtcFile, const char *pSection, const char *pKey, char *pValue)
Set a value in a configuration file.
GetCursorPos
MG_EXPORT void GUIAPI GetCursorPos(POINT *ppt)
Get position of the current cursor.
Ping
MG_EXPORT void GUIAPI Ping(void)
Makes a beep sound.
_DESKTOPOPS::mouse_handler
void(* mouse_handler)(void *context, int message, WPARAM wParam, LPARAM lParam)
Definition: minigui.h:2579
LoadEtcFile
MG_EXPORT GHANDLE GUIAPI LoadEtcFile(const char *pEtcFile)
Loads an etc file into memory.
SetValueToEtcSec
MG_EXPORT int GUIAPI SetValueToEtcSec(GHANDLE hSect, const char *pKey, char *pValue)
Set the value in the etc section object.
TRUE
#define TRUE
TRUE value, defined as 1 by MiniGUI.
Definition: common.h:358
DESKTOPOPS
struct _DESKTOPOPS DESKTOPOPS
LPARAM
UINT_PTR LPARAM
A type definition for the second message paramter.
Definition: common.h:712
ETC_S
struct _ETC_S ETC_S
RemoveSectionInEtc
MG_EXPORT int GUIAPI RemoveSectionInEtc(GHANDLE hEtc, const char *pSection)
Removes a section in etc object.
mg_slice_copy
MG_EXPORT void * mg_slice_copy(size_t block_size, const void *mem_block)
Allocate and copy a slice.
HCURSOR
GHANDLE HCURSOR
Handle to cursor.
Definition: common.h:422
_DESKTOPOPS::paint_desktop
void(* paint_desktop)(void *context, HDC dc_desktop, const RECT *inv_rc)
Definition: minigui.h:2571
_ETCSECTION::key_nr_alloc
int key_nr_alloc
Definition: minigui.h:2914
SetCursorEx
MG_EXPORT HCURSOR GUIAPI SetCursorEx(HCURSOR hcsr, BOOL set_def)
Changes the current cursor.
JoinLayer
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:2689
SaveSectionToEtcFile
MG_EXPORT int GUIAPI SaveSectionToEtcFile(const char *pEtcFile, PETCSECTION psect)
Saves a section to an etc file.
ClipCursor
MG_EXPORT void GUIAPI ClipCursor(const RECT *prc)
Clips the cursor range.
ETCSECTION
struct _ETCSECTION ETCSECTION