Fixed build issues on Mac OS X
authorSam Lantinga
Thu, 31 May 2007 14:46:01 +0000
changeset 211021942f552734
parent 2109 51cbe188a49e
child 2111 874162355be5
Fixed build issues on Mac OS X
src/audio/macosx/SDL_coreaudio.c
src/joystick/darwin/10.3.9-FIX/IOHIDLib.h
src/joystick/darwin/SDL_sysjoystick.c
     1.1 --- a/src/audio/macosx/SDL_coreaudio.c	Tue May 29 12:14:16 2007 +0000
     1.2 +++ b/src/audio/macosx/SDL_coreaudio.c	Thu May 31 14:46:01 2007 +0000
     1.3 @@ -128,7 +128,7 @@
     1.4  
     1.5          size = sizeof(CFStringRef);
     1.6          result = AudioDeviceGetProperty(dev, 0, iscapture,
     1.7 -                                        kAudioObjectPropertyName,
     1.8 +                                        kAudioDevicePropertyDeviceNameCFString,
     1.9                                          &size, &cfstr);
    1.10  
    1.11          if (result != kAudioHardwareNoError)
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/src/joystick/darwin/10.3.9-FIX/IOHIDLib.h	Thu May 31 14:46:01 2007 +0000
     2.3 @@ -0,0 +1,873 @@
     2.4 +/*
     2.5 + *
     2.6 + * @APPLE_LICENSE_HEADER_START@
     2.7 + * 
     2.8 + * Copyright (c) 1999-2003 Apple Computer, Inc.  All Rights Reserved.
     2.9 + * 
    2.10 + * This file contains Original Code and/or Modifications of Original Code
    2.11 + * as defined in and that are subject to the Apple Public Source License
    2.12 + * Version 2.0 (the 'License'). You may not use this file except in
    2.13 + * compliance with the License. Please obtain a copy of the License at
    2.14 + * http://www.opensource.apple.com/apsl/ and read it before using this
    2.15 + * file.
    2.16 + * 
    2.17 + * The Original Code and all software distributed under the License are
    2.18 + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
    2.19 + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
    2.20 + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
    2.21 + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
    2.22 + * Please see the License for the specific language governing rights and
    2.23 + * limitations under the License.
    2.24 + * 
    2.25 + * @APPLE_LICENSE_HEADER_END@
    2.26 + */
    2.27 +
    2.28 +#ifndef _IOKIT_HID_IOHIDLIB_H_
    2.29 +#define _IOKIT_HID_IOHIDLIB_H_
    2.30 +
    2.31 +#include <sys/cdefs.h>
    2.32 +
    2.33 +__BEGIN_DECLS
    2.34 +#include <CoreFoundation/CoreFoundation.h>
    2.35 +#if COREFOUNDATION_CFPLUGINCOM_SEPARATE
    2.36 +#include <CoreFoundation/CFPlugInCOM.h>
    2.37 +#endif
    2.38 +
    2.39 +#include <IOKit/IOTypes.h>
    2.40 +#include <IOKit/IOReturn.h>
    2.41 +
    2.42 +#include <IOKit/hid/IOHIDKeys.h>
    2.43 +
    2.44 +struct IOHIDEventStruct
    2.45 +{
    2.46 +    IOHIDElementType	type;
    2.47 +    IOHIDElementCookie	elementCookie;
    2.48 +    SInt32		value;
    2.49 +    AbsoluteTime	timestamp;
    2.50 +    UInt32		longValueSize;
    2.51 +    void *		longValue;
    2.52 +};
    2.53 +typedef struct IOHIDEventStruct IOHIDEventStruct;
    2.54 +
    2.55 +/* FA12FA38-6F1A-11D4-BA0C-0005028F18D5 */
    2.56 +#define kIOHIDDeviceUserClientTypeID CFUUIDGetConstantUUIDWithBytes(NULL, \
    2.57 +    0xFA, 0x12, 0xFA, 0x38, 0x6F, 0x1A, 0x11, 0xD4,			\
    2.58 +    0xBA, 0x0C, 0x00, 0x05, 0x02, 0x8F, 0x18, 0xD5)
    2.59 +
    2.60 +/* 13AA9C44-6F1B-11D4-907C-0005028F18D5 */
    2.61 +#define kIOHIDDeviceFactoryID CFUUIDGetConstantUUIDWithBytes(NULL,	\
    2.62 +    0x13, 0xAA, 0x9C, 0x44, 0x6F, 0x1B, 0x11, 0xD4,			\
    2.63 +    0x90, 0x7C, 0x00, 0x05, 0x02, 0x8F, 0x18, 0xD5)
    2.64 +
    2.65 +/* 78BD420C-6F14-11D4-9474-0005028F18D5 */
    2.66 +/*! @defined kIOHIDDeviceInterfaceID
    2.67 +    @discussion Interface ID for the IOHIDDeviceInterface. Corresponds to an
    2.68 +                 available HID device. */
    2.69 +#define kIOHIDDeviceInterfaceID CFUUIDGetConstantUUIDWithBytes(NULL, 	\
    2.70 +    0x78, 0xBD, 0x42, 0x0C, 0x6F, 0x14, 0x11, 0xD4,			\
    2.71 +    0x94, 0x74, 0x00, 0x05, 0x02, 0x8F, 0x18, 0xD5)
    2.72 +    
    2.73 +/* 7D0B510E-16D5-11D7-9E9B-000393992E38 */
    2.74 +/*! @defined kIOHIDDeviceInterfaceID121
    2.75 +    @discussion Interface ID for the IOHIDDeviceInterface121. Corresponds to 
    2.76 +                an available HID device that includes methods from
    2.77 +                IOHIDDeviceInterface.  This interface is available on 
    2.78 +                IOHIDLib 1.2.1 and Mac OS X 10.2.3 or later.*/
    2.79 +#define kIOHIDDeviceInterfaceID121 CFUUIDGetConstantUUIDWithBytes(NULL, \
    2.80 +    0x7d, 0xb, 0x51, 0xe, 0x16, 0xd5, 0x11, 0xd7, 			\
    2.81 +    0x9e, 0x9b, 0x0, 0x3, 0x93, 0x99, 0x2e, 0x38)
    2.82 +
    2.83 +/* B70ABF31-16D5-11D7-AB35-000393992E38 */
    2.84 +/*! @defined kIOHIDDeviceInterfaceID122
    2.85 +    @discussion Interface ID for the IOHIDDeviceInterface122. Corresponds to 
    2.86 +                an available HID device that includes methods from
    2.87 +                IOHIDDeviceInterface and IOHIDDeviceInterface121. This 
    2.88 +                interface is available on IOHIDLib 1.2.2 and Mac OS X 10.3
    2.89 +                or later.*/
    2.90 +#define kIOHIDDeviceInterfaceID122 CFUUIDGetConstantUUIDWithBytes(NULL, \
    2.91 +    0xb7, 0xa, 0xbf, 0x31, 0x16, 0xd5, 0x11, 0xd7, 			\
    2.92 +    0xab, 0x35, 0x0, 0x3, 0x93, 0x99, 0x2e, 0x38)
    2.93 +
    2.94 +/* 8138629E-6F14-11D4-970E-0005028F18D5 */
    2.95 +/*! @defined kIOHIDQueueInterfaceID
    2.96 +    @discussion Interface ID for the kIOHIDQueueInterfaceID. Corresponds to a
    2.97 +                queue for a specific HID device. */
    2.98 +#define kIOHIDQueueInterfaceID CFUUIDGetConstantUUIDWithBytes(NULL, 	\
    2.99 +    0x81, 0x38, 0x62, 0x9E, 0x6F, 0x14, 0x11, 0xD4,			\
   2.100 +    0x97, 0x0E, 0x00, 0x05, 0x02, 0x8F, 0x18, 0xD5)
   2.101 +
   2.102 +/* 80CDCC00-755D-11D4-8E0F-0005028F18D5 */
   2.103 +/*! @defined kIOHIDOutputTransactionInterfaceID
   2.104 +    @discussion Interface ID for the kIOHIDOutputTransactionInterfaceID.
   2.105 +                Corresponds to an output transaction for one or more report IDs
   2.106 +                on a specific device. */
   2.107 +#define kIOHIDOutputTransactionInterfaceID CFUUIDGetConstantUUIDWithBytes(NULL,\
   2.108 +    0x80, 0xCD, 0xCC, 0x00, 0x75, 0x5D, 0x11, 0xD4,			\
   2.109 +    0x80, 0xEF, 0x00, 0x05, 0x02, 0x8F, 0x18, 0xD5)
   2.110 +
   2.111 +/*! @typedef IOHIDCallbackFunction
   2.112 +    @discussion Type and arguments of callout C function that is used when a
   2.113 +                completion routine is called, see
   2.114 +                IOHIDLib.h:setRemovalCallback().
   2.115 +    @param target void * pointer to your data, often a pointer to an object.
   2.116 +    @param result Completion result of desired operation.
   2.117 +    @param refcon void * pointer to more data.
   2.118 +    @param sender Interface instance sending the completion routine.
   2.119 +*/
   2.120 +typedef void (*IOHIDCallbackFunction)
   2.121 +              (void * target, IOReturn result, void * refcon, void * sender);
   2.122 +
   2.123 +/*! @typedef IOHIDElementCallbackFunction
   2.124 +    @discussion Type and arguments of callout C function that is used when a
   2.125 +                completion routine is called, see IOHIDLib.h:setElementValue().
   2.126 +    @param target void * pointer to your data, often a pointer to an object.
   2.127 +    @param result Completion result of desired operation.
   2.128 +    @param refcon void * pointer to more data.
   2.129 +    @param sender Interface instance sending the completion routine.
   2.130 +    @param elementCookie Element within interface instance sending completion.
   2.131 +*/
   2.132 +typedef void (*IOHIDElementCallbackFunction)
   2.133 +              (void *	 		target,
   2.134 +               IOReturn 		result,
   2.135 +               void * 			refcon,
   2.136 +               void * 			sender,
   2.137 +               IOHIDElementCookie 	elementCookie);
   2.138 +
   2.139 +/*! @typedef IOHIDReportCallbackFunction
   2.140 +    @discussion Type and arguments of callout C function that is used when a
   2.141 +                completion routine is called, see IOHIDLib.h:setReport().
   2.142 +    @param target void * pointer to your data, often a pointer to an object.
   2.143 +    @param result Completion result of desired operation.
   2.144 +    @param refcon void * pointer to more data.
   2.145 +    @param sender Interface instance sending the completion routine.
   2.146 +    @param bufferSize Size of the buffer received upon completion.
   2.147 +*/
   2.148 +typedef void (*IOHIDReportCallbackFunction)
   2.149 +              (void *	 		target,
   2.150 +               IOReturn 		result,
   2.151 +               void * 			refcon,
   2.152 +               void * 			sender,
   2.153 +               UInt32		 	bufferSize);
   2.154 +               
   2.155 +
   2.156 +/* Forward declarations of the queue and output transaction interfaces */
   2.157 +struct IOHIDQueueInterface;
   2.158 +struct IOHIDOutputTransactionInterface;
   2.159 +typedef struct IOHIDQueueInterface IOHIDQueueInterface;
   2.160 +typedef struct IOHIDOutputTransactionInterface IOHIDOutputTransactionInterface;
   2.161 +
   2.162 +//
   2.163 +// IOHIDDeviceInterface Functions available in version 1.0 (10.0) and higher of Mac OS X
   2.164 +//
   2.165 +#define IOHIDDEVICEINTERFACE_FUNCS_100 							\
   2.166 +    IOReturn (*createAsyncEventSource)(void * self, CFRunLoopSourceRef * source); 	\
   2.167 +    CFRunLoopSourceRef (*getAsyncEventSource)(void * self);				\
   2.168 +    IOReturn (*createAsyncPort)(void * self, mach_port_t * port);			\
   2.169 +    mach_port_t (*getAsyncPort)(void * self);						\
   2.170 +    IOReturn (*open)(void * self, UInt32 flags);					\
   2.171 +    IOReturn (*close)(void * self);							\
   2.172 +    IOReturn (*setRemovalCallback)(void * self, IOHIDCallbackFunction removalCallback,	\
   2.173 +                                   void * removalTarget, void * removalRefcon);		\
   2.174 +    IOReturn (*getElementValue)(void * self, IOHIDElementCookie	elementCookie,		\
   2.175 +                                IOHIDEventStruct * valueEvent);				\
   2.176 +    IOReturn (*setElementValue)(void * self, IOHIDElementCookie elementCookie,		\
   2.177 +                                IOHIDEventStruct * valueEvent, UInt32 timeoutMS,	\
   2.178 +                                IOHIDElementCallbackFunction callback,			\
   2.179 +                                void * callbackTarget, void * callbackRefcon);		\
   2.180 +    IOReturn (*queryElementValue)(void * self, IOHIDElementCookie elementCookie,	\
   2.181 +                                IOHIDEventStruct * valueEvent, UInt32 timeoutMS,	\
   2.182 +                                IOHIDElementCallbackFunction callback,			\
   2.183 +                                void * callbackTarget, void * callbackRefcon);		\
   2.184 +    IOReturn (*startAllQueues)(void * self);						\
   2.185 +    IOReturn (*stopAllQueues)(void * self);						\
   2.186 +    IOHIDQueueInterface ** (*allocQueue) (void *self);					\
   2.187 +    IOHIDOutputTransactionInterface ** (*allocOutputTransaction) (void *self)
   2.188 +    
   2.189 +//
   2.190 +// IOHIDDeviceInterface Functions available in version 1.2.1 (10.2.3) and higher of Mac OS X
   2.191 +//
   2.192 +#define IOHIDDEVICEINTERFACE_FUNCS_121	 						\
   2.193 +    IOReturn (*setReport)(void * self, IOHIDReportType reportType, UInt32 reportID,	\
   2.194 +                                void * reportBuffer, UInt32 reportBufferSize,		\
   2.195 +                                UInt32 timeoutMS, IOHIDReportCallbackFunction callback,	\
   2.196 +                                void * callbackTarget, void * callbackRefcon);		\
   2.197 +    IOReturn (*getReport)(void * self, IOHIDReportType reportType,			\
   2.198 +                                UInt32 reportID, void * reportBuffer,			\
   2.199 +                                UInt32 * reportBufferSize, UInt32 timeoutMS,		\
   2.200 +                                IOHIDReportCallbackFunction callback,			\
   2.201 +                                void * callbackTarget, void * callbackRefcon)
   2.202 +                                
   2.203 +//
   2.204 +// IOHIDDeviceInterface Functions available in version 1.2.2 (10.3) and higher of Mac OS X
   2.205 +//
   2.206 +#define IOHIDDEVICEINTERFACE_FUNCS_122	 						\
   2.207 +    IOReturn (*copyMatchingElements)(void * self, CFDictionaryRef matchingDict, 	\
   2.208 +                                CFArrayRef * elements);					\
   2.209 +    IOReturn (*setInterruptReportHandlerCallback)(void * self, void * reportBuffer, 		\
   2.210 +                                UInt32 reportBufferSize, 				\
   2.211 +                                IOHIDReportCallbackFunction callback,			\
   2.212 +                                void * callbackTarget, void * callbackRefcon)	
   2.213 +
   2.214 +typedef struct IOHIDDeviceInterface
   2.215 +{
   2.216 +    IUNKNOWN_C_GUTS;
   2.217 +    IOHIDDEVICEINTERFACE_FUNCS_100;
   2.218 +    IOHIDDEVICEINTERFACE_FUNCS_121;
   2.219 +} IOHIDDeviceInterface;
   2.220 +
   2.221 +typedef struct IOHIDDeviceInterface121
   2.222 +{
   2.223 +    IUNKNOWN_C_GUTS;
   2.224 +    IOHIDDEVICEINTERFACE_FUNCS_100;
   2.225 +    IOHIDDEVICEINTERFACE_FUNCS_121;
   2.226 +} IOHIDDeviceInterface121;
   2.227 +
   2.228 +typedef struct IOHIDDeviceInterface122
   2.229 +{
   2.230 +    IUNKNOWN_C_GUTS;
   2.231 +    IOHIDDEVICEINTERFACE_FUNCS_100;
   2.232 +    IOHIDDEVICEINTERFACE_FUNCS_121;
   2.233 +    IOHIDDEVICEINTERFACE_FUNCS_122;
   2.234 +} IOHIDDeviceInterface122;
   2.235 +
   2.236 +
   2.237 +//
   2.238 +// IOHIDQueueInterface Functions available in version 1.0 (10.0) and higher of Mac OS X
   2.239 +//
   2.240 +#define IOHIDQUEUEINTERFACE_FUNCS_100							\
   2.241 +    IOReturn (*createAsyncEventSource)(void * self, CFRunLoopSourceRef * source);	\
   2.242 +    CFRunLoopSourceRef (*getAsyncEventSource)(void * self);				\
   2.243 +    IOReturn (*createAsyncPort)(void * self, mach_port_t * port);			\
   2.244 +    mach_port_t (*getAsyncPort)(void * self);						\
   2.245 +    IOReturn (*create)(void * self, UInt32 flags, UInt32 depth);			\
   2.246 +    IOReturn (*dispose)(void * self);							\
   2.247 +    IOReturn (*addElement)(void * self, IOHIDElementCookie elementCookie, UInt32 flags);\
   2.248 +    IOReturn (*removeElement)(void * self, IOHIDElementCookie elementCookie);		\
   2.249 +    Boolean (*hasElement)(void * self, IOHIDElementCookie elementCookie);		\
   2.250 +    IOReturn (*start)(void * self);							\
   2.251 +    IOReturn (*stop)(void * self);							\
   2.252 +    IOReturn (*getNextEvent)(void * self, IOHIDEventStruct * event,			\
   2.253 +                                AbsoluteTime maxTime, UInt32 timeoutMS);		\
   2.254 +    IOReturn (*setEventCallout)(void * self, IOHIDCallbackFunction callback,		\
   2.255 +                                void * callbackTarget,  void * callbackRefcon);		\
   2.256 +    IOReturn (*getEventCallout)(void * self, IOHIDCallbackFunction * outCallback,	\
   2.257 +                                void ** outCallbackTarget, void ** outCallbackRefcon)
   2.258 +
   2.259 +struct IOHIDQueueInterface
   2.260 +{
   2.261 +    IUNKNOWN_C_GUTS;
   2.262 +    IOHIDQUEUEINTERFACE_FUNCS_100;
   2.263 +};
   2.264 +
   2.265 +//
   2.266 +// IOHIDOutputTransactionInterface Functions available in version 1.2 (10.2) and higher of Mac OS X
   2.267 +//
   2.268 +#define IOHIDOUTPUTTRANSACTIONINTERFACE_FUNCS_120 					\
   2.269 +    IOReturn (*createAsyncEventSource)(void * self, CFRunLoopSourceRef * source);	\
   2.270 +    CFRunLoopSourceRef (*getAsyncEventSource)(void * self);				\
   2.271 +    IOReturn (*createAsyncPort)(void * self, mach_port_t * port);			\
   2.272 +    mach_port_t (*getAsyncPort)(void * self);						\
   2.273 +    IOReturn (*create)(void * self);							\
   2.274 +    IOReturn (*dispose)(void * self);							\
   2.275 +    IOReturn (*addElement)(void * self, IOHIDElementCookie elementCookie);		\
   2.276 +    IOReturn (*removeElement)(void * self, IOHIDElementCookie elementCookie);		\
   2.277 +    Boolean  (*hasElement)(void * self, IOHIDElementCookie elementCookie);		\
   2.278 +    IOReturn (*setElementDefault)(void *self, IOHIDElementCookie elementCookie,		\
   2.279 +                                IOHIDEventStruct * valueEvent);				\
   2.280 +    IOReturn (*getElementDefault)(void * self, IOHIDElementCookie elementCookie,	\
   2.281 +                                IOHIDEventStruct * outValueEvent);			\
   2.282 +    IOReturn (*setElementValue)(void * self, IOHIDElementCookie elementCookie,		\
   2.283 +                                IOHIDEventStruct * valueEvent);				\
   2.284 +    IOReturn (*getElementValue)(void * self, IOHIDElementCookie elementCookie,		\
   2.285 +                                IOHIDEventStruct * outValueEvent);			\
   2.286 +    IOReturn (*commit)(void * self, UInt32 timeoutMS, IOHIDCallbackFunction callback,	\
   2.287 +                                void * callbackTarget, void * callbackRefcon);		\
   2.288 +    IOReturn (*clear)(void * self)
   2.289 +
   2.290 +struct IOHIDOutputTransactionInterface
   2.291 +{
   2.292 +    IUNKNOWN_C_GUTS;
   2.293 +    IOHIDOUTPUTTRANSACTIONINTERFACE_FUNCS_120;
   2.294 +};
   2.295 +
   2.296 +
   2.297 +//
   2.298 +//  BEGIN READABLE STRUCTURE DEFINITIONS 
   2.299 +//  
   2.300 +//  This portion of uncompiled code provides a more reader friendly representation of 
   2.301 +//  the CFPlugin methods defined above.
   2.302 +
   2.303 +#if 0
   2.304 +/*! @class IOHIDDeviceInterface
   2.305 +    @discussion CFPlugin object subclass which provides the primary interface to
   2.306 +                HID devices.
   2.307 +*/
   2.308 +typedef struct IOHIDDeviceInterface
   2.309 +{
   2.310 +
   2.311 +    IUNKNOWN_C_GUTS;
   2.312 +
   2.313 +/*! @function createAsyncEventSource
   2.314 +    @abstract Creates async eventsource.
   2.315 +    @discussion This method will create an async mach port, if one
   2.316 +        has not already been created.
   2.317 +    @param source Reference to CFRunLoopSourceRef that is created.
   2.318 +    @result Returns an IOReturn code.
   2.319 +*/
   2.320 +    IOReturn (*createAsyncEventSource)(void * 			self,
   2.321 +                                       CFRunLoopSourceRef * 	source);
   2.322 +
   2.323 +/*! @function getAsyncEventSource
   2.324 +    @abstract Gets the created async event source.
   2.325 +    @result Returns a CFRunLoopSourceRef.
   2.326 +*/
   2.327 +    CFRunLoopSourceRef (*getAsyncEventSource)(void * self);
   2.328 +    
   2.329 +/*! @function createAsyncPort
   2.330 +    @abstract Creates an async port.
   2.331 +    @discussion The port must be created before any callbacks can be used. 
   2.332 +    @param port Reference to mach port that is created. 
   2.333 +    @result Returns an IOReturn code.
   2.334 +*/
   2.335 +    IOReturn (*createAsyncPort)(void * self, mach_port_t * port);
   2.336 +    
   2.337 +/*! @function getAsyncPort
   2.338 +    @abstract Gets the current async port.
   2.339 +    @result Returns a mach_port_t.
   2.340 +*/
   2.341 +    mach_port_t (*getAsyncPort)(void * self);
   2.342 +    
   2.343 +/*! @function open
   2.344 +    @abstract Opens the device.
   2.345 +    @param flags Flags to be passed down to the user client.
   2.346 +    @result Returns an IOReturn code.
   2.347 +*/
   2.348 +    IOReturn (*open)(void * self, UInt32 flags);
   2.349 +    
   2.350 +/*! @function close
   2.351 +    @abstract Closes the device.
   2.352 +    @result Returns an IOReturn code.
   2.353 +*/
   2.354 +    IOReturn (*close)(void * self);
   2.355 +
   2.356 +/*! @function setRemovalCallback
   2.357 +    @abstract Sets callback to be used when device is removed.
   2.358 +    @param removalCallback Called when the device is removed. 
   2.359 +    @param removeTarget Passed to the callback.
   2.360 +    @param removalRefcon Passed to the callback.
   2.361 +    @result Returns an IOReturn code.
   2.362 +*/
   2.363 +    IOReturn (*setRemovalCallback)(void * 			self,
   2.364 +                                   IOHIDCallbackFunction	removalCallback,
   2.365 +                                   void *			removalTarget,
   2.366 +                                   void *			removalRefcon);
   2.367 +
   2.368 +/*! @function getElementValue
   2.369 +    @abstract Obtains the most recent value of an element.
   2.370 +    @discussion This call is most useful for interrupt driven elements,
   2.371 +        such as input type elements.  Since feature type element values 
   2.372 +        need to be polled from the device, it is recommended to use the 
   2.373 +        queryElementValue method to obtain the current value.  The  
   2.374 +        timestamp field in the event details the last time the element 
   2.375 +        value was altered.
   2.376 +    @param elementCookie The element of interest. 
   2.377 +    @param valueEvent The event that will be filled.   If a long value is 
   2.378 +        present, it is up to the caller to deallocate it.
   2.379 +    @result Returns an IOReturn code.
   2.380 +*/
   2.381 +    IOReturn (*getElementValue)(void * 			self,
   2.382 +                                IOHIDElementCookie	elementCookie,
   2.383 +                                IOHIDEventStruct *	valueEvent);
   2.384 +
   2.385 +/*! @function setElementValue
   2.386 +    @abstract Sets an element value on the device.
   2.387 +    @discussion This call is most useful for feature type elements.  It is
   2.388 +        recommended to use IOOutputTransaction for output type elements.
   2.389 +    @param elementCookie The element of interest. 
   2.390 +    @param valueEvent The event that will be filled.  If a long value is
   2.391 +        present, it will be copied.
   2.392 +    @param timeoutMS UNSUPPORTED.
   2.393 +    @param callback UNSUPPORTED.
   2.394 +    @param callbackTarget UNSUPPORTED.
   2.395 +    @param callbackRefcon UNSUPPORTED.
   2.396 +    @result Returns an IOReturn code.
   2.397 +*/
   2.398 +    IOReturn (*setElementValue)(void *	 			self,
   2.399 +                                IOHIDElementCookie		elementCookie,
   2.400 +                                IOHIDEventStruct *		valueEvent,
   2.401 +                                UInt32 				timeoutMS,
   2.402 +                                IOHIDElementCallbackFunction	callback,
   2.403 +                                void * 				callbackTarget,
   2.404 +                                void *				callbackRefcon);
   2.405 +
   2.406 +/*! @function queryElementValue
   2.407 +    @abstract Obtains the current value of an element.
   2.408 +    @discussion This call is most useful for feature type elements.  This
   2.409 +        method will poll the device for the current element value.
   2.410 +    @param elementCookie The element of interest. 
   2.411 +    @param valueEvent The event that will be filled.  If a long value is 
   2.412 +        present, it is up to the caller to deallocate it.
   2.413 +    @param timeoutMS UNSUPPORTED.
   2.414 +    @param callback UNSUPPORTED.
   2.415 +    @param callbackTarget UNSUPPORTED.
   2.416 +    @param callbackRefcon UNSUPPORTED.
   2.417 +    @result Returns an IOReturn code.
   2.418 +*/
   2.419 +    IOReturn (*queryElementValue)(void * 			self,
   2.420 +                                IOHIDElementCookie		elementCookie,
   2.421 +                                IOHIDEventStruct *		valueEvent,
   2.422 +                                UInt32 				timeoutMS,
   2.423 +                                IOHIDElementCallbackFunction	callback,
   2.424 +                                void * 				callbackTarget,
   2.425 +                                void *				callbackRefcon);
   2.426 +
   2.427 +/*! @function startAllQueues
   2.428 +    @abstract Starts data delivery on all queues for this device.
   2.429 +    @result Returns an IOReturn code.
   2.430 +*/
   2.431 +    IOReturn (*startAllQueues)(void * self);
   2.432 +    
   2.433 +/*! @function stopAllQueues
   2.434 +    @abstract Stops data delivery on all queues for this device.
   2.435 +    @result Returns an IOReturn code.
   2.436 +*/
   2.437 +    IOReturn (*stopAllQueues)(void * self);
   2.438 +
   2.439 +/*! @function allocQueue
   2.440 +    @abstract Wrapper to return instances of the IOHIDQueueInterface. 
   2.441 +    @result Returns the created IOHIDQueueInterface.
   2.442 +*/
   2.443 +    IOHIDQueueInterface ** (*allocQueue) (void *self);
   2.444 +    
   2.445 +/*! @function allocOutputTransaction
   2.446 +    @abstract Wrapper to return instances of the IOHIDOutputTransactionInterface. 
   2.447 +    @result Returns the created IOHIDOutputTransactionInterface.
   2.448 +*/
   2.449 +    IOHIDOutputTransactionInterface ** (*allocOutputTransaction) (void *self);
   2.450 +    
   2.451 +} IOHIDDeviceInterface;
   2.452 +
   2.453 +/*! @class IOHIDDeviceInterface121
   2.454 +    @discussion CFPlugin object subclass which provides the primary interface to
   2.455 +                HID devices.  This class is a subclass of IOHIDDeviceInterface.
   2.456 +*/
   2.457 +typedef struct IOHIDDeviceInterface121
   2.458 +{
   2.459 +
   2.460 +    IUNKNOWN_C_GUTS;
   2.461 +    IOHIDDEVICEINTERFACE_FUNCS_100;
   2.462 +
   2.463 +/*! @function setReport
   2.464 +    @abstract Sends a report to the device.
   2.465 +    @param reportType The report type.
   2.466 +    @param reportID The report id.
   2.467 +    @param reportBuffer Pointer to a preallocated buffer.
   2.468 +    @param reportBufferSize Size of the reportBuffer in bytes.
   2.469 +    @param timeoutMS
   2.470 +    @param callback If null, this method will behave synchronously.
   2.471 +    @param callbackTarget The callback target passed to the callback.
   2.472 +    @param callbackRefcon The callback refcon passed to the callback. 
   2.473 +    @result Returns an IOReturn code.
   2.474 +*/
   2.475 +    IOReturn (*setReport)	(void * 			self,
   2.476 +                                IOHIDReportType			reportType,
   2.477 +                                UInt32				reportID,
   2.478 +                                void *				reportBuffer,
   2.479 +                                UInt32				reportBufferSize,
   2.480 +                                UInt32 				timeoutMS,
   2.481 +                                IOHIDReportCallbackFunction	callback,
   2.482 +                                void * 				callbackTarget,
   2.483 +                                void *				callbackRefcon);
   2.484 +
   2.485 +/*! @function getReport
   2.486 +    @abstract Obtains a report from the device.
   2.487 +    @param reportType The report type.
   2.488 +    @param reportID The report ID.
   2.489 +    @param reportBuffer Pointer to a preallocated buffer.
   2.490 +    @param reportBufferSize Size of the reportBuffer in bytes.  
   2.491 +        When finished, will contain the actual size of the report.
   2.492 +    @param timeoutMS
   2.493 +    @param callback If null, this method will behave synchronously.
   2.494 +    @param callbackTarget The callback target passed to the callback.
   2.495 +    @param callbackRefcon The callback refcon passed to the callback. 
   2.496 +    @result Returns an IOReturn code.
   2.497 +*/
   2.498 +    IOReturn (*getReport)	(void * 			self,
   2.499 +                                IOHIDReportType			reportType,
   2.500 +                                UInt32				reportID,
   2.501 +                                void *				reportBuffer,
   2.502 +                                UInt32 *			reportBufferSize,
   2.503 +                                UInt32 				timeoutMS,
   2.504 +                                IOHIDReportCallbackFunction	callback,
   2.505 +                                void * 				callbackTarget,
   2.506 +                                void *				callbackRefcon);
   2.507 +                                
   2.508 +}IOHIDDeviceInterface121;
   2.509 +
   2.510 +/*! @class IOHIDDeviceInterface122
   2.511 +    @discussion CFPlugin object subclass which provides the primary interface to
   2.512 +                HID devices.  This class is a subclass of IOHIDDeviceInterface121.
   2.513 +*/
   2.514 +typedef struct IOHIDDeviceInterface122
   2.515 +{
   2.516 +
   2.517 +    IUNKNOWN_C_GUTS;
   2.518 +    IOHIDDEVICEINTERFACE_FUNCS_100;
   2.519 +    IOHIDDEVICEINTERFACE_FUNCS_121;
   2.520 +
   2.521 +/*! @function copyMatchingElements
   2.522 +    @abstract Obtains specific elements defined by the device.
   2.523 +    @discussion Using keys defined in IOHIDKeys.h for elements, create a 
   2.524 +            matching dictonary containing items that you wish to search for.  
   2.525 +            A null array indicates that no elements matching that criteria 
   2.526 +            were found. Each item in the array is a reference to the same 
   2.527 +            dictionary item that represents each element in the I/O Registry.
   2.528 +            It is up to the caller to release the returned array of elements. 
   2.529 +    @param matchingDict Dictionary containg key/value pairs to match on.  Pass
   2.530 +            a null value to match on all elements.
   2.531 +    @param elements Pointer to a CFArrayRef that will be returned by this
   2.532 +            method.  It is up to the caller to release it when finished. 
   2.533 +    @result Returns an IOReturn code. 
   2.534 +*/
   2.535 +    IOReturn (*copyMatchingElements)(void * 			self, 
   2.536 +                                CFDictionaryRef 		matchingDict, 
   2.537 +                                CFArrayRef * 			elements);
   2.538 +                                
   2.539 +/*! @function setInterruptReportHandlerCallback
   2.540 +    @abstract Sets the report handler callout to be called when the data 
   2.541 +        is received from the Interrupt-In pipe.
   2.542 +    @discussion In order for this to work correctly, you must call
   2.543 +        createAsyncPort and createAsyncEventSource.
   2.544 +    @param reportBuffer Pointer to a preallocated buffer.
   2.545 +    @param reportBufferSize Size of the reportBuffer in bytes.  
   2.546 +    @param callback If non-NULL, is a callback to be called when data 
   2.547 +        is received from the device.
   2.548 +    @param callbackTarget The callback target passed to the callback
   2.549 +    @param callbackRefcon The callback refcon passed to the callback.
   2.550 +    @result Returns an IOReturn code. 
   2.551 +*/
   2.552 +    IOReturn (*setInterruptReportHandlerCallback)(
   2.553 +                            void * 				self,
   2.554 +                            void *				reportBuffer,
   2.555 +                            UInt32				reportBufferSize, 
   2.556 +                            IOHIDReportCallbackFunction 	callback,
   2.557 +                            void * 				callbackTarget, 
   2.558 +                            void * 				callbackRefcon);
   2.559 +    
   2.560 +}IOHIDDeviceInterface122;
   2.561 +
   2.562 +/*! @class IOHIDQueueInterface
   2.563 +    @discussion CFPlugin object subclass which provides an interface for input
   2.564 +                queues from HID devices. Created by an IOHIDDeviceInterface
   2.565 +                object.
   2.566 +*/
   2.567 +typedef struct IOHIDQueueInterface
   2.568 +{
   2.569 +
   2.570 +    IUNKNOWN_C_GUTS;
   2.571 +
   2.572 +/*! @function createAsyncEventSource
   2.573 +    @abstract Creates an async event source.
   2.574 +    @discussion This will be used with setEventCallout.
   2.575 +    @param source The newly created event source.
   2.576 +    @result Returns an IOReturn code. 
   2.577 +*/
   2.578 +    IOReturn (*createAsyncEventSource)(void * 			self, 
   2.579 +                                        CFRunLoopSourceRef * 	source);
   2.580 +
   2.581 +/*! @function getAsyncEventSource
   2.582 +    @abstract Obtains the current event source.
   2.583 +    @result Returns a CFRunLoopSourceRef.
   2.584 +*/
   2.585 +    CFRunLoopSourceRef (*getAsyncEventSource)(void * self);
   2.586 +
   2.587 +/*! @function createAsyncPort
   2.588 +    @abstract Creates an async port.
   2.589 +    @discussion This will be used with createAsyncEventSource.
   2.590 +    @param port The newly created async port.
   2.591 +    @result Returns an IOReturn code.
   2.592 +*/
   2.593 +    IOReturn (*createAsyncPort)(void * self, mach_port_t * port);
   2.594 +    
   2.595 +/*! @function getAsyncPort
   2.596 +    @abstract Obtains the current async port.
   2.597 +    @result Returns a mach_port_t.
   2.598 +*/
   2.599 +    mach_port_t (*getAsyncPort)(void * self);
   2.600 +    
   2.601 +/*! @function create
   2.602 +    @abstract Creates the current queue. 
   2.603 +    @param flags
   2.604 +    @param depth The maximum number of elements in the queue 
   2.605 +        before the oldest elements in the queue begin to be lost.
   2.606 +    @result Returns an IOReturn code. 
   2.607 +*/
   2.608 +    IOReturn (*create)(void * 			self, 
   2.609 +                        UInt32 			flags,
   2.610 +                        UInt32			depth);
   2.611 +
   2.612 +/*! @function create
   2.613 +    @abstract Disposes of the current queue. 
   2.614 +    @result Returns an IOReturn code. 
   2.615 +*/
   2.616 +    IOReturn (*dispose)(void * self);
   2.617 +    
   2.618 +/*! @function addElement
   2.619 +    @abstract Adds an element to the queue.
   2.620 +    @discussion If the element has already been added to queue,
   2.621 +        an error will be returned.
   2.622 +    @param elementCookie The element of interest. 
   2.623 +    @param flags 
   2.624 +    @result Returns an IOReturn code. 
   2.625 +*/
   2.626 +    IOReturn (*addElement)(void * self,
   2.627 +                           IOHIDElementCookie elementCookie,
   2.628 +                           UInt32 flags);
   2.629 +
   2.630 +/*! @function removeElement
   2.631 +    @abstract Removes an element from the queue.
   2.632 +    @discussion If the element has not been added to queue,
   2.633 +        an error will be returned.
   2.634 +    @param elementCookie The element of interest. 
   2.635 +    @result Returns an IOReturn code. 
   2.636 +*/
   2.637 +    IOReturn (*removeElement)(void * self, IOHIDElementCookie elementCookie);
   2.638 +    
   2.639 +/*! @function hasElement
   2.640 +    @abstract Checks whether an element has been added to 
   2.641 +        the queue.
   2.642 +    @discussion Will return true if present, otherwise will return false.
   2.643 +    @param elementCookie The element of interest. 
   2.644 +    @result Returns a Boolean value. 
   2.645 +*/
   2.646 +    Boolean (*hasElement)(void * self, IOHIDElementCookie elementCookie);
   2.647 +
   2.648 +/*! @function start
   2.649 +    @abstract Starts event delivery to the queue. 
   2.650 +    @result Returns an IOReturn code. 
   2.651 +*/
   2.652 +    IOReturn (*start)(void * self);
   2.653 +    
   2.654 +/*! @function stop
   2.655 +    @abstract Stops event delivery to the queue. 
   2.656 +    @result Returns an IOReturn code. 
   2.657 +*/
   2.658 +    IOReturn (*stop)(void * self);
   2.659 +
   2.660 +/*! @function getNextEvent
   2.661 +    @abstract Reads next event from the queue.
   2.662 +    @param event The event that will be filled.  If a long value is
   2.663 +        present, it is up to the caller to deallocate it.
   2.664 +    @param maxtime UNSUPPORTED.  If non-zero, limits read events to 
   2.665 +        those that occured on or before maxTime.
   2.666 +    @param timoutMS UNSUPPORTED.  The timeout in milliseconds, a zero  
   2.667 +        timeout will cause this call to be non-blocking (returning  
   2.668 +        queue empty) if there is a NULL callback, and blocking forever 
   2.669 +        until the queue is non-empty if there is a valid callback.
   2.670 +    @result Returns an IOReturn code. 
   2.671 +*/
   2.672 +    IOReturn (*getNextEvent)(void * 			self,
   2.673 +                            IOHIDEventStruct *		event,
   2.674 +                            AbsoluteTime		maxTime,
   2.675 +                            UInt32 			timeoutMS);
   2.676 +
   2.677 +/*! @function setEventCallout
   2.678 +    @abstract Sets the event callout to be called when the queue 
   2.679 +        transitions to non-empty.
   2.680 +    @discussion In order for this to work correctly, you must call
   2.681 +        createAsyncPort and createAsyncEventSource.
   2.682 +    @param callback if non-NULL is a callback to be called when data 
   2.683 +        is  inserted to the queue
   2.684 +    @param callbackTarget The callback target passed to the callback
   2.685 +    @param callbackRefcon The callback refcon passed to the callback.
   2.686 +    @result Returns an IOReturn code.
   2.687 +*/
   2.688 +    IOReturn (*setEventCallout)(void * 			self,
   2.689 +                                IOHIDCallbackFunction   callback,
   2.690 +                                void * 			callbackTarget,
   2.691 +                                void *			callbackRefcon);
   2.692 +
   2.693 +/*! @function getEventCallout
   2.694 +    @abstract Gets the event callout.
   2.695 +    @discussion This callback will be called the queue transitions
   2.696 +        to non-empty.
   2.697 +    @param callback if non-NULL is a callback to be called when data 
   2.698 +        is  inserted to the queue
   2.699 +    @param callbackTarget The callback target passed to the callback
   2.700 +    @param callbackRefcon The callback refcon passed to the callback 
   2.701 +    @result Returns an IOReturn code. 
   2.702 +*/
   2.703 +    IOReturn (*getEventCallout)(void * 			self,
   2.704 +                                IOHIDCallbackFunction * outCallback,
   2.705 +                                void ** 		outCallbackTarget,
   2.706 +                                void **			outCallbackRefcon);
   2.707 +} IOHIDQueueInterface;
   2.708 +
   2.709 +/*! @class IOHIDOutputTransactionInterface
   2.710 +    @discussion CFPlugin object subclass which privides interface for output
   2.711 +                transactions to HID devices. Created by a IOHIDDeviceInterface
   2.712 +                object. */
   2.713 +
   2.714 +typedef struct IOHIDOutputTransactionInterface
   2.715 +{
   2.716 +    IUNKNOWN_C_GUTS;
   2.717 +                    
   2.718 +/*! @function createAsyncEventSource
   2.719 +    @abstract Creates an async event source.
   2.720 +    @discussion This will be used with setEventCallout.
   2.721 +    @param source The newly created event source 
   2.722 +    @result Returns an IOReturn code. 
   2.723 +*/
   2.724 +    IOReturn (*createAsyncEventSource)(void * 			self, 
   2.725 +                                        CFRunLoopSourceRef * 	source);
   2.726 +
   2.727 +/*! @function getAsyncEventSource
   2.728 +    @abstract Obtains the current event source.
   2.729 +    @result Returns a CFRunLoopSourceRef.
   2.730 +*/
   2.731 +    CFRunLoopSourceRef (*getAsyncEventSource)(void * self);
   2.732 +
   2.733 +/*! @function createAsyncPort
   2.734 +    @abstract Creates an async port.
   2.735 +    @discussion This will be used with createAsyncEventSource.
   2.736 +    @param port The newly created async port. 
   2.737 +    @result Returns an IOReturn code. 
   2.738 +*/
   2.739 +    IOReturn (*createAsyncPort)(void * self, mach_port_t * port);
   2.740 +    
   2.741 +/*! @function getAsyncPort
   2.742 +    @abstract Obtains the current async port. 
   2.743 +    @result Returns a mach_port_t.
   2.744 +*/
   2.745 +    mach_port_t (*getAsyncPort)(void * self);
   2.746 +    
   2.747 +/*! @function create
   2.748 +    @abstract Creates the current transaction.
   2.749 +    @discussion This method will free any memory that has been
   2.750 +        allocated for this transaction. 
   2.751 +    @result Returns an IOReturn code.
   2.752 +*/
   2.753 +    IOReturn (*create)(void * self);
   2.754 +    
   2.755 +/*! @function dispose
   2.756 +    @abstract Disposes of the current transaction.
   2.757 +    @discussion The transaction will have to be recreated, in order
   2.758 +        to perform any operations on the transaction. 
   2.759 +    @result Returns an IOReturn code. 
   2.760 +*/
   2.761 +    IOReturn (*dispose)(void * self);
   2.762 +    
   2.763 +/*! @function addElement
   2.764 +    @abstract Adds an element to the transaction.
   2.765 +    @discussion If the element has already been added to transaction,
   2.766 +        an error will be returned.
   2.767 +    @param elementCookie The element of interest.
   2.768 +    @result Returns an IOReturn code. 
   2.769 +*/
   2.770 +    IOReturn (*addElement)	(void * self, IOHIDElementCookie elementCookie);
   2.771 +    
   2.772 +/*! @function removeElement
   2.773 +    @abstract Removes an element from the transaction.
   2.774 +    @discussion If the element has not been added to transaction,
   2.775 +        an error will be returned.
   2.776 +    @param elementCookie The element of interest. 
   2.777 +    @result Returns an IOReturn code.
   2.778 +*/
   2.779 +    IOReturn (*removeElement)	(void * self, IOHIDElementCookie elementCookie);
   2.780 +    
   2.781 +/*! @function hasElement
   2.782 +    @abstract Checks whether an element has been added to 
   2.783 +        the transaction.
   2.784 +    @discussion Will return true if present, otherwise will return false.
   2.785 +    @param elementCookie The element of interest. 
   2.786 +    @result Returns a Boolean value. 
   2.787 +*/
   2.788 +    Boolean  (*hasElement)	(void * self, IOHIDElementCookie elementCookie);
   2.789 +    
   2.790 +/*! @function setElementDefault
   2.791 +    @abstract Sets the default value of an element in a 
   2.792 +        transaction.
   2.793 +    @discussion An error will be returned if the element has not been
   2.794 +        added to the transaction.
   2.795 +    @param elementCookie The element of interest. 
   2.796 +    @param valueEvent The event that will be filled.  If a long value is
   2.797 +        present, it will be copied. 
   2.798 +    @result Returns an IOReturn code. 
   2.799 +*/
   2.800 +    IOReturn (*setElementDefault)(void *	 	self,
   2.801 +                                    IOHIDElementCookie	elementCookie,
   2.802 +                                    IOHIDEventStruct *	valueEvent);
   2.803 +    
   2.804 +/*! @function getElementDefault
   2.805 +    @abstract Obtains the default value of an element in a 
   2.806 +        transaction.
   2.807 +    @discussion An error will be returned if the element has not been 
   2.808 +        added to the transaction.
   2.809 +    @param elementCookie The element of interest. 
   2.810 +    @param outValueEvent The event that will be filled.  If a long value is 
   2.811 +        present, it is up to the caller to deallocate it. 
   2.812 +    @result Returns an IOReturn code.
   2.813 +*/
   2.814 +    IOReturn (*getElementDefault)(void *	 	self,
   2.815 +                                    IOHIDElementCookie	elementCookie,
   2.816 +                                    IOHIDEventStruct *	outValueEvent);
   2.817 +    
   2.818 +/*! @function setElementValue
   2.819 +    @abstract Sets the value of an element in a transaction.
   2.820 +    @discussion An error will be returned if the element has not been
   2.821 +        added to the transaction.
   2.822 +    @param elementCookie The element of interest. 
   2.823 +    @param valueEvent The event that will be filled.  If a long value is
   2.824 +        present, it will be copied.
   2.825 +    @result Returns an IOReturn code. 
   2.826 +*/
   2.827 +    IOReturn (*setElementValue)(void *	 		self,
   2.828 +                                IOHIDElementCookie	elementCookie,
   2.829 +                                IOHIDEventStruct *	valueEvent);
   2.830 +    
   2.831 +/*! @function getElementValue
   2.832 +    @abstract Obtains the value of an element in a transaction.
   2.833 +    @discussion An error will be returned if the element has not been 
   2.834 +        added to the transaction.
   2.835 +    @param elementCookie The element of interest. 
   2.836 +    @param outValueEvent The event that will be filled.  If a long value is 
   2.837 +        present, it is up to the caller to deallocate it. 
   2.838 +    @result Returns an IOReturn code.
   2.839 +*/
   2.840 +    IOReturn (*getElementValue)(void *	 		self,
   2.841 +                                IOHIDElementCookie	elementCookie,
   2.842 +                                IOHIDEventStruct *	outValueEvent);
   2.843 +    
   2.844 +/*! @function commit
   2.845 +    @abstract Commits the transaction.
   2.846 +    @discussion Transaction element values, if set, will be sent to the 
   2.847 +        device.  Otherwise, the default element value will be used.  If
   2.848 +        neither are set, that element will be omitted from the commit.
   2.849 +        After a transaction is committed, transaction element values 
   2.850 +        will be cleared.  Default values will be preserved.
   2.851 +    @param timeoutMS UNSUPPORTED
   2.852 +    @param callback UNSUPPORTED
   2.853 +    @param callbackTarget UNSUPPORTED
   2.854 +    @param callbackRefcon UNSUPPORTED 
   2.855 +    @result Returns an IOReturn code.
   2.856 +*/
   2.857 +    IOReturn (*commit)(void * 			self,
   2.858 +                        UInt32 			timeoutMS,
   2.859 +                        IOHIDCallbackFunction   callback,
   2.860 +                        void * 			callbackTarget,
   2.861 +                        void *			callbackRefcon);
   2.862 +    
   2.863 +/*! @function clear
   2.864 +    @abstract Clears the transaction.
   2.865 +    @discussion Transaction element values will cleared.   Default 
   2.866 +        values will be preserved. 
   2.867 +    @result Returns an IOReturn code. 
   2.868 +*/
   2.869 +    IOReturn (*clear)(void * self);
   2.870 +} IOHIDOutputTransactionInterface;
   2.871 +
   2.872 +#endif
   2.873 +
   2.874 +__END_DECLS
   2.875 +
   2.876 +#endif /* !_IOKIT_HID_IOHIDLIB_H_ */
     3.1 --- a/src/joystick/darwin/SDL_sysjoystick.c	Tue May 29 12:14:16 2007 +0000
     3.2 +++ b/src/joystick/darwin/SDL_sysjoystick.c	Thu May 31 14:46:01 2007 +0000
     3.3 @@ -39,7 +39,11 @@
     3.4  /* The header was moved here in Mac OS X 10.1 */
     3.5  #include <Kernel/IOKit/hidsystem/IOHIDUsageTables.h>
     3.6  #endif
     3.7 +#if MAC_OS_X_VERSION_MIN_REQUIRED == 1030
     3.8 +#include "10.3.9-FIX/IOHIDLib.h"
     3.9 +#else
    3.10  #include <IOKit/hid/IOHIDLib.h>
    3.11 +#endif
    3.12  #include <IOKit/hid/IOHIDKeys.h>
    3.13  #include <CoreFoundation/CoreFoundation.h>
    3.14  #include <Carbon/Carbon.h>      /* for NewPtrClear, DisposePtr */