home *** CD-ROM | disk | FTP | other *** search
/ Power Programmierung 2 / Power-Programmierung CD 2 (Tewi)(1994).iso / gnu / djgpp / contrib / dvx / inc / x11 / passivgr.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-07-15  |  4.7 KB  |  170 lines

  1. /*
  2. * $XConsortium: PassivGraI.h,v 1.5 90/07/26 10:13:08 swick Exp $
  3. */
  4.  
  5. /********************************************************
  6.  
  7. Copyright (c) 1988 by Hewlett-Packard Company
  8. Copyright (c) 1987, 1988, 1989 by Digital Equipment Corporation, Maynard, 
  9.               Massachusetts, and the Massachusetts Institute of Technology, 
  10.               Cambridge, Massachusetts
  11.  
  12. Permission to use, copy, modify, and distribute this software 
  13. and its documentation for any purpose and without fee is hereby 
  14. granted, provided that the above copyright notice appear in all 
  15. copies and that both that copyright notice and this permission 
  16. notice appear in supporting documentation, and that the names of 
  17. Hewlett-Packard, Digital or  M.I.T.  not be used in advertising or 
  18. publicity pertaining to distribution of the software without specific, 
  19. written prior permission.
  20.  
  21. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
  22. ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
  23. DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
  24. ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
  25. WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
  26. ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
  27. SOFTWARE.
  28.  
  29. ********************************************************/
  30.  
  31. #ifndef _PDI_h_
  32. #define _PDI_h_
  33.  
  34.  
  35. #define KEYBOARD TRUE
  36. #define POINTER  FALSE
  37.  
  38. typedef enum _XtServerGrabType { /* Added Tag. POHC 91/01/16 */
  39.     XtNoServerGrab, 
  40.     XtPassiveServerGrab,
  41.     XtActiveServerGrab,
  42.     XtPseudoPassiveServerGrab,
  43.     XtPseudoActiveServerGrab
  44. }XtServerGrabType;
  45.  
  46. typedef struct _DetailRec {
  47.     unsigned short     exact;
  48.     Mask          *pMask;
  49. } DetailRec;
  50.  
  51. typedef struct _XtServerGrabRec {
  52.     struct _XtServerGrabRec     *next;
  53.     Widget            widget;
  54.     Boolean               ownerEvents;
  55.     int                     pointerMode;
  56.     int                keyboardMode;
  57.     DetailRec             modifiersDetail;
  58.     Mask            eventMask;
  59.     DetailRec            detail;        /* key or button */
  60.     Window            confineTo;    /* always NULL for keyboards */
  61.     Cursor            cursor;        /* always NULL for keyboards */
  62. } XtServerGrabRec, *XtServerGrabPtr;
  63.  
  64. typedef struct _XtDeviceRec{
  65.     XtServerGrabRec    grab;     /* need copy in order to protect
  66.                    during grab */
  67.     XtServerGrabType    grabType;
  68. }XtDeviceRec, *XtDevice;
  69.  
  70. typedef enum _XtGeneology { /* Added Tag. POHC 91/01/16 */
  71.     XtMyAncestor,
  72.     XtMyDescendant,
  73.     XtMyCousin,
  74.     XtMySelf,
  75.     XtUnrelated
  76. }XtGeneology;
  77.  
  78.  
  79. typedef struct _XtPerWidgetInputRec { /* Added Tag. POHC 91/01/16 */
  80.     Widget        focusKid;
  81.     XtServerGrabPtr    keyList, ptrList;
  82.     Widget        queryEventDescendant;
  83.     unsigned int    map_handler_added:1;
  84.     unsigned int    realize_handler_added:1;
  85.     unsigned int    active_handler_added:1;
  86.     unsigned int    haveFocus:1;
  87.     XtGeneology        focalPoint;
  88. }XtPerWidgetInputRec, *XtPerWidgetInput;
  89.  
  90. typedef struct XtPerDisplayInputRec{
  91.     XtGrabList     grabList;
  92.     XtDeviceRec keyboard, pointer;
  93.     KeyCode    activatingKey;
  94.     Widget     *trace;
  95.     int        traceDepth, traceMax;
  96.     Widget     focusWidget;
  97. }XtPerDisplayInputRec, *XtPerDisplayInput;
  98.  
  99. #define IsServerGrab(g) ((g == XtPassiveServerGrab) ||\
  100.              (g == XtActiveServerGrab))
  101.  
  102. #define IsAnyGrab(g) ((g == XtPassiveServerGrab) ||\
  103.               (g == XtActiveServerGrab)  ||\
  104.               (g == XtPseudoPassiveServerGrab))
  105.  
  106. #define IsEitherPassiveGrab(g) ((g == XtPassiveServerGrab) ||\
  107.                 (g == XtPseudoPassiveServerGrab))
  108.  
  109. #define IsPseudoGrab(g) ((g == XtPseudoPassiveServerGrab))
  110.  
  111. extern void _XtDestroyServerGrabs(
  112. #if NeedFunctionPrototypes
  113.     Widget        /* w */,
  114.     XtPointer        /* pwi */, /*XtPerWidgetInput*/
  115.     XtPointer        /* call_data */
  116. #endif
  117. );
  118.  
  119. #if NeedWidePrototypes
  120. #define Boolean int
  121. #endif
  122.  
  123. extern XtPerWidgetInput _XtGetPerWidgetInput(
  124. #if NeedFunctionPrototypes
  125.     Widget    /* widget */,
  126.     Boolean    /* create */
  127. #endif
  128. );
  129.  
  130. extern XtServerGrabPtr _XtCheckServerGrabsOnWidget(
  131. #if NeedFunctionPrototypes
  132.     XEvent*        /* event */,
  133.     Widget        /* widget */,
  134.     Boolean        /* isKeyboard */
  135. #endif
  136. );
  137.  
  138. #undef Boolean
  139.  
  140. /*
  141. extern XtGrabList* _XtGetGrabList( XtPerDisplayInput );
  142. */
  143.  
  144. #define _XtGetGrabList(pdi) (&(pdi)->grabList)
  145.  
  146. extern void _XtFreePerWidgetInput(
  147. #if NeedFunctionPrototypes
  148.     Widget        /* w */,
  149.     XtPerWidgetInput    /* pwi */
  150. #endif
  151. );
  152.  
  153. extern Widget _XtProcessKeyboardEvent(
  154. #if NeedFunctionPrototypes
  155.     XKeyEvent*        /* event */,
  156.     Widget        /* widget */,
  157.     XtPerDisplayInput    /* pdi */
  158. #endif
  159. );
  160.  
  161. extern Widget _XtProcessPointerEvent(
  162. #if NeedFunctionPrototypes
  163.     XButtonEvent*    /* event */,
  164.     Widget        /* widget */,
  165.     XtPerDisplayInput    /* pdi */
  166. #endif
  167. );
  168.  
  169. #endif /* _PDI_h_ */
  170.