CrsrDev.h

/*
    File:       CrsrDev.h
    
    Description:
 
    Author:     RK
 
    Copyright:  Copyright: © 1999 by Apple Computer, Inc.
                all rights reserved.
    
    Disclaimer: You may incorporate this sample code into your applications without
                restriction, though the sample code has been provided "AS IS" and the
                responsibility for its operation is 100% yours.  However, what you are
                not permitted to do is to redistribute the source as "DSC Sample Code"
                after having made changes. If you're going to re-distribute the source,
                we require that you make it clear in the source that the code was
                descended from Apple Sample Code, but that you've made changes.
    
    Change History (most recent first):
 
*/
 
#include <Types.h>
#include <fixmath.h>
 
struct AcclPoint    {
    Fixed       deviceSpeed;
    Fixed       cursorSpeed;
};
 
typedef struct AcclPoint AcclPoint;
 
struct AcclTable    {
    Fixed       accel;
    short       numAcclPoints;
    AcclPoint   acclPoints[1];  
};
 
typedef struct AcclTable AcclTable;
typedef AcclTable *AcclTablePtr;
 
struct AcclRsrcType {
    UInt32          acclClass;
    short           numAcclTables;
    AcclTable       acclTable[1];
};
 
typedef struct AcclRsrcType AcclRsrcType;
typedef AcclRsrcType *AcclRsrcPtr, **AcclRsrcHandle;
 
struct AccelPointRec {
    Fixed   devSpeed;       // device speed
    Fixed   slope;
    Fixed   intercept;
};
 
typedef struct AccelPointRec    AccelPointRec;
typedef AccelPointRec           AccelPointArray[1];
typedef AccelPointArray         *AccelPointArrPtr;
 
struct MyCursorDevice {
    struct CursorDevice     *nextCursorDevice;          /* pointer to next record in linked list */
    CursorData              *whichCursor;               /* pointer to data for target cursor */
    long                    refCon;                     /* application-defined */
    long                    unused;                     /* reserved for future */
    OSType                  devID;                      /* device identifier (from ADB reg 1) */
    Fixed                   resolution;                 /* units/inch (orig. from ADB reg 1) */
    UInt8                   devClass;                   /* device class (from ADB reg 1) */
    UInt8                   cntButtons;                 /* number of buttons (from ADB reg 1) */
    UInt8                   filler1;                    /* reserved for future */
    UInt8                   buttons;                    /* state of all buttons */
    UInt8                   buttonOp[8];                /* action performed per button */
    unsigned long           buttonTicks[8];             /* ticks when button last went up (for debounce) */
    long                    buttonData[8];              /* data for the button operation */
    unsigned long           doubleClickTime;            /* device-specific double click speed */
    Fixed                   acceleration;               /* current acceleration */
    AccelPointArrPtr        accelPointArrPtr;           /* fields used internally to CDM */
    Fixed                   deltaX;                 
    Fixed                   deltaY;                 
    Fixed                   errorX;                 
    Fixed                   errorY; 
    Fixed                   denom;
    Fixed                   spread;
    UInt8                   newData;
    UInt8                   filler2;            
};
typedef struct MyCursorDevice MyCursorDevice, *MyCursorDevicePtr;