1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
|
#ifndef X_HIL_H
#define X_HIL_H
/* $TOG: x_hil.h /main/5 1998/02/10 13:11:44 kaleb $ */
/*
Copyright 1988, 1998 The Open Group
All Rights Reserved.
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
Except as contained in this notice, the name of The Open Group shall
not be used in advertising or otherwise to promote the sale, use or
other dealings in this Software without prior written authorization
from The Open Group.
Copyright 1988 by Hewlett-Packard Company
Permission to use, copy, modify, and distribute this software
and its documentation for any purpose and without fee is hereby
granted, provided that the above copyright notice appear in all
copies and that both that copyright notice and this permission
notice appear in supporting documentation, and that the name of
Hewlett-Packard not be used in advertising or publicity
pertaining to distribution of the software without specific, written
prior permission.
HEWLETT-PACKARD MAKES NO WARRANTY OF ANY KIND WITH REGARD
TO THIS SOFWARE, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. Hewlett-Packard shall not be liable for errors
contained herein or direct, indirect, special, incidental or
consequential damages in connection with the furnishing,
performance, or use of this material.
This software is not subject to any license of the American
Telephone and Telegraph Company or of the Regents of the
University of California.
*/
#include "hpext.h"
/* MAXHILEVENTS is the maximum number of X events that can
be put on the events queue as the result of reading a
single HIL data packet. The HIL definition is that
a packet may contain one motion event and up to 8 bytes
of key data. If the key device is a barcode reader in
ASCII mode, we translate each ASCII code into up to 6
keycodes. The maximum number of X events that can be
generated from a single HIL packet is therefore 49.
MAX_EVENTS is the size of the server's internal queue of
input events. X input is a two-step process, with the
first step consisting of reading input events from the
device and putting them on this internal queue. Later
in the dispatch loop, that queue is emptied and all the
events are routed by DIX to the appropriate clients.
The size of the event queue is not as large as the
theoretical maximum, but motion events are compressed
into a single event until a key or button is seen.
The worst at all reasonable case is alternating key and
motion data, which would result in less than 50 events.
A more reasonable guess is 20 events per device.
Our queue size therefore allows for the worst case on
5 - 10 devices simultaneously.
*/
#define MAXHILEVENTS 49
#define MOTION_BUFFER_SIZE 100
#define MAX_EVENTS 256
#define WR_EVENTS MAX_EVENTS-1
struct x11EventQueue
{
xHPEvent *events;
int size;
int head;
int tail;
};
#endif
|