xref: /original-bsd/sys/sys/tablet.h (revision 333da485)
1 /*-
2  * Copyright (c) 1985, 1986, 1993
3  *	The Regents of the University of California.  All rights reserved.
4  *
5  * %sccs.include.redist.c%
6  *
7  *	@(#)tablet.h	8.3 (Berkeley) 01/04/94
8  */
9 
10 #ifndef _SYS_TABLET_H_
11 #define	_SYS_TABLET_H_
12 
13 /*
14  * Tablet line discipline.
15  */
16 #include <sys/ioctl.h>
17 
18 /*
19  * Reads on the tablet return one of the following structures, depending on
20  * the underlying tablet type.  The first two are defined such that a read of
21  * sizeof (gtcopos) on a non-gtco tablet will return meaningful info.  The
22  * in-proximity bit is simulated where the tablet does not directly provide
23  * the information.
24  */
25 struct	tbpos {
26 	int	xpos, ypos;	/* raw x-y coordinates */
27 	short	status;		/* buttons/pen down */
28 #define	TBINPROX	0100000		/* pen in proximity of tablet */
29 	short	scount;		/* sample count */
30 };
31 
32 struct	gtcopos {
33 	int	xpos, ypos;	/* raw x-y coordinates */
34 	short	status;		/* as above */
35 	short	scount;		/* sample count */
36 	short	xtilt, ytilt;	/* raw tilt */
37 	short	pressure;
38 	short	pad;		/* pad to longword boundary */
39 };
40 
41 struct	polpos {
42 	short	p_x, p_y, p_z;	/* raw 3-space coordinates */
43 	short	p_azi, p_pit, p_rol;	/* azimuth, pitch, and roll */
44 	short	p_stat;		/* status, as above */
45 	char	p_key;		/* calculator input keyboard */
46 };
47 
48 #define BIOSMODE	_IOW('b', 1, int)	/* set mode bit(s) */
49 #define BIOGMODE	_IOR('b', 2, int)	/* get mode bit(s) */
50 #define	TBMODE		0xfff0		/* mode bits: */
51 #define		TBPOINT		0x0010		/* single point */
52 #define		TBRUN		0x0000		/* runs contin. */
53 #define		TBSTOP		0x0020		/* shut-up */
54 #define		TBGO		0x0000		/* ~TBSTOP */
55 #define	TBTYPE		0x000f		/* tablet type: */
56 #define		TBUNUSED	0x0
57 #define		TBHITACHI	0x1		/* hitachi tablet */
58 #define		TBTIGER		0x2		/* hitachi tiger */
59 #define		TBGTCO		0x3		/* gtco */
60 #define		TBPOL		0x4		/* polhemus 3space */
61 #define		TBHDG		0x5		/* hdg-1111b, low res */
62 #define		TBHDGHIRES	0x6		/* hdg-1111b, high res */
63 #define		TBDIGI		0x7		/* gtco digi-pad, low res */
64 #define		TBDIGIHIRES	0x8		/* gtco digi-pad, high res */
65 #define BIOSTYPE	_IOW('b', 3, int)	/* set tablet type */
66 #define BIOGTYPE	_IOR('b', 4, int)	/* get tablet type*/
67 
68 #endif /* !_SYS_TABLET_H_ */
69