home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / X / mit / server / include / input.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-07-21  |  4.1 KB  |  141 lines

  1. /* $XConsortium: input.h,v 1.12 92/08/21 15:09:38 rws Exp $ */
  2. /************************************************************
  3. Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts,
  4. and the Massachusetts Institute of Technology, Cambridge, Massachusetts.
  5.  
  6.                         All Rights Reserved
  7.  
  8. Permission to use, copy, modify, and distribute this software and its 
  9. documentation for any purpose and without fee is hereby granted, 
  10. provided that the above copyright notice appear in all copies and that
  11. both that copyright notice and this permission notice appear in 
  12. supporting documentation, and that the names of Digital or MIT not be
  13. used in advertising or publicity pertaining to distribution of the
  14. software without specific, written prior permission.  
  15.  
  16. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
  17. ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
  18. DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
  19. ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
  20. WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
  21. ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
  22. SOFTWARE.
  23.  
  24. ********************************************************/
  25. #ifndef INPUT_H
  26. #define INPUT_H
  27.  
  28. #include "misc.h"
  29.  
  30. #define DEVICE_INIT    0
  31. #define DEVICE_ON    1
  32. #define DEVICE_OFF    2
  33. #define DEVICE_CLOSE    3
  34.  
  35. #define MAP_LENGTH    256
  36. #define DOWN_LENGTH    32    /* 256/8 => number of bytes to hold 256 bits */
  37. #define NullGrab ((GrabPtr)NULL)
  38. #define PointerRootWin ((WindowPtr)PointerRoot)
  39. #define NoneWin ((WindowPtr)None)
  40. #define NullDevice ((DevicePtr)NULL)
  41.  
  42. #ifndef FollowKeyboard
  43. #define FollowKeyboard         3
  44. #endif
  45. #ifndef FollowKeyboardWin
  46. #define FollowKeyboardWin  ((WindowPtr) FollowKeyboard)
  47. #endif
  48. #ifndef RevertToFollowKeyboard
  49. #define RevertToFollowKeyboard    3
  50. #endif
  51.  
  52. typedef unsigned long Leds;
  53. typedef struct _OtherClients *OtherClientsPtr;
  54. typedef struct _InputClients *InputClientsPtr;
  55. typedef struct _GrabRec *GrabPtr;
  56.  
  57. typedef int (*DeviceProc)();
  58. typedef void (*ProcessInputProc)();
  59.  
  60. typedef struct _DeviceRec {
  61.     pointer    devicePrivate;
  62.     ProcessInputProc processInputProc;    /* current */
  63.     ProcessInputProc realInputProc;    /* deliver */
  64.     ProcessInputProc enqueueInputProc;    /* enqueue */
  65.     Bool    on;            /* used by DDX to keep state */
  66. } DeviceRec, *DevicePtr;
  67.  
  68. typedef struct {
  69.     int            click, bell, bell_pitch, bell_duration;
  70.     Bool        autoRepeat;
  71.     unsigned char    autoRepeats[32];
  72.     Leds        leds;
  73.     unsigned char    id;
  74. } KeybdCtrl;
  75.  
  76. typedef struct {
  77.     KeySym  *map;
  78.     KeyCode minKeyCode,
  79.         maxKeyCode;
  80.     int     mapWidth;
  81. } KeySymsRec, *KeySymsPtr;
  82.  
  83. typedef struct {
  84.     int        num, den, threshold;
  85.     unsigned char id;
  86. } PtrCtrl;
  87.  
  88. typedef struct {
  89.     int         resolution, min_value, max_value;
  90.     int         integer_displayed;
  91.     unsigned char id;
  92. } IntegerCtrl;
  93.  
  94. typedef struct {
  95.     int         max_symbols, num_symbols_supported;
  96.     int         num_symbols_displayed;
  97.     KeySym      *symbols_supported;
  98.     KeySym      *symbols_displayed;
  99.     unsigned char id;
  100. } StringCtrl;
  101.  
  102. typedef struct {
  103.     int         percent, pitch, duration;
  104.     unsigned char id;
  105. } BellCtrl;
  106.  
  107. typedef struct {
  108.     Leds        led_values;
  109.     Mask        led_mask;
  110.     unsigned char id;
  111. } LedCtrl;
  112.  
  113. extern KeybdCtrl    defaultKeyboardControl;
  114. extern PtrCtrl        defaultPointerControl;
  115.  
  116. extern DevicePtr AddInputDevice();
  117. extern Bool EnableDevice();
  118. extern Bool DisableDevice();
  119. extern void RegisterPointerDevice();
  120. extern void RegisterKeyboardDevice();
  121. extern DevicePtr LookupKeyboardDevice();
  122. extern DevicePtr LookupPointerDevice();
  123.  
  124. extern void ProcessPointerEvent();
  125. extern void ProcessKeyboardEvent();
  126.  
  127. extern Bool InitKeyClassDeviceStruct();
  128. extern Bool InitButtonClassDeviceStruct();
  129. extern Bool InitFocusClassDeviceStruct();
  130. extern Bool InitKbdFeedbackClassDeviceStruct();
  131. extern Bool InitPtrFeedbackClassDeviceStruct();
  132. extern Bool InitValuatorClassDeviceStruct();
  133. extern Bool InitPointerDeviceStruct();
  134. extern Bool InitKeyboardDeviceStruct();
  135.  
  136. extern void CloseDownDevices();
  137.  
  138. extern void WriteEventsToClient();
  139.  
  140. #endif /* INPUT_H */
  141.