1*4882a593Smuzhiyun /* 2*4882a593Smuzhiyun * Xplugin rootless implementation 3*4882a593Smuzhiyun * 4*4882a593Smuzhiyun * Copyright (c) 2003 Torrey T. Lyons. All Rights Reserved. 5*4882a593Smuzhiyun * Copyright (c) 2002-2012 Apple Inc. All rights reserved. 6*4882a593Smuzhiyun * 7*4882a593Smuzhiyun * Permission is hereby granted, free of charge, to any person obtaining a 8*4882a593Smuzhiyun * copy of this software and associated documentation files (the "Software"), 9*4882a593Smuzhiyun * to deal in the Software without restriction, including without limitation 10*4882a593Smuzhiyun * the rights to use, copy, modify, merge, publish, distribute, sublicense, 11*4882a593Smuzhiyun * and/or sell copies of the Software, and to permit persons to whom the 12*4882a593Smuzhiyun * Software is furnished to do so, subject to the following conditions: 13*4882a593Smuzhiyun * 14*4882a593Smuzhiyun * The above copyright notice and this permission notice shall be included in 15*4882a593Smuzhiyun * all copies or substantial portions of the Software. 16*4882a593Smuzhiyun * 17*4882a593Smuzhiyun * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18*4882a593Smuzhiyun * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19*4882a593Smuzhiyun * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 20*4882a593Smuzhiyun * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR 21*4882a593Smuzhiyun * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 22*4882a593Smuzhiyun * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 23*4882a593Smuzhiyun * DEALINGS IN THE SOFTWARE. 24*4882a593Smuzhiyun * 25*4882a593Smuzhiyun * Except as contained in this notice, the name(s) of the above copyright 26*4882a593Smuzhiyun * holders shall not be used in advertising or otherwise to promote the sale, 27*4882a593Smuzhiyun * use or other dealings in this Software without prior written authorization. 28*4882a593Smuzhiyun */ 29*4882a593Smuzhiyun 30*4882a593Smuzhiyun #ifndef XPR_H 31*4882a593Smuzhiyun #define XPR_H 32*4882a593Smuzhiyun 33*4882a593Smuzhiyun #include "windowstr.h" 34*4882a593Smuzhiyun #include "screenint.h" 35*4882a593Smuzhiyun #include <Xplugin.h> 36*4882a593Smuzhiyun 37*4882a593Smuzhiyun #include "darwin.h" 38*4882a593Smuzhiyun 39*4882a593Smuzhiyun #undef DEBUG_LOG 40*4882a593Smuzhiyun #define DEBUG_LOG(msg, args ...) ASL_LOG(ASL_LEVEL_DEBUG, "xpr", msg, ## args) 41*4882a593Smuzhiyun 42*4882a593Smuzhiyun Bool 43*4882a593Smuzhiyun QuartzModeBundleInit(void); 44*4882a593Smuzhiyun 45*4882a593Smuzhiyun void 46*4882a593Smuzhiyun AppleDRIExtensionInit(void); 47*4882a593Smuzhiyun void 48*4882a593Smuzhiyun xprAppleWMInit(void); 49*4882a593Smuzhiyun Bool 50*4882a593Smuzhiyun xprInit(ScreenPtr pScreen); 51*4882a593Smuzhiyun Bool 52*4882a593Smuzhiyun xprIsX11Window(int windowNumber); 53*4882a593Smuzhiyun WindowPtr 54*4882a593Smuzhiyun xprGetXWindow(xp_window_id wid); 55*4882a593Smuzhiyun 56*4882a593Smuzhiyun void 57*4882a593Smuzhiyun xprHideWindows(Bool hide); 58*4882a593Smuzhiyun 59*4882a593Smuzhiyun Bool 60*4882a593Smuzhiyun QuartzInitCursor(ScreenPtr pScreen); 61*4882a593Smuzhiyun void 62*4882a593Smuzhiyun QuartzSuspendXCursor(ScreenPtr pScreen); 63*4882a593Smuzhiyun void 64*4882a593Smuzhiyun QuartzResumeXCursor(ScreenPtr pScreen); 65*4882a593Smuzhiyun 66*4882a593Smuzhiyun /* If we are rooted, we need the root window and desktop levels to be below 67*4882a593Smuzhiyun * the menubar (24) but above native windows. Normal window level is 0. 68*4882a593Smuzhiyun * Floating window level is 3. The rest are filled in as appropriate. 69*4882a593Smuzhiyun * See CGWindowLevel.h 70*4882a593Smuzhiyun */ 71*4882a593Smuzhiyun 72*4882a593Smuzhiyun #include <X11/extensions/applewmconst.h> 73*4882a593Smuzhiyun static const int normal_window_levels[AppleWMNumWindowLevels + 1] = { 74*4882a593Smuzhiyun 0, 3, 4, 5, INT_MIN + 30, INT_MIN + 29, 75*4882a593Smuzhiyun }; 76*4882a593Smuzhiyun static const int rooted_window_levels[AppleWMNumWindowLevels + 1] = { 77*4882a593Smuzhiyun 20, 21, 22, 23, 19, 18, 78*4882a593Smuzhiyun }; 79*4882a593Smuzhiyun 80*4882a593Smuzhiyun #endif /* XPR_H */ 81