17#include <Cocoa/Cocoa.h>
29@interface FakeCrossingEvent : NSEvent {
30 NSWindow *fQuartzWindow;
31 NSPoint fLocationInWindow;
36@implementation FakeCrossingEvent
39- (id) initWithWindow : (NSWindow *) window location : (NSPoint) location
42 assert(window &&
"initWithWindow:location:, parameter 'window' is nil");
44 if (self = [super
init]) {
45 fQuartzWindow = window;
46 fLocationInWindow = location;
55 assert(fQuartzWindow &&
"window, fQuartzWindow is nil");
60- (NSPoint) locationInWindow
62 assert(fQuartzWindow != nil &&
"locationInWindow, fQuartzWindow is nil");
63 return fLocationInWindow;
67- (NSTimeInterval) timestamp
84template<
typename T1,
typename T2>
91 return fFirst < rhs.fFirst;
100 assert(buf != 0 &&
"MapUnicharToKeySym, parameter 'buf' is null");
102 static const KeySymPair<unichar, EKeySym> keyMap[] = {
110 {NSUpArrowFunctionKey,
kKey_Up},
160 const unsigned nEntries =
sizeof keyMap /
sizeof keyMap[0];
164 KeySymPair<unichar, EKeySym> valueToFind = {};
165 valueToFind.fFirst = key;
166 const KeySymPair<unichar, EKeySym> *iter = std::lower_bound(keyMap, keyMap + nEntries, valueToFind);
168 if (iter != keyMap + nEntries && iter->fFirst == key) {
169 buf[0] = key <= 0x7e ? key : 0;
170 rootKeySym = iter->fSecond;
181 if (keySym >= 0x20 && keySym <= 0x7e)
184 static const KeySymPair<EKeySym, unichar> keyMap[] = {
199 {
kKey_Up, NSUpArrowFunctionKey},
249 const unsigned nEntries =
sizeof keyMap /
sizeof keyMap[0];
251 KeySymPair<EKeySym, unichar> valueToFind = {};
252 valueToFind.fFirst =
static_cast<EKeySym>(keySym);
253 const KeySymPair<EKeySym, unichar> *iter = std::lower_bound(keyMap, keyMap + nEntries, valueToFind);
254 if (iter != keyMap + nEntries && iter->fFirst == keySym)
255 return iter->fSecond;
263 NSUInteger cocoaModifiers = 0;
276 return cocoaModifiers;
282 const NSUInteger modifiers = [NSEvent modifierFlags];
296 return rootModifiers;
303 const NSUInteger buttons = [NSEvent pressedMouseButtons];
308 if (buttons & (1 << 2))
311 return rootModifiers;
316#pragma mark - Several aux. functions to extract parameters from Cocoa events.
322 assert(theEvent != nil &&
"TimeForCocoaEvent, parameter 'theEvent' is nil");
324 return [theEvent timestamp] * 1000;
332 assert(theEvent != nil &&
"NewX11EventFromCocoaEvent, parameter 'theEvent' is nil");
346 assert(cocoaEvent != nil &&
"ConvertEventLocationToROOTXY, parameter 'cocoaEvent' is nil");
347 assert(eventView != nil &&
"ConvertEventLocationToROOTXY, parameter 'eventView' is nil");
348 assert(rootEvent != 0 &&
"ConvertEventLocationToROOTXY, parameter 'rootEvent' is null");
350 if (![cocoaEvent window])
351 NSLog(
@"Error in ConvertEventLocationToROOTXY, window property"
352 " of event is nil, can not convert coordinates correctly");
359 const NSPoint viewPoint = [eventView convertPoint : winPoint fromView : nil];
361 rootEvent->
fX = viewPoint.x;
362 rootEvent->
fY = viewPoint.y;
371 assert(theEvent != nil &&
"GetKeyboardModifiersFromCocoaEvent, parameter 'event' is nil");
373 const NSUInteger modifiers = [theEvent modifierFlags];
374 unsigned rootModifiers = 0;
386 return rootModifiers;
392 assert(theEvent != nil &&
"GetModifiersFromCocoaEvent, parameter 'event' is nil");
395 const NSUInteger buttons = [NSEvent pressedMouseButtons];
400 if (buttons & (1 << 2))
403 return rootModifiers;
406#pragma mark - Misc. aux. functions.
409bool IsParent(NSView<X11Window> *testParent, NSView<X11Window> *testChild)
411 assert(testParent != nil &&
"IsParent, parameter 'testParent' is nil");
412 assert(testChild != nil &&
"IsParent, parameter 'testChild' is nil");
414 if (testChild.fParentView) {
415 NSView<X11Window> *parent = testChild.fParentView;
417 if(parent == testParent)
419 parent = parent.fParentView;
427bool IsInBranch(NSView<X11Window> *parent, NSView<X11Window> *child, NSView<X11Window> *testView)
429 assert(child != nil &&
"IsInBranch, parameter 'child' is nil");
430 assert(testView != nil &&
"IsInBranch, parameter 'testView' is nil");
432 if (testView == child || testView == parent)
435 for (NSView<X11Window> *current = child.fParentView; current != parent; current = current.fParentView) {
436 if (current == testView)
453 NSView<X11Window> **lca)
459 assert(view1 != nil &&
"FindLowestCommonAncestor, parameter 'view1' is nil");
460 assert(view2 != nil &&
"findLowestCommonAncestor, parameter 'view2' is nil");
461 assert(lca != 0 &&
"FindLowestCommonAncestor, parameter 'lca' is null");
463 if (!view1.fParentView)
466 if (!view2.fParentView)
469 NSView<X11Window> *
const ancestor = (NSView<X11Window> *)[view1 ancestorSharedWithView : view2];
482 assert(view1 != nil &&
"FindRelation, view1 parameter is nil");
483 assert(view2 != nil &&
"FindRelation, view2 parameter is nil");
484 assert(lca != 0 &&
"FindRelation, lca parameter is nil");
499 assert(viewFrom != nil &&
"FindViewToPropagateEvent, parameter 'view' is nil");
501 if (viewFrom.fEventMask & checkMask)
504 for (viewFrom = viewFrom.fParentView; viewFrom; viewFrom = viewFrom.fParentView) {
505 if (viewFrom.fEventMask & checkMask)
514 NSView<X11Window> *grabView,
Mask_t grabMask)
521 assert(viewFrom != nil &&
"FindViewToPropagateEvent, parameter 'view' is nil");
523 if (viewFrom.fEventMask & checkMask)
526 for (viewFrom = viewFrom.fParentView; viewFrom; viewFrom = viewFrom.fParentView) {
527 if (viewFrom.fEventMask & checkMask)
531 if (grabView && (grabMask & checkMask))
537#pragma mark - Aux. 'low-level' functions to generate events and call HandleEvent for a root window.
548 assert(view != nil &&
"SendEnterEvent, parameter 'view' is nil");
549 assert(theEvent != nil &&
"SendEnterEvent, parameter 'event' is nil");
550 assert(view.fID != 0 &&
"SendEnterEvent, view.fID is 0");
554#ifdef DEBUG_ROOT_COCOA
555 NSLog(
@"SendEnterEvent, ROOT's widget %u was not found", view.fID);
562 enterEvent.
fCode = detail;
571 queue.push_back(enterEvent);
583 assert(view != nil &&
"SendLeaveEvent, parameter 'view' is nil");
584 assert(theEvent != nil &&
"SendLeaveEvent, parameter 'event' is nil");
585 assert(view.fID != 0 &&
"SendLeaveEvent, view.fID is 0");
589#ifdef DEBUG_ROOT_COCOA
590 NSLog(
@"SendLeaveEvent, ROOT's widget %u was not found", view.fID);
597 leaveEvent.
fCode = detail;
603 queue.push_back(leaveEvent);
614 assert(view != nil &&
"SendPointerMotionEvent, parameter 'view' is nil");
615 assert(theEvent != nil &&
"SendPointerMotionEvent, parameter 'event' is nil");
616 assert(view.fID != 0 &&
"SendPointerMotionEvent, view.fID is 0");
620#ifdef DEBUG_ROOT_COCOA
621 NSLog(
@"SendPointerMotionEvent, ROOT's widget %u was not found", view.fID);
632 queue.push_back(motionEvent);
645 assert(view != nil &&
"SendButtonPressEvent, parameter 'view' is nil");
646 assert(theEvent != nil &&
"SendButtonPressEvent, parameter 'event' is nil");
647 assert(view.fID != 0 &&
"SendButtonPressEvent, view.fID is 0");
651#ifdef DEBUG_ROOT_COCOA
652 NSLog(
@"SendButtonpressEvent, ROOT's widget %u was not found", view.fID);
659 pressEvent.
fCode = btn;
671 NSPoint viewPoint = {};
672 viewPoint.x = pressEvent.
fX;
673 viewPoint.y = pressEvent.
fY;
674 for (NSView<X11Window> *child in [view subviews]) {
675 if (!child.fIsOverlapped && [child hitTest : viewPoint]) {
676 pressEvent.
fUser[0] = child.fID;
682 queue.push_back(pressEvent);
694 assert(view != nil &&
"SendButtonReleaseEvent, parameter 'view' is nil");
695 assert(theEvent != nil &&
"SendButtonReleaseEvent, parameter 'event' is nil");
696 assert(view.fID != 0 &&
"SendButtonReleaseEvent, view.fID is 0");
700#ifdef DEBUG_ROOT_COCOA
701 NSLog(
@"SendButtonReleaseEvent, ROOT's widget %u was not found", view.fID);
708 releaseEvent.
fCode = btn;
713 queue.push_back(releaseEvent);
718 NSEvent *theEvent, NSPoint windowPoint)
720 assert(view != nil &&
"SendKeyPressEvent, parameter 'view' is nil");
721 assert(theEvent != nil &&
"SendKeyPressEvent, parameter 'event' is nil");
722 assert(view.fID != 0 &&
"SendKeyPressEvent, view.fID is 0");
726#ifdef DEBUG_ROOT_COCOA
727 NSLog(
@"SendKeyPressEvent, ROOT's widget %u was not found", view.fID);
736 NSString *
const characters = [theEvent charactersIgnoringModifiers];
737 assert(characters != nil &&
"SendKeyPressEvent, [theEvent characters] returned nil");
738 assert([characters length] > 0 &&
"SendKeyPressEvent, characters is an empty string");
740 keyPressEvent.
fCode = [characters characterAtIndex : 0];
744 const NSPoint viewPoint = [view convertPoint : windowPoint fromView : nil];
747 keyPressEvent.
fX = viewPoint.x;
748 keyPressEvent.
fY = viewPoint.y;
750 keyPressEvent.
fXRoot = screenPoint.x;
751 keyPressEvent.
fYRoot = screenPoint.y;
754 keyPressEvent.
fUser[0] = childView.fID;
757 queue.push_back(keyPressEvent);
762 NSEvent *theEvent, NSPoint windowPoint)
764 assert(view != nil &&
"SendKeyReleaseEvent, parameter 'view' is nil");
765 assert(theEvent != nil &&
"SendKeyReleaseEvent, parameter 'event' is nil");
766 assert(view.fID != 0 &&
"SendKeyReleaseEvent, view.fID is 0");
770#ifdef DEBUG_ROOT_COCOA
771 NSLog(
@"SendKeyPressEvent, ROOT's widget %u was not found", view.fID);
781 NSString *
const characters = [theEvent charactersIgnoringModifiers];
782 assert(characters != nil &&
"SendKeyReleaseEvent, [theEvent characters] returned nil");
783 assert([characters length] > 0 &&
"SendKeyReleaseEvent, characters is an empty string");
784 keyReleaseEvent.
fCode = [characters characterAtIndex : 0];
787 const NSPoint viewPoint = [view convertPoint : windowPoint fromView : nil];
788 keyReleaseEvent.
fX = viewPoint.x;
789 keyReleaseEvent.
fY = viewPoint.y;
792 keyReleaseEvent.
fXRoot = screenPoint.x;
793 keyReleaseEvent.
fYRoot = screenPoint.y;
797 keyReleaseEvent.
fUser[0] = childView.fID;
800 queue.push_back(keyReleaseEvent);
807 assert(view != nil &&
"SendFocusInEvent, parameter 'view' is nil");
811#ifdef DEBUG_ROOT_COCOA
812 NSLog(
@"SendFocusInEvent, ROOT's widget %u was not found", view.fID);
818 focusInEvent.
fWindow = view.fID;
820 focusInEvent.
fCode = mode;
822 queue.push_back(focusInEvent);
828 assert(view != nil &&
"SendFocusOutEvent, parameter 'view' is nil");
832#ifdef DEBUG_ROOT_COCOA
833 NSLog(
@"SendFocusOutEvent, ROOT's widget %u was not found", view.fID);
839 focusOutEvent.
fWindow = view.fID;
841 focusOutEvent.
fCode = mode;
843 queue.push_back(focusOutEvent);
846#pragma mark - Aux. functions to send events to view's branch.
850 NSEvent *theEvent,
EXMagic mode)
853 assert(from != nil &&
"SendEnterEventRange, 'from' parameter is nil");
854 assert(to != nil &&
"SendEnterEventRange, 'to' parameter is nil");
855 assert(theEvent != nil &&
"SendEnterEventRange, event parameter is nil");
860 from = from.fParentView;
866 NSEvent *theEvent,
EXMagic mode)
869 assert(from != nil &&
"SendEnterEventClosedRange, 'from' parameter is nil");
870 assert(to != nil &&
"SendEnterEventClosedRange, 'to' parameter is nil");
871 assert(theEvent != nil &&
"SendEnterEventClosedRange, event parameter is nil");
880 NSEvent *theEvent,
EXMagic mode)
883 assert(from != nil &&
"SendLeaveEventRange, 'from' parameter is nil");
884 assert(to != nil &&
"SendLeaveEventRange, 'to' parameter is nil");
885 assert(theEvent != nil &&
"SendLeaveEventRange, event parameter is nil");
890 from = from.fParentView;
896 NSEvent *theEvent,
EXMagic mode)
899 assert(from != nil &&
"SendLeaveEventClosedRange, 'from' parameter is nil");
900 assert(to != nil &&
"SendLeaveEventClosedRange, 'to' parameter is nil");
901 assert(theEvent != nil &&
"SendLeaveEventClosedRange, event parameter is nil");
908#pragma mark - Top-level crossing event generators.
915 NSEvent *theEvent,
EXMagic detail)
924 assert(parent != nil &&
"GenerateCrossingEventChildToParent, parameter 'parent' is nil");
925 assert(child != nil &&
"GenerateCrossingEventChildToParent, parameter 'child' is nil");
926 assert(theEvent != nil &&
"GenerateCrossingEventChildToParent, parameter 'event' is nil");
927 assert(child.fParentView != nil &&
928 "GenerateCrossingEventChildToParent, parameter 'child' must have QuartzView* parent");
945 NSEvent *theEvent,
EXMagic detail)
955 assert(parent != nil &&
"GenerateCrossingEventParentToChild, parameter 'parent' is nil");
956 assert(child != nil &&
"GenerateCrossingEventParentToChild, parameter 'child' is nil");
957 assert(theEvent != nil &&
"GenerateCrossingEventParentToChild, parameter 'event' is nil");
958 assert(child.fParentView != nil &&
959 "GenerateCrossingEventParentToChild, parameter 'child' must have QuartzView* parent");
976 NSView<X11Window> *ancestor, NSEvent *theEvent,
EXMagic detail)
984 assert(child1 != nil &&
"GenerateCrossingEventFromChild1ToChild2, parameter 'child1' is nil");
985 assert(child2 != nil &&
"GenerateCrossingEventFromChild1ToChild2, child2 parameter is nil");
986 assert(theEvent != nil &&
"GenerateCrossingEventFromChild1ToChild2, theEvent parameter is nil");
996 if (child1.fParentView)
998 (NSView<X11Window> *)[[child1 window] contentView], theEvent, detail);
999 if (child2.fParentView)
1001 (NSView<X11Window> *)[[child2 window] contentView], theEvent, detail);
1003 if (child1.fParentView)
1005 if (child2.fParentView)
1016 NSEvent *theEvent,
EXMagic detail)
1021 assert(theEvent != nil &&
"GenerateCrossingEvent, event parameter is nil");
1023 if (fromView == toView) {
1040 }
else if (!toView) {
1045 NSView<X11Window> *ancestor = 0;
1087 NSView<X11Window> *grabView,
Mask_t grabEventMask, NSEvent *theEvent)
1092 assert(theEvent != nil &&
"GenerateCrossingEventForGrabView, parameter 'event' is nil");
1093 assert(grabView != nil &&
"GenerateCrossingEventForGrabView, parameter 'grabView' is nil");
1094 assert((fromView != nil || toView != nil) &&
1095 "GenerateCrossingEventForGrabView, both 'toView' and 'fromView' parameters are nil");
1097 if (fromView == toView)
1103 if (fromView == grabView && wantsLeave)
1106 if (toView == grabView && wantsEnter)
1112 if (wantsEnter &&
IsParent(grabView, toView))
1114 }
else if (!toView) {
1116 if (wantsLeave &&
IsParent(grabView, fromView))
1119 NSView<X11Window> *ancestor = 0;
1125 }
else if (
IsInBranch(nil, toView, grabView)) {
1136 : fViewUnderPointer(nil),
1140 fButtonGrabView(nil),
1151 assert(view != nil &&
"GenerateConfigureNotifyEvent, parameter 'view' is nil");
1157 newEvent.
fX = newFrame.origin.x;
1158 newEvent.
fY = newFrame.origin.y;
1160 newEvent.
fWidth = newFrame.size.width;
1161 newEvent.
fHeight = newFrame.size.height;
1176 assert(view != nil &&
"GenerateExposeEvent, parameter 'view' is nil");
1179 exposeEvent.
fWindow = view.fID;
1181 exposeEvent.
fX = exposedRect.origin.x;
1182 exposeEvent.
fY = exposedRect.origin.y;
1183 exposeEvent.
fWidth = exposedRect.size.width;
1184 exposeEvent.
fHeight = exposedRect.size.height;
1187 assert(window != 0 &&
"GenerateExposeEvent, window was not found");
1195 assert(theEvent != nil &&
"GenerateCrossingEvent, parameter 'event' is nil");
1204 assert(theEvent &&
"GenerateCrossingEventNoGrab, parameter 'theEvent' is nil");
1215 assert(theEvent != nil &&
"GenerateCrossingEventActiveGrab, parameter 'theEvent' is nil");
1246 assert(theEvent != nil &&
"GeneratePointerMotionEvent, parameter 'theEvent' is nil");
1260 assert(eventView != nil &&
"GenerateButtonPressEvent, parameter 'eventView' is nil");
1261 assert(theEvent != nil &&
"GenerateButtonpressEvent, parameter 'theEvent' is nil");
1273 assert(eventView != nil &&
"GenerateButtonReleaseEvent, parameter 'eventView' is nil");
1274 assert(theEvent != nil &&
"GenerateButtonReleaseEvent, parameter 'theEvent' is nil");
1287 assert(eventView != nil &&
"GenerateKeyPressEvent, parameter 'eventView' is nil");
1288 assert(theEvent != nil &&
"GenerateKeyPressEvent, parameter 'theEvent' is nil");
1290 if (![[theEvent charactersIgnoringModifiers] length])
1303 assert(eventView != nil &&
"GenerateKeyReleaseEvent, parameter 'eventView' is nil");
1304 assert(theEvent != nil &&
"GenerateKeyReleaseEvent, parameter 'theEvent' is nil");
1306 if (![[theEvent charactersIgnoringModifiers] length])
1341 assert(grabView != nil &&
"SetPointerGrab, parameter 'grabView' is nil");
1363 const NSPoint location = [[grabView window] mouseLocationOutsideOfEventStream];
1365 location : location]);
1368 NSLog(
@"EventTranslator::SetPointerGrab, crossing event initialization failed");
1376 [
fButtonGrabView activateGrab : eventMask ownerEvents : fOwnerEvents];
1389 const NSPoint location = [[candidateView window] mouseLocationOutsideOfEventStream];
1391 location : location ]);
1395 NSLog(
@"EventTranslator::CancelPointerGrab, crossing event initialization failed");
1408 location : location ]);
1412 NSLog(
@"EventTranslator::CancelPointerGrab, crossing event initialization failed");
1458void ClearPointerIfViewIsRelated(NSView<X11Window> *&view,
Window_t winID)
1460 NSView<X11Window> *
v = view;
1462 for (;
v;
v =
v.fParentView) {
1463 if (
v.fID == winID) {
1480 for (NSView<X11Window> *view =
fButtonGrabView; view; view = view.fParentView) {
1481 if (view.fID == winID) {
1489 for (NSView<X11Window> *view =
fViewUnderPointer; view; view = view.fParentView) {
1490 if (view.fID == winID) {
1491 NSPoint location = {};
1498 location : location]);
1501 NSLog(
@"EventTranslator::CheckUnmappedView, crossing event initialization failed");
1513 ClearPointerIfViewIsRelated(
fFocusView, winID);
1521 assert(theEvent != nil &&
"GeneratePointerMotionEventNoGrab, parameter 'theEvent' is nil");
1523 const Mask_t maskToTest = [NSEvent pressedMouseButtons] ?
1548 assert(theEvent != nil &&
"GeneratePointerMotionEventActiveGrab, parameter 'theEvent' is nil");
1550 const Mask_t maskToTest = [NSEvent pressedMouseButtons] ?
1582 assert(view != nil &&
"GenerateButtonPressEventNoGrab, parameter 'view' is nil");
1583 assert(theEvent != nil &&
"GenerateButtonPressEventNoGrab, parameter 'theEvent' is nil");
1615 assert(theEvent != nil &&
"GenerateButtonPressEventActiveGrab, parameter 'theEvent' is nil");
1647 assert(eventView != nil &&
"GenerateButtonReleaseEventNoGrab, parameter 'eventView' is nil");
1648 assert(theEvent != nil &&
"GenerateButtonReleaseEventNoGrabm parameter 'theEvent' is nil");
1660 assert(eventView != nil &&
"GenerateButtonReleaseEventActiveGrab, parameter 'eventView' is nil");
1661 assert(theEvent != nil &&
"GenerateButtonReleaseEventActiveGrab, parameter 'theEvent' is nil");
1701 assert(eventView != nil &&
"GenerateKeyPressEventNoGrab, parameter 'eventView' is nil");
1702 assert(theEvent != nil &&
"GenerateKeyPressEventNoGrab, parameter 'theEvent' is nil");
1703 assert(
fFocusView != nil &&
"GenerateKeyPressEventNoGrab, fFocusView is nil");
1708 NSView<X11Window> *candidateView =
fFocusView;
1713 candidateView = testView;
1724 assert(eventView != nil &&
"GenerateKeyEventActiveGrab, parameter 'eventView' is nil");
1725 assert(theEvent != nil &&
"GenerateKeyEventActiveGrab, parameter 'theEvent' is nil");
1726 assert(
fFocusView != nil &&
"GenerateKeyEventActiveGrab, fFocusView is nil");
1757 assert(eventView != nil &&
"GenerateKeyReleaseEventNoGrab, parameter 'eventView' is nil");
1758 assert(theEvent != nil &&
"GenerateKeyReleaseEventNoGrab, parameter 'theEvent' is nil");
1760 NSView<X11Window> *candidateView =
fFocusView;
1765 candidateView = testView;
1775 assert(view != nil &&
"GenerateKeyEventForView, parameter 'view' is nil");
1776 assert(theEvent != nil &&
"GenerateKeyEventForView, parameter 'theEvent' is nil");
1778 "GenerateKeyEvenForView, event's type must be keydown or keyup");
1782 NSView<X11Window> *childView = nil;
1784 NSPoint mousePosition = {};
1786 mousePosition = [topLevel mouseLocationOutsideOfEventStream];
1799 assert(fromView != nil &&
"FindButtonGrabView, parameter 'fromView' is nil");
1800 assert(theEvent != nil &&
"FindButtonGrabView, parameter 'theEvent' is nil");
1806 NSView<X11Window> *grabView = 0;
1807 NSView<X11Window> *buttonPressView = 0;
1809 for (NSView<X11Window> *view = fromView; view != nil; view = view.fParentView) {
1812 buttonPressView = view;
1815 if (view.fPassiveGrabButton ==
kAnyButton || view.fPassiveGrabButton == btn) {
1817 if (view.fPassiveGrabKeyModifiers ==
kAnyModifier || (view.fPassiveGrabKeyModifiers & keyModifiers))
1827 }
else if (buttonPressView) {
1845 assert(eventView != nil &&
"FindKeyGrabView, parameter 'eventView' is nil");
1846 assert(theEvent != nil &&
"FindKeyGrabView, parameter 'theEvent' is nil");
1848 NSString *
const characters = [theEvent charactersIgnoringModifiers];
1849 assert(characters != nil &&
"FindKeyGrabView, [theEvent characters] returned nil");
1850 assert([characters length] > 0 &&
"FindKeyGrabView, characters is an empty string");
1852 const unichar keyCode = [characters characterAtIndex : 0];
1857 currentView = eventView;
1859 for (; currentView; currentView = currentView.fParentView) {
1860 if ([currentView findPassiveKeyGrab : keyCode modifiers : modifiers])
const Mask_t kButtonMotionMask
const Mask_t kFocusChangeMask
const Mask_t kKeyLockMask
const Mask_t kButtonPressMask
const Mask_t kKeyMod1Mask
const Mask_t kKeyReleaseMask
const Mask_t kAnyModifier
const Mask_t kKeyPressMask
const Mask_t kButton1Mask
const Mask_t kPointerMotionMask
const Mask_t kKeyShiftMask
const Mask_t kKeyControlMask
const Mask_t kKeyMod2Mask
const Mask_t kButton3Mask
const Mask_t kLeaveWindowMask
const Mask_t kButton2Mask
const Mask_t kButtonReleaseMask
const Mask_t kEnterWindowMask
Bool_t operator<(const TDatime &d1, const TDatime &d2)
DerivedType * Get() const
void CheckUnmappedView(Window_t winID)
void FindKeyGrabView(NSView< X11Window > *eventView, NSEvent *theEvent)
NSView< X11Window > * fButtonGrabView
void GenerateFocusChangeEvent(NSView< X11Window > *eventView)
void FindButtonGrab(NSView< X11Window > *fromView, NSEvent *theEvent, EMouseButton btn)
void GenerateExposeEvent(NSView< X11Window > *view, const NSRect &exposedRect)
NSView< X11Window > * fFocusView
void GenerateKeyEventActiveGrab(NSView< X11Window > *eventView, NSEvent *theEvent)
void GenerateConfigureNotifyEvent(NSView< X11Window > *view, const NSRect &newFrame)
void GenerateCrossingEvent(NSEvent *theEvent)
void GenerateKeyEventForView(NSView< X11Window > *view, NSEvent *theEvent)
void GenerateButtonPressEventActiveGrab(NSView< X11Window > *view, NSEvent *theEvent, EMouseButton btn)
void GeneratePointerMotionEventNoGrab(NSEvent *theEvent)
void GenerateCrossingEventActiveGrab(NSEvent *theEvent)
NSView< X11Window > * fKeyGrabView
void GenerateButtonReleaseEventActiveGrab(NSView< X11Window > *eventView, NSEvent *theEvent, EMouseButton btn)
unsigned GetInputFocus() const
void GenerateButtonReleaseEventNoGrab(NSView< X11Window > *eventView, NSEvent *theEvent, EMouseButton btn)
bool HasPointerGrab() const
void GenerateKeyReleaseEvent(NSView< X11Window > *eventView, NSEvent *theEvent)
void SetPointerGrab(NSView< X11Window > *grabView, unsigned eventMask, bool ownerEvents)
EMouseButton fImplicitGrabButton
void GenerateKeyPressEvent(NSView< X11Window > *eventView, NSEvent *theEvent)
void GenerateKeyPressEventNoGrab(NSView< X11Window > *eventView, NSEvent *theEvent)
void GenerateKeyReleaseEventNoGrab(NSView< X11Window > *eventView, NSEvent *theEvent)
void GenerateCrossingEventNoGrab(NSEvent *theEvent)
void GeneratePointerMotionEventActiveGrab(NSEvent *theEvent)
PointerGrab fPointerGrabType
void GenerateButtonPressEvent(NSView< X11Window > *eventView, NSEvent *theEvent, EMouseButton btn)
void GeneratePointerMotionEvent(NSEvent *theEvent)
void GenerateDestroyNotify(unsigned winID)
NSView< X11Window > * fViewUnderPointer
void SetInputFocus(NSView< X11Window > *focusView)
void GenerateButtonPressEventNoGrab(NSView< X11Window > *view, NSEvent *theEvent, EMouseButton btn)
void GenerateButtonReleaseEvent(NSView< X11Window > *eventView, NSEvent *theEvent, EMouseButton btn)
virtual Bool_t HandleEvent(Event_t *)
const NSUInteger kCommandKeyMask
const NSUInteger kDeviceIndependentModifierFlagsMask
const NSUInteger kAlternateKeyMask
const NSUInteger kControlKeyMask
const NSUInteger kAlphaShiftKeyMask
const NSUInteger kShiftKeyMask
const NSEventType kKeyDown
Ancestry FindLowestCommonAncestor(NSView< X11Window > *view1, NSView< X11Window > *view2, NSView< X11Window > **lca)
void GenerateCrossingEventParentToChild(EventQueue_t &queue, NSView< X11Window > *parent, NSView< X11Window > *child, NSEvent *theEvent, EXMagic detail)
void ConvertEventLocationToROOTXY(NSEvent *cocoaEvent, NSView< X11Window > *eventView, Event_t *rootEvent)
void SendEnterEventClosedRange(EventQueue_t &queue, NSView< X11Window > *from, NSView< X11Window > *to, NSEvent *theEvent, EXMagic mode)
bool IsParent(NSView< X11Window > *testParent, NSView< X11Window > *testChild)
void SendLeaveEvent(EventQueue_t &queue, NSView< X11Window > *view, NSEvent *theEvent, EXMagic detail)
void SendKeyReleaseEvent(EventQueue_t &queue, NSView< X11Window > *view, NSView< X11Window > *childView, NSEvent *theEvent, NSPoint windowPoint)
unsigned GetModifiersFromCocoaEvent(NSEvent *theEvent)
void GenerateCrossingEventForGrabView(EventQueue_t &queue, NSView< X11Window > *fromView, NSView< X11Window > *toView, NSView< X11Window > *grabView, Mask_t grabEventMask, NSEvent *theEvent)
void SendFocusInEvent(EventQueue_t &queue, NSView< X11Window > *view, EXMagic mode)
Ancestry FindRelation(NSView< X11Window > *view1, NSView< X11Window > *view2, NSView< X11Window > **lca)
void GenerateCrossingEventChildToParent(EventQueue_t &queue, NSView< X11Window > *parent, NSView< X11Window > *child, NSEvent *theEvent, EXMagic detail)
Time_t TimeForCocoaEvent(NSEvent *theEvent)
void SendFocusOutEvent(EventQueue_t &queue, NSView< X11Window > *view, EXMagic mode)
NSView< X11Window > * FindViewToPropagateEvent(NSView< X11Window > *viewFrom, Mask_t checkMask)
void SendPointerMotionEvent(EventQueue_t &queue, NSView< X11Window > *view, NSEvent *theEvent)
void SendKeyPressEvent(EventQueue_t &queue, NSView< X11Window > *view, NSView< X11Window > *childView, NSEvent *theEvent, NSPoint windowPoint)
void SendEnterEventRange(EventQueue_t &queue, NSView< X11Window > *from, NSView< X11Window > *to, NSEvent *theEvent, EXMagic mode)
void SendLeaveEventClosedRange(EventQueue_t &queue, NSView< X11Window > *from, NSView< X11Window > *to, NSEvent *theEvent, EXMagic mode)
void SendButtonReleaseEvent(EventQueue_t &queue, NSView< X11Window > *view, NSEvent *theEvent, EMouseButton btn)
void GenerateCrossingEventFromChild1ToChild2(EventQueue_t &queue, NSView< X11Window > *child1, NSView< X11Window > *child2, NSView< X11Window > *ancestor, NSEvent *theEvent, EXMagic detail)
void SendLeaveEventRange(EventQueue_t &queue, NSView< X11Window > *from, NSView< X11Window > *to, NSEvent *theEvent, EXMagic mode)
void GenerateCrossingEvents(EventQueue_t &queue, NSView< X11Window > *fromView, NSView< X11Window > *toView, NSEvent *theEvent, EXMagic detail)
void SendButtonPressEvent(EventQueue_t &queue, NSView< X11Window > *view, NSEvent *theEvent, EMouseButton btn)
bool IsInBranch(NSView< X11Window > *parent, NSView< X11Window > *child, NSView< X11Window > *testView)
Event_t NewX11EventFromCocoaEvent(unsigned windowID, NSEvent *theEvent)
void SendEnterEvent(EventQueue_t &queue, NSView< X11Window > *view, NSEvent *theEvent, EXMagic detail)
unsigned GetKeyboardModifiersFromCocoaEvent(NSEvent *theEvent)
Int_t MapKeySymToKeyCode(Int_t keySym)
NSPoint ConvertPointFromScreenToBase(NSPoint screenPoint, NSWindow *window)
int GlobalYCocoaToROOT(CGFloat yCocoa)
std::deque< Event_t > EventQueue_t
void MapUnicharToKeySym(unichar key, char *buf, Int_t len, UInt_t &rootKeySym)
NSPoint ConvertPointFromBaseToScreen(NSWindow *window, NSPoint windowPoint)
NSPoint TranslateToScreen(NSView< X11Window > *from, NSPoint point)
int GlobalXCocoaToROOT(CGFloat xCocoa)
NSView< X11Window > * FindViewForPointerEvent(NSEvent *pointerEvent)
NSView< X11Window > * FindViewUnderPointer()
UInt_t GetKeyboardModifiers()
QuartzWindow * FindWindowUnderPointer()
NSUInteger GetCocoaKeyModifiersFromROOTKeyModifiers(UInt_t rootKeyModifiers)
Namespace for new ROOT classes and functions.