2 * Copyright (c) 2001 Torrey T. Lyons. All Rights Reserved.
3 * Copyright (c) 2002 Apple Computer, Inc. All rights reserved.
5 * Permission is hereby granted, free of charge, to any person obtaining a
6 * copy of this software and associated documentation files (the "Software"),
7 * to deal in the Software without restriction, including without limitation
8 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
9 * and/or sell copies of the Software, and to permit persons to whom the
10 * Software is furnished to do so, subject to the following conditions:
12 * The above copyright notice and this permission notice shall be included in
13 * all copies or substantial portions of the Software.
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18 * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
19 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
20 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
21 * DEALINGS IN THE SOFTWARE.
23 * Except as contained in this notice, the name(s) of the above copyright
24 * holders shall not be used in advertising or otherwise to promote the sale,
25 * use or other dealings in this Software without prior written authorization.
27 /* $XFree86: xc/programs/Xserver/hw/darwin/darwin.h,v 1.11 2002/03/28 02:21:08 torrey Exp $ */
33 #include "screenint.h"
34 #include "scrnintstr.h"
35 #include "extensions/XKB.h"
47 int colorBitsPerPixel;
48 unsigned int redMask, greenMask, blueMask;
49 } DarwinFramebufferRec, *DarwinFramebufferPtr;
51 /* From darwinKeyboard.c */
52 int DarwinModifierNXKeyToNXKeycode(int key, int side);
53 void DarwinKeyboardInit(DeviceIntPtr pDev);
54 void DarwinKeyboardReload (DeviceIntPtr pDev);
56 /* from darwin-new-keymap.c */
57 unsigned int DarwinSystemKeymapSeed (void);
59 /* from darwin-input.c */
60 void DarwinEnqueueEvent (const xEvent *e);
61 Bool DarwinDequeueEvent (xEvent *e);
62 void DarwinInputInit (void);
63 void DarwinInputPreInit (void);
64 int DarwinMouseProc(DeviceIntPtr pPointer, int what);
65 int DarwinKeybdProc(DeviceIntPtr pDev, int onoff);
68 #define assert(x) { if ((x) == 0) \
69 FatalError("assert failed on line %d of %s!\n", __LINE__, __FILE__); }
70 #define kern_assert(x) { if ((x) != KERN_SUCCESS) \
71 FatalError("assert failed on line %d of %s with kernel return 0x%x!\n", \
72 __LINE__, __FILE__, x); }
73 #define SCREEN_PRIV(pScreen) \
74 ((DarwinFramebufferPtr)pScreen->devPrivates[darwinScreenIndex].ptr)
76 #define MIN_KEYCODE XkbMinLegalKeyCode // unfortunately, this isn't 0...
78 extern void DarwinEnqueuePointerEvent (xEvent *xe);
79 extern void DarwinAdjustScreenOrigins (ScreenInfo *pScreenInfo);
81 /* Global variables from darwin.c */
82 extern int darwinScreenIndex; // index into pScreen.devPrivates
83 extern int darwinScreensFound;
85 /* User preferences used by generic Darwin X server code */
86 extern Bool darwinSwapAltMeta;
87 extern int darwinFakeButtons;
88 extern char *darwinKeymapFile;
89 extern Bool darwinSyncKeymap;
91 /* location of X11's (0,0) point in global screen coordinates */
92 extern int darwinMainScreenX;
93 extern int darwinMainScreenY;
95 /* Client message event type ranges. */
97 kXdarwinFirstEvent = 1,
98 kXdarwinLastEvent = kXdarwinFirstEvent + 99,
99 kXquartzFirstEvent = kXdarwinLastEvent + 1,
100 kXquartzLastEvent = kXquartzFirstEvent + 99,
103 /* "Darwin" client message types */
105 kXdarwinQuit = kXdarwinFirstEvent,
108 extern char *DarwinFindLibraryFile (const char *file, const char *pathext);
109 extern void DarwinForeachLibraryFile (const char *dir,
110 void (*callback) (const char *dir,
115 extern void DarwinSetFakeButtons (const char *mod2, const char *mod3);
117 #endif /* _DARWIN_H */