master
ブランチ master
ShaderPlayground / deps / xlibre / include / X11 / PassivGraI.h
5.4 KB、185行 生 Blame 履歴
1/********************************************************
2
3Copyright 1988 by Hewlett-Packard Company
4Copyright 1987, 1988, 1989 by Digital Equipment Corporation, Maynard
5
6Permission to use, copy, modify, and distribute this software
7and its documentation for any purpose and without fee is hereby
8granted, provided that the above copyright notice appear in all
9copies and that both that copyright notice and this permission
10notice appear in supporting documentation, and that the names of
11Hewlett-Packard or Digital not be used in advertising or
12publicity pertaining to distribution of the software without specific,
13written prior permission.
14
15DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
16ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
17DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
18ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
19WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
20ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
21SOFTWARE.
22
23********************************************************/
24
25/*
26
27Copyright 1987, 1988, 1989, 1998 The Open Group
28
29Permission to use, copy, modify, distribute, and sell this software and its
30documentation for any purpose is hereby granted without fee, provided that
31the above copyright notice appear in all copies and that both that
32copyright notice and this permission notice appear in supporting
33documentation.
34
35The above copyright notice and this permission notice shall be included in
36all copies or substantial portions of the Software.
37
38THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
39IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
40FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
41OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
42AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
43CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
44
45Except as contained in this notice, the name of The Open Group shall not be
46used in advertising or otherwise to promote the sale, use or other dealings
47in this Software without prior written authorization from The Open Group.
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
60typedef enum {
61 XtNoServerGrab,
62 XtPassiveServerGrab,
63 XtActiveServerGrab,
64 XtPseudoPassiveServerGrab,
65 XtPseudoActiveServerGrab
66}XtServerGrabType;
67
68typedef 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
81typedef 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
90typedef struct _XtDeviceRec{
91 XtServerGrabRec grab; /* need copy in order to protect
92 during grab */
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
101typedef char XtGeneology; /* do not use an enum makes PerWidgetInput larger */
102
103typedef 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
114typedef 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
135extern void _XtDestroyServerGrabs(
136 Widget /* w */,
137 XtPointer /* pwi */, /*XtPerWidgetInput*/
138 XtPointer /* call_data */
139);
140
141extern XtPerWidgetInput _XtGetPerWidgetInput(
142 Widget /* widget */,
143 _XtBoolean /* create */
144);
145
146extern XtServerGrabPtr _XtCheckServerGrabsOnWidget(
147 XEvent* /* event */,
148 Widget /* widget */,
149 _XtBoolean /* isKeyboard */
150);
151
152/*
153extern XtGrabList* _XtGetGrabList( XtPerDisplayInput );
154*/
155
156#define _XtGetGrabList(pdi) (&(pdi)->grabList)
157
158extern void _XtFreePerWidgetInput(
159 Widget /* w */,
160 XtPerWidgetInput /* pwi */
161);
162
163extern Widget _XtProcessKeyboardEvent(
164 XKeyEvent* /* event */,
165 Widget /* widget */,
166 XtPerDisplayInput /* pdi */
167);
168
169extern Widget _XtProcessPointerEvent(
170 XButtonEvent* /* event */,
171 Widget /* widget */,
172 XtPerDisplayInput /* pdi */
173);
174
175extern void _XtRegisterPassiveGrabs(
176 Widget /* widget */
177);
178
179extern void _XtClearAncestorCache(
180 Widget /* widget */
181);
182
183_XFUNCPROTOEND
184
185#endif /* _PDI_h_ */