src/joystick/darwin/SDL_sysjoystick_c.h
branchgsoc2008_force_feedback
changeset 2632 9e7f58b1b255
child 2637 2f826c229d77
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/src/joystick/darwin/SDL_sysjoystick_c.h	Wed Aug 06 11:08:29 2008 +0000
     1.3 @@ -0,0 +1,87 @@
     1.4 +/*
     1.5 +	SDL - Simple DirectMedia Layer
     1.6 +    Copyright (C) 1997-2004 Sam Lantinga
     1.7 +
     1.8 +	This library is free software; you can redistribute it and/or
     1.9 +	modify it under the terms of the GNU Library General Public
    1.10 +	License as published by the Free Software Foundation; either
    1.11 +	version 2 of the License, or (at your option) any later version.
    1.12 +
    1.13 +	This library is distributed in the hope that it will be useful,
    1.14 +	but WITHOUT ANY WARRANTY; without even the implied warranty of
    1.15 +	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    1.16 +	Library General Public License for more details.
    1.17 +
    1.18 +	You should have received a copy of the GNU Library General Public
    1.19 +	License along with this library; if not, write to the Free
    1.20 +	Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
    1.21 +
    1.22 +	Sam Lantinga
    1.23 +	slouken@libsdl.org
    1.24 +*/
    1.25 +#include "SDL_config.h"
    1.26 +
    1.27 +#ifndef SDL_JOYSTICK_IOKIT_H
    1.28 +
    1.29 +
    1.30 +#if MAC_OS_X_VERSION_MIN_REQUIRED == 1030
    1.31 +#include "10.3.9-FIX/IOHIDLib.h"
    1.32 +#else
    1.33 +#include <IOKit/hid/IOHIDLib.h>
    1.34 +#endif
    1.35 +#include <IOKit/hid/IOHIDKeys.h>
    1.36 +
    1.37 +
    1.38 +struct recElement
    1.39 +{
    1.40 +    IOHIDElementCookie cookie;  /* unique value which identifies element, will NOT change */
    1.41 +    long min;                   /* reported min value possible */
    1.42 +    long max;                   /* reported max value possible */
    1.43 +#if 0
    1.44 +    /* TODO: maybe should handle the following stuff somehow? */
    1.45 +
    1.46 +    long scaledMin;             /* reported scaled min value possible */
    1.47 +    long scaledMax;             /* reported scaled max value possible */
    1.48 +    long size;                  /* size in bits of data return from element */
    1.49 +    Boolean relative;           /* are reports relative to last report (deltas) */
    1.50 +    Boolean wrapping;           /* does element wrap around (one value higher than max is min) */
    1.51 +    Boolean nonLinear;          /* are the values reported non-linear relative to element movement */
    1.52 +    Boolean preferredState;     /* does element have a preferred state (such as a button) */
    1.53 +    Boolean nullState;          /* does element have null state */
    1.54 +#endif                          /* 0 */
    1.55 +
    1.56 +    /* runtime variables used for auto-calibration */
    1.57 +    long minReport;             /* min returned value */
    1.58 +    long maxReport;             /* max returned value */
    1.59 +
    1.60 +    struct recElement *pNext;   /* next element in list */
    1.61 +};
    1.62 +typedef struct recElement recElement;
    1.63 +
    1.64 +struct joystick_hwdata
    1.65 +{
    1.66 +    IOHIDDeviceInterface **interface;   /* interface to device, NULL = no interface */
    1.67 +
    1.68 +    char product[256];          /* name of product */
    1.69 +    long usage;                 /* usage page from IOUSBHID Parser.h which defines general usage */
    1.70 +    long usagePage;             /* usage within above page from IOUSBHID Parser.h which defines specific usage */
    1.71 +
    1.72 +    long axes;                  /* number of axis (calculated, not reported by device) */
    1.73 +    long buttons;               /* number of buttons (calculated, not reported by device) */
    1.74 +    long hats;                  /* number of hat switches (calculated, not reported by device) */
    1.75 +    long elements;              /* number of total elements (shouldbe total of above) (calculated, not reported by device) */
    1.76 +
    1.77 +    recElement *firstAxis;
    1.78 +    recElement *firstButton;
    1.79 +    recElement *firstHat;
    1.80 +
    1.81 +    int removed;
    1.82 +    int uncentered;
    1.83 +
    1.84 +    struct joystick_hwdata *pNext;      /* next device */
    1.85 +};
    1.86 +typedef struct joystick_hwdata recDevice;
    1.87 +
    1.88 +
    1.89 +#endif /* SDL_JOYSTICK_IOKIT_H */
    1.90 +