home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / X / mit / server / ddx / ibm / common / ibmMouse.c < prev    next >
Encoding:
C/C++ Source or Header  |  1991-07-16  |  2.3 KB  |  77 lines

  1. /*
  2.  * $XConsortium: ibmMouse.c,v 1.2 91/07/16 13:08:44 jap Exp $
  3.  *
  4.  * Copyright IBM Corporation 1987,1988,1989,1990,1991
  5.  *
  6.  * All Rights Reserved
  7.  *
  8.  * License 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, FITNESS, AND 
  18.  * NONINFRINGEMENT OF THIRD PARTY RIGHTS, IN NO EVENT SHALL
  19.  * IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
  20.  * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
  21.  * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
  22.  * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
  23.  * SOFTWARE.
  24.  *
  25. */
  26.  
  27. #include <stdio.h>
  28.  
  29. #include "X.h"
  30. #include "Xproto.h"
  31. #include "miscstruct.h"
  32. #include "scrnintstr.h"
  33. #include "input.h"
  34. #include "cursorstr.h"
  35.  
  36. #include "ibmIO.h"
  37. #include "ibmMouse.h"
  38. #include "ibmScreen.h"
  39.  
  40. #include "OSio.h"
  41. #include "ibmTrace.h"
  42.  
  43. /***================================================================***/
  44.  
  45. DevicePtr    ibmPtr;
  46. int        ibmDoPointerAccel=        0;
  47. int        ibmPointerThreshold=         0;
  48. int        ibmPointerAccelNumerator=     0;
  49. int        ibmPointerAccelDenominator=     0;
  50.  
  51. /***================================================================***/
  52.  
  53. void
  54. ibmChangePointerControl(pDevice,pCtrl)
  55. DevicePtr    pDevice;
  56. PtrCtrl        *pCtrl;
  57. {
  58. int    scale;
  59.  
  60.     TRACE(("ibmChangePointerControl( pDevice= 0x%x, pCtrl= 0x%x )\n",
  61.                         pDevice,pCtrl));
  62.     if ((pCtrl->num>0)&&(pCtrl->den>0)) {
  63.     ibmPointerAccelNumerator=        pCtrl->num;
  64.     ibmPointerAccelDenominator=        pCtrl->den;
  65.     }
  66.     else {
  67.     if (pCtrl->num==-1)        ibmPointerAccelNumerator= 1;
  68.     if (pCtrl->den==-1)        ibmPointerAccelDenominator= 1;
  69.     }
  70.     if (pCtrl->threshold>=0)
  71.     ibmPointerThreshold=        pCtrl->threshold;
  72.     else if (pCtrl->threshold==-1)
  73.     ibmPointerThreshold=        1;
  74.     ibmDoPointerAccel= (ibmPointerAccelNumerator!=ibmPointerAccelDenominator);
  75.     return;
  76. }
  77.