2 * Copyright (c) 2008 Apple, Inc.
3 * Copyright (c) 2001-2004 Torrey T. Lyons. 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.
28 #ifndef _DARWIN_EVENTS_H
29 #define _DARWIN_EVENTS_H
31 /* For extra precision of our cursor and other valuators */
32 #define XQUARTZ_VALUATOR_LIMIT (1 << 16)
39 DarwinEQEnqueue(const xEventPtr e
);
41 DarwinEQPointerPost(DeviceIntPtr pDev
, xEventPtr e
);
43 DarwinEQSwitchScreen(ScreenPtr pScreen
, Bool fromDIX
);
45 DarwinInputReleaseButtonsAndKeys(DeviceIntPtr pDev
);
47 DarwinSendTabletEvents(DeviceIntPtr pDev
, int ev_type
, int ev_button
,
48 double pointer_x
, double pointer_y
, double pressure
,
49 double tilt_x
, double tilt_y
);
51 DarwinSendPointerEvents(DeviceIntPtr pDev
, int ev_type
, int ev_button
,
52 double pointer_x
, double pointer_y
,
53 double pointer_dx
, double pointer_dy
);
55 DarwinSendKeyboardEvents(int ev_type
, int keycode
);
57 DarwinSendScrollEvents(double scroll_x
, double scroll_y
);
59 DarwinUpdateModKeys(int flags
);
61 DarwinListenOnOpenFD(int fd
);
64 * Subtypes for the ET_XQuartz event type
67 kXquartzReloadKeymap
, // Reload system keymap
68 kXquartzActivate
, // restore X drawing and cursor
69 kXquartzDeactivate
, // clip X drawing and switch to Aqua cursor
70 kXquartzSetRootClip
, // enable or disable drawing to the X screen
71 kXquartzQuit
, // kill the X server and release the display
72 kXquartzBringAllToFront
, // bring all X windows to front
73 kXquartzToggleFullscreen
, // Enable/Disable fullscreen mode
74 kXquartzSetRootless
, // Set rootless mode
75 kXquartzSpaceChanged
, // Spaces changed
76 kXquartzListenOnOpenFD
, // Listen to the launchd fd (passed as arg)
80 kXquartzControllerNotify
, // send an AppleWMControllerNotify event
81 kXquartzPasteboardNotify
, // notify the WM to copy or paste
82 kXquartzReloadPreferences
, // send AppleWMReloadPreferences
84 * Xplugin notification events
86 kXquartzDisplayChanged
, // display configuration has changed
87 kXquartzWindowState
, // window visibility state has changed
88 kXquartzWindowMoved
, // window has moved on screen
91 /* Send one of the above events to the server thread. */
93 DarwinSendDDXEvent(int type
, int argc
, ...);
95 /* A mask of the modifiers that are in our X11 keyboard layout:
96 * (Fn for example is just useful for 3button mouse emulation) */
97 extern int darwin_all_modifier_mask
;
99 /* A mask of the modifiers that are in our X11 keyboard layout:
100 * (Fn for example is just useful for 3button mouse emulation) */
101 extern int darwin_x11_modifier_mask
;
103 /* The current state of the above listed modifiers */
104 extern int darwin_all_modifier_flags
;
106 #endif /* _DARWIN_EVENTS_H */