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

  1. /*
  2.  * $Id: ibmMouse.c,v 1.1 1991/09/20 18:24:03 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. #include "X.h"
  27. #include "input.h"
  28.  
  29. #include "ibmTrace.h"
  30.  
  31. /***================================================================***/
  32.  
  33. DevicePtr    ibmPtr ;
  34. int        ibmDoPointerAccel =        0 ;
  35. int        ibmPointerThreshold =         0 ;
  36. int        ibmPointerAccelNumerator =     0 ;
  37. int        ibmPointerAccelDenominator =     0 ;
  38.  
  39. /***================================================================***/
  40.  
  41. void
  42. ibmChangePointerControl( pDevice, pCtrl )
  43. DevicePtr    pDevice ;
  44. PtrCtrl        *pCtrl ;
  45. {
  46.     TRACE( ( "ibmChangePointerControl(pDevice=0x%x,pCtrl=0x%x)\n",
  47.        pDevice, pCtrl ) ) ;
  48.  
  49.     if ( ( pCtrl->num > 0 ) && ( pCtrl->den > 0 ) ) {
  50.     ibmPointerAccelNumerator = pCtrl->num ;
  51.     ibmPointerAccelDenominator = pCtrl->den ;
  52.     }
  53.     else {
  54.     if ( pCtrl->num == -1 )
  55.         ibmPointerAccelNumerator = 1 ;
  56.     if ( pCtrl->den == -1 )
  57.         ibmPointerAccelDenominator = 1 ;
  58.     }
  59.     if ( pCtrl->threshold >= 0 )
  60.     ibmPointerThreshold = pCtrl->threshold ;
  61.     else if ( pCtrl->threshold == -1 )
  62.     ibmPointerThreshold = 1 ;
  63.     ibmDoPointerAccel =
  64.     ( ibmPointerAccelNumerator != ibmPointerAccelDenominator ) ;
  65.  
  66.     return ;
  67. }
  68.