1 | /*
|
---|
2 | * Copyright (c) 2001-2004 Torrey T. Lyons. All Rights Reserved.
|
---|
3 | *
|
---|
4 | * Permission is hereby granted, free of charge, to any person obtaining a
|
---|
5 | * copy of this software and associated documentation files (the "Software"),
|
---|
6 | * to deal in the Software without restriction, including without limitation
|
---|
7 | * the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
---|
8 | * and/or sell copies of the Software, and to permit persons to whom the
|
---|
9 | * Software is furnished to do so, subject to the following conditions:
|
---|
10 | *
|
---|
11 | * The above copyright notice and this permission notice shall be included in
|
---|
12 | * all copies or substantial portions of the Software.
|
---|
13 | *
|
---|
14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
---|
15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
---|
16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
---|
17 | * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
---|
18 | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
---|
19 | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
---|
20 | * DEALINGS IN THE SOFTWARE.
|
---|
21 | *
|
---|
22 | * Except as contained in this notice, the name(s) of the above copyright
|
---|
23 | * holders shall not be used in advertising or otherwise to promote the sale,
|
---|
24 | * use or other dealings in this Software without prior written authorization.
|
---|
25 | */
|
---|
26 | /* $XFree86: xc/programs/Xserver/hw/darwin/darwin.h,v 1.20 2003/11/15 00:07:09 torrey Exp $ */
|
---|
27 |
|
---|
28 | #ifndef _DARWIN_H
|
---|
29 | #define _DARWIN_H
|
---|
30 |
|
---|
31 | #include <IOKit/IOTypes.h>
|
---|
32 | #include "inputstr.h"
|
---|
33 | #include "scrnintstr.h"
|
---|
34 | #include <X11/extensions/XKB.h>
|
---|
35 |
|
---|
36 | typedef struct {
|
---|
37 | void *framebuffer;
|
---|
38 | int x;
|
---|
39 | int y;
|
---|
40 | int width;
|
---|
41 | int height;
|
---|
42 | int pitch;
|
---|
43 | int colorType;
|
---|
44 | int bitsPerPixel;
|
---|
45 | int colorBitsPerPixel;
|
---|
46 | int bitsPerComponent;
|
---|
47 | } DarwinFramebufferRec, *DarwinFramebufferPtr;
|
---|
48 |
|
---|
49 |
|
---|
50 | // From darwin.c
|
---|
51 | void DarwinPrintBanner();
|
---|
52 | int DarwinParseModifierList(const char *constmodifiers);
|
---|
53 | void DarwinAdjustScreenOrigins(ScreenInfo *pScreenInfo);
|
---|
54 | void xf86SetRootClip (ScreenPtr pScreen, BOOL enable);
|
---|
55 |
|
---|
56 | // From darwinEvents.c
|
---|
57 | Bool DarwinEQInit(DevicePtr pKbd, DevicePtr pPtr);
|
---|
58 | void DarwinEQEnqueue(const xEvent *e);
|
---|
59 | void DarwinEQPointerPost(xEvent *e);
|
---|
60 | void DarwinEQSwitchScreen(ScreenPtr pScreen, Bool fromDIX);
|
---|
61 |
|
---|
62 | // From darwinKeyboard.c
|
---|
63 | int DarwinModifierNXKeyToNXKeycode(int key, int side);
|
---|
64 | void DarwinKeyboardInit(DeviceIntPtr pDev);
|
---|
65 | int DarwinModifierNXKeycodeToNXKey(unsigned char keycode, int *outSide);
|
---|
66 | int DarwinModifierNXKeyToNXMask(int key);
|
---|
67 | int DarwinModifierNXMaskToNXKey(int mask);
|
---|
68 | int DarwinModifierStringToNXKey(const char *string);
|
---|
69 |
|
---|
70 | // Mode specific functions
|
---|
71 | Bool DarwinModeAddScreen(int index, ScreenPtr pScreen);
|
---|
72 | Bool DarwinModeSetupScreen(int index, ScreenPtr pScreen);
|
---|
73 | void DarwinModeInitOutput(int argc,char **argv);
|
---|
74 | void DarwinModeInitInput(int argc, char **argv);
|
---|
75 | int DarwinModeProcessArgument(int argc, char *argv[], int i);
|
---|
76 | void DarwinModeProcessEvent(xEvent *xe);
|
---|
77 | void DarwinModeGiveUp(void);
|
---|
78 | void DarwinModeBell(int volume, DeviceIntPtr pDevice, pointer ctrl, int class);
|
---|
79 |
|
---|
80 |
|
---|
81 | #undef assert
|
---|
82 | #define assert(x) { if ((x) == 0) \
|
---|
83 | FatalError("assert failed on line %d of %s!\n", __LINE__, __FILE__); }
|
---|
84 | #define kern_assert(x) { if ((x) != KERN_SUCCESS) \
|
---|
85 | FatalError("assert failed on line %d of %s with kernel return 0x%x!\n", \
|
---|
86 | __LINE__, __FILE__, x); }
|
---|
87 | #define SCREEN_PRIV(pScreen) \
|
---|
88 | ((DarwinFramebufferPtr)pScreen->devPrivates[darwinScreenIndex].ptr)
|
---|
89 |
|
---|
90 |
|
---|
91 | #define MIN_KEYCODE XkbMinLegalKeyCode // unfortunately, this isn't 0...
|
---|
92 |
|
---|
93 |
|
---|
94 | /*
|
---|
95 | * Global variables from darwin.c
|
---|
96 | */
|
---|
97 | extern int darwinScreenIndex; // index into pScreen.devPrivates
|
---|
98 | extern int darwinScreensFound;
|
---|
99 | extern io_connect_t darwinParamConnect;
|
---|
100 | extern int darwinEventReadFD;
|
---|
101 | extern int darwinEventWriteFD;
|
---|
102 | extern DeviceIntPtr darwinPointer;
|
---|
103 | extern DeviceIntPtr darwinKeyboard;
|
---|
104 |
|
---|
105 | // User preferences
|
---|
106 | extern int darwinMouseAccelChange;
|
---|
107 | extern int darwinFakeButtons;
|
---|
108 | extern int darwinFakeMouse2Mask;
|
---|
109 | extern int darwinFakeMouse3Mask;
|
---|
110 | extern int darwinSwapAltMeta;
|
---|
111 | extern char *darwinKeymapFile;
|
---|
112 | extern int darwinSyncKeymap;
|
---|
113 | extern unsigned int darwinDesiredWidth, darwinDesiredHeight;
|
---|
114 | extern int darwinDesiredDepth;
|
---|
115 | extern int darwinDesiredRefresh;
|
---|
116 |
|
---|
117 | // location of X11's (0,0) point in global screen coordinates
|
---|
118 | extern int darwinMainScreenX;
|
---|
119 | extern int darwinMainScreenY;
|
---|
120 |
|
---|
121 |
|
---|
122 | /*
|
---|
123 | * Special ddx events understood by the X server
|
---|
124 | */
|
---|
125 | enum {
|
---|
126 | kXDarwinUpdateModifiers // update all modifier keys
|
---|
127 | = LASTEvent+1, // (from X.h list of event names)
|
---|
128 | kXDarwinUpdateButtons, // update state of mouse buttons 2 and up
|
---|
129 | kXDarwinScrollWheel, // scroll wheel event
|
---|
130 |
|
---|
131 | /*
|
---|
132 | * Quartz-specific events -- not used in IOKit mode
|
---|
133 | */
|
---|
134 | kXDarwinActivate, // restore X drawing and cursor
|
---|
135 | kXDarwinDeactivate, // clip X drawing and switch to Aqua cursor
|
---|
136 | kXDarwinSetRootClip, // enable or disable drawing to the X screen
|
---|
137 | kXDarwinQuit, // kill the X server and release the display
|
---|
138 | kXDarwinReadPasteboard, // copy Mac OS X pasteboard into X cut buffer
|
---|
139 | kXDarwinWritePasteboard, // copy X cut buffer onto Mac OS X pasteboard
|
---|
140 | /*
|
---|
141 | * AppleWM events
|
---|
142 | */
|
---|
143 | kXDarwinControllerNotify, // send an AppleWMControllerNotify event
|
---|
144 | kXDarwinPasteboardNotify, // notify the WM to copy or paste
|
---|
145 | /*
|
---|
146 | * Xplugin notification events
|
---|
147 | */
|
---|
148 | kXDarwinDisplayChanged, // display configuration has changed
|
---|
149 | kXDarwinWindowState, // window visibility state has changed
|
---|
150 | kXDarwinWindowMoved // window has moved on screen
|
---|
151 | };
|
---|
152 |
|
---|
153 | #endif /* _DARWIN_H */
|
---|