1*4882a593Smuzhiyun /* 2*4882a593Smuzhiyun * Copyright (C) 2008-2012 Apple, Inc. 3*4882a593Smuzhiyun * Copyright (c) 2001-2004 Torrey T. Lyons. All Rights Reserved. 4*4882a593Smuzhiyun * 5*4882a593Smuzhiyun * Permission is hereby granted, free of charge, to any person obtaining a 6*4882a593Smuzhiyun * copy of this software and associated documentation files (the "Software"), 7*4882a593Smuzhiyun * to deal in the Software without restriction, including without limitation 8*4882a593Smuzhiyun * the rights to use, copy, modify, merge, publish, distribute, sublicense, 9*4882a593Smuzhiyun * and/or sell copies of the Software, and to permit persons to whom the 10*4882a593Smuzhiyun * Software is furnished to do so, subject to the following conditions: 11*4882a593Smuzhiyun * 12*4882a593Smuzhiyun * The above copyright notice and this permission notice shall be included in 13*4882a593Smuzhiyun * all copies or substantial portions of the Software. 14*4882a593Smuzhiyun * 15*4882a593Smuzhiyun * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16*4882a593Smuzhiyun * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17*4882a593Smuzhiyun * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 18*4882a593Smuzhiyun * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR 19*4882a593Smuzhiyun * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 20*4882a593Smuzhiyun * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 21*4882a593Smuzhiyun * DEALINGS IN THE SOFTWARE. 22*4882a593Smuzhiyun * 23*4882a593Smuzhiyun * Except as contained in this notice, the name(s) of the above copyright 24*4882a593Smuzhiyun * holders shall not be used in advertising or otherwise to promote the sale, 25*4882a593Smuzhiyun * use or other dealings in this Software without prior written authorization. 26*4882a593Smuzhiyun */ 27*4882a593Smuzhiyun 28*4882a593Smuzhiyun #ifndef _DARWIN_H 29*4882a593Smuzhiyun #define _DARWIN_H 30*4882a593Smuzhiyun 31*4882a593Smuzhiyun #include <IOKit/IOTypes.h> 32*4882a593Smuzhiyun #include "inputstr.h" 33*4882a593Smuzhiyun #include "scrnintstr.h" 34*4882a593Smuzhiyun #include <X11/extensions/XKB.h> 35*4882a593Smuzhiyun #include <asl.h> 36*4882a593Smuzhiyun 37*4882a593Smuzhiyun #include "darwinfb.h" 38*4882a593Smuzhiyun 39*4882a593Smuzhiyun // From darwin.c 40*4882a593Smuzhiyun void 41*4882a593Smuzhiyun DarwinPrintBanner(void); 42*4882a593Smuzhiyun int 43*4882a593Smuzhiyun DarwinParseModifierList(const char *constmodifiers, int separatelr); 44*4882a593Smuzhiyun void 45*4882a593Smuzhiyun DarwinAdjustScreenOrigins(ScreenInfo *pScreenInfo); 46*4882a593Smuzhiyun 47*4882a593Smuzhiyun #define SCREEN_PRIV(pScreen) ((DarwinFramebufferPtr) \ 48*4882a593Smuzhiyun dixLookupPrivate(&pScreen->devPrivates, \ 49*4882a593Smuzhiyun darwinScreenKey)) 50*4882a593Smuzhiyun 51*4882a593Smuzhiyun /* 52*4882a593Smuzhiyun * Global variables from darwin.c 53*4882a593Smuzhiyun */ 54*4882a593Smuzhiyun extern DevPrivateKeyRec darwinScreenKeyRec; 55*4882a593Smuzhiyun #define darwinScreenKey (&darwinScreenKeyRec) 56*4882a593Smuzhiyun extern int darwinScreensFound; 57*4882a593Smuzhiyun extern io_connect_t darwinParamConnect; 58*4882a593Smuzhiyun extern int darwinEventReadFD; 59*4882a593Smuzhiyun extern int darwinEventWriteFD; 60*4882a593Smuzhiyun extern DeviceIntPtr darwinPointer; 61*4882a593Smuzhiyun extern DeviceIntPtr darwinTabletCursor; 62*4882a593Smuzhiyun extern DeviceIntPtr darwinTabletStylus; 63*4882a593Smuzhiyun extern DeviceIntPtr darwinTabletEraser; 64*4882a593Smuzhiyun extern DeviceIntPtr darwinKeyboard; 65*4882a593Smuzhiyun 66*4882a593Smuzhiyun // User preferences 67*4882a593Smuzhiyun extern int darwinMouseAccelChange; 68*4882a593Smuzhiyun extern int darwinFakeButtons; 69*4882a593Smuzhiyun extern int darwinFakeMouse2Mask; 70*4882a593Smuzhiyun extern int darwinFakeMouse3Mask; 71*4882a593Smuzhiyun extern unsigned int darwinAppKitModMask; 72*4882a593Smuzhiyun extern unsigned int windowItemModMask; 73*4882a593Smuzhiyun extern int darwinSyncKeymap; 74*4882a593Smuzhiyun extern int darwinDesiredDepth; 75*4882a593Smuzhiyun 76*4882a593Smuzhiyun // location of X11's (0,0) point in global screen coordinates 77*4882a593Smuzhiyun extern int darwinMainScreenX; 78*4882a593Smuzhiyun extern int darwinMainScreenY; 79*4882a593Smuzhiyun 80*4882a593Smuzhiyun // bundle-main.c 81*4882a593Smuzhiyun extern char *bundle_id_prefix; 82*4882a593Smuzhiyun 83*4882a593Smuzhiyun _X_ATTRIBUTE_PRINTF(6, 7) 84*4882a593Smuzhiyun extern void 85*4882a593Smuzhiyun xq_asl_log(int level, const char *subsystem, const char *file, 86*4882a593Smuzhiyun const char *function, int line, const char *fmt, 87*4882a593Smuzhiyun ...); 88*4882a593Smuzhiyun 89*4882a593Smuzhiyun #define ASL_LOG(level, subsystem, msg, args ...) xq_asl_log(level, subsystem, \ 90*4882a593Smuzhiyun __FILE__, \ 91*4882a593Smuzhiyun __FUNCTION__, \ 92*4882a593Smuzhiyun __LINE__, msg, \ 93*4882a593Smuzhiyun ## args) 94*4882a593Smuzhiyun #define DEBUG_LOG(msg, args ...) ASL_LOG(ASL_LEVEL_DEBUG, \ 95*4882a593Smuzhiyun "XQuartz", msg, \ 96*4882a593Smuzhiyun ## args) 97*4882a593Smuzhiyun #define TRACE() DEBUG_LOG("TRACE") 98*4882a593Smuzhiyun 99*4882a593Smuzhiyun #endif /* _DARWIN_H */ 100