home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-385-Vol-1of3.iso / x / xibm.zip / AIX / aixMouse.c < prev    next >
C/C++ Source or Header  |  1991-09-20  |  3KB  |  108 lines

  1. /*
  2.  * $Id: aixMouse.c,v 1.1 1991/09/20 17:58:56 mtranle Exp $
  3.  *
  4.  * Copyright IBM Corporation 1987,1988,1989
  5.  *
  6.  * All Rights Reserved
  7.  *
  8.  * Permission to use, copy, modify, and distribute this software and its
  9.  * documentation for any purpose and without fee is hereby granted,
  10.  * provided that the above copyright notice appear in all copies and that 
  11.  * both that copyright notice and this permission notice appear in
  12.  * supporting documentation, and that the name of IBM not be
  13.  * used in advertising or publicity pertaining to distribution of the
  14.  * software without specific, written prior permission.
  15.  *
  16.  * IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
  17.  * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
  18.  * IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
  19.  * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
  20.  * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
  21.  * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
  22.  * SOFTWARE.
  23.  *
  24. */
  25.  
  26. #ifndef lint
  27. static char sccsid[] = "@(#)aixMouse.c    3.2 88/09/26 21:40:02";
  28. #endif
  29.  
  30. #include <stdio.h>
  31. #include <sys/types.h>
  32. #include <sys/file.h>
  33. #include <sys/hft.h>
  34.  
  35. #include "X.h"
  36. #include "Xproto.h"
  37. #include "miscstruct.h"
  38. #include "scrnintstr.h"
  39. #include "input.h"
  40. #include "cursorstr.h"
  41.  
  42. #include "ibmIO.h"
  43. #include "ibmMouse.h"
  44. #include "ibmScreen.h"
  45.  
  46. #include "ibmTrace.h"
  47.  
  48. #include "hftQueue.h"
  49.  
  50. extern    char    *getenv();
  51.  
  52. int    AIXMouseChordDelay= 20;
  53.  
  54. /***================================================================***/
  55.  
  56. static int
  57. AIXGetMotionEvents(buff, start, stop)
  58.     CARD32 start, stop;
  59.     xTimecoord *buff;
  60. {
  61.     TRACE(("rtGetMotionEvents( buff= 0x%x, start= %d, stop= %d )\n",
  62.                             buff,start,stop));
  63.     return 0;
  64. }
  65.  
  66. /***================================================================***/
  67.  
  68. static unsigned    always0= 0;
  69.  
  70. int
  71. AIXMouseProc(pDev, onoff)
  72.     DevicePtr    pDev;
  73.     int onoff;
  74. {
  75.     BYTE map[4];
  76.  
  77.     TRACE(("AIXMouseProc( pDev= 0x%x, onoff= 0x%x )\n",pDev, onoff ));
  78.  
  79.     switch (onoff)
  80.     {
  81.     case DEVICE_INIT: 
  82.         ibmPtr = pDev;
  83.         map[1] = 1;
  84.         map[2] = 2;
  85.         map[3] = 3;
  86. #ifdef AIXps2
  87.         /*
  88.          * On the AIX PS/2, the default HFT horizontal (11) and 
  89.          * vertical (22) mouse threshold is too jerky.
  90.          */  
  91.         hftSetLocatorThresholds(2,2);
  92. #endif /* AIXps2 */
  93.         InitPointerDeviceStruct(
  94.         ibmPtr, map, 3, AIXGetMotionEvents, ibmChangePointerControl );
  95.         SetInputCheck( &hftPending, &always0 );
  96.         break;
  97.     case DEVICE_ON:
  98.         pDev->on = TRUE;
  99.         break;
  100.     case DEVICE_OFF:
  101.         pDev->on = FALSE;
  102.         break;
  103.     case DEVICE_CLOSE:
  104.         break;
  105.     }
  106.     return Success;
  107. }
  108.