darwinEvents.h revision 6747b715
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 344642e01fSmrgBool DarwinEQInit(void); 354642e01fSmrgvoid DarwinEQEnqueue(const xEventPtr e); 364642e01fSmrgvoid DarwinEQPointerPost(DeviceIntPtr pDev, xEventPtr e); 374642e01fSmrgvoid DarwinEQSwitchScreen(ScreenPtr pScreen, Bool fromDIX); 384642e01fSmrgvoid DarwinSendPointerEvents(DeviceIntPtr pDev, int ev_type, int ev_button, float pointer_x, float pointer_y, 394642e01fSmrg float pressure, float tilt_x, float tilt_y); 404642e01fSmrgvoid DarwinSendProximityEvents(int ev_type, float pointer_x, float pointer_y); 414642e01fSmrgvoid DarwinSendKeyboardEvents(int ev_type, int keycode); 424642e01fSmrgvoid DarwinSendScrollEvents(float count_x, float count_y, float pointer_x, float pointer_y, 434642e01fSmrg float pressure, float tilt_x, float tilt_y); 444642e01fSmrgvoid DarwinUpdateModKeys(int flags); 454642e01fSmrgvoid DarwinListenOnOpenFD(int fd); 464642e01fSmrg 474642e01fSmrg/* 486747b715Smrg * Subtypes for the ET_XQuartz event type 494642e01fSmrg */ 504642e01fSmrgenum { 516747b715Smrg kXquartzReloadKeymap, // Reload system keymap 524642e01fSmrg kXquartzActivate, // restore X drawing and cursor 534642e01fSmrg kXquartzDeactivate, // clip X drawing and switch to Aqua cursor 544642e01fSmrg kXquartzSetRootClip, // enable or disable drawing to the X screen 554642e01fSmrg kXquartzQuit, // kill the X server and release the display 564642e01fSmrg kXquartzBringAllToFront, // bring all X windows to front 574642e01fSmrg kXquartzToggleFullscreen, // Enable/Disable fullscreen mode 584642e01fSmrg kXquartzSetRootless, // Set rootless mode 594642e01fSmrg kXquartzSpaceChanged, // Spaces changed 604642e01fSmrg kXquartzListenOnOpenFD, // Listen to the launchd fd (passed as arg) 614642e01fSmrg /* 624642e01fSmrg * AppleWM events 634642e01fSmrg */ 644642e01fSmrg kXquartzControllerNotify, // send an AppleWMControllerNotify event 654642e01fSmrg kXquartzPasteboardNotify, // notify the WM to copy or paste 664642e01fSmrg kXquartzReloadPreferences, // send AppleWMReloadPreferences 674642e01fSmrg /* 684642e01fSmrg * Xplugin notification events 694642e01fSmrg */ 704642e01fSmrg kXquartzDisplayChanged, // display configuration has changed 714642e01fSmrg kXquartzWindowState, // window visibility state has changed 724642e01fSmrg kXquartzWindowMoved, // window has moved on screen 734642e01fSmrg}; 744642e01fSmrg 754642e01fSmrg/* Send one of the above events to the server thread. */ 764642e01fSmrgvoid DarwinSendDDXEvent(int type, int argc, ...); 774642e01fSmrg 786747b715Smrg/* A mask of the modifiers that are in our X11 keyboard layout: 796747b715Smrg * (Fn for example is just useful for 3button mouse emulation) */ 806747b715Smrgextern int darwin_all_modifier_mask; 816747b715Smrg 826747b715Smrg/* A mask of the modifiers that are in our X11 keyboard layout: 836747b715Smrg * (Fn for example is just useful for 3button mouse emulation) */ 846747b715Smrgextern int darwin_x11_modifier_mask; 856747b715Smrg 866747b715Smrg/* The current state of the above listed modifiers */ 876747b715Smrgextern int darwin_all_modifier_flags; 884642e01fSmrg 894642e01fSmrg#endif /* _DARWIN_EVENTS_H */ 90