12 #ifndef ROOT_X11Events
13 #define ROOT_X11Events
19 #include <Foundation/Foundation.h>
49 typedef std::deque<Event_t> EventQueue_t;
51 class EventTranslator {
52 friend class ::TGCocoa;
56 void GenerateConfigureNotifyEvent(NSView<X11Window> *view,
const NSRect &newFrame);
57 void GenerateDestroyNotify(
unsigned winID);
58 void GenerateExposeEvent(NSView<X11Window> *view,
const NSRect &exposedRect);
60 void GenerateCrossingEvent(NSEvent *theEvent);
61 void GeneratePointerMotionEvent(NSEvent *theEvent);
63 void GenerateButtonPressEvent(NSView<X11Window> *eventView, NSEvent *theEvent, EMouseButton btn);
64 void GenerateButtonReleaseEvent(NSView<X11Window> *eventView, NSEvent *theEvent, EMouseButton btn);
66 void GenerateKeyPressEvent(NSView<X11Window> *eventView, NSEvent *theEvent);
67 void GenerateKeyReleaseEvent(NSView<X11Window> *eventView, NSEvent *theEvent);
69 void GenerateFocusChangeEvent(NSView<X11Window> *eventView);
71 void SetPointerGrab(NSView<X11Window> *grabView,
unsigned eventMask,
bool ownerEvents);
72 void CancelPointerGrab();
74 void SetInputFocus(NSView<X11Window> *focusView);
75 unsigned GetInputFocus()
const;
81 void CheckUnmappedView(Window_t winID);
83 bool HasPointerGrab()
const;
88 void GenerateCrossingEventNoGrab(NSEvent *theEvent);
89 void GenerateCrossingEventActiveGrab(NSEvent *theEvent);
91 void GeneratePointerMotionEventNoGrab(NSEvent *theEvent);
92 void GeneratePointerMotionEventActiveGrab(NSEvent *theEvent);
94 void GenerateButtonPressEventNoGrab(NSView<X11Window> *view, NSEvent *theEvent, EMouseButton btn);
95 void GenerateButtonPressEventActiveGrab(NSView<X11Window> *view, NSEvent *theEvent, EMouseButton btn);
97 void GenerateButtonReleaseEventNoGrab(NSView<X11Window> *eventView, NSEvent *theEvent, EMouseButton btn);
98 void GenerateButtonReleaseEventActiveGrab(NSView<X11Window> *eventView, NSEvent *theEvent, EMouseButton btn);
100 void GenerateKeyPressEventNoGrab(NSView<X11Window> *eventView, NSEvent *theEvent);
101 void GenerateKeyReleaseEventNoGrab(NSView<X11Window> *eventView, NSEvent *theEvent);
103 void GenerateKeyEventActiveGrab(NSView<X11Window> *eventView, NSEvent *theEvent);
104 void GenerateKeyEventForView(NSView<X11Window> *view, NSEvent *theEvent);
106 void FindButtonGrab(NSView<X11Window> *fromView, NSEvent *theEvent, EMouseButton btn);
107 void FindKeyGrabView(NSView<X11Window> *eventView, NSEvent *theEvent);
109 NSView<X11Window> *fViewUnderPointer;
111 PointerGrab fPointerGrabType;
112 unsigned fGrabEventMask;
116 NSView<X11Window> *fButtonGrabView;
117 NSView<X11Window> *fKeyGrabView;
118 NSView<X11Window> *fFocusView;
119 EMouseButton fImplicitGrabButton;
121 EventQueue_t fEventQueue;
124 void MapUnicharToKeySym(unichar key,
char *buf, Int_t len, UInt_t &rootKeySym);
125 Int_t MapKeySymToKeyCode(Int_t keySym);
126 NSUInteger GetCocoaKeyModifiersFromROOTKeyModifiers(UInt_t rootKeyModifiers);
128 UInt_t GetModifiers();