1/* External interface for the server's AppleWM support
2 *
3 * Copyright (c) 2003-2004 Torrey T. Lyons. All Rights Reserved.
4 * Copyright (c) 2002-2012 Apple Inc. All rights reserved.
5 *
6 * Permission is hereby granted, free of charge, to any person
7 * obtaining a copy of this software and associated documentation files
8 * (the "Software"), to deal in the Software without restriction,
9 * including without limitation the rights to use, copy, modify, merge,
10 * publish, distribute, sublicense, and/or sell copies of the Software,
11 * and to permit persons to whom the Software is furnished to do so,
12 * subject to the following conditions:
13 *
14 * The above copyright notice and this permission notice shall be
15 * included in all copies or substantial portions of the Software.
16 *
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
18 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
19 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
20 * NONINFRINGEMENT.  IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT
21 * HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
22 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
24 * DEALINGS IN THE SOFTWARE.
25 *
26 * Except as contained in this notice, the name(s) of the above
27 * copyright holders shall not be used in advertising or otherwise to
28 * promote the sale, use or other dealings in this Software without
29 * prior written authorization.
30 */
31
32#ifndef _APPLEWMEXT_H_
33#define _APPLEWMEXT_H_
34
35#include "window.h"
36#include <Xplugin.h>
37
38typedef int (*DisableUpdateProc)(void);
39typedef int (*EnableUpdateProc)(void);
40typedef int (*SetWindowLevelProc)(WindowPtr pWin, int level);
41typedef int (*FrameGetRectProc)(xp_frame_rect type, xp_frame_class class,
42                                const BoxRec *outer,
43                                const BoxRec *inner, BoxRec *ret);
44typedef int (*FrameHitTestProc)(xp_frame_class class, int x, int y,
45                                const BoxRec *outer,
46                                const BoxRec *inner, int *ret);
47typedef int (*FrameDrawProc)(WindowPtr pWin, xp_frame_class class,
48                             xp_frame_attr attr,
49                             const BoxRec *outer, const BoxRec *inner,
50                             unsigned int title_len,
51                             const unsigned char *title_bytes);
52typedef int (*SendPSNProc)(uint32_t hi, uint32_t lo);
53typedef int (*AttachTransientProc)(WindowPtr pWinChild, WindowPtr pWinParent);
54
55/*
56 * AppleWM implementation function list
57 */
58typedef struct _AppleWMProcs {
59    DisableUpdateProc DisableUpdate;
60    EnableUpdateProc EnableUpdate;
61    SetWindowLevelProc SetWindowLevel;
62    FrameGetRectProc FrameGetRect;
63    FrameHitTestProc FrameHitTest;
64    FrameDrawProc FrameDraw;
65    SendPSNProc SendPSN;
66    AttachTransientProc AttachTransient;
67} AppleWMProcsRec, *AppleWMProcsPtr;
68
69void
70AppleWMExtensionInit(AppleWMProcsPtr procsPtr);
71
72void
73AppleWMSetScreenOrigin(WindowPtr pWin);
74
75Bool
76AppleWMDoReorderWindow(WindowPtr pWin);
77
78void
79AppleWMSendEvent(int /* type */, unsigned int /* mask */, int /* which */,
80                 int                  /* arg */
81                 );
82
83unsigned int
84AppleWMSelectedEvents(void);
85
86#endif /* _APPLEWMEXT_H_ */
87