1/*
2 * Copyright (c) 1999-2009 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
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/*
24 * Copyright (c) 1999 Apple Computer, Inc.  All rights reserved.
25 *
26 * HISTORY
27 *
28 */
29
30#ifndef _IOKIT_IOHIDLIB_H
31#define _IOKIT_IOHIDLIB_H
32
33#include <IOKit/hidsystem/IOHIDShared.h>
34#include <sys/cdefs.h>
35
36__BEGIN_DECLS
37
38/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
39
40extern kern_return_t
41IOHIDCreateSharedMemory( io_connect_t connect,
42	unsigned int version );
43
44extern kern_return_t
45IOHIDSetEventsEnable( io_connect_t connect,
46	boolean_t enable );
47
48extern kern_return_t
49IOHIDSetCursorEnable( io_connect_t connect,
50	boolean_t enable );
51
52enum {
53    // Options for IOHIDPostEvent()
54    kIOHIDSetGlobalEventFlags       = 0x00000001,
55    kIOHIDSetCursorPosition         = 0x00000002,
56    kIOHIDSetRelativeCursorPosition = 0x00000004,
57    kIOHIDPostHIDManagerEvent       = 0x00000008
58};
59
60extern kern_return_t
61IOHIDPostEvent( io_connect_t        connect,
62                UInt32              eventType,
63                IOGPoint            location,
64                const NXEventData * eventData,
65                UInt32              eventDataVersion,
66                IOOptionBits        eventFlags,
67                IOOptionBits        options );
68
69extern kern_return_t
70IOHIDSetMouseLocation( io_connect_t connect,
71	int x, int y);
72
73extern kern_return_t
74IOHIDGetButtonEventNum( io_connect_t connect,
75	NXMouseButton button, int * eventNum );
76
77extern kern_return_t
78IOHIDSetCursorBounds( io_connect_t connect, const IOGBounds * bounds );
79
80extern kern_return_t
81IOHIDGetScrollAcceleration( io_connect_t handle, double * acceleration );
82
83extern kern_return_t
84IOHIDSetScrollAcceleration( io_connect_t handle, double acceleration );
85
86extern kern_return_t
87IOHIDGetMouseAcceleration( io_connect_t handle, double * acceleration );
88
89extern kern_return_t
90IOHIDSetMouseAcceleration( io_connect_t handle, double acceleration );
91
92extern kern_return_t
93IOHIDGetMouseButtonMode( io_connect_t handle, int * mode );
94
95extern kern_return_t
96IOHIDSetMouseButtonMode( io_connect_t handle, int mode );
97
98extern kern_return_t
99IOHIDGetAccelerationWithKey( io_connect_t handle, CFStringRef key, double * acceleration );
100
101extern kern_return_t
102IOHIDSetAccelerationWithKey( io_connect_t handle, CFStringRef key, double acceleration );
103
104extern kern_return_t
105IOHIDGetParameter( io_connect_t handle, CFStringRef key, IOByteCount maxSize,
106		void * bytes, IOByteCount * actualSize );
107
108extern kern_return_t
109IOHIDSetParameter( io_connect_t handle, CFStringRef key,
110		const void * bytes, IOByteCount size );
111
112extern kern_return_t
113IOHIDCopyCFTypeParameter( io_connect_t handle, CFStringRef key,
114                CFTypeRef * parameter );
115
116extern kern_return_t
117IOHIDSetCFTypeParameter( io_connect_t handle, CFStringRef key,
118                CFTypeRef parameter );
119
120// selectors are found in IOHIDParameter.h
121extern kern_return_t
122IOHIDGetModifierLockState( io_connect_t handle, int selector, bool *state );
123
124extern kern_return_t
125IOHIDSetModifierLockState( io_connect_t handle, int selector, bool state );
126
127extern kern_return_t
128IOHIDGetStateForSelector( io_connect_t handle, int selector, UInt32 *state );
129
130extern kern_return_t
131IOHIDSetStateForSelector( io_connect_t handle, int selector, UInt32 state );
132
133// Used by Window Server only
134extern kern_return_t
135IOHIDRegisterVirtualDisplay( io_connect_t handle, UInt32 *display_token );
136
137extern kern_return_t
138IOHIDUnregisterVirtualDisplay( io_connect_t handle, UInt32 display_token );
139
140extern kern_return_t
141IOHIDSetVirtualDisplayBounds( io_connect_t handle, UInt32 display_token, const IOGBounds * bounds );
142
143extern kern_return_t
144IOHIDGetActivityState( io_connect_t handle, bool *hidActivityIdle );
145
146/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
147
148__END_DECLS
149
150#endif /* ! _IOKIT_IOHIDLIB_H */
151
152