Remove src/joystick/darwin/10.3.9-FIX dir.
The license on IOHIDLib.h says we have to distribute a copy of the APSL with
every copy of SDL, and include a "prominent notice" in the documentation, and
that's annoying for something that's only there because Apple forgot to copy
a file in an ancient SDK.
1.1 --- a/src/joystick/darwin/10.3.9-FIX/IOHIDLib.h Sun Aug 21 09:26:56 2011 -0400
1.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
1.3 @@ -1,874 +0,0 @@
1.4 -/* *INDENT-OFF* */
1.5 -/*
1.6 - *
1.7 - * @APPLE_LICENSE_HEADER_START@
1.8 - *
1.9 - * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved.
1.10 - *
1.11 - * This file contains Original Code and/or Modifications of Original Code
1.12 - * as defined in and that are subject to the Apple Public Source License
1.13 - * Version 2.0 (the 'License'). You may not use this file except in
1.14 - * compliance with the License. Please obtain a copy of the License at
1.15 - * http://www.opensource.apple.com/apsl/ and read it before using this
1.16 - * file.
1.17 - *
1.18 - * The Original Code and all software distributed under the License are
1.19 - * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
1.20 - * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
1.21 - * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
1.22 - * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
1.23 - * Please see the License for the specific language governing rights and
1.24 - * limitations under the License.
1.25 - *
1.26 - * @APPLE_LICENSE_HEADER_END@
1.27 - */
1.28 -
1.29 -#ifndef _IOKIT_HID_IOHIDLIB_H_
1.30 -#define _IOKIT_HID_IOHIDLIB_H_
1.31 -
1.32 -#include <sys/cdefs.h>
1.33 -
1.34 -__BEGIN_DECLS
1.35 -#include <CoreFoundation/CoreFoundation.h>
1.36 -#if COREFOUNDATION_CFPLUGINCOM_SEPARATE
1.37 -#include <CoreFoundation/CFPlugInCOM.h>
1.38 -#endif
1.39 -
1.40 -#include <IOKit/IOTypes.h>
1.41 -#include <IOKit/IOReturn.h>
1.42 -
1.43 -#include <IOKit/hid/IOHIDKeys.h>
1.44 -
1.45 -struct IOHIDEventStruct
1.46 -{
1.47 - IOHIDElementType type;
1.48 - IOHIDElementCookie elementCookie;
1.49 - SInt32 value;
1.50 - AbsoluteTime timestamp;
1.51 - UInt32 longValueSize;
1.52 - void * longValue;
1.53 -};
1.54 -typedef struct IOHIDEventStruct IOHIDEventStruct;
1.55 -
1.56 -/* FA12FA38-6F1A-11D4-BA0C-0005028F18D5 */
1.57 -#define kIOHIDDeviceUserClientTypeID CFUUIDGetConstantUUIDWithBytes(NULL, \
1.58 - 0xFA, 0x12, 0xFA, 0x38, 0x6F, 0x1A, 0x11, 0xD4, \
1.59 - 0xBA, 0x0C, 0x00, 0x05, 0x02, 0x8F, 0x18, 0xD5)
1.60 -
1.61 -/* 13AA9C44-6F1B-11D4-907C-0005028F18D5 */
1.62 -#define kIOHIDDeviceFactoryID CFUUIDGetConstantUUIDWithBytes(NULL, \
1.63 - 0x13, 0xAA, 0x9C, 0x44, 0x6F, 0x1B, 0x11, 0xD4, \
1.64 - 0x90, 0x7C, 0x00, 0x05, 0x02, 0x8F, 0x18, 0xD5)
1.65 -
1.66 -/* 78BD420C-6F14-11D4-9474-0005028F18D5 */
1.67 -/*! @defined kIOHIDDeviceInterfaceID
1.68 - @discussion Interface ID for the IOHIDDeviceInterface. Corresponds to an
1.69 - available HID device. */
1.70 -#define kIOHIDDeviceInterfaceID CFUUIDGetConstantUUIDWithBytes(NULL, \
1.71 - 0x78, 0xBD, 0x42, 0x0C, 0x6F, 0x14, 0x11, 0xD4, \
1.72 - 0x94, 0x74, 0x00, 0x05, 0x02, 0x8F, 0x18, 0xD5)
1.73 -
1.74 -/* 7D0B510E-16D5-11D7-9E9B-000393992E38 */
1.75 -/*! @defined kIOHIDDeviceInterfaceID121
1.76 - @discussion Interface ID for the IOHIDDeviceInterface121. Corresponds to
1.77 - an available HID device that includes methods from
1.78 - IOHIDDeviceInterface. This interface is available on
1.79 - IOHIDLib 1.2.1 and Mac OS X 10.2.3 or later.*/
1.80 -#define kIOHIDDeviceInterfaceID121 CFUUIDGetConstantUUIDWithBytes(NULL, \
1.81 - 0x7d, 0xb, 0x51, 0xe, 0x16, 0xd5, 0x11, 0xd7, \
1.82 - 0x9e, 0x9b, 0x0, 0x3, 0x93, 0x99, 0x2e, 0x38)
1.83 -
1.84 -/* B70ABF31-16D5-11D7-AB35-000393992E38 */
1.85 -/*! @defined kIOHIDDeviceInterfaceID122
1.86 - @discussion Interface ID for the IOHIDDeviceInterface122. Corresponds to
1.87 - an available HID device that includes methods from
1.88 - IOHIDDeviceInterface and IOHIDDeviceInterface121. This
1.89 - interface is available on IOHIDLib 1.2.2 and Mac OS X 10.3
1.90 - or later.*/
1.91 -#define kIOHIDDeviceInterfaceID122 CFUUIDGetConstantUUIDWithBytes(NULL, \
1.92 - 0xb7, 0xa, 0xbf, 0x31, 0x16, 0xd5, 0x11, 0xd7, \
1.93 - 0xab, 0x35, 0x0, 0x3, 0x93, 0x99, 0x2e, 0x38)
1.94 -
1.95 -/* 8138629E-6F14-11D4-970E-0005028F18D5 */
1.96 -/*! @defined kIOHIDQueueInterfaceID
1.97 - @discussion Interface ID for the kIOHIDQueueInterfaceID. Corresponds to a
1.98 - queue for a specific HID device. */
1.99 -#define kIOHIDQueueInterfaceID CFUUIDGetConstantUUIDWithBytes(NULL, \
1.100 - 0x81, 0x38, 0x62, 0x9E, 0x6F, 0x14, 0x11, 0xD4, \
1.101 - 0x97, 0x0E, 0x00, 0x05, 0x02, 0x8F, 0x18, 0xD5)
1.102 -
1.103 -/* 80CDCC00-755D-11D4-8E0F-0005028F18D5 */
1.104 -/*! @defined kIOHIDOutputTransactionInterfaceID
1.105 - @discussion Interface ID for the kIOHIDOutputTransactionInterfaceID.
1.106 - Corresponds to an output transaction for one or more report IDs
1.107 - on a specific device. */
1.108 -#define kIOHIDOutputTransactionInterfaceID CFUUIDGetConstantUUIDWithBytes(NULL,\
1.109 - 0x80, 0xCD, 0xCC, 0x00, 0x75, 0x5D, 0x11, 0xD4, \
1.110 - 0x80, 0xEF, 0x00, 0x05, 0x02, 0x8F, 0x18, 0xD5)
1.111 -
1.112 -/*! @typedef IOHIDCallbackFunction
1.113 - @discussion Type and arguments of callout C function that is used when a
1.114 - completion routine is called, see
1.115 - IOHIDLib.h:setRemovalCallback().
1.116 - @param target void * pointer to your data, often a pointer to an object.
1.117 - @param result Completion result of desired operation.
1.118 - @param refcon void * pointer to more data.
1.119 - @param sender Interface instance sending the completion routine.
1.120 -*/
1.121 -typedef void (*IOHIDCallbackFunction)
1.122 - (void * target, IOReturn result, void * refcon, void * sender);
1.123 -
1.124 -/*! @typedef IOHIDElementCallbackFunction
1.125 - @discussion Type and arguments of callout C function that is used when a
1.126 - completion routine is called, see IOHIDLib.h:setElementValue().
1.127 - @param target void * pointer to your data, often a pointer to an object.
1.128 - @param result Completion result of desired operation.
1.129 - @param refcon void * pointer to more data.
1.130 - @param sender Interface instance sending the completion routine.
1.131 - @param elementCookie Element within interface instance sending completion.
1.132 -*/
1.133 -typedef void (*IOHIDElementCallbackFunction)
1.134 - (void * target,
1.135 - IOReturn result,
1.136 - void * refcon,
1.137 - void * sender,
1.138 - IOHIDElementCookie elementCookie);
1.139 -
1.140 -/*! @typedef IOHIDReportCallbackFunction
1.141 - @discussion Type and arguments of callout C function that is used when a
1.142 - completion routine is called, see IOHIDLib.h:setReport().
1.143 - @param target void * pointer to your data, often a pointer to an object.
1.144 - @param result Completion result of desired operation.
1.145 - @param refcon void * pointer to more data.
1.146 - @param sender Interface instance sending the completion routine.
1.147 - @param bufferSize Size of the buffer received upon completion.
1.148 -*/
1.149 -typedef void (*IOHIDReportCallbackFunction)
1.150 - (void * target,
1.151 - IOReturn result,
1.152 - void * refcon,
1.153 - void * sender,
1.154 - UInt32 bufferSize);
1.155 -
1.156 -
1.157 -/* Forward declarations of the queue and output transaction interfaces */
1.158 -struct IOHIDQueueInterface;
1.159 -struct IOHIDOutputTransactionInterface;
1.160 -typedef struct IOHIDQueueInterface IOHIDQueueInterface;
1.161 -typedef struct IOHIDOutputTransactionInterface IOHIDOutputTransactionInterface;
1.162 -
1.163 -//
1.164 -// IOHIDDeviceInterface Functions available in version 1.0 (10.0) and higher of Mac OS X
1.165 -//
1.166 -#define IOHIDDEVICEINTERFACE_FUNCS_100 \
1.167 - IOReturn (*createAsyncEventSource)(void * self, CFRunLoopSourceRef * source); \
1.168 - CFRunLoopSourceRef (*getAsyncEventSource)(void * self); \
1.169 - IOReturn (*createAsyncPort)(void * self, mach_port_t * port); \
1.170 - mach_port_t (*getAsyncPort)(void * self); \
1.171 - IOReturn (*open)(void * self, UInt32 flags); \
1.172 - IOReturn (*close)(void * self); \
1.173 - IOReturn (*setRemovalCallback)(void * self, IOHIDCallbackFunction removalCallback, \
1.174 - void * removalTarget, void * removalRefcon); \
1.175 - IOReturn (*getElementValue)(void * self, IOHIDElementCookie elementCookie, \
1.176 - IOHIDEventStruct * valueEvent); \
1.177 - IOReturn (*setElementValue)(void * self, IOHIDElementCookie elementCookie, \
1.178 - IOHIDEventStruct * valueEvent, UInt32 timeoutMS, \
1.179 - IOHIDElementCallbackFunction callback, \
1.180 - void * callbackTarget, void * callbackRefcon); \
1.181 - IOReturn (*queryElementValue)(void * self, IOHIDElementCookie elementCookie, \
1.182 - IOHIDEventStruct * valueEvent, UInt32 timeoutMS, \
1.183 - IOHIDElementCallbackFunction callback, \
1.184 - void * callbackTarget, void * callbackRefcon); \
1.185 - IOReturn (*startAllQueues)(void * self); \
1.186 - IOReturn (*stopAllQueues)(void * self); \
1.187 - IOHIDQueueInterface ** (*allocQueue) (void *self); \
1.188 - IOHIDOutputTransactionInterface ** (*allocOutputTransaction) (void *self)
1.189 -
1.190 -//
1.191 -// IOHIDDeviceInterface Functions available in version 1.2.1 (10.2.3) and higher of Mac OS X
1.192 -//
1.193 -#define IOHIDDEVICEINTERFACE_FUNCS_121 \
1.194 - IOReturn (*setReport)(void * self, IOHIDReportType reportType, UInt32 reportID, \
1.195 - void * reportBuffer, UInt32 reportBufferSize, \
1.196 - UInt32 timeoutMS, IOHIDReportCallbackFunction callback, \
1.197 - void * callbackTarget, void * callbackRefcon); \
1.198 - IOReturn (*getReport)(void * self, IOHIDReportType reportType, \
1.199 - UInt32 reportID, void * reportBuffer, \
1.200 - UInt32 * reportBufferSize, UInt32 timeoutMS, \
1.201 - IOHIDReportCallbackFunction callback, \
1.202 - void * callbackTarget, void * callbackRefcon)
1.203 -
1.204 -//
1.205 -// IOHIDDeviceInterface Functions available in version 1.2.2 (10.3) and higher of Mac OS X
1.206 -//
1.207 -#define IOHIDDEVICEINTERFACE_FUNCS_122 \
1.208 - IOReturn (*copyMatchingElements)(void * self, CFDictionaryRef matchingDict, \
1.209 - CFArrayRef * elements); \
1.210 - IOReturn (*setInterruptReportHandlerCallback)(void * self, void * reportBuffer, \
1.211 - UInt32 reportBufferSize, \
1.212 - IOHIDReportCallbackFunction callback, \
1.213 - void * callbackTarget, void * callbackRefcon)
1.214 -
1.215 -typedef struct IOHIDDeviceInterface
1.216 -{
1.217 - IUNKNOWN_C_GUTS;
1.218 - IOHIDDEVICEINTERFACE_FUNCS_100;
1.219 - IOHIDDEVICEINTERFACE_FUNCS_121;
1.220 -} IOHIDDeviceInterface;
1.221 -
1.222 -typedef struct IOHIDDeviceInterface121
1.223 -{
1.224 - IUNKNOWN_C_GUTS;
1.225 - IOHIDDEVICEINTERFACE_FUNCS_100;
1.226 - IOHIDDEVICEINTERFACE_FUNCS_121;
1.227 -} IOHIDDeviceInterface121;
1.228 -
1.229 -typedef struct IOHIDDeviceInterface122
1.230 -{
1.231 - IUNKNOWN_C_GUTS;
1.232 - IOHIDDEVICEINTERFACE_FUNCS_100;
1.233 - IOHIDDEVICEINTERFACE_FUNCS_121;
1.234 - IOHIDDEVICEINTERFACE_FUNCS_122;
1.235 -} IOHIDDeviceInterface122;
1.236 -
1.237 -
1.238 -//
1.239 -// IOHIDQueueInterface Functions available in version 1.0 (10.0) and higher of Mac OS X
1.240 -//
1.241 -#define IOHIDQUEUEINTERFACE_FUNCS_100 \
1.242 - IOReturn (*createAsyncEventSource)(void * self, CFRunLoopSourceRef * source); \
1.243 - CFRunLoopSourceRef (*getAsyncEventSource)(void * self); \
1.244 - IOReturn (*createAsyncPort)(void * self, mach_port_t * port); \
1.245 - mach_port_t (*getAsyncPort)(void * self); \
1.246 - IOReturn (*create)(void * self, UInt32 flags, UInt32 depth); \
1.247 - IOReturn (*dispose)(void * self); \
1.248 - IOReturn (*addElement)(void * self, IOHIDElementCookie elementCookie, UInt32 flags);\
1.249 - IOReturn (*removeElement)(void * self, IOHIDElementCookie elementCookie); \
1.250 - Boolean (*hasElement)(void * self, IOHIDElementCookie elementCookie); \
1.251 - IOReturn (*start)(void * self); \
1.252 - IOReturn (*stop)(void * self); \
1.253 - IOReturn (*getNextEvent)(void * self, IOHIDEventStruct * event, \
1.254 - AbsoluteTime maxTime, UInt32 timeoutMS); \
1.255 - IOReturn (*setEventCallout)(void * self, IOHIDCallbackFunction callback, \
1.256 - void * callbackTarget, void * callbackRefcon); \
1.257 - IOReturn (*getEventCallout)(void * self, IOHIDCallbackFunction * outCallback, \
1.258 - void ** outCallbackTarget, void ** outCallbackRefcon)
1.259 -
1.260 -struct IOHIDQueueInterface
1.261 -{
1.262 - IUNKNOWN_C_GUTS;
1.263 - IOHIDQUEUEINTERFACE_FUNCS_100;
1.264 -};
1.265 -
1.266 -//
1.267 -// IOHIDOutputTransactionInterface Functions available in version 1.2 (10.2) and higher of Mac OS X
1.268 -//
1.269 -#define IOHIDOUTPUTTRANSACTIONINTERFACE_FUNCS_120 \
1.270 - IOReturn (*createAsyncEventSource)(void * self, CFRunLoopSourceRef * source); \
1.271 - CFRunLoopSourceRef (*getAsyncEventSource)(void * self); \
1.272 - IOReturn (*createAsyncPort)(void * self, mach_port_t * port); \
1.273 - mach_port_t (*getAsyncPort)(void * self); \
1.274 - IOReturn (*create)(void * self); \
1.275 - IOReturn (*dispose)(void * self); \
1.276 - IOReturn (*addElement)(void * self, IOHIDElementCookie elementCookie); \
1.277 - IOReturn (*removeElement)(void * self, IOHIDElementCookie elementCookie); \
1.278 - Boolean (*hasElement)(void * self, IOHIDElementCookie elementCookie); \
1.279 - IOReturn (*setElementDefault)(void *self, IOHIDElementCookie elementCookie, \
1.280 - IOHIDEventStruct * valueEvent); \
1.281 - IOReturn (*getElementDefault)(void * self, IOHIDElementCookie elementCookie, \
1.282 - IOHIDEventStruct * outValueEvent); \
1.283 - IOReturn (*setElementValue)(void * self, IOHIDElementCookie elementCookie, \
1.284 - IOHIDEventStruct * valueEvent); \
1.285 - IOReturn (*getElementValue)(void * self, IOHIDElementCookie elementCookie, \
1.286 - IOHIDEventStruct * outValueEvent); \
1.287 - IOReturn (*commit)(void * self, UInt32 timeoutMS, IOHIDCallbackFunction callback, \
1.288 - void * callbackTarget, void * callbackRefcon); \
1.289 - IOReturn (*clear)(void * self)
1.290 -
1.291 -struct IOHIDOutputTransactionInterface
1.292 -{
1.293 - IUNKNOWN_C_GUTS;
1.294 - IOHIDOUTPUTTRANSACTIONINTERFACE_FUNCS_120;
1.295 -};
1.296 -
1.297 -
1.298 -//
1.299 -// BEGIN READABLE STRUCTURE DEFINITIONS
1.300 -//
1.301 -// This portion of uncompiled code provides a more reader friendly representation of
1.302 -// the CFPlugin methods defined above.
1.303 -
1.304 -#if 0
1.305 -/*! @class IOHIDDeviceInterface
1.306 - @discussion CFPlugin object subclass which provides the primary interface to
1.307 - HID devices.
1.308 -*/
1.309 -typedef struct IOHIDDeviceInterface
1.310 -{
1.311 -
1.312 - IUNKNOWN_C_GUTS;
1.313 -
1.314 -/*! @function createAsyncEventSource
1.315 - @abstract Creates async eventsource.
1.316 - @discussion This method will create an async mach port, if one
1.317 - has not already been created.
1.318 - @param source Reference to CFRunLoopSourceRef that is created.
1.319 - @result Returns an IOReturn code.
1.320 -*/
1.321 - IOReturn (*createAsyncEventSource)(void * self,
1.322 - CFRunLoopSourceRef * source);
1.323 -
1.324 -/*! @function getAsyncEventSource
1.325 - @abstract Gets the created async event source.
1.326 - @result Returns a CFRunLoopSourceRef.
1.327 -*/
1.328 - CFRunLoopSourceRef (*getAsyncEventSource)(void * self);
1.329 -
1.330 -/*! @function createAsyncPort
1.331 - @abstract Creates an async port.
1.332 - @discussion The port must be created before any callbacks can be used.
1.333 - @param port Reference to mach port that is created.
1.334 - @result Returns an IOReturn code.
1.335 -*/
1.336 - IOReturn (*createAsyncPort)(void * self, mach_port_t * port);
1.337 -
1.338 -/*! @function getAsyncPort
1.339 - @abstract Gets the current async port.
1.340 - @result Returns a mach_port_t.
1.341 -*/
1.342 - mach_port_t (*getAsyncPort)(void * self);
1.343 -
1.344 -/*! @function open
1.345 - @abstract Opens the device.
1.346 - @param flags Flags to be passed down to the user client.
1.347 - @result Returns an IOReturn code.
1.348 -*/
1.349 - IOReturn (*open)(void * self, UInt32 flags);
1.350 -
1.351 -/*! @function close
1.352 - @abstract Closes the device.
1.353 - @result Returns an IOReturn code.
1.354 -*/
1.355 - IOReturn (*close)(void * self);
1.356 -
1.357 -/*! @function setRemovalCallback
1.358 - @abstract Sets callback to be used when device is removed.
1.359 - @param removalCallback Called when the device is removed.
1.360 - @param removeTarget Passed to the callback.
1.361 - @param removalRefcon Passed to the callback.
1.362 - @result Returns an IOReturn code.
1.363 -*/
1.364 - IOReturn (*setRemovalCallback)(void * self,
1.365 - IOHIDCallbackFunction removalCallback,
1.366 - void * removalTarget,
1.367 - void * removalRefcon);
1.368 -
1.369 -/*! @function getElementValue
1.370 - @abstract Obtains the most recent value of an element.
1.371 - @discussion This call is most useful for interrupt driven elements,
1.372 - such as input type elements. Since feature type element values
1.373 - need to be polled from the device, it is recommended to use the
1.374 - queryElementValue method to obtain the current value. The
1.375 - timestamp field in the event details the last time the element
1.376 - value was altered.
1.377 - @param elementCookie The element of interest.
1.378 - @param valueEvent The event that will be filled. If a long value is
1.379 - present, it is up to the caller to deallocate it.
1.380 - @result Returns an IOReturn code.
1.381 -*/
1.382 - IOReturn (*getElementValue)(void * self,
1.383 - IOHIDElementCookie elementCookie,
1.384 - IOHIDEventStruct * valueEvent);
1.385 -
1.386 -/*! @function setElementValue
1.387 - @abstract Sets an element value on the device.
1.388 - @discussion This call is most useful for feature type elements. It is
1.389 - recommended to use IOOutputTransaction for output type elements.
1.390 - @param elementCookie The element of interest.
1.391 - @param valueEvent The event that will be filled. If a long value is
1.392 - present, it will be copied.
1.393 - @param timeoutMS UNSUPPORTED.
1.394 - @param callback UNSUPPORTED.
1.395 - @param callbackTarget UNSUPPORTED.
1.396 - @param callbackRefcon UNSUPPORTED.
1.397 - @result Returns an IOReturn code.
1.398 -*/
1.399 - IOReturn (*setElementValue)(void * self,
1.400 - IOHIDElementCookie elementCookie,
1.401 - IOHIDEventStruct * valueEvent,
1.402 - UInt32 timeoutMS,
1.403 - IOHIDElementCallbackFunction callback,
1.404 - void * callbackTarget,
1.405 - void * callbackRefcon);
1.406 -
1.407 -/*! @function queryElementValue
1.408 - @abstract Obtains the current value of an element.
1.409 - @discussion This call is most useful for feature type elements. This
1.410 - method will poll the device for the current element value.
1.411 - @param elementCookie The element of interest.
1.412 - @param valueEvent The event that will be filled. If a long value is
1.413 - present, it is up to the caller to deallocate it.
1.414 - @param timeoutMS UNSUPPORTED.
1.415 - @param callback UNSUPPORTED.
1.416 - @param callbackTarget UNSUPPORTED.
1.417 - @param callbackRefcon UNSUPPORTED.
1.418 - @result Returns an IOReturn code.
1.419 -*/
1.420 - IOReturn (*queryElementValue)(void * self,
1.421 - IOHIDElementCookie elementCookie,
1.422 - IOHIDEventStruct * valueEvent,
1.423 - UInt32 timeoutMS,
1.424 - IOHIDElementCallbackFunction callback,
1.425 - void * callbackTarget,
1.426 - void * callbackRefcon);
1.427 -
1.428 -/*! @function startAllQueues
1.429 - @abstract Starts data delivery on all queues for this device.
1.430 - @result Returns an IOReturn code.
1.431 -*/
1.432 - IOReturn (*startAllQueues)(void * self);
1.433 -
1.434 -/*! @function stopAllQueues
1.435 - @abstract Stops data delivery on all queues for this device.
1.436 - @result Returns an IOReturn code.
1.437 -*/
1.438 - IOReturn (*stopAllQueues)(void * self);
1.439 -
1.440 -/*! @function allocQueue
1.441 - @abstract Wrapper to return instances of the IOHIDQueueInterface.
1.442 - @result Returns the created IOHIDQueueInterface.
1.443 -*/
1.444 - IOHIDQueueInterface ** (*allocQueue) (void *self);
1.445 -
1.446 -/*! @function allocOutputTransaction
1.447 - @abstract Wrapper to return instances of the IOHIDOutputTransactionInterface.
1.448 - @result Returns the created IOHIDOutputTransactionInterface.
1.449 -*/
1.450 - IOHIDOutputTransactionInterface ** (*allocOutputTransaction) (void *self);
1.451 -
1.452 -} IOHIDDeviceInterface;
1.453 -
1.454 -/*! @class IOHIDDeviceInterface121
1.455 - @discussion CFPlugin object subclass which provides the primary interface to
1.456 - HID devices. This class is a subclass of IOHIDDeviceInterface.
1.457 -*/
1.458 -typedef struct IOHIDDeviceInterface121
1.459 -{
1.460 -
1.461 - IUNKNOWN_C_GUTS;
1.462 - IOHIDDEVICEINTERFACE_FUNCS_100;
1.463 -
1.464 -/*! @function setReport
1.465 - @abstract Sends a report to the device.
1.466 - @param reportType The report type.
1.467 - @param reportID The report id.
1.468 - @param reportBuffer Pointer to a preallocated buffer.
1.469 - @param reportBufferSize Size of the reportBuffer in bytes.
1.470 - @param timeoutMS
1.471 - @param callback If null, this method will behave synchronously.
1.472 - @param callbackTarget The callback target passed to the callback.
1.473 - @param callbackRefcon The callback refcon passed to the callback.
1.474 - @result Returns an IOReturn code.
1.475 -*/
1.476 - IOReturn (*setReport) (void * self,
1.477 - IOHIDReportType reportType,
1.478 - UInt32 reportID,
1.479 - void * reportBuffer,
1.480 - UInt32 reportBufferSize,
1.481 - UInt32 timeoutMS,
1.482 - IOHIDReportCallbackFunction callback,
1.483 - void * callbackTarget,
1.484 - void * callbackRefcon);
1.485 -
1.486 -/*! @function getReport
1.487 - @abstract Obtains a report from the device.
1.488 - @param reportType The report type.
1.489 - @param reportID The report ID.
1.490 - @param reportBuffer Pointer to a preallocated buffer.
1.491 - @param reportBufferSize Size of the reportBuffer in bytes.
1.492 - When finished, will contain the actual size of the report.
1.493 - @param timeoutMS
1.494 - @param callback If null, this method will behave synchronously.
1.495 - @param callbackTarget The callback target passed to the callback.
1.496 - @param callbackRefcon The callback refcon passed to the callback.
1.497 - @result Returns an IOReturn code.
1.498 -*/
1.499 - IOReturn (*getReport) (void * self,
1.500 - IOHIDReportType reportType,
1.501 - UInt32 reportID,
1.502 - void * reportBuffer,
1.503 - UInt32 * reportBufferSize,
1.504 - UInt32 timeoutMS,
1.505 - IOHIDReportCallbackFunction callback,
1.506 - void * callbackTarget,
1.507 - void * callbackRefcon);
1.508 -
1.509 -}IOHIDDeviceInterface121;
1.510 -
1.511 -/*! @class IOHIDDeviceInterface122
1.512 - @discussion CFPlugin object subclass which provides the primary interface to
1.513 - HID devices. This class is a subclass of IOHIDDeviceInterface121.
1.514 -*/
1.515 -typedef struct IOHIDDeviceInterface122
1.516 -{
1.517 -
1.518 - IUNKNOWN_C_GUTS;
1.519 - IOHIDDEVICEINTERFACE_FUNCS_100;
1.520 - IOHIDDEVICEINTERFACE_FUNCS_121;
1.521 -
1.522 -/*! @function copyMatchingElements
1.523 - @abstract Obtains specific elements defined by the device.
1.524 - @discussion Using keys defined in IOHIDKeys.h for elements, create a
1.525 - matching dictonary containing items that you wish to search for.
1.526 - A null array indicates that no elements matching that criteria
1.527 - were found. Each item in the array is a reference to the same
1.528 - dictionary item that represents each element in the I/O Registry.
1.529 - It is up to the caller to release the returned array of elements.
1.530 - @param matchingDict Dictionary containg key/value pairs to match on. Pass
1.531 - a null value to match on all elements.
1.532 - @param elements Pointer to a CFArrayRef that will be returned by this
1.533 - method. It is up to the caller to release it when finished.
1.534 - @result Returns an IOReturn code.
1.535 -*/
1.536 - IOReturn (*copyMatchingElements)(void * self,
1.537 - CFDictionaryRef matchingDict,
1.538 - CFArrayRef * elements);
1.539 -
1.540 -/*! @function setInterruptReportHandlerCallback
1.541 - @abstract Sets the report handler callout to be called when the data
1.542 - is received from the Interrupt-In pipe.
1.543 - @discussion In order for this to work correctly, you must call
1.544 - createAsyncPort and createAsyncEventSource.
1.545 - @param reportBuffer Pointer to a preallocated buffer.
1.546 - @param reportBufferSize Size of the reportBuffer in bytes.
1.547 - @param callback If non-NULL, is a callback to be called when data
1.548 - is received from the device.
1.549 - @param callbackTarget The callback target passed to the callback
1.550 - @param callbackRefcon The callback refcon passed to the callback.
1.551 - @result Returns an IOReturn code.
1.552 -*/
1.553 - IOReturn (*setInterruptReportHandlerCallback)(
1.554 - void * self,
1.555 - void * reportBuffer,
1.556 - UInt32 reportBufferSize,
1.557 - IOHIDReportCallbackFunction callback,
1.558 - void * callbackTarget,
1.559 - void * callbackRefcon);
1.560 -
1.561 -}IOHIDDeviceInterface122;
1.562 -
1.563 -/*! @class IOHIDQueueInterface
1.564 - @discussion CFPlugin object subclass which provides an interface for input
1.565 - queues from HID devices. Created by an IOHIDDeviceInterface
1.566 - object.
1.567 -*/
1.568 -typedef struct IOHIDQueueInterface
1.569 -{
1.570 -
1.571 - IUNKNOWN_C_GUTS;
1.572 -
1.573 -/*! @function createAsyncEventSource
1.574 - @abstract Creates an async event source.
1.575 - @discussion This will be used with setEventCallout.
1.576 - @param source The newly created event source.
1.577 - @result Returns an IOReturn code.
1.578 -*/
1.579 - IOReturn (*createAsyncEventSource)(void * self,
1.580 - CFRunLoopSourceRef * source);
1.581 -
1.582 -/*! @function getAsyncEventSource
1.583 - @abstract Obtains the current event source.
1.584 - @result Returns a CFRunLoopSourceRef.
1.585 -*/
1.586 - CFRunLoopSourceRef (*getAsyncEventSource)(void * self);
1.587 -
1.588 -/*! @function createAsyncPort
1.589 - @abstract Creates an async port.
1.590 - @discussion This will be used with createAsyncEventSource.
1.591 - @param port The newly created async port.
1.592 - @result Returns an IOReturn code.
1.593 -*/
1.594 - IOReturn (*createAsyncPort)(void * self, mach_port_t * port);
1.595 -
1.596 -/*! @function getAsyncPort
1.597 - @abstract Obtains the current async port.
1.598 - @result Returns a mach_port_t.
1.599 -*/
1.600 - mach_port_t (*getAsyncPort)(void * self);
1.601 -
1.602 -/*! @function create
1.603 - @abstract Creates the current queue.
1.604 - @param flags
1.605 - @param depth The maximum number of elements in the queue
1.606 - before the oldest elements in the queue begin to be lost.
1.607 - @result Returns an IOReturn code.
1.608 -*/
1.609 - IOReturn (*create)(void * self,
1.610 - UInt32 flags,
1.611 - UInt32 depth);
1.612 -
1.613 -/*! @function create
1.614 - @abstract Disposes of the current queue.
1.615 - @result Returns an IOReturn code.
1.616 -*/
1.617 - IOReturn (*dispose)(void * self);
1.618 -
1.619 -/*! @function addElement
1.620 - @abstract Adds an element to the queue.
1.621 - @discussion If the element has already been added to queue,
1.622 - an error will be returned.
1.623 - @param elementCookie The element of interest.
1.624 - @param flags
1.625 - @result Returns an IOReturn code.
1.626 -*/
1.627 - IOReturn (*addElement)(void * self,
1.628 - IOHIDElementCookie elementCookie,
1.629 - UInt32 flags);
1.630 -
1.631 -/*! @function removeElement
1.632 - @abstract Removes an element from the queue.
1.633 - @discussion If the element has not been added to queue,
1.634 - an error will be returned.
1.635 - @param elementCookie The element of interest.
1.636 - @result Returns an IOReturn code.
1.637 -*/
1.638 - IOReturn (*removeElement)(void * self, IOHIDElementCookie elementCookie);
1.639 -
1.640 -/*! @function hasElement
1.641 - @abstract Checks whether an element has been added to
1.642 - the queue.
1.643 - @discussion Will return true if present, otherwise will return false.
1.644 - @param elementCookie The element of interest.
1.645 - @result Returns a Boolean value.
1.646 -*/
1.647 - Boolean (*hasElement)(void * self, IOHIDElementCookie elementCookie);
1.648 -
1.649 -/*! @function start
1.650 - @abstract Starts event delivery to the queue.
1.651 - @result Returns an IOReturn code.
1.652 -*/
1.653 - IOReturn (*start)(void * self);
1.654 -
1.655 -/*! @function stop
1.656 - @abstract Stops event delivery to the queue.
1.657 - @result Returns an IOReturn code.
1.658 -*/
1.659 - IOReturn (*stop)(void * self);
1.660 -
1.661 -/*! @function getNextEvent
1.662 - @abstract Reads next event from the queue.
1.663 - @param event The event that will be filled. If a long value is
1.664 - present, it is up to the caller to deallocate it.
1.665 - @param maxtime UNSUPPORTED. If non-zero, limits read events to
1.666 - those that occured on or before maxTime.
1.667 - @param timoutMS UNSUPPORTED. The timeout in milliseconds, a zero
1.668 - timeout will cause this call to be non-blocking (returning
1.669 - queue empty) if there is a NULL callback, and blocking forever
1.670 - until the queue is non-empty if there is a valid callback.
1.671 - @result Returns an IOReturn code.
1.672 -*/
1.673 - IOReturn (*getNextEvent)(void * self,
1.674 - IOHIDEventStruct * event,
1.675 - AbsoluteTime maxTime,
1.676 - UInt32 timeoutMS);
1.677 -
1.678 -/*! @function setEventCallout
1.679 - @abstract Sets the event callout to be called when the queue
1.680 - transitions to non-empty.
1.681 - @discussion In order for this to work correctly, you must call
1.682 - createAsyncPort and createAsyncEventSource.
1.683 - @param callback if non-NULL is a callback to be called when data
1.684 - is inserted to the queue
1.685 - @param callbackTarget The callback target passed to the callback
1.686 - @param callbackRefcon The callback refcon passed to the callback.
1.687 - @result Returns an IOReturn code.
1.688 -*/
1.689 - IOReturn (*setEventCallout)(void * self,
1.690 - IOHIDCallbackFunction callback,
1.691 - void * callbackTarget,
1.692 - void * callbackRefcon);
1.693 -
1.694 -/*! @function getEventCallout
1.695 - @abstract Gets the event callout.
1.696 - @discussion This callback will be called the queue transitions
1.697 - to non-empty.
1.698 - @param callback if non-NULL is a callback to be called when data
1.699 - is inserted to the queue
1.700 - @param callbackTarget The callback target passed to the callback
1.701 - @param callbackRefcon The callback refcon passed to the callback
1.702 - @result Returns an IOReturn code.
1.703 -*/
1.704 - IOReturn (*getEventCallout)(void * self,
1.705 - IOHIDCallbackFunction * outCallback,
1.706 - void ** outCallbackTarget,
1.707 - void ** outCallbackRefcon);
1.708 -} IOHIDQueueInterface;
1.709 -
1.710 -/*! @class IOHIDOutputTransactionInterface
1.711 - @discussion CFPlugin object subclass which privides interface for output
1.712 - transactions to HID devices. Created by a IOHIDDeviceInterface
1.713 - object. */
1.714 -
1.715 -typedef struct IOHIDOutputTransactionInterface
1.716 -{
1.717 - IUNKNOWN_C_GUTS;
1.718 -
1.719 -/*! @function createAsyncEventSource
1.720 - @abstract Creates an async event source.
1.721 - @discussion This will be used with setEventCallout.
1.722 - @param source The newly created event source
1.723 - @result Returns an IOReturn code.
1.724 -*/
1.725 - IOReturn (*createAsyncEventSource)(void * self,
1.726 - CFRunLoopSourceRef * source);
1.727 -
1.728 -/*! @function getAsyncEventSource
1.729 - @abstract Obtains the current event source.
1.730 - @result Returns a CFRunLoopSourceRef.
1.731 -*/
1.732 - CFRunLoopSourceRef (*getAsyncEventSource)(void * self);
1.733 -
1.734 -/*! @function createAsyncPort
1.735 - @abstract Creates an async port.
1.736 - @discussion This will be used with createAsyncEventSource.
1.737 - @param port The newly created async port.
1.738 - @result Returns an IOReturn code.
1.739 -*/
1.740 - IOReturn (*createAsyncPort)(void * self, mach_port_t * port);
1.741 -
1.742 -/*! @function getAsyncPort
1.743 - @abstract Obtains the current async port.
1.744 - @result Returns a mach_port_t.
1.745 -*/
1.746 - mach_port_t (*getAsyncPort)(void * self);
1.747 -
1.748 -/*! @function create
1.749 - @abstract Creates the current transaction.
1.750 - @discussion This method will free any memory that has been
1.751 - allocated for this transaction.
1.752 - @result Returns an IOReturn code.
1.753 -*/
1.754 - IOReturn (*create)(void * self);
1.755 -
1.756 -/*! @function dispose
1.757 - @abstract Disposes of the current transaction.
1.758 - @discussion The transaction will have to be recreated, in order
1.759 - to perform any operations on the transaction.
1.760 - @result Returns an IOReturn code.
1.761 -*/
1.762 - IOReturn (*dispose)(void * self);
1.763 -
1.764 -/*! @function addElement
1.765 - @abstract Adds an element to the transaction.
1.766 - @discussion If the element has already been added to transaction,
1.767 - an error will be returned.
1.768 - @param elementCookie The element of interest.
1.769 - @result Returns an IOReturn code.
1.770 -*/
1.771 - IOReturn (*addElement) (void * self, IOHIDElementCookie elementCookie);
1.772 -
1.773 -/*! @function removeElement
1.774 - @abstract Removes an element from the transaction.
1.775 - @discussion If the element has not been added to transaction,
1.776 - an error will be returned.
1.777 - @param elementCookie The element of interest.
1.778 - @result Returns an IOReturn code.
1.779 -*/
1.780 - IOReturn (*removeElement) (void * self, IOHIDElementCookie elementCookie);
1.781 -
1.782 -/*! @function hasElement
1.783 - @abstract Checks whether an element has been added to
1.784 - the transaction.
1.785 - @discussion Will return true if present, otherwise will return false.
1.786 - @param elementCookie The element of interest.
1.787 - @result Returns a Boolean value.
1.788 -*/
1.789 - Boolean (*hasElement) (void * self, IOHIDElementCookie elementCookie);
1.790 -
1.791 -/*! @function setElementDefault
1.792 - @abstract Sets the default value of an element in a
1.793 - transaction.
1.794 - @discussion An error will be returned if the element has not been
1.795 - added to the transaction.
1.796 - @param elementCookie The element of interest.
1.797 - @param valueEvent The event that will be filled. If a long value is
1.798 - present, it will be copied.
1.799 - @result Returns an IOReturn code.
1.800 -*/
1.801 - IOReturn (*setElementDefault)(void * self,
1.802 - IOHIDElementCookie elementCookie,
1.803 - IOHIDEventStruct * valueEvent);
1.804 -
1.805 -/*! @function getElementDefault
1.806 - @abstract Obtains the default value of an element in a
1.807 - transaction.
1.808 - @discussion An error will be returned if the element has not been
1.809 - added to the transaction.
1.810 - @param elementCookie The element of interest.
1.811 - @param outValueEvent The event that will be filled. If a long value is
1.812 - present, it is up to the caller to deallocate it.
1.813 - @result Returns an IOReturn code.
1.814 -*/
1.815 - IOReturn (*getElementDefault)(void * self,
1.816 - IOHIDElementCookie elementCookie,
1.817 - IOHIDEventStruct * outValueEvent);
1.818 -
1.819 -/*! @function setElementValue
1.820 - @abstract Sets the value of an element in a transaction.
1.821 - @discussion An error will be returned if the element has not been
1.822 - added to the transaction.
1.823 - @param elementCookie The element of interest.
1.824 - @param valueEvent The event that will be filled. If a long value is
1.825 - present, it will be copied.
1.826 - @result Returns an IOReturn code.
1.827 -*/
1.828 - IOReturn (*setElementValue)(void * self,
1.829 - IOHIDElementCookie elementCookie,
1.830 - IOHIDEventStruct * valueEvent);
1.831 -
1.832 -/*! @function getElementValue
1.833 - @abstract Obtains the value of an element in a transaction.
1.834 - @discussion An error will be returned if the element has not been
1.835 - added to the transaction.
1.836 - @param elementCookie The element of interest.
1.837 - @param outValueEvent The event that will be filled. If a long value is
1.838 - present, it is up to the caller to deallocate it.
1.839 - @result Returns an IOReturn code.
1.840 -*/
1.841 - IOReturn (*getElementValue)(void * self,
1.842 - IOHIDElementCookie elementCookie,
1.843 - IOHIDEventStruct * outValueEvent);
1.844 -
1.845 -/*! @function commit
1.846 - @abstract Commits the transaction.
1.847 - @discussion Transaction element values, if set, will be sent to the
1.848 - device. Otherwise, the default element value will be used. If
1.849 - neither are set, that element will be omitted from the commit.
1.850 - After a transaction is committed, transaction element values
1.851 - will be cleared. Default values will be preserved.
1.852 - @param timeoutMS UNSUPPORTED
1.853 - @param callback UNSUPPORTED
1.854 - @param callbackTarget UNSUPPORTED
1.855 - @param callbackRefcon UNSUPPORTED
1.856 - @result Returns an IOReturn code.
1.857 -*/
1.858 - IOReturn (*commit)(void * self,
1.859 - UInt32 timeoutMS,
1.860 - IOHIDCallbackFunction callback,
1.861 - void * callbackTarget,
1.862 - void * callbackRefcon);
1.863 -
1.864 -/*! @function clear
1.865 - @abstract Clears the transaction.
1.866 - @discussion Transaction element values will cleared. Default
1.867 - values will be preserved.
1.868 - @result Returns an IOReturn code.
1.869 -*/
1.870 - IOReturn (*clear)(void * self);
1.871 -} IOHIDOutputTransactionInterface;
1.872 -
1.873 -#endif
1.874 -
1.875 -__END_DECLS
1.876 -
1.877 -#endif /* !_IOKIT_HID_IOHIDLIB_H_ */
2.1 --- a/src/joystick/darwin/SDL_sysjoystick.c Sun Aug 21 09:26:56 2011 -0400
2.2 +++ b/src/joystick/darwin/SDL_sysjoystick.c Sun Aug 21 09:47:43 2011 -0400
2.3 @@ -39,11 +39,7 @@
2.4 /* The header was moved here in Mac OS X 10.1 */
2.5 #include <Kernel/IOKit/hidsystem/IOHIDUsageTables.h>
2.6 #endif
2.7 -#if MAC_OS_X_VERSION_MIN_REQUIRED == 1030
2.8 -#include "10.3.9-FIX/IOHIDLib.h"
2.9 -#else
2.10 #include <IOKit/hid/IOHIDLib.h>
2.11 -#endif
2.12 #include <IOKit/hid/IOHIDKeys.h>
2.13 #include <CoreFoundation/CoreFoundation.h>
2.14 #include <Carbon/Carbon.h> /* for NewPtrClear, DisposePtr */