home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / X / mit / server / ddx / mips / mipsMouse.h < prev    next >
Encoding:
C/C++ Source or Header  |  1991-07-18  |  2.5 KB  |  82 lines

  1. /*
  2.  * $XConsortium: mipsMouse.h,v 1.4 91/07/18 22:58:50 keith Exp $
  3.  *
  4.  * Copyright 1991 MIPS Computer Systems, Inc.
  5.  *
  6.  * Permission to use, copy, modify, distribute, and sell this software and its
  7.  * documentation for any purpose is hereby granted without fee, provided that
  8.  * the above copyright notice appear in all copies and that both that
  9.  * copyright notice and this permission notice appear in supporting
  10.  * documentation, and that the name of MIPS not be used in advertising or
  11.  * publicity pertaining to distribution of the software without specific,
  12.  * written prior permission.  MIPS makes no representations about the
  13.  * suitability of this software for any purpose.  It is provided "as is"
  14.  * without express or implied warranty.
  15.  *
  16.  * MIPS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
  17.  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL MIPS
  18.  * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  19.  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
  20.  * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN 
  21.  * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  22.  */
  23. /* $Header: mipsMouse.h,v 1.4 91/07/18 22:58:50 keith Exp $ */
  24. #ifndef __DDX_MIPSMOUSE_H
  25. #define    __DDX_MIPSMOUSE_H
  26.  
  27. #define NBUTTONS    3
  28.  
  29. #define RAW_LEFT    4
  30. #define RAW_MIDDLE    2
  31. #define RAW_RIGHT    1
  32.  
  33. /* mouse device name */
  34.  
  35. #define    MOUSEDEV    "/dev/mouse"
  36.  
  37. /* motion buffer */
  38. #ifdef X11R4
  39. #define MOUSEQSIZE      100
  40.  
  41. typedef struct {
  42.     int        time;
  43.     int        scrn;
  44.     int        dx, dy;
  45.     int        bmask;
  46. } mouseQ_t;
  47. #endif /* X11R4 */
  48.  
  49. /* macros for i/o with mouse device */
  50.  
  51. #define LPACKETSIZE    5
  52. #define LSYNCBIT    0x80
  53. #define BUTTONMASK(x)    ((~(x)) & 0x07)
  54.  
  55. /* mouse private structure */
  56.  
  57. typedef
  58. struct  _mousePriv {
  59.     int        fd;        /* File descriptor of the mouse */
  60.     short    unit;        /* which mouse /dev/tty(unit) */
  61.     short    cap;        /* Device capabilities */
  62.     short    baud;        /* Baud rate */
  63.     short    rate;        /* Sampling rate */
  64.     INT16    rootX, rootY;    /* Current mouse position */
  65.     char    type;        /* mouse type */
  66. #define    MIPS_MOUSE_DEFAULT    0
  67. #define    MIPS_MOUSE_MOUSEMAN    1
  68.     char    buttonstate;    /* Which buttons are down */
  69.     struct {
  70.     char mask;
  71.     char val;
  72.     } buttonmap[NBUTTONS];    /* Conversion between mouse and cursor buttons */
  73.     int        scrn;        /* What screen is the cursor on */
  74.     PtrCtrl    ctrl;        /* Pointer control */
  75. } MousePriv, *MousePrivPtr;
  76.  
  77. /* keyboard and mouse defines */
  78.  
  79. extern MousePriv    mousePriv;
  80.  
  81. #endif /* __DDX_MIPSMOUSE_H */
  82.