|
|
1.1 root 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 OTHERCLIENTS(win) ((OtherClientsPtr)(win)->otherClients)
37: #define NullGrab ((GrabPtr)NULL)
38: #define PASSIVEGRABS(win) ((GrabPtr)(win)->passiveGrabs)
39: #define PointerRootWin ((WindowPtr)PointerRoot)
40: #define NoneWin ((WindowPtr)None)
41: #define NullDevice ((DevicePtr)NULL)
42:
43: typedef unsigned long Leds;
44: typedef struct _OtherClients *OtherClientsPtr;
45: typedef struct _GrabRec *GrabPtr;
46:
47: typedef int (*DeviceProc)();
48: typedef void (*ProcessInputProc)();
49:
50: typedef struct _DeviceRec {
51: pointer devicePrivate;
52: ProcessInputProc processInputProc;
53: Bool on; /* used by DDX to keep state */
54: } DeviceRec, *DevicePtr;
55:
56: typedef struct {
57: int count;
58: DevicePtr *devices;
59: } DevicesDescriptor;
60:
61: typedef struct {
62: int click, bell, bell_pitch, bell_duration;
63: Bool autoRepeat;
64: unsigned char autoRepeats[32];
65: Leds leds;
66: } KeybdCtrl;
67:
68: typedef struct {
69: KeySym *map;
70: KeyCode minKeyCode,
71: maxKeyCode;
72: int mapWidth;
73: } KeySymsRec, *KeySymsPtr;
74:
75: typedef struct {
76: int num, den, threshold;
77: } PtrCtrl;
78:
79: extern KeybdCtrl defaultKeyboardControl;
80: extern PtrCtrl defaultPointerControl;
81:
82: extern int DeliverEvents(/* WindowPtr, xEvent*, int, WindowPtr */);
83: extern int MaybeDeliverEventsToClient(/*
84: WindowPtr, xEvent *, int, Mask, ClientPtr */);
85:
86: extern DevicePtr AddInputDevice(/* DeviceProc, Bool */);
87: extern void RegisterPointerDevice();
88: extern void RegisterKeyboardDevice();
89:
90: extern void ProcessPointerEvent();
91: extern void ProcessKeyboardEvent();
92: extern void ProcessOtherEvent();
93:
94: extern void InitPointerDeviceStruct();
95: extern void InitKeyboardDeviceStruct();
96: extern void InitOtherDeviceStruct();
97: extern GrabPtr SetDeviceGrab();
98:
99: extern DevicesDescriptor GetInputDevices();
100: extern DevicePtr LookupInputDevice();
101: extern DevicePtr LookupKeyboardDevice();
102: extern DevicePtr LookupPointerDevice();
103:
104: extern void CloseDownDevices();
105: extern int InitAndStartDevices();
106: extern int NumMotionEvents();
107:
108: extern void WriteEventsToClient();
109: extern int EventSelectForWindow();
110: extern int EventSupressForWindow();
111:
112: #endif /* INPUT_H */
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.