2 * $Xorg: PassivGraI.h,v 1.4 2001/02/09 02:03:56 xorgcvs Exp $
5 /********************************************************
7 Copyright 1988 by Hewlett-Packard Company
8 Copyright 1987, 1988, 1989 by Digital Equipment Corporation, Maynard
10 Permission to use, copy, modify, and distribute this software
11 and its documentation for any purpose and without fee is hereby
12 granted, provided that the above copyright notice appear in all
13 copies and that both that copyright notice and this permission
14 notice appear in supporting documentation, and that the names of
15 Hewlett-Packard or Digital not be used in advertising or
16 publicity pertaining to distribution of the software without specific,
17 written prior permission.
19 DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
20 ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
21 DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
22 ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
23 WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
24 ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
27 ********************************************************/
31 Copyright 1987, 1988, 1989, 1998 The Open Group
33 Permission to use, copy, modify, distribute, and sell this software and its
34 documentation for any purpose is hereby granted without fee, provided that
35 the above copyright notice appear in all copies and that both that
36 copyright notice and this permission notice appear in supporting
39 The above copyright notice and this permission notice shall be included in
40 all copies or substantial portions of the Software.
42 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
43 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
44 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
45 OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
46 AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
47 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
49 Except as contained in this notice, the name of The Open Group shall not be
50 used in advertising or otherwise to promote the sale, use or other dealings
51 in this Software without prior written authorization from The Open Group.
54 /* $XFree86: xc/lib/Xt/PassivGraI.h,v 1.3 2001/12/14 19:56:27 dawes Exp $ */
67 XtPseudoPassiveServerGrab
,
68 XtPseudoActiveServerGrab
71 typedef struct _XtServerGrabRec
{
72 struct _XtServerGrabRec
*next
;
74 unsigned int ownerEvents
:1;
75 unsigned int pointerMode
:1;
76 unsigned int keyboardMode
:1;
77 unsigned int hasExt
:1;
78 unsigned int confineToIsWidgetWin
:1;
80 unsigned short modifiers
;
81 unsigned short eventMask
;
82 } XtServerGrabRec
, *XtServerGrabPtr
;
84 typedef struct _XtGrabExtRec
{
89 } XtServerGrabExtRec
, *XtServerGrabExtPtr
;
91 #define GRABEXT(p) ((XtServerGrabExtPtr)((p)+1))
93 typedef struct _XtDeviceRec
{
94 XtServerGrabRec grab
; /* need copy in order to protect
96 XtServerGrabType grabType
;
97 }XtDeviceRec
, *XtDevice
;
99 #define XtMyAncestor 0
100 #define XtMyDescendant 1
103 #define XtUnrelated 4
104 typedef char XtGeneology
; /* do not use an enum makes PerWidgetInput larger */
108 XtServerGrabPtr keyList
, ptrList
;
109 Widget queryEventDescendant
;
110 unsigned int map_handler_added
:1;
111 unsigned int realize_handler_added
:1;
112 unsigned int active_handler_added
:1;
113 unsigned int haveFocus
:1;
114 XtGeneology focalPoint
;
115 }XtPerWidgetInputRec
, *XtPerWidgetInput
;
117 typedef struct XtPerDisplayInputRec
{
119 XtDeviceRec keyboard
, pointer
;
120 KeyCode activatingKey
;
122 int traceDepth
, traceMax
;
124 }XtPerDisplayInputRec
, *XtPerDisplayInput
;
126 #define IsServerGrab(g) ((g == XtPassiveServerGrab) ||\
127 (g == XtActiveServerGrab))
129 #define IsAnyGrab(g) ((g == XtPassiveServerGrab) ||\
130 (g == XtActiveServerGrab) ||\
131 (g == XtPseudoPassiveServerGrab))
133 #define IsEitherPassiveGrab(g) ((g == XtPassiveServerGrab) ||\
134 (g == XtPseudoPassiveServerGrab))
136 #define IsPseudoGrab(g) ((g == XtPseudoPassiveServerGrab))
138 extern void _XtDestroyServerGrabs(
140 XtPointer
/* pwi */, /*XtPerWidgetInput*/
141 XtPointer
/* call_data */
144 extern XtPerWidgetInput
_XtGetPerWidgetInput(
146 _XtBoolean
/* create */
149 extern XtServerGrabPtr
_XtCheckServerGrabsOnWidget(
152 _XtBoolean
/* isKeyboard */
156 extern XtGrabList* _XtGetGrabList( XtPerDisplayInput );
159 #define _XtGetGrabList(pdi) (&(pdi)->grabList)
161 extern void _XtFreePerWidgetInput(
163 XtPerWidgetInput
/* pwi */
166 extern Widget
_XtProcessKeyboardEvent(
167 XKeyEvent
* /* event */,
169 XtPerDisplayInput
/* pdi */
172 extern Widget
_XtProcessPointerEvent(
173 XButtonEvent
* /* event */,
175 XtPerDisplayInput
/* pdi */
178 extern void _XtRegisterPassiveGrabs(
182 extern void _XtClearAncestorCache(