105b261ecSmrg/*
205b261ecSmrg *Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved.
36747b715Smrg *Copyright (C) Colin Harrison 2005-2009
405b261ecSmrg *
505b261ecSmrg *Permission is hereby granted, free of charge, to any person obtaining
605b261ecSmrg * a copy of this software and associated documentation files (the
705b261ecSmrg *"Software"), to deal in the Software without restriction, including
805b261ecSmrg *without limitation the rights to use, copy, modify, merge, publish,
905b261ecSmrg *distribute, sublicense, and/or sell copies of the Software, and to
1005b261ecSmrg *permit persons to whom the Software is furnished to do so, subject to
1105b261ecSmrg *the following conditions:
1205b261ecSmrg *
1305b261ecSmrg *The above copyright notice and this permission notice shall be
1405b261ecSmrg *included in all copies or substantial portions of the Software.
1505b261ecSmrg *
1605b261ecSmrg *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
1705b261ecSmrg *EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
1805b261ecSmrg *MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
1905b261ecSmrg *NONINFRINGEMENT. IN NO EVENT SHALL THE XFREE86 PROJECT BE LIABLE FOR
2005b261ecSmrg *ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
2105b261ecSmrg *CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
2205b261ecSmrg *WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
2305b261ecSmrg *
2405b261ecSmrg *Except as contained in this notice, the name of the XFree86 Project
2505b261ecSmrg *shall not be used in advertising or otherwise to promote the sale, use
2605b261ecSmrg *or other dealings in this Software without prior written authorization
2705b261ecSmrg *from the XFree86 Project.
2805b261ecSmrg *
2905b261ecSmrg * Authors:	Kensuke Matsuzaki
306747b715Smrg *              Colin Harrison
3105b261ecSmrg */
321b5d61b8Smrg#if !defined(_WINWINDOW_H_)
331b5d61b8Smrg#define _WINWINDOW_H_
3405b261ecSmrg
3505b261ecSmrg#ifndef NO
3605b261ecSmrg#define NO			0
3705b261ecSmrg#endif
3805b261ecSmrg#ifndef YES
3905b261ecSmrg#define YES			1
4005b261ecSmrg#endif
4105b261ecSmrg
4205b261ecSmrg/* Constant strings */
4305b261ecSmrg#ifndef PROJECT_NAME
4435c4bbdfSmrg#define PROJECT_NAME		"Cygwin/X"
4505b261ecSmrg#endif
466747b715Smrg#define EXECUTABLE_NAME         "XWin"
4705b261ecSmrg#define WINDOW_CLASS		"cygwin/x"
486747b715Smrg#define WINDOW_TITLE		PROJECT_NAME ":%s.%d"
496747b715Smrg#define WINDOW_TITLE_XDMCP	"%s:%s.%d"
5005b261ecSmrg#define WIN_SCR_PROP		"cyg_screen_prop rl"
5105b261ecSmrg#define WINDOW_CLASS_X		"cygwin/x X rl"
5235c4bbdfSmrg#define WINDOW_CLASS_X_MSG      "cygwin/x X msg"
5305b261ecSmrg#define WINDOW_TITLE_X		PROJECT_NAME " X"
5405b261ecSmrg#define WIN_WINDOW_PROP		"cyg_window_prop_rl"
5505b261ecSmrg#ifdef HAS_DEVWINDOWS
5635c4bbdfSmrg#define WIN_MSG_QUEUE_FNAME	"/dev/windows"
5705b261ecSmrg#endif
5805b261ecSmrg#define WIN_WID_PROP		"cyg_wid_prop_rl"
5905b261ecSmrg#define WIN_NEEDMANAGE_PROP	"cyg_override_redirect_prop_rl"
6005b261ecSmrg#ifndef CYGMULTIWINDOW_DEBUG
6105b261ecSmrg#define CYGMULTIWINDOW_DEBUG    NO
6205b261ecSmrg#endif
6305b261ecSmrg#ifndef CYGWINDOWING_DEBUG
6405b261ecSmrg#define CYGWINDOWING_DEBUG	NO
6505b261ecSmrg#endif
6605b261ecSmrg
676747b715Smrg#define XMING_SIGNATURE		0x12345678L
686747b715Smrg
6905b261ecSmrgtypedef struct _winPrivScreenRec *winPrivScreenPtr;
7005b261ecSmrg
7105b261ecSmrg/*
7205b261ecSmrg * Window privates
7305b261ecSmrg */
7405b261ecSmrg
7535c4bbdfSmrgtypedef struct {
7635c4bbdfSmrg    DWORD dwDummy;
7735c4bbdfSmrg    HRGN hRgn;
7835c4bbdfSmrg    HWND hWnd;
7935c4bbdfSmrg    winPrivScreenPtr pScreenPriv;
8035c4bbdfSmrg    Bool fXKilled;
8135c4bbdfSmrg    HDWP hDwp;
8235c4bbdfSmrg#ifdef XWIN_GLX_WINDOWS
8335c4bbdfSmrg    Bool fWglUsed;
8435c4bbdfSmrg#endif
8505b261ecSmrg} winPrivWinRec, *winPrivWinPtr;
8605b261ecSmrg
8735c4bbdfSmrgtypedef struct _winWMMessageRec {
8835c4bbdfSmrg    DWORD dwID;
8935c4bbdfSmrg    DWORD msg;
9035c4bbdfSmrg    int iWindow;
9135c4bbdfSmrg    HWND hwndWindow;
9235c4bbdfSmrg    int iX, iY;
9335c4bbdfSmrg    int iWidth, iHeight;
9405b261ecSmrg} winWMMessageRec, *winWMMessagePtr;
9505b261ecSmrg
9605b261ecSmrg/*
9705b261ecSmrg * winmultiwindowwm.c
9805b261ecSmrg */
9905b261ecSmrg
10005b261ecSmrg#define		WM_WM_MOVE		(WM_USER + 1)
10105b261ecSmrg#define		WM_WM_SIZE		(WM_USER + 2)
10205b261ecSmrg#define		WM_WM_RAISE		(WM_USER + 3)
10305b261ecSmrg#define		WM_WM_LOWER		(WM_USER + 4)
10405b261ecSmrg#define		WM_WM_UNMAP		(WM_USER + 6)
10505b261ecSmrg#define		WM_WM_KILL		(WM_USER + 7)
10605b261ecSmrg#define		WM_WM_ACTIVATE		(WM_USER + 8)
10705b261ecSmrg#define		WM_WM_NAME_EVENT	(WM_USER + 9)
10835c4bbdfSmrg#define		WM_WM_ICON_EVENT	(WM_USER + 10)
10905b261ecSmrg#define		WM_WM_CHANGE_STATE	(WM_USER + 11)
110ed6184dfSmrg#define		WM_WM_MAP_UNMANAGED	(WM_USER + 12)
111ed6184dfSmrg#define		WM_WM_MAP_MANAGED	(WM_USER + 13)
11235c4bbdfSmrg#define		WM_WM_HINTS_EVENT	(WM_USER + 14)
11305b261ecSmrg
1146747b715Smrg#define		MwmHintsDecorations	(1L << 1)
1156747b715Smrg
11635c4bbdfSmrg#define		MwmDecorAll		(1L << 0)
11735c4bbdfSmrg#define		MwmDecorBorder		(1L << 1)
11835c4bbdfSmrg#define		MwmDecorHandle		(1L << 2)
11935c4bbdfSmrg#define		MwmDecorTitle		(1L << 3)
12035c4bbdfSmrg#define		MwmDecorMenu		(1L << 4)
12135c4bbdfSmrg#define		MwmDecorMinimize	(1L << 5)
12235c4bbdfSmrg#define		MwmDecorMaximize	(1L << 6)
1236747b715Smrg
1241b5d61b8Smrg/*
1251b5d61b8Smrg  This structure only contains 3 elements.  The Motif 2.0 structure contains 5,
1261b5d61b8Smrg  but we only need the first 3, so that is all we will define
1271b5d61b8Smrg
1281b5d61b8Smrg  This structure represents xcb_get_property()'s view of the property as a
1291b5d61b8Smrg  sequence of ints, rather than XGetWindowProperty()'s view of the property as a
1301b5d61b8Smrg  sequence of arch-dependent longs.
1311b5d61b8Smrg*/
1326747b715Smrgtypedef struct MwmHints {
1331b5d61b8Smrg    unsigned int flags, functions, decorations;
1346747b715Smrg} MwmHints;
13535c4bbdfSmrg
1366747b715Smrg#define		PropMwmHintsElements	3
1376747b715Smrg
13805b261ecSmrgvoid
13935c4bbdfSmrg winSendMessageToWM(void *pWMInfo, winWMMessagePtr msg);
14005b261ecSmrg
14105b261ecSmrgBool
14205b261ecSmrg
14335c4bbdfSmrgwinInitWM(void **ppWMInfo,
14435c4bbdfSmrg          pthread_t * ptWMProc,
14535c4bbdfSmrg          pthread_t * ptXMsgProc,
14635c4bbdfSmrg          pthread_mutex_t * ppmServerStarted,
147ed6184dfSmrg          int dwScreen, HWND hwndScreen, Bool compositeWM);
14805b261ecSmrg
14905b261ecSmrgvoid
15035c4bbdfSmrg winDeinitMultiWindowWM(void);
15105b261ecSmrg
15235c4bbdfSmrgvoid
15335c4bbdfSmrg winPropertyStoreInit(void);
15405b261ecSmrg
15505b261ecSmrgvoid
15635c4bbdfSmrg winPropertyStoreDestroy(void);
15705b261ecSmrg
15835c4bbdfSmrgvoid
15935c4bbdfSmrg winSetAppUserModelID(HWND hWnd, const char *AppID);
16005b261ecSmrg
16135c4bbdfSmrgvoid
1621b5d61b8Smrg winShowWindowOnTaskbar(HWND hWnd, Bool show);
16305b261ecSmrg
16405b261ecSmrg#endif
165