home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / X / mit / server / ddx / omron / omronMouse.h < prev    next >
Encoding:
C/C++ Source or Header  |  1991-06-29  |  2.3 KB  |  68 lines

  1. /*
  2.  * $XConsortium: omronMouse.h,v 1.1 91/06/29 13:49:05 xguest Exp $
  3.  *
  4.  * Copyright 1991 by OMRON Corporation
  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 OMRON not be used in advertising or
  11.  * publicity pertaining to distribution of the software without specific,
  12.  * written prior permission.  OMRON 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.  * OMRON DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
  17.  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL OMRON
  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.  
  24. #define MSB_LEFT    4
  25. #define MSB_MIDDLE    2
  26. #define MSB_RIGHT    1
  27.  
  28. #define    LEFT_PRESSED(b)        ((b) & (MSB_LEFT << 6))
  29. #define MIDDLE_PRESSED(b)    ((b) & (MSB_MIDDLE << 6))
  30. #define RIGHT_PRESSED(b)    ((b) & (MSB_RIGHT << 6))
  31.  
  32. #define LEFT_RELEASED(b)    ((b) & (MSB_LEFT << 3))
  33. #define MIDDLE_RELEASED(b)    ((b) & (MSB_MIDDLE << 3))
  34. #define RIGHT_RELEASED(b)    ((b) & (MSB_RIGHT << 3))
  35.  
  36. #define MOUSE_EVENT(b)        ((b) & 0x01f8)
  37. #define BUTTON_PRESSED(b)    ((b) & 0x01c0)
  38. #define BUTTON_RELEASED(b)    ((b) & 0x0038)
  39.  
  40. #define    LEFT_UP(b)        ((b) & MSB_LEFT)
  41. #define MIDDLE_UP(b)        ((b) & MSB_MIDDLE)
  42. #define RIGHT_UP(b)        ((b) & MSB_RIGHT)
  43.  
  44. #define LEFT_DOWN(b)        (!LEFT_UP(b))
  45. #define MIDDLE_DOWN(b)        (!MIDDLE_UP(b))
  46. #define RIGHT_DOWN(b)        (!RIGHT_UP(b))
  47.  
  48.  
  49. typedef    struct    _omronMousePrvRec {
  50.     int fd;
  51.     int ctl_flags;
  52.     int button_state;
  53. #ifdef uniosu
  54.     int ttyfd;
  55. #endif
  56. }    omronMousePrv,    *omronMousePrvPtr;
  57.  
  58. extern int  omronMouseProc();
  59. extern void omronMouseGiveUp();
  60.  
  61. extern void omronMouseEnqueueEvent();
  62. extern struct msdata  *omronMouseGetEvents();
  63.  
  64. #ifndef UNUSE_DRV_TIME
  65. extern void    omronMouseEnqueueTEvent();
  66. extern struct msdatat *omronMouseGetTEvents();
  67. #endif
  68.