| 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 | |
| 38 | #if XPLUGIN_VERSION < 4 |
| 39 | typedef int xp_frame_attr; |
| 40 | typedef int xp_frame_class; |
| 41 | typedef int xp_frame_rect; |
| 42 | #endif |
| 43 | |
| 44 | typedef int (*DisableUpdateProc)(void); |
| 45 | typedef int (*EnableUpdateProc)(void); |
| 46 | typedef int (*SetWindowLevelProc)(WindowPtr pWin, int level); |
| 47 | typedef int (*FrameGetRectProc)(xp_frame_rect type, xp_frame_class class, |
| 48 | const BoxRec *outer, |
| 49 | const BoxRec *inner, BoxRec *ret); |
| 50 | typedef int (*FrameHitTestProc)(xp_frame_class class, int x, int y, |
| 51 | const BoxRec *outer, |
| 52 | const BoxRec *inner, int *ret); |
| 53 | typedef int (*FrameDrawProc)(WindowPtr pWin, xp_frame_class class, |
| 54 | xp_frame_attr attr, |
| 55 | const BoxRec *outer, const BoxRec *inner, |
| 56 | unsigned int title_len, |
| 57 | const unsigned char *title_bytes); |
| 58 | typedef int (*SendPSNProc)(uint32_t hi, uint32_t lo); |
| 59 | typedef int (*AttachTransientProc)(WindowPtr pWinChild, WindowPtr pWinParent); |
| 60 | |
| 61 | /* |
| 62 | * AppleWM implementation function list |
| 63 | */ |
| 64 | typedef struct _AppleWMProcs { |
| 65 | DisableUpdateProc DisableUpdate; |
| 66 | EnableUpdateProc EnableUpdate; |
| 67 | SetWindowLevelProc SetWindowLevel; |
| 68 | FrameGetRectProc FrameGetRect; |
| 69 | FrameHitTestProc FrameHitTest; |
| 70 | FrameDrawProc FrameDraw; |
| 71 | SendPSNProc SendPSN; |
| 72 | AttachTransientProc AttachTransient; |
| 73 | } AppleWMProcsRec, *AppleWMProcsPtr; |
| 74 | |
| 75 | void |
| 76 | AppleWMExtensionInit(AppleWMProcsPtr procsPtr); |
| 77 | |
| 78 | void |
| 79 | AppleWMSetScreenOrigin(WindowPtr pWin); |
| 80 | |
| 81 | Bool |
| 82 | AppleWMDoReorderWindow(WindowPtr pWin); |
| 83 | |
| 84 | void |
| 85 | AppleWMSendEvent(int /* type */, unsigned int /* mask */, int /* which */, |
| 86 | int /* arg */ |
| 87 | ); |
| 88 | |
| 89 | unsigned int |
| 90 | AppleWMSelectedEvents(void); |
| 91 | |
| 92 | #endif /* _APPLEWMEXT_H_ */ |