Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:14:30

0001 /********************************************************
0002 
0003 Copyright 1988 by Hewlett-Packard Company
0004 Copyright 1987, 1988, 1989 by Digital Equipment Corporation, Maynard
0005 
0006 Permission to use, copy, modify, and distribute this software
0007 and its documentation for any purpose and without fee is hereby
0008 granted, provided that the above copyright notice appear in all
0009 copies and that both that copyright notice and this permission
0010 notice appear in supporting documentation, and that the names of
0011 Hewlett-Packard or Digital not be used in advertising or
0012 publicity pertaining to distribution of the software without specific,
0013 written prior permission.
0014 
0015 DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
0016 ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
0017 DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
0018 ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
0019 WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
0020 ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
0021 SOFTWARE.
0022 
0023 ********************************************************/
0024 
0025 /*
0026 
0027 Copyright 1987, 1988, 1989, 1998  The Open Group
0028 
0029 Permission to use, copy, modify, distribute, and sell this software and its
0030 documentation for any purpose is hereby granted without fee, provided that
0031 the above copyright notice appear in all copies and that both that
0032 copyright notice and this permission notice appear in supporting
0033 documentation.
0034 
0035 The above copyright notice and this permission notice shall be included in
0036 all copies or substantial portions of the Software.
0037 
0038 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
0039 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
0040 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
0041 OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
0042 AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
0043 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
0044 
0045 Except as contained in this notice, the name of The Open Group shall not be
0046 used in advertising or otherwise to promote the sale, use or other dealings
0047 in this Software without prior written authorization from The Open Group.
0048 
0049 */
0050 
0051 #ifndef _PDI_h_
0052 #define _PDI_h_
0053 
0054 
0055 #define KEYBOARD TRUE
0056 #define POINTER  FALSE
0057 
0058 _XFUNCPROTOBEGIN
0059 
0060 typedef enum {
0061     XtNoServerGrab,
0062     XtPassiveServerGrab,
0063     XtActiveServerGrab,
0064     XtPseudoPassiveServerGrab,
0065     XtPseudoActiveServerGrab
0066 }XtServerGrabType;
0067 
0068 typedef struct _XtServerGrabRec {
0069     struct _XtServerGrabRec     *next;
0070     Widget          widget;
0071     unsigned int        ownerEvents:1;
0072     unsigned int        pointerMode:1;
0073     unsigned int        keyboardMode:1;
0074     unsigned int        hasExt:1;
0075     unsigned int        confineToIsWidgetWin:1;
0076     KeyCode         keybut;
0077     unsigned short      modifiers;
0078     unsigned short      eventMask;
0079 } XtServerGrabRec, *XtServerGrabPtr;
0080 
0081 typedef struct _XtGrabExtRec {
0082     Mask            *pKeyButMask;
0083     Mask            *pModifiersMask;
0084     Window          confineTo;
0085     Cursor          cursor;
0086 } XtServerGrabExtRec, *XtServerGrabExtPtr;
0087 
0088 #define GRABEXT(p) ((XtServerGrabExtPtr)((p)+1))
0089 
0090 typedef struct _XtDeviceRec{
0091     XtServerGrabRec grab;   /* need copy in order to protect
0092                    during grab */
0093     XtServerGrabType    grabType;
0094 }XtDeviceRec, *XtDevice;
0095 
0096 #define XtMyAncestor    0
0097 #define XtMyDescendant  1
0098 #define XtMyCousin  2
0099 #define XtMySelf    3
0100 #define XtUnrelated 4
0101 typedef char XtGeneology; /* do not use an enum makes PerWidgetInput larger */
0102 
0103 typedef struct {
0104     Widget      focusKid;
0105     XtServerGrabPtr keyList, ptrList;
0106     Widget      queryEventDescendant;
0107     unsigned int    map_handler_added:1;
0108     unsigned int    realize_handler_added:1;
0109     unsigned int    active_handler_added:1;
0110     unsigned int    haveFocus:1;
0111     XtGeneology     focalPoint;
0112 }XtPerWidgetInputRec, *XtPerWidgetInput;
0113 
0114 typedef struct XtPerDisplayInputRec{
0115     XtGrabList  grabList;
0116     XtDeviceRec keyboard, pointer;
0117     KeyCode activatingKey;
0118     Widget  *trace;
0119     int     traceDepth, traceMax;
0120     Widget  focusWidget;
0121 }XtPerDisplayInputRec, *XtPerDisplayInput;
0122 
0123 #define IsServerGrab(g) ((g == XtPassiveServerGrab) ||\
0124              (g == XtActiveServerGrab))
0125 
0126 #define IsAnyGrab(g) ((g == XtPassiveServerGrab) ||\
0127               (g == XtActiveServerGrab)  ||\
0128               (g == XtPseudoPassiveServerGrab))
0129 
0130 #define IsEitherPassiveGrab(g) ((g == XtPassiveServerGrab) ||\
0131                 (g == XtPseudoPassiveServerGrab))
0132 
0133 #define IsPseudoGrab(g) ((g == XtPseudoPassiveServerGrab))
0134 
0135 extern void _XtDestroyServerGrabs(
0136     Widget      /* w */,
0137     XtPointer       /* pwi */, /*XtPerWidgetInput*/
0138     XtPointer       /* call_data */
0139 );
0140 
0141 extern XtPerWidgetInput _XtGetPerWidgetInput(
0142     Widget  /* widget */,
0143     _XtBoolean  /* create */
0144 );
0145 
0146 extern XtServerGrabPtr _XtCheckServerGrabsOnWidget(
0147     XEvent*     /* event */,
0148     Widget      /* widget */,
0149     _XtBoolean      /* isKeyboard */
0150 );
0151 
0152 /*
0153 extern XtGrabList* _XtGetGrabList( XtPerDisplayInput );
0154 */
0155 
0156 #define _XtGetGrabList(pdi) (&(pdi)->grabList)
0157 
0158 extern void _XtFreePerWidgetInput(
0159     Widget      /* w */,
0160     XtPerWidgetInput    /* pwi */
0161 );
0162 
0163 extern Widget _XtProcessKeyboardEvent(
0164     XKeyEvent*      /* event */,
0165     Widget      /* widget */,
0166     XtPerDisplayInput   /* pdi */
0167 );
0168 
0169 extern Widget _XtProcessPointerEvent(
0170     XButtonEvent*   /* event */,
0171     Widget      /* widget */,
0172     XtPerDisplayInput   /* pdi */
0173 );
0174 
0175 extern void _XtRegisterPassiveGrabs(
0176     Widget      /* widget */
0177 );
0178 
0179 extern void _XtClearAncestorCache(
0180     Widget      /* widget */
0181 );
0182 
0183 _XFUNCPROTOEND
0184 
0185 #endif /* _PDI_h_ */