From e9950cf6a9c174b10a28aedb68306028f4c5d11b Mon Sep 17 00:00:00 2001 From: Vincent Wei Date: Wed, 26 Feb 2020 11:09:53 +0800 Subject: [PATCH] add REQID_CALCPOSITION and CALCPOSINFO; check REQID_SYS_LAST is not larger than MAX_SYS_REQID --- src/include/client.h | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/src/include/client.h b/src/include/client.h index 8f783bbc..84df103b 100644 --- a/src/include/client.h +++ b/src/include/client.h @@ -114,13 +114,25 @@ // Move the current client to another layer #define REQID_MOVETOLAYER 0x0021 +// Calculate the position a main window with WS_EX_AUTOPOSITION +#define REQID_CALCPOSITION 0x0022 + +#define REQID_SYS_LAST REQID_CALCPOSITION /* * XXX: To fellows who need to add a new REQID, - * please make sure your new ID _less_ than MAX_SYS_REQID + * please make sure the your new ID is _LESS_ than MAX_SYS_REQID * (defined in /include/minigui.h). */ +/* Make sure the MAX_SYS_REQID is large enough for system requests */ +#define MGUI_COMPILE_TIME_ASSERT(name, x) \ + typedef int MGUI_dummy_ ## name[((x)?1:0) * 2 - 1] + +MGUI_COMPILE_TIME_ASSERT(sys_request_id, MAX_SYS_REQID >= REQID_SYS_LAST); + +#undef MGUI_COMPILE_TIME_ASSERT + /* Since 5.0.0 */ typedef struct _SharedSurfInfo { Uint32 flags; @@ -175,6 +187,12 @@ typedef struct _MovedClientInfo { int zo_shmid; } MOVEDCLIENTINFO; +typedef struct _CalcPosInfo { + DWORD style; + DWORD ex_style; + RECT rc; +} CALCPOSINFO; + #define ID_ZOOP_ALLOC 1 #define ID_ZOOP_FREE 2 #define ID_ZOOP_MOVE2TOP 3