home *** CD-ROM | disk | FTP | other *** search
/ Otherware / Otherware_1_SB_Development.iso / amiga / os / bsdss4.tz / bsdss4 / bsdss / server / sys / tablet.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-04-22  |  4.9 KB  |  134 lines

  1. /* 
  2.  * Mach Operating System
  3.  * Copyright (c) 1992 Carnegie Mellon University
  4.  * All Rights Reserved.
  5.  * 
  6.  * Permission to use, copy, modify and distribute this software and its
  7.  * documentation is hereby granted, provided that both the copyright
  8.  * notice and this permission notice appear in all copies of the
  9.  * software, derivative works or modified versions, and any portions
  10.  * thereof, and that both notices appear in supporting documentation.
  11.  * 
  12.  * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
  13.  * CONDITION.  CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
  14.  * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
  15.  * 
  16.  * Carnegie Mellon requests users of this software to return to
  17.  * 
  18.  *  Software Distribution Coordinator  or  Software.Distribution@CS.CMU.EDU
  19.  *  School of Computer Science
  20.  *  Carnegie Mellon University
  21.  *  Pittsburgh PA 15213-3890
  22.  * 
  23.  * any improvements or extensions that they make and grant Carnegie Mellon 
  24.  * the rights to redistribute these changes.
  25.  */
  26. /*
  27.  * HISTORY
  28.  * $Log:    tablet.h,v $
  29.  * Revision 2.1  92/04/21  17:16:02  rwd
  30.  * BSDSS
  31.  * 
  32.  *
  33.  */
  34.  
  35. /*-
  36.  * Copyright (c) 1985, 1986 The Regents of the University of California.
  37.  * All rights reserved.
  38.  *
  39.  * Redistribution and use in source and binary forms, with or without
  40.  * modification, are permitted provided that the following conditions
  41.  * are met:
  42.  * 1. Redistributions of source code must retain the above copyright
  43.  *    notice, this list of conditions and the following disclaimer.
  44.  * 2. Redistributions in binary form must reproduce the above copyright
  45.  *    notice, this list of conditions and the following disclaimer in the
  46.  *    documentation and/or other materials provided with the distribution.
  47.  * 3. All advertising materials mentioning features or use of this software
  48.  *    must display the following acknowledgement:
  49.  *    This product includes software developed by the University of
  50.  *    California, Berkeley and its contributors.
  51.  * 4. Neither the name of the University nor the names of its contributors
  52.  *    may be used to endorse or promote products derived from this software
  53.  *    without specific prior written permission.
  54.  *
  55.  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  56.  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  57.  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  58.  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  59.  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  60.  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  61.  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  62.  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  63.  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  64.  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  65.  * SUCH DAMAGE.
  66.  *
  67.  *    @(#)tablet.h    7.5 (Berkeley) 2/15/91
  68.  */
  69.  
  70. #ifndef _TABLET_H_
  71. #define    _TABLET_H_
  72.  
  73. /*
  74.  * Tablet line discipline.
  75.  */
  76. #ifdef KERNEL
  77. #include <../h/ioctl.h>
  78. #else
  79. #include <sys/ioctl.h>
  80. #endif
  81.  
  82. /*
  83.  * Reads on the tablet return one of the following structures, depending on
  84.  * the underlying tablet type.  The first two are defined such that a read of
  85.  * sizeof (gtcopos) on a non-gtco tablet will return meaningful info.  The
  86.  * in-proximity bit is simulated where the tablet does not directly provide
  87.  * the information.
  88.  */
  89. struct    tbpos {
  90.     int    xpos, ypos;    /* raw x-y coordinates */
  91.     short    status;        /* buttons/pen down */
  92. #define    TBINPROX    0100000        /* pen in proximity of tablet */
  93.     short    scount;        /* sample count */
  94. };
  95.  
  96. struct    gtcopos {
  97.     int    xpos, ypos;    /* raw x-y coordinates */
  98.     short    status;        /* as above */
  99.     short    scount;        /* sample count */
  100.     short    xtilt, ytilt;    /* raw tilt */
  101.     short    pressure;
  102.     short    pad;        /* pad to longword boundary */
  103. };
  104.  
  105. struct    polpos {
  106.     short    p_x, p_y, p_z;    /* raw 3-space coordinates */
  107.     short    p_azi, p_pit, p_rol;    /* azimuth, pitch, and roll */
  108.     short    p_stat;        /* status, as above */
  109.     char    p_key;        /* calculator input keyboard */
  110. };
  111.  
  112. #define BIOSMODE    _IOW('b', 1, int)    /* set mode bit(s) */
  113. #define BIOGMODE    _IOR('b', 2, int)    /* get mode bit(s) */
  114. #define    TBMODE        0xfff0        /* mode bits: */
  115. #define        TBPOINT        0x0010        /* single point */
  116. #define        TBRUN        0x0000        /* runs contin. */
  117. #define        TBSTOP        0x0020        /* shut-up */
  118. #define        TBGO        0x0000        /* ~TBSTOP */
  119. #define    TBTYPE        0x000f        /* tablet type: */
  120. #define        TBUNUSED    0x0
  121. #define        TBHITACHI    0x1        /* hitachi tablet */
  122. #define        TBTIGER        0x2        /* hitachi tiger */
  123. #define        TBGTCO        0x3        /* gtco */
  124. #define        TBPOL        0x4        /* polhemus 3space */
  125. #define        TBHDG        0x5        /* hdg-1111b, low res */
  126. #define        TBHDGHIRES    0x6        /* hdg-1111b, high res */
  127. #define        TBDIGI        0x7        /* gtco digi-pad, low res */
  128. #define        TBDIGIHIRES    0x8        /* gtco digi-pad, high res */
  129. #define BIOSTYPE    _IOW('b', 3, int)    /* set tablet type */
  130. #define BIOGTYPE    _IOR('b', 4, int)    /* get tablet type*/
  131. #endif
  132.  
  133. #endif /* !_TABLET_H_ */
  134.