FreeStick  0.3
Cross Platform Open Sorce Joystick Lib
IOHIDElement_.h
Go to the documentation of this file.
1 // File: IOHIDElement_.h
2 // Abstract: convieance functions for IOHIDElementGetProperty
3 // Version: 5.0
4 //
5 // Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple
6 // Inc. ("Apple") in consideration of your agreement to the following
7 // terms, and your use, installation, modification or redistribution of
8 // this Apple software constitutes acceptance of these terms. If you do
9 // not agree with these terms, please do not use, install, modify or
10 // redistribute this Apple software.
11 //
12 // In consideration of your agreement to abide by the following terms, and
13 // subject to these terms, Apple grants you a personal, non-exclusive
14 // license, under Apple's copyrights in this original Apple software (the
15 // "Apple Software"), to use, reproduce, modify and redistribute the Apple
16 // Software, with or without modifications, in source and/or binary forms;
17 // provided that if you redistribute the Apple Software in its entirety and
18 // without modifications, you must retain this notice and the following
19 // text and disclaimers in all such redistributions of the Apple Software.
20 // Neither the name, trademarks, service marks or logos of Apple Inc. may
21 // be used to endorse or promote products derived from the Apple Software
22 // without specific prior written permission from Apple. Except as
23 // expressly stated in this notice, no other rights or licenses, express or
24 // implied, are granted by Apple herein, including but not limited to any
25 // patent rights that may be infringed by your derivative works or by other
26 // works in which the Apple Software may be incorporated.
27 //
28 // The Apple Software is provided by Apple on an "AS IS" basis. APPLE
29 // MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION
30 // THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS
31 // FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND
32 // OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS.
33 //
34 // IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL
35 // OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
36 // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
37 // INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION,
38 // MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED
39 // AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE),
40 // STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE
41 // POSSIBILITY OF SUCH DAMAGE.
42 //
43 // Copyright (C) 2010 Apple Inc. All Rights Reserved.
44 //
45 // *****************************************************
46 #ifndef __IOHIDElement___
47 #define __IOHIDElement___
48 
49 // *****************************************************
50 #pragma mark - includes & imports
51 
52 #include <AvailabilityMacros.h>
53 
54 #include "IOHIDLib_.h"
55 // *****************************************************
56 #if PRAGMA_ONCE
57 #pragma once
58 #endif // if PRAGMA_ONCE
59 
60 #ifdef __cplusplus
61 extern "C" {
62 #endif // ifdef __cplusplus
63 
64 #if PRAGMA_IMPORT
65 #pragma import on
66 #endif // if PRAGMA_IMPORT
67 
68 #if PRAGMA_STRUCT_ALIGN
69 #pragma options align=mac68k
70 #elif PRAGMA_STRUCT_PACKPUSH
71 #pragma pack(push, 2)
72 #elif PRAGMA_STRUCT_PACK
73 #pragma pack(2)
74 #endif // if PRAGMA_STRUCT_ALIGN
75 
76 // *****************************************************
77 #pragma mark - typedef's, struct's, enums, defines, etc.
78 // -----------------------------------------------------
79 
80 // *****************************************************
81 #pragma mark - exported globals
82 // -----------------------------------------------------
83 
84 // *****************************************************
85 #pragma mark - exported function prototypes
86 // -----------------------------------------------------
87 
88 // *************************************************************************
89 //
90 // HIDIsValidElement(inIOHIDElementRef)
91 //
92 // Purpose: validate this element
93 //
94 // Inputs: inIOHIDElementRef - the element
95 //
96 // Returns: Boolean - TRUE if this is a valid element ref
97 //
98 extern Boolean HIDIsValidElement(IOHIDElementRef inIOHIDElementRef);
99 
100 // *************************************************************************
101 //
102 // IOHIDElement_GetValue(inIOHIDElementRef, inIOHIDValueScaleType)
103 //
104 // Purpose: returns the current value for an element(polling)
105 //
106 // Notes: will return 0 on error conditions which should be accounted for by application
107 //
108 // Inputs: inIOHIDElementRef - the element
109 // inIOHIDValueScaleType - scale type (calibrated or physical)
110 //
111 // Returns: double - current value for element
112 //
113 extern double IOHIDElement_GetValue(IOHIDElementRef inIOHIDElementRef, IOHIDValueScaleType inIOHIDValueScaleType);
114 
115 // *************************************************************************
116 //
117 // IOHIDElement_GetCalibrationMin(inIOHIDElementRef)
118 //
119 // Purpose: get the minimum bounds for a calibrated value for this element
120 //
121 // Inputs: inIOHIDElementRef - the IOHIDElementRef for this element
122 //
123 // Returns: double - the minimum Calibration value for this element
124 //
125 
126 extern double IOHIDElement_GetCalibrationMin(IOHIDElementRef inIOHIDElementRef);
127 
128 // *************************************************************************
129 //
130 // IOHIDElement_SetCalibrationMin(inIOHIDElementRef, inValue)
131 //
132 // Purpose: set the minimum bounds for a calibrated value for this element
133 //
134 // Inputs: inIOHIDElementRef - the IOHIDElementRef for this element
135 // inValue - the minimum bounds for a calibrated value for this element
136 //
137 // Returns: nothing
138 //
139 
140 extern void IOHIDElement_SetCalibrationMin(IOHIDElementRef inIOHIDElementRef, double inValue);
141 
142 // *************************************************************************
143 //
144 // IOHIDElement_GetCalibrationMax(inIOHIDElementRef)
145 //
146 // Purpose: get the maximum bounds for a calibrated value for this element
147 //
148 // Inputs: inIOHIDElementRef - the IOHIDElementRef for this element
149 //
150 // Returns: double - the maximum Calibration value for this element
151 //
152 
153 extern double IOHIDElement_GetCalibrationMax(IOHIDElementRef inIOHIDElementRef);
154 
155 // *************************************************************************
156 //
157 // IOHIDElement_SetCalibrationMax(inIOHIDElementRef, inValue)
158 //
159 // Purpose: set the maximum bounds for a calibrated value for this element
160 //
161 // Inputs: inIOHIDElementRef - the IOHIDElementRef for this element
162 // inValue - the maximum Calibration value for this element
163 //
164 // Returns: nothing
165 //
166 
167 extern void IOHIDElement_SetCalibrationMax(IOHIDElementRef inIOHIDElementRef, double inValue);
168 
169 // *************************************************************************
170 //
171 // IOHIDElement_GetCalibrationSaturationMin(inIOHIDElementRef)
172 //
173 // Purpose: get the mininum tolerance to be used when calibrating a logical element value
174 //
175 // Inputs: inIOHIDElementRef - the IOHIDElementRef for this element
176 //
177 // Returns: double - the maximum Calibration value for this element
178 //
179 
180 extern double IOHIDElement_GetCalibrationSaturationMin(IOHIDElementRef inIOHIDElementRef);
181 
182 // *************************************************************************
183 //
184 // IOHIDElement_SetCalibrationSaturationMin(inIOHIDElementRef, inValue)
185 //
186 // Purpose: set the mininum tolerance to be used when calibrating a logical element value
187 //
188 // Inputs: inIOHIDElementRef - the IOHIDElementRef for this element
189 // inValue - the maximum Calibration value for this element
190 //
191 // Returns: nothing
192 //
193 
194 extern void IOHIDElement_SetCalibrationSaturationMin(IOHIDElementRef inIOHIDElementRef, double inValue);
195 
196 // *************************************************************************
197 //
198 // IOHIDElement_GetCalibrationSaturationMax(inIOHIDElementRef)
199 //
200 // Purpose: get the maximum tolerance to be used when calibrating a logical element value
201 //
202 // Inputs: inIOHIDElementRef - the IOHIDElementRef for this element
203 //
204 // Returns: double - the maximum Calibration value for this element
205 //
206 
207 extern double IOHIDElement_GetCalibrationSaturationMax(IOHIDElementRef inIOHIDElementRef);
208 
209 // *************************************************************************
210 //
211 // IOHIDElement_SetCalibrationSaturationMax(inIOHIDElementRef, inValue)
212 //
213 // Purpose: set the maximum tolerance to be used when calibrating a logical element value
214 //
215 // Inputs: inIOHIDElementRef - the IOHIDElementRef for this element
216 // inValue - the maximum Calibration value for this element
217 //
218 // Returns: nothing
219 //
220 
221 extern void IOHIDElement_SetCalibrationSaturationMax(IOHIDElementRef inIOHIDElementRef, double inValue);
222 
223 // *************************************************************************
224 //
225 // IOHIDElement_GetCalibrationDeadZoneMin(inIOHIDElementRef)
226 //
227 // Purpose: get the minimum bounds near the midpoint of a logical value in which the value is ignored
228 //
229 // Inputs: inIOHIDElementRef - the IOHIDElementRef for this element
230 //
231 // Returns: double - the maximum Calibration value for this element
232 //
233 
234 extern double IOHIDElement_GetCalibrationDeadZoneMin(IOHIDElementRef inIOHIDElementRef);
235 
236 // *************************************************************************
237 //
238 // IOHIDElement_SetCalibrationDeadZoneMin(inIOHIDElementRef, inValue)
239 //
240 // Purpose: set the minimum bounds near the midpoint of a logical value in which the value is ignored
241 //
242 // Inputs: inIOHIDElementRef - the IOHIDElementRef for this element
243 // inValue - the maximum Calibration value for this element
244 //
245 // Returns: nothing
246 //
247 
248 extern void IOHIDElement_SetCalibrationDeadZoneMin(IOHIDElementRef inIOHIDElementRef, double inValue);
249 
250 // *************************************************************************
251 //
252 // IOHIDElement_GetCalibrationDeadZoneMax(inIOHIDElementRef)
253 //
254 // Purpose: get the maximum bounds near the midpoint of a logical value in which the value is ignored
255 //
256 // Inputs: inIOHIDElementRef - the IOHIDElementRef for this element
257 //
258 // Returns: double - the maximum Calibration value for this element
259 //
260 
261 extern double IOHIDElement_GetCalibrationDeadZoneMax(IOHIDElementRef inIOHIDElementRef);
262 
263 // *************************************************************************
264 //
265 // IOHIDElement_SetCalibrationDeadZoneMax(inIOHIDElementRef, inValue)
266 //
267 // Purpose: set the maximum bounds near the midpoint of a logical value in which the value is ignored
268 //
269 // Inputs: inIOHIDElementRef - the IOHIDElementRef for this element
270 // inValue - the maximum Calibration value for this element
271 //
272 // Returns: nothing
273 //
274 
275 extern void IOHIDElement_SetCalibrationDeadZoneMax(IOHIDElementRef inIOHIDElementRef, double inValue);
276 
277 // *************************************************************************
278 //
279 // IOHIDElement_GetCalibrationGranularity(inIOHIDElementRef)
280 //
281 // Purpose: get the level of detail returned for a calibrated element value
282 //
283 // Inputs: inIOHIDElementRef - the IOHIDElementRef for this element
284 //
285 // Returns: double_t - the maximum Calibration value for this element
286 //
287 
288 extern double_t IOHIDElement_GetCalibrationGranularity(IOHIDElementRef inIOHIDElementRef);
289 
290 // *************************************************************************
291 //
292 // IOHIDElement_SetCalibrationGranularity(inIOHIDElementRef, inValue)
293 //
294 // Purpose: set the level of detail returned for a calibrated element value
295 //
296 // Inputs: inIOHIDElementRef - the IOHIDElementRef for this element
297 // inValue - the the level of detail for this element
298 //
299 // Returns: nothing
300 //
301 
302 extern void IOHIDElement_SetCalibrationGranularity(IOHIDElementRef inIOHIDElementRef, double_t inValue);
303 
304 extern Boolean IOHIDElement_GetLongProperty(IOHIDElementRef inIOHIDElementRef, CFStringRef inKey, uint32_t * outValue);
305 extern void IOHIDElement_SetLongProperty(IOHIDElementRef inIOHIDElementRef, CFStringRef inKey, uint32_t inValue);
306 extern Boolean IOHIDElement_GetDoubleProperty(IOHIDElementRef inIOHIDElementRef, CFStringRef inKey, double * outValue);
307 extern void IOHIDElement_SetDoubleProperty(IOHIDElementRef inIOHIDElementRef, CFStringRef inKey, double inValue);
308 
309 // *****************************************************
310 #if PRAGMA_STRUCT_ALIGN
311 #pragma options align=reset
312 #elif PRAGMA_STRUCT_PACKPUSH
313 #pragma pack(pop)
314 #elif PRAGMA_STRUCT_PACK
315 #pragma pack()
316 #endif // if PRAGMA_STRUCT_ALIGN
317 
318 #ifdef PRAGMA_IMPORT_OFF
319 #pragma import off
320 #elif PRAGMA_IMPORT
321 #pragma import reset
322 #endif // ifdef PRAGMA_IMPORT_OFF
323 
324 #ifdef __cplusplus
325 }
326 #endif // ifdef __cplusplus
327 
328 #endif // __IOHIDElement___ //
void IOHIDElement_SetCalibrationSaturationMax(IOHIDElementRef inIOHIDElementRef, double inValue)
Definition: IOHIDElement_.c:277
double IOHIDElement_GetCalibrationSaturationMin(IOHIDElementRef inIOHIDElementRef)
Definition: IOHIDElement_.c:210
Boolean HIDIsValidElement(IOHIDElementRef inIOHIDElementRef)
Definition: IOHIDElement_.c:81
double IOHIDElement_GetCalibrationDeadZoneMax(IOHIDElementRef inIOHIDElementRef)
Definition: IOHIDElement_.c:333
void IOHIDElement_SetCalibrationMin(IOHIDElementRef inIOHIDElementRef, double inValue)
Definition: IOHIDElement_.c:154
double_t IOHIDElement_GetCalibrationGranularity(IOHIDElementRef inIOHIDElementRef)
Definition: IOHIDElement_.c:374
double IOHIDElement_GetValue(IOHIDElementRef inIOHIDElementRef, IOHIDValueScaleType inIOHIDValueScaleType)
Definition: IOHIDElement_.c:106
void IOHIDElement_SetCalibrationDeadZoneMax(IOHIDElementRef inIOHIDElementRef, double inValue)
Definition: IOHIDElement_.c:359
void IOHIDElement_SetCalibrationMax(IOHIDElementRef inIOHIDElementRef, double inValue)
Definition: IOHIDElement_.c:195
double IOHIDElement_GetCalibrationSaturationMax(IOHIDElementRef inIOHIDElementRef)
Definition: IOHIDElement_.c:251
void IOHIDElement_SetDoubleProperty(IOHIDElementRef inIOHIDElementRef, CFStringRef inKey, double inValue)
Definition: IOHIDElement_.c:501
Boolean IOHIDElement_GetLongProperty(IOHIDElementRef inIOHIDElementRef, CFStringRef inKey, uint32_t *outValue)
Definition: IOHIDElement_.c:421
double IOHIDElement_GetCalibrationMin(IOHIDElementRef inIOHIDElementRef)
Definition: IOHIDElement_.c:128
void IOHIDElement_SetLongProperty(IOHIDElementRef inIOHIDElementRef, CFStringRef inKey, uint32_t inValue)
Definition: IOHIDElement_.c:450
double IOHIDElement_GetCalibrationMax(IOHIDElementRef inIOHIDElementRef)
Definition: IOHIDElement_.c:169
void IOHIDElement_SetCalibrationDeadZoneMin(IOHIDElementRef inIOHIDElementRef, double inValue)
Definition: IOHIDElement_.c:318
void IOHIDElement_SetCalibrationSaturationMin(IOHIDElementRef inIOHIDElementRef, double inValue)
Definition: IOHIDElement_.c:236
double IOHIDElement_GetCalibrationDeadZoneMin(IOHIDElementRef inIOHIDElementRef)
Definition: IOHIDElement_.c:292
void IOHIDElement_SetCalibrationGranularity(IOHIDElementRef inIOHIDElementRef, double_t inValue)
Definition: IOHIDElement_.c:400
Boolean IOHIDElement_GetDoubleProperty(IOHIDElementRef inIOHIDElementRef, CFStringRef inKey, double *outValue)
Definition: IOHIDElement_.c:472