IOHIDEventSystemClient.h 3.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. /*
  2. IOHIDEventSystemClient.h ... I/O Kit HID Event System Client
  3. Copyright (c) 2010 KennyTM~ <kennytm@gmail.com>
  4. All rights reserved.
  5. Redistribution and use in source and binary forms, with or without modification,
  6. are permitted provided that the following conditions are met:
  7. * Redistributions of source code must retain the above copyright notice, this
  8. list of conditions and the following disclaimer.
  9. * Redistributions in binary form must reproduce the above copyright notice,
  10. this list of conditions and the following disclaimer in the documentation
  11. and/or other materials provided with the distribution.
  12. * Neither the name of the KennyTM~ nor the names of its contributors may be
  13. used to endorse or promote products derived from this software without
  14. specific prior written permission.
  15. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
  16. ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  17. WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  18. DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
  19. ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  20. (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  21. LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
  22. ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  23. (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  24. SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  25. */
  26. // With reference to http://www.opensource.apple.com/source/IOHIDFamily/IOHIDFamily-258.1/IOHIDLib/IOHIDEventServiceClass.h
  27. #ifndef IOHID_EVENT_SYSTEM_CLIENT_H
  28. #define IOHID_EVENT_SYSTEM_CLIENT_H
  29. #include <CoreFoundation/CoreFoundation.h>
  30. #include "IOHIDEventQueue.h"
  31. #include "IOHIDEvent.h"
  32. #if __cplusplus
  33. extern "C" {
  34. #endif
  35. typedef struct __IOHIDEventSystemClient
  36. #if 0
  37. {
  38. void* x00;
  39. CFMachPortRef serverPort; // 4
  40. CFRunLoopSourceRef serverSource; // 8
  41. IOHIDEventSystemClientEventCallback callback; // c
  42. void* target; // 10
  43. void* refcon; // 14
  44. CFMachPortRef queuePort; // 18
  45. CFRunLoopSourceRef queueSource; // 1c
  46. CFRunLoopSourceRef source2; // 24
  47. CFRunLoopTimerRef timer; // 28
  48. IOHIDEventQueueRef queue; // 2c
  49. CFRunLoopRef runloop; // 34
  50. CFStringRef mode; // 38
  51. }
  52. #endif
  53. * IOHIDEventSystemClientRef;
  54. typedef void(*IOHIDEventSystemClientEventCallback)(void* target, void* refcon, IOHIDEventQueueRef queue, IOHIDEventRef event);
  55. void IOHIDEventSystemClientRegisterEventCallback(IOHIDEventSystemClientRef client, IOHIDEventSystemClientEventCallback callback, void* target, void* refcon);
  56. void IOHIDEventSystemClientUnregisterEventCallback(IOHIDEventSystemClientRef client);
  57. void IOHIDEventSystemClientUnscheduleWithRunLoop(IOHIDEventSystemClientRef client, CFRunLoopRef runloop, CFStringRef mode);
  58. void IOHIDEventSystemClientScheduleWithRunLoop(IOHIDEventSystemClientRef client, CFRunLoopRef runloop, CFStringRef mode);
  59. CFPropertyListRef IOHIDEventSystemClientCopyProperty(IOHIDEventSystemClientRef client, CFStringRef property);
  60. Boolean IOHIDEventSystemClientSetProperty(IOHIDEventSystemClientRef client, CFStringRef property, CFPropertyListRef value);
  61. IOHIDEventSystemClientRef IOHIDEventSystemClient(void);
  62. #if __cplusplus
  63. }
  64. #endif
  65. #endif