2 // File: HID_Name_Lookup.h
4 // Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple Inc. ("Apple")
5 // in consideration of your agreement to the following terms, and your use,
6 // installation, modification or redistribution of this Apple software
7 // constitutes acceptance of these terms. If you do not agree with these
8 // terms, please do not use, install, modify or redistribute this Apple
11 // In consideration of your agreement to abide by the following terms, and
12 // subject to these terms, Apple grants you a personal, non - exclusive
13 // license, under Apple's copyrights in this original Apple software ( the
14 // "Apple Software" ), to use, reproduce, modify and redistribute the Apple
15 // Software, with or without modifications, in source and / or binary forms;
16 // provided that if you redistribute the Apple Software in its entirety and
17 // without modifications, you must retain this notice and the following text
18 // and disclaimers in all such redistributions of the Apple Software. Neither
19 // the name, trademarks, service marks or logos of Apple Inc. may be used to
20 // endorse or promote products derived from the Apple Software without specific
21 // prior written permission from Apple. Except as expressly stated in this
22 // notice, no other rights or licenses, express or implied, are granted by
23 // Apple herein, including but not limited to any patent rights that may be
24 // infringed by your derivative works or by other works in which the Apple
25 // Software may be incorporated.
27 // The Apple Software is provided by Apple on an "AS IS" basis. APPLE MAKES NO
28 // WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED
29 // WARRANTIES OF NON - INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A
30 // PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND OPERATION
31 // ALONE OR IN COMBINATION WITH YOUR PRODUCTS.
33 // IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR
34 // CONSEQUENTIAL DAMAGES ( INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
35 // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
36 // INTERRUPTION ) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, MODIFICATION
37 // AND / OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED AND WHETHER
38 // UNDER THEORY OF CONTRACT, TORT ( INCLUDING NEGLIGENCE ), STRICT LIABILITY OR
39 // OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
41 // Copyright ( C ) 2002-2008 Apple Inc. All Rights Reserved.
44 #ifndef _HID_Name_Lookup_h_
45 #define _HID_Name_Lookup_h_
47 /*****************************************************/
48 #pragma mark - includes & imports
50 #include "HID_Utilities_External.h"
52 /*****************************************************/
65 #if PRAGMA_STRUCT_ALIGN
66 #pragma options align = mac68k
67 #elif PRAGMA_STRUCT_PACKPUSH
68 #pragma pack( push, 2 )
69 #elif PRAGMA_STRUCT_PACK
73 /*****************************************************/
74 #pragma mark - typedef's, struct's, enums, defines, etc.
75 // Notes: Now that as the device data has now been moved into external .XML files these
76 // constansts should no longer be used. They will eventually be eliminated from this header.
78 #define kMicrosoft 1118
79 #define kSideWinderFFB2 27
81 #define kLogitech 1133
82 #define kWingManStrikeForce3D 49797
86 #define kiShockIIFFB 16416
88 #define kMacsense 1635
89 #define kFunPadF107 38916
91 /*****************************************************/
92 #pragma mark - exported globals
94 /*****************************************************/
95 #pragma mark - exported function prototypes
97 // get vendor name from vendor ID
98 extern Boolean
HIDGetVendorNameFromVendorID( long inVendorID
, char * outCStrName
);
100 // get product name from vendor/product ID
101 extern Boolean
HIDGetProductNameFromVendorProductID( long inVendorID
, long inProductID
, char * outCStrName
);
103 // get element name from vendor id/product id look up ( using cookies )
104 extern Boolean
HIDGetElementNameFromVendorProductCookie (int inVendorID
, int inProductID
, IOHIDElementCookie inCookie
, char * outCStrName
);
106 // get element name from vendor id/product id look up ( using usage page & usage )
107 extern Boolean
HIDGetElementNameFromVendorProductUsage( long inVendorID
, long inProductID
, long inUsagePage
, long inUsage
, char * inCStrName
);
109 // Add device to usage & cookie db's
110 extern Boolean
HIDAddDeviceToXML( IOHIDDeviceRef inIOHIDDeviceRef
);
112 // Add element to usage & cookie db's
113 extern Boolean
HIDAddDeviceElementToXML( IOHIDDeviceRef inIOHIDDeviceRef
, IOHIDElementRef inIOHIDElementRef
);
115 // returns C string type name given a type enumeration passed in as parameter( see IOHIDKeys.h )
116 // returns empty string for invalid types
117 extern void HIDGetTypeName( IOHIDElementType inIOHIDElementType
, char * outCStrName
);
118 extern void HIDGetUsageName (const long valueUsagePage
, const long valueUsage
, char * cstrName
);
120 // return a CFStringRef string for a given usage page & usage( see IOUSBHIDParser.h )
121 extern CFStringRef
HIDCopyUsageName( long inUsagePage
, long inUsage
);
123 /*****************************************************/
124 #if PRAGMA_STRUCT_ALIGN
125 #pragma options align = reset
126 #elif PRAGMA_STRUCT_PACKPUSH
128 #elif PRAGMA_STRUCT_PACK
132 #ifdef PRAGMA_IMPORT_OFF
141 /*****************************************************/
142 #endif // _HID_Name_Lookup_h_