home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / X / mit / server / include / input.h.orig < prev    next >
Encoding:
Text File  |  1991-05-14  |  3.9 KB  |  139 lines

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