1/*
2 * @APPLE_LICENSE_HEADER_START@
3 *
4 * Copyright (c) 1999-2003 Apple Computer, Inc.  All Rights Reserved.
5 *
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. Please obtain a copy of the License at
10 * http://www.opensource.apple.com/apsl/ and read it before using this
11 * file.
12 *
13 * The Original Code and all software distributed under the License are
14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18 * Please see the License for the specific language governing rights and
19 * limitations under the License.
20 *
21 * @APPLE_LICENSE_HEADER_END@
22 */
23#ifndef _IOKIT_HID_IOHIDFAMILYPRIVATE_H
24#define _IOKIT_HID_IOHIDFAMILYPRIVATE_H
25
26#include "IOHIDKeys.h"
27#include "IOHIDDevice.h"
28
29__BEGIN_DECLS
30
31/* Following table is used to convert Apple USB keyboard IDs into a numbering
32   scheme that can be combined with ADB handler IDs for both Cocoa and Carbon */
33enum {
34    kgestUSBUnknownANSIkd   = 3,       /* Unknown ANSI keyboard */
35    kgestUSBGenericANSIkd   = 40,      /* Generic ANSI keyboard */
36    kgestUSBGenericISOkd    = 41,      /* Generic ANSI keyboard */
37    kgestUSBGenericJISkd    = 42,      /* Generic ANSI keyboard */
38
39    kgestUSBCosmoANSIKbd    = 198,     /* (0xC6) Gestalt Cosmo USB Domestic (ANSI) Keyboard */
40    kprodUSBCosmoANSIKbd    = 0x201,   // The actual USB product ID in hardware
41    kgestUSBCosmoISOKbd     = 199,     /* (0xC7) Cosmo USB International (ISO) Keyboard */
42    kprodUSBCosmoISOKbd     = 0x202,
43    kgestUSBCosmoJISKbd     = 200,     /* (0xC8) Cosmo USB Japanese (JIS) Keyboard */
44    kprodUSBCosmoJISKbd     = 0x203,
45    kgestUSBAndyANSIKbd       = 204,      /* (0xCC) Andy USB Keyboard Domestic (ANSI) Keyboard */
46    kprodUSBAndyANSIKbd     = 0x204,
47    kgestUSBAndyISOKbd      = 205,      /* (0xCD) Andy USB Keyboard International (ISO) Keyboard */
48    kprodUSBAndyISOKbd      = 0x205,
49    kgestUSBAndyJISKbd      = 206,      /* (0xCE) Andy USB Keyboard Japanese (JIS) Keyboard */
50    kprodUSBAndyJISKbd      = 0x206,
51
52    kgestQ6ANSIKbd          = 31,      /* (031) Apple Q6 Keyboard Domestic (ANSI) Keyboard */
53    kprodQ6ANSIKbd          = 0x208,
54    kgestQ6ISOKbd           = 32,      /* (32) Apple Q6 Keyboard International (ISO) Keyboard */
55    kprodQ6ISOKbd           = 0x209,
56    kgestQ6JISKbd           = 33,      /* (33) Apple Q6 Keyboard Japanese (JIS) Keyboard */
57    kprodQ6JISKbd           = 0x20a,
58
59    kgestQ30ANSIKbd         = 34,      /* (34) Apple Q30 Keyboard Domestic (ANSI) Keyboard */
60    kprodQ30ANSIKbd         = 0x20b,
61    kgestQ30ISOKbd          = 35,      /* (35) Apple Q30 Keyboard International (ISO) Keyboard */
62    kprodQ30ISOKbd          = 0x20c,
63    kgestQ30JISKbd          = 36,      /* (36) Apple Q30 Keyboard Japanese (JIS) Keyboard */
64    kprodQ30JISKbd          = 0x20d,
65
66    kgestFountainANSIKbd    = 37,      /* (37) Apple Fountain Keyboard Domestic (ANSI) Keyboard */
67    kprodFountainANSIKbd    = 0x20e,
68    kgestFountainISOKbd     = 38,      /* (38) Apple Fountain Keyboard International (ISO) Keyboard */
69    kprodFountainISOKbd     = 0x20f,
70    kgestFountainJISKbd     = 39,      /* (39) Apple Fountain Keyboard Japanese (JIS) Keyboard */
71    kprodFountainJISKbd     = 0x210,
72
73    kgestSantaANSIKbd       = 37,      /* (37) Apple Santa Keyboard Domestic (ANSI) Keyboard */
74    kprodSantaANSIKbd       = 0x211,
75    kgestSantaISOKbd        = 38,      /* (38) Apple Santa Keyboard International (ISO) Keyboard */
76    kprodSantaISOKbd        = 0x212,
77    kgestSantaJISKbd        = 39,      /* (39) Apple Santa Keyboard Japanese (JIS) Keyboard */
78    kprodSantaJISKbd        = 0x213,
79
80    kgestM89ISOKbd          = 47,      /* (47) Apple M89 Wired (ISO) Keyboard */
81    kgestM90ISOKbd          = 44      /* (44) Apple M90 Wireless (ISO) Keyboard */
82};
83
84bool CompareProperty(IOService * owner, OSDictionary * matching, const char * key, SInt32 * score, SInt32 increment = 0);
85bool CompareDeviceUsage( IOService * owner, OSDictionary * matching, SInt32 * score, SInt32 increment = 0);
86bool CompareDeviceUsagePairs(IOService * owner, OSDictionary * matching, SInt32 * score, SInt32 increment = 0);
87bool CompareProductID( IOService * owner, OSDictionary * matching, SInt32 * score);
88bool MatchPropertyTable(IOService * owner, OSDictionary * table, SInt32 * score);
89bool CompareNumberPropertyMask( IOService *owner, OSDictionary *matching, const char *key, const char *maskKey, SInt32 *score, SInt32 increment);
90bool CompareNumberPropertyArray( IOService * owner, OSDictionary * matching, const char * arrayName, const char * key, SInt32 * score, SInt32 increment);
91bool CompareNumberPropertyArrayWithMask( IOService * owner, OSDictionary * matching, const char * arrayName, const char * key, const char * maskKey, SInt32 * score, SInt32 increment);
92
93#define     kEjectKeyDelayMS        100     // the delay for a dedicated eject key
94#define     kEjectF12DelayMS        250     // the delay for an F12/eject key
95
96void IOHIDSystemActivityTickle(SInt32 nxEventType, IOService *sender);
97
98#define NX_HARDWARE_TICKLE  (NX_LASTEVENT+1)
99
100__END_DECLS
101
102#endif /* !_IOKIT_HID_IOHIDFAMILYPRIVATE_H */
103