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