117ca54c3Smrg/*
217ca54c3Smrg * WindowsWM extension is based on AppleWM extension
317ca54c3Smrg * Authors:	Kensuke Matsuzaki
417ca54c3Smrg */
517ca54c3Smrg/**************************************************************************
617ca54c3Smrg
717ca54c3SmrgCopyright (c) 2002 Apple Computer, Inc.
817ca54c3SmrgAll Rights Reserved.
917ca54c3Smrg
1017ca54c3SmrgPermission is hereby granted, free of charge, to any person obtaining a
1117ca54c3Smrgcopy of this software and associated documentation files (the
1217ca54c3Smrg"Software"), to deal in the Software without restriction, including
1317ca54c3Smrgwithout limitation the rights to use, copy, modify, merge, publish,
1417ca54c3Smrgdistribute, sub license, and/or sell copies of the Software, and to
1517ca54c3Smrgpermit persons to whom the Software is furnished to do so, subject to
1617ca54c3Smrgthe following conditions:
1717ca54c3Smrg
1817ca54c3SmrgThe above copyright notice and this permission notice (including the
1917ca54c3Smrgnext paragraph) shall be included in all copies or substantial portions
2017ca54c3Smrgof the Software.
2117ca54c3Smrg
2217ca54c3SmrgTHE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
2317ca54c3SmrgOR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
2417ca54c3SmrgMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
2517ca54c3SmrgIN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
2617ca54c3SmrgANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
2717ca54c3SmrgTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
2817ca54c3SmrgSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
2917ca54c3Smrg
3017ca54c3Smrg**************************************************************************/
3117ca54c3Smrg
3217ca54c3Smrg#ifndef _WINDOWSWM_H_
3317ca54c3Smrg#define _WINDOWSWM_H_
3417ca54c3Smrg
3517ca54c3Smrg#include <X11/Xfuncproto.h>
3617ca54c3Smrg
3717ca54c3Smrg#define X_WindowsWMQueryVersion		0
3817ca54c3Smrg#define X_WindowsWMFrameGetRect		1
3917ca54c3Smrg#define X_WindowsWMFrameDraw		2
4017ca54c3Smrg#define X_WindowsWMFrameSetTitle	3
4117ca54c3Smrg#define X_WindowsWMDisableUpdate	4
4217ca54c3Smrg#define X_WindowsWMReenableUpdate	5
4317ca54c3Smrg#define X_WindowsWMSelectInput		6
4417ca54c3Smrg#define X_WindowsWMSetFrontProcess	7
4517ca54c3Smrg
4617ca54c3Smrg/* Events */
4717ca54c3Smrg#define WindowsWMControllerNotify	0
4817ca54c3Smrg#define WindowsWMActivationNotify	1
4917ca54c3Smrg#define WindowsWMNumberEvents		2
5017ca54c3Smrg
5117ca54c3Smrg#define WindowsWMControllerNotifyMask	(1L << 0)
5217ca54c3Smrg#define WindowsWMActivationNotifyMask	(1L << 1)
5317ca54c3Smrg
5417ca54c3Smrg/* "Kinds" of ControllerNotify events */
5517ca54c3Smrg#define WindowsWMMinimizeWindow		0
5617ca54c3Smrg#define WindowsWMMaximizeWindow		1
5717ca54c3Smrg#define WindowsWMRestoreWindow		2
5817ca54c3Smrg#define WindowsWMCloseWindow		3
5917ca54c3Smrg#define WindowsWMBringAllToFront	4
6017ca54c3Smrg#define WindowsWMHideWindow		5
6117ca54c3Smrg#define WindowsWMMoveWindow		6
6217ca54c3Smrg#define WindowsWMResizeWindow		7
6317ca54c3Smrg#define WindowsWMActivateWindow		8
6417ca54c3Smrg
6517ca54c3Smrg/* "Kinds" of ActivationNotify events */
6617ca54c3Smrg#define WindowsWMIsActive		0
6717ca54c3Smrg#define WindowsWMIsInactive		1
6817ca54c3Smrg
6917ca54c3Smrg/* Errors */
7017ca54c3Smrg#define WindowsWMClientNotLocal		0
7117ca54c3Smrg#define WindowsWMOperationNotSupported	1
7217ca54c3Smrg#define WindowsWMNumberErrors		(WindowsWMOperationNotSupported + 1)
7317ca54c3Smrg
7417ca54c3Smrg/* Possible value for frame_rect argument to XWindowsWMFrameGetRect() */
7517ca54c3Smrg#define WindowsWMFrameRectTitleBar	1
7617ca54c3Smrg#define WindowsWMFrameRectTracking	2
7717ca54c3Smrg#define WindowsWMFrameRectGrowBox	3
7817ca54c3Smrg
7917ca54c3Smrg/* Window frame styles */
8017ca54c3Smrg#define WindowsWMFrameStyleBorder		0x800000
8117ca54c3Smrg#define WindowsWMFrameStyleCaption		0xc00000
8217ca54c3Smrg#define WindowsWMFrameStyleChild		0x40000000
8317ca54c3Smrg#define WindowsWMFrameStyleChildWindow		0x40000000
8417ca54c3Smrg#define WindowsWMFrameStyleClipChildren		0x2000000
8517ca54c3Smrg#define WindowsWMFrameStyleClipSiblings		0x4000000
8617ca54c3Smrg#define WindowsWMFrameStyleDisabled		0x8000000
8717ca54c3Smrg#define WindowsWMFrameStyleDlgFrame		0x400000
8817ca54c3Smrg#define WindowsWMFrameStyleGroup		0x20000
8917ca54c3Smrg#define WindowsWMFrameStyleHScroll		0x100000
9017ca54c3Smrg#define WindowsWMFrameStyleIconic		0x20000000
9117ca54c3Smrg#define WindowsWMFrameStyleMaximize		0x1000000
9217ca54c3Smrg#define WindowsWMFrameStyleMaximizeBox		0x10000
9317ca54c3Smrg#define WindowsWMFrameStyleMinimize		0x20000000
9417ca54c3Smrg#define WindowsWMFrameStyleMinimizeBox		0x20000
9517ca54c3Smrg#define WindowsWMFrameStyleOverlapped		0
9617ca54c3Smrg#define WindowsWMFrameStyleOverlappedWindow	0xcf0000
9717ca54c3Smrg#define WindowsWMFrameStylePopup		0x80000000
9817ca54c3Smrg#define WindowsWMFrameStylePopupWindow		0x80880000
9917ca54c3Smrg#define WindowsWMFrameStyleSizeBox		0x40000
10017ca54c3Smrg#define WindowsWMFrameStyleSysMenu		0x80000
10117ca54c3Smrg#define WindowsWMFrameStyleTabStop		0x10000
10217ca54c3Smrg#define WindowsWMFrameStyleThickFrame		0x40000
10317ca54c3Smrg#define WindowsWMFrameStyleTiled		0
10417ca54c3Smrg#define WindowsWMFrameStyleTiledWindow		0xcf0000
10517ca54c3Smrg#define WindowsWMFrameStyleVisible		0x10000000
10617ca54c3Smrg#define WindowsWMFrameStyleVScroll		0x200000
10717ca54c3Smrg
10817ca54c3Smrg/* Window frame Ex-styles */
10917ca54c3Smrg#define WindowsWMFrameStyleExAcceptFiles	16
11017ca54c3Smrg#define WindowsWMFrameStyleExAppWindow		0x40000
11117ca54c3Smrg#define WindowsWMFrameStyleExClientEdge		512
11217ca54c3Smrg#define WindowsWMFrameStyleExComposited		0x2000000
11317ca54c3Smrg#define WindowsWMFrameStyleExContextHelp	0x400
11417ca54c3Smrg#define WindowsWMFrameStyleExControlParent	0x10000
11517ca54c3Smrg#define WindowsWMFrameStyleExDlgModalFrame	1
11617ca54c3Smrg#define WindowsWMFrameStyleExLayered		0x80000
11717ca54c3Smrg#define WindowsWMFrameStyleExLayoutRtl		0x400000
11817ca54c3Smrg#define WindowsWMFrameStyleExLeft		0
11917ca54c3Smrg#define WindowsWMFrameStyleExLeftScrollBar	0x4000
12017ca54c3Smrg#define WindowsWMFrameStyleExLtrReading		0
12117ca54c3Smrg#define WindowsWMFrameStyleExMDIChild		64
12217ca54c3Smrg#define WindowsWMFrameStyleExNoActivate		0x8000000
12317ca54c3Smrg#define WindowsWMFrameStyleExNoInheritLayout	0x100000
12417ca54c3Smrg#define WindowsWMFrameStyleExNoParentNotify	4
12517ca54c3Smrg#define WindowsWMFrameStyleExOverlappedWindow	0x300
12617ca54c3Smrg#define WindowsWMFrameStyleExPaletteWindow	0x188
12717ca54c3Smrg#define WindowsWMFrameStyleExRight		0x1000
12817ca54c3Smrg#define WindowsWMFrameStyleExRightScrollBar	0
12917ca54c3Smrg#define WindowsWMFrameStyleExRtlReading		0x2000
13017ca54c3Smrg#define WindowsWMFrameStyleExStaticEdge		0x20000
13117ca54c3Smrg#define WindowsWMFrameStyleExToolWindow		128
13217ca54c3Smrg#define WindowsWMFrameStyleExTopMost		8
13317ca54c3Smrg#define WindowsWMFrameStyleExTransparent	32
13417ca54c3Smrg#define WindowsWMFrameStyleExWindowEdge		256
13517ca54c3Smrg
13617ca54c3Smrg#define WINDOWSWM_RAISE_ON_CLICK	"_WINDOWSWM_RAISE_ON_CLICK"
13717ca54c3Smrg#define WINDOWSWM_MOUSE_ACTIVATE	"_WINDOWSWM_MOUSE_ACTIVATE"
13817ca54c3Smrg#define WINDOWSWM_CLIENT_WINDOW		"_WINDOWSWM_CLIENT_WINDOW"
13917ca54c3Smrg#define WINDOWSWM_NATIVE_HWND		"_WINDOWSWM_NATIVE_HWND"
14017ca54c3Smrg
14117ca54c3Smrg#ifndef _WINDOWSWM_SERVER_
14217ca54c3Smrg
14317ca54c3Smrgtypedef struct {
14417ca54c3Smrg    int	type;		    /* of event */
14517ca54c3Smrg    unsigned long serial;   /* # of last request processed by server */
146d63b911fSmrg    Bool send_event;	    /* true if this came from a SendEvent request */
14717ca54c3Smrg    Display *display;	    /* Display the event was read from */
14817ca54c3Smrg    Window window;	    /* window of event */
14917ca54c3Smrg    Time time;		    /* server timestamp when event happened */
15017ca54c3Smrg    int kind;		    /* subtype of event */
15117ca54c3Smrg    int arg;
15217ca54c3Smrg    int x;
15317ca54c3Smrg    int y;
15417ca54c3Smrg    int w;
15517ca54c3Smrg    int h;
15617ca54c3Smrg} XWindowsWMNotifyEvent;
15717ca54c3Smrg
15817ca54c3Smrg_XFUNCPROTOBEGIN
15917ca54c3Smrg
16017ca54c3SmrgBool XWindowsWMQueryExtension (Display *dpy, int *event_base, int *error_base);
16117ca54c3Smrg
16217ca54c3SmrgBool XWindowsWMQueryVersion (Display *dpy, int *majorVersion,
16317ca54c3Smrg			     int *minorVersion, int *patchVersion);
16417ca54c3Smrg
16517ca54c3SmrgBool XWindowsWMDisableUpdate (Display *dpy, int screen);
16617ca54c3Smrg
16717ca54c3SmrgBool XWindowsWMReenableUpdate (Display *dpy, int screen);
16817ca54c3Smrg
16917ca54c3SmrgBool XWindowsWMSelectInput (Display *dpy, unsigned long mask);
17017ca54c3Smrg
17117ca54c3SmrgBool XWindowsWMSetFrontProcess (Display *dpy);
17217ca54c3Smrg
17317ca54c3SmrgBool XWindowsWMFrameGetRect (Display *dpy,
17417ca54c3Smrg			     unsigned int frame_style,
17517ca54c3Smrg			     unsigned int frame_style_ex,
17617ca54c3Smrg			     unsigned int frame_rect,
17717ca54c3Smrg			     short inner_x, short inner_y,
17817ca54c3Smrg			     short inner_w, short inner_h,
17917ca54c3Smrg			     short *ret_x, short *ret_y,
18017ca54c3Smrg			     short *ret_w, short *ret_h);
18117ca54c3Smrg
18217ca54c3SmrgBool XWindowsWMFrameDraw (Display *dpy, int screen, Window window,
18317ca54c3Smrg			  unsigned int frame_style,
18417ca54c3Smrg			  unsigned int frame_style_ex,
18517ca54c3Smrg			  short inner_x, short inner_y,
18617ca54c3Smrg			  short inner_w, short inner_h);
18717ca54c3Smrg
18817ca54c3SmrgBool XWindowsWMFrameSetTitle (Display *dpy, int screen, Window window,
18917ca54c3Smrg			      unsigned int title_length,
19017ca54c3Smrg			      const char * title_bytes);
19117ca54c3Smrg
19217ca54c3Smrg_XFUNCPROTOEND
19317ca54c3Smrg
19417ca54c3Smrg#endif /* _WINDOWSWM_SERVER_ */
19517ca54c3Smrg#endif /* _WINDOWSWM_H_ */
196