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