14642e01fSmrg/*
24642e01fSmrg * Copyright (c) 2008 Apple, Inc.
34642e01fSmrg * Copyright (c) 2001-2004 Torrey T. Lyons. All Rights Reserved.
44642e01fSmrg *
54642e01fSmrg * Permission is hereby granted, free of charge, to any person obtaining a
64642e01fSmrg * copy of this software and associated documentation files (the "Software"),
74642e01fSmrg * to deal in the Software without restriction, including without limitation
84642e01fSmrg * the rights to use, copy, modify, merge, publish, distribute, sublicense,
94642e01fSmrg * and/or sell copies of the Software, and to permit persons to whom the
104642e01fSmrg * Software is furnished to do so, subject to the following conditions:
114642e01fSmrg *
124642e01fSmrg * The above copyright notice and this permission notice shall be included in
134642e01fSmrg * all copies or substantial portions of the Software.
144642e01fSmrg *
154642e01fSmrg * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
164642e01fSmrg * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
174642e01fSmrg * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
184642e01fSmrg * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
194642e01fSmrg * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
204642e01fSmrg * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
214642e01fSmrg * DEALINGS IN THE SOFTWARE.
224642e01fSmrg *
234642e01fSmrg * Except as contained in this notice, the name(s) of the above copyright
244642e01fSmrg * holders shall not be used in advertising or otherwise to promote the sale,
254642e01fSmrg * use or other dealings in this Software without prior written authorization.
264642e01fSmrg */
274642e01fSmrg
284642e01fSmrg#ifndef _DARWIN_EVENTS_H
294642e01fSmrg#define _DARWIN_EVENTS_H
304642e01fSmrg
314642e01fSmrg/* For extra precision of our cursor and other valuators */
324642e01fSmrg#define XQUARTZ_VALUATOR_LIMIT (1 << 16)
334642e01fSmrg
3435c4bbdfSmrgBool
3535c4bbdfSmrgDarwinEQInit(void);
3635c4bbdfSmrgvoid
3735c4bbdfSmrgDarwinEQFini(void);
3835c4bbdfSmrgvoid
3935c4bbdfSmrgDarwinEQEnqueue(const xEventPtr e);
4035c4bbdfSmrgvoid
4135c4bbdfSmrgDarwinEQPointerPost(DeviceIntPtr pDev, xEventPtr e);
4235c4bbdfSmrgvoid
4335c4bbdfSmrgDarwinEQSwitchScreen(ScreenPtr pScreen, Bool fromDIX);
4435c4bbdfSmrgvoid
4535c4bbdfSmrgDarwinInputReleaseButtonsAndKeys(DeviceIntPtr pDev);
4635c4bbdfSmrgvoid
4735c4bbdfSmrgDarwinSendTabletEvents(DeviceIntPtr pDev, int ev_type, int ev_button,
4835c4bbdfSmrg                       double pointer_x, double pointer_y, double pressure,
4935c4bbdfSmrg                       double tilt_x, double tilt_y);
5035c4bbdfSmrgvoid
5135c4bbdfSmrgDarwinSendPointerEvents(DeviceIntPtr pDev, int ev_type, int ev_button,
5235c4bbdfSmrg                        double pointer_x, double pointer_y,
5335c4bbdfSmrg                        double pointer_dx, double pointer_dy);
5435c4bbdfSmrgvoid
5535c4bbdfSmrgDarwinSendKeyboardEvents(int ev_type, int keycode);
5635c4bbdfSmrgvoid
5735c4bbdfSmrgDarwinSendScrollEvents(double scroll_x, double scroll_y);
5835c4bbdfSmrgvoid
5935c4bbdfSmrgDarwinUpdateModKeys(int flags);
6035c4bbdfSmrgvoid
6135c4bbdfSmrgDarwinListenOnOpenFD(int fd);
624642e01fSmrg
634642e01fSmrg/*
646747b715Smrg * Subtypes for the ET_XQuartz event type
654642e01fSmrg */
664642e01fSmrgenum {
676747b715Smrg    kXquartzReloadKeymap,     // Reload system keymap
684642e01fSmrg    kXquartzActivate,         // restore X drawing and cursor
694642e01fSmrg    kXquartzDeactivate,       // clip X drawing and switch to Aqua cursor
704642e01fSmrg    kXquartzSetRootClip,      // enable or disable drawing to the X screen
714642e01fSmrg    kXquartzQuit,             // kill the X server and release the display
724642e01fSmrg    kXquartzBringAllToFront,  // bring all X windows to front
734642e01fSmrg    kXquartzToggleFullscreen, // Enable/Disable fullscreen mode
744642e01fSmrg    kXquartzSetRootless,      // Set rootless mode
754642e01fSmrg    kXquartzSpaceChanged,     // Spaces changed
764642e01fSmrg    kXquartzListenOnOpenFD,   // Listen to the launchd fd (passed as arg)
774642e01fSmrg    /*
784642e01fSmrg     * AppleWM events
794642e01fSmrg     */
804642e01fSmrg    kXquartzControllerNotify, // send an AppleWMControllerNotify event
814642e01fSmrg    kXquartzPasteboardNotify, // notify the WM to copy or paste
824642e01fSmrg    kXquartzReloadPreferences, // send AppleWMReloadPreferences
834642e01fSmrg    /*
844642e01fSmrg     * Xplugin notification events
854642e01fSmrg     */
864642e01fSmrg    kXquartzDisplayChanged,   // display configuration has changed
874642e01fSmrg    kXquartzWindowState,      // window visibility state has changed
884642e01fSmrg    kXquartzWindowMoved,      // window has moved on screen
894642e01fSmrg};
904642e01fSmrg
914642e01fSmrg/* Send one of the above events to the server thread. */
9235c4bbdfSmrgvoid
9335c4bbdfSmrgDarwinSendDDXEvent(int type, int argc, ...);
944642e01fSmrg
956747b715Smrg/* A mask of the modifiers that are in our X11 keyboard layout:
966747b715Smrg * (Fn for example is just useful for 3button mouse emulation) */
976747b715Smrgextern int darwin_all_modifier_mask;
986747b715Smrg
996747b715Smrg/* A mask of the modifiers that are in our X11 keyboard layout:
1006747b715Smrg * (Fn for example is just useful for 3button mouse emulation) */
1016747b715Smrgextern int darwin_x11_modifier_mask;
1026747b715Smrg
1036747b715Smrg/* The current state of the above listed modifiers */
1046747b715Smrgextern int darwin_all_modifier_flags;
1054642e01fSmrg
1064642e01fSmrg#endif  /* _DARWIN_EVENTS_H */
107