| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
| 6 | |
| 7 | |
| 8 | |
| 9 | |
| 10 | |
| 11 | |
| 12 | |
| 13 | |
| 14 | |
| 15 | |
| 16 | |
| 17 | |
| 18 | |
| 19 | |
| 20 | |
| 21 | |
| 22 | |
| 23 | |
| 24 | |
| 25 | |
| 26 | |
| 27 | |
| 28 | |
| 29 | |
| 30 | |
| 31 | |
| 32 | |
| 33 | |
| 34 | |
| 35 | |
| 36 | |
| 37 | |
| 38 | |
| 39 | |
| 40 | |
| 41 | |
| 42 | |
| 43 | |
| 44 | |
| 45 | |
| 46 | |
| 47 | |
| 48 | |
| 49 | |
| 50 | |
| 51 | #ifndef _PDI_h_ |
| 52 | #define _PDI_h_ |
| 53 | |
| 54 | |
| 55 | #define KEYBOARD TRUE |
| 56 | #define POINTER FALSE |
| 57 | |
| 58 | _XFUNCPROTOBEGIN |
| 59 | |
| 60 | typedef enum { |
| 61 | XtNoServerGrab, |
| 62 | XtPassiveServerGrab, |
| 63 | XtActiveServerGrab, |
| 64 | XtPseudoPassiveServerGrab, |
| 65 | XtPseudoActiveServerGrab |
| 66 | }XtServerGrabType; |
| 67 | |
| 68 | typedef struct _XtServerGrabRec { |
| 69 | struct _XtServerGrabRec *next; |
| 70 | Widget widget; |
| 71 | unsigned int ownerEvents:1; |
| 72 | unsigned int pointerMode:1; |
| 73 | unsigned int keyboardMode:1; |
| 74 | unsigned int hasExt:1; |
| 75 | unsigned int confineToIsWidgetWin:1; |
| 76 | KeyCode keybut; |
| 77 | unsigned short modifiers; |
| 78 | unsigned short eventMask; |
| 79 | } XtServerGrabRec, *XtServerGrabPtr; |
| 80 | |
| 81 | typedef struct _XtGrabExtRec { |
| 82 | Mask *pKeyButMask; |
| 83 | Mask *pModifiersMask; |
| 84 | Window confineTo; |
| 85 | Cursor cursor; |
| 86 | } XtServerGrabExtRec, *XtServerGrabExtPtr; |
| 87 | |
| 88 | #define GRABEXT(p) ((XtServerGrabExtPtr)((p)+1)) |
| 89 | |
| 90 | typedef struct _XtDeviceRec{ |
| 91 | XtServerGrabRec grab; |
| 92 | |
| 93 | XtServerGrabType grabType; |
| 94 | }XtDeviceRec, *XtDevice; |
| 95 | |
| 96 | #define XtMyAncestor 0 |
| 97 | #define XtMyDescendant 1 |
| 98 | #define XtMyCousin 2 |
| 99 | #define XtMySelf 3 |
| 100 | #define XtUnrelated 4 |
| 101 | typedef char XtGeneology; |
| 102 | |
| 103 | typedef struct { |
| 104 | Widget focusKid; |
| 105 | XtServerGrabPtr keyList, ptrList; |
| 106 | Widget queryEventDescendant; |
| 107 | unsigned int map_handler_added:1; |
| 108 | unsigned int realize_handler_added:1; |
| 109 | unsigned int active_handler_added:1; |
| 110 | unsigned int haveFocus:1; |
| 111 | XtGeneology focalPoint; |
| 112 | }XtPerWidgetInputRec, *XtPerWidgetInput; |
| 113 | |
| 114 | typedef struct XtPerDisplayInputRec{ |
| 115 | XtGrabList grabList; |
| 116 | XtDeviceRec keyboard, pointer; |
| 117 | KeyCode activatingKey; |
| 118 | Widget *trace; |
| 119 | int traceDepth, traceMax; |
| 120 | Widget focusWidget; |
| 121 | }XtPerDisplayInputRec, *XtPerDisplayInput; |
| 122 | |
| 123 | #define IsServerGrab(g) ((g == XtPassiveServerGrab) ||\ |
| 124 | (g == XtActiveServerGrab)) |
| 125 | |
| 126 | #define IsAnyGrab(g) ((g == XtPassiveServerGrab) ||\ |
| 127 | (g == XtActiveServerGrab) ||\ |
| 128 | (g == XtPseudoPassiveServerGrab)) |
| 129 | |
| 130 | #define IsEitherPassiveGrab(g) ((g == XtPassiveServerGrab) ||\ |
| 131 | (g == XtPseudoPassiveServerGrab)) |
| 132 | |
| 133 | #define IsPseudoGrab(g) ((g == XtPseudoPassiveServerGrab)) |
| 134 | |
| 135 | extern void _XtDestroyServerGrabs( |
| 136 | Widget , |
| 137 | XtPointer , |
| 138 | XtPointer |
| 139 | ); |
| 140 | |
| 141 | extern XtPerWidgetInput _XtGetPerWidgetInput( |
| 142 | Widget , |
| 143 | _XtBoolean |
| 144 | ); |
| 145 | |
| 146 | extern XtServerGrabPtr _XtCheckServerGrabsOnWidget( |
| 147 | XEvent* , |
| 148 | Widget , |
| 149 | _XtBoolean |
| 150 | ); |
| 151 | |
| 152 | |
| 153 | |
| 154 | |
| 155 | |
| 156 | #define _XtGetGrabList(pdi) (&(pdi)->grabList) |
| 157 | |
| 158 | extern void _XtFreePerWidgetInput( |
| 159 | Widget , |
| 160 | XtPerWidgetInput |
| 161 | ); |
| 162 | |
| 163 | extern Widget _XtProcessKeyboardEvent( |
| 164 | XKeyEvent* , |
| 165 | Widget , |
| 166 | XtPerDisplayInput |
| 167 | ); |
| 168 | |
| 169 | extern Widget _XtProcessPointerEvent( |
| 170 | XButtonEvent* , |
| 171 | Widget , |
| 172 | XtPerDisplayInput |
| 173 | ); |
| 174 | |
| 175 | extern void _XtRegisterPassiveGrabs( |
| 176 | Widget |
| 177 | ); |
| 178 | |
| 179 | extern void _XtClearAncestorCache( |
| 180 | Widget |
| 181 | ); |
| 182 | |
| 183 | _XFUNCPROTOEND |
| 184 | |
| 185 | #endif |