Chameleon Applications

Chameleon Applications Svn Source Tree

Root/branches/iFabio/Chameleon/i386/include/IOKit/hidsystem/IOHIDSystem.h

Source at commit 296 created 12 years 10 months ago.
By ifabio, add i386 folder
1/*
2 * @APPLE_LICENSE_HEADER_START@
3 *
4 * Copyright (c) 1999-2009 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/* Copyright (c) 1992 NeXT Computer, Inc. All rights reserved.
24 *
25 * EventDriver.h - Exported Interface Event Driver object.
26 *
27 *The EventDriver is a pseudo-device driver.
28 *
29 * HISTORY
30 * 19 Mar 1992 Mike Paquette at NeXT
31 * Created.
32 * 4 Aug 1993 Erik Kay at NeXT
33 *API cleanup
34 */
35
36#ifndef_IOHIDSYSTEM_H
37#define _IOHIDSYSTEM_H
38
39#include <TargetConditionals.h>
40#include <IOKit/IOTimerEventSource.h>
41#include <IOKit/IOInterruptEventSource.h>
42#include <IOKit/IOService.h>
43#include <IOKit/IOMessage.h>
44#include <IOKit/IOUserClient.h>
45#include <IOKit/IOWorkLoop.h>
46#include <IOKit/IOCommandGate.h>
47#include <IOKit/IOBufferMemoryDescriptor.h>
48#include <IOKit/pwr_mgt/IOPM.h>
49#if TARGET_OS_EMBEDDED
50class IOGraphicsDevice;
51#else
52#include <IOKit/graphics/IOGraphicsDevice.h>
53#endif
54#include <IOKit/hidsystem/IOHIDevice.h>
55#include <IOKit/hidsystem/IOHIDShared.h>
56#include <IOKit/hidsystem/IOHIDTypes.h>
57#include <IOKit/hidsystem/IOLLEvent.h>
58#include <IOKit/IODataQueue.h>
59#include <IOKit/hidsystem/ev_keymap.h>/* For NX_NUM_SCANNED_SPECIALKEYS */
60
61
62// The following messages should be unique across the entire system
63#ifndef sub_iokit_hidsystem
64#define sub_iokit_hidsystem err_sub(14)
65#endif
66
67#define kIOHIDSystem508MouseClickMessage iokit_family_msg(sub_iokit_hidsystem, 1)
68#define kIOHIDSystemDeviceSeizeRequestMessageiokit_family_msg(sub_iokit_hidsystem, 2)
69#define kIOHIDSystem508SpecialKeyDownMessage iokit_family_msg(sub_iokit_hidsystem, 3)
70
71class IOHIDKeyboardDevice;
72class IOHIDPointingDevice;
73class IOHIDEvent;
74
75class IOHIDSystem : public IOService
76{
77OSDeclareDefaultStructors(IOHIDSystem);
78
79friend class IOHIDUserClient;
80friend class IOHIDParamUserClient;
81friend class IOHIDEventSystemUserClient;
82
83private:
84IOWorkLoop *workLoop;
85IOTimerEventSource * timerES;
86IOTimerEventSource * vblES;
87 IOInterruptEventSource * eventConsumerES;
88 IOInterruptEventSource * keyboardEQES;
89 IOCommandGate *cmdGate;
90IOUserClient *serverConnect;
91IOUserClient *paramConnect;
92 IONotifier *eventPublishNotify;
93 IONotifier *eventTerminateNotify;
94 IONotifier *publishNotify;
95 IONotifier *terminateNotify;
96
97 OSArray *ioHIDevices;
98 OSSet * touchEventPosters;
99
100// Ports on which we hold send rights
101mach_port_teventPort;// Send msg here when event queue
102// goes non-empty
103 mach_port_t stackShotPort;
104mach_port_t_specialKeyPort[NX_NUM_SCANNED_SPECIALKEYS]; // Special key msgs
105void*eventMsg;// Msg to be sent to Window Server.
106void*stackShotMsg;// Msg to be sent to Stack Shot.
107
108// Shared memory area information
109 IOBufferMemoryDescriptor * globalMemory;
110uintptr_tshmem_addr;// kernel address of shared memory
111vm_size_tshmem_size;// size of shared memory
112
113// Pointers to structures which occupy the shared memory area.
114volatile void*evs;// Pointer to private driver shmem
115volatile EvGlobals *evg;// Pointer to EvGlobals (shmem)
116// Internal variables related to the shared memory area
117intlleqSize;// # of entries in low-level queue
118 // FIXME: why is this ivar lleqSize an ivar? {Dan]
119
120// Screens list
121vm_size_tevScreenSize;// Byte size of evScreen array
122void*evScreen;// array of screens known to driver
123volatile void*lastShmemPtr;// Pointer used to index thru shmem
124// while assigning shared areas to
125// drivers.
126intscreens;// running total of allocated screens
127UInt32cursorScreens;// bit mask of screens with cursor present
128 UInt32cursorPinScreen;// a screen to pin against
129IOGBoundscursorPin;// Range to which cursor is pinned
130// while on this screen.
131IOGBoundsworkSpace;// IOGBounds of full workspace.
132// Event Status state - This includes things like event timestamps,
133// time til screen dim, and related things manipulated through the
134// Event Status API.
135//
136IOGPointpointerLoc;// Current pointing device location
137// The value leads evg->cursorLoc.
138 IOGPointpointerDelta;// The cumulative pointer delta values since
139 // previous mouse move event was posted
140
141IOGPointclickLoc;// location of last mouse click
142IOGPoint clickSpaceThresh;// max mouse delta to be a doubleclick
143intclickState;// Current click state
144
145bool evOpenCalled;// Has the driver been opened?
146bool evInitialized;// Has the first-open-only initialization run?
147 bool evStateChanging; // Is the event system state changing.
148bool eventsOpen;// Boolean: has evmmap been called yet?
149bool cursorStarted;// periodic events running?
150bool cursorEnabled;// cursor positioning ok?
151bool cursorCoupled;// cursor positioning on pointer moves ok?
152bool cursorPinned;// cursor positioning on pointer moves ok?
153
154short leftENum;// Unique ID for last left down event
155short rightENum;// Unique ID for last right down event
156
157// The periodic event mechanism timestamps and state
158// are recorded here.
159AbsoluteTime thisPeriodicRun;
160 AbsoluteTime periodicEventDelta;// Time between periodic events
161 // todo: make infinite
162 AbsoluteTime clickTime;// Timestamps used to determine doubleclicks
163 AbsoluteTime clickTimeThresh;
164
165 AbsoluteTime waitSustain;// Sustain time before removing cursor
166 AbsoluteTime waitSusTime;// Sustain counter
167 AbsoluteTime waitFrameRate;// Ticks per wait cursor frame
168 AbsoluteTime waitFrameTime;// Wait cursor frame timer
169
170 AbsoluteTime lastRelativeEventTime;// Used to post mouse events once per frame
171 AbsoluteTime lastRelativeMoveTime;
172 AbsoluteTime lastEventTime;
173 AbsoluteTime lastUndimEvent;
174 SInt32 postDeltaX, accumDX;
175 SInt32 postDeltaY, accumDY;
176
177// Flags used in scheduling periodic event callbacks
178boolneedSetCursorPosition;
179boolneedToKickEventConsumer;
180
181 IOService *displayManager;// points to display manager
182 IOPMPowerFlagsdisplayState;
183
184 IOService *rootDomain;
185 AbsoluteTimestateChangeDeadline;
186
187 OSDictionary * savedParameters;// keep user settings
188
189 const char * registryName;// cache our name
190 UInt32maxWaitCursorFrame;// animation frames
191UInt32firstWaitCursorFrame;//
192
193 intcachedEventFlags;
194 OSArray * cachedButtonStates;
195
196 OSArray * systemInfo;
197
198 IOHIDPointingDevice * _hidPointingDevice;
199 IOHIDKeyboardDevice * _hidKeyboardDevice;
200
201 unsigned consumedKeyCode;
202
203 OSObject * lastSender;
204
205 UInt32 scrollZoomMask;
206
207 bool setParamPropertiesInProgress;
208
209 OSSet * dataQueueSet;
210
211private:
212 void vblEvent(void);
213 UInt8 getSubtypeForSender(OSObject * sender);
214 void updateMouseEventForSender(OSObject * sender, NXEventData * evData);
215 void updateMouseMoveEventForSender(OSObject * sender, NXEventData * evData);
216 void updateScrollEventForSender(OSObject * sender, NXEventData * evData);
217 static void _vblEvent(OSObject *self, IOTimerEventSource *sender);
218
219 inline short getUniqueEventNum();
220
221 virtual IOReturn powerStateDidChangeTo( IOPMPowerFlags, unsigned long, IOService * );
222 /* Resets */
223 void _resetMouseParameters();
224
225 /* Initialize the shared memory area */
226 void initShmem(bool clean);
227 /* Dispatch low level events through shared memory to the WindowServer */
228 void postEvent(int what,
229 /* at */ IOGPoint * location,
230 /* atTime */ AbsoluteTime ts,
231 /* withData */ NXEventData * myData,
232 /* sender */ OSObject * sender = 0,
233 /* pid */ UInt32 extPID = 0,
234 /* processKEQ*/bool processKEQ = true);
235 /* Dispatch mechanisms for screen state changes */
236 void evDispatch(
237 /* command */ EvCmd evcmd);
238 /* Dispatch mechanism for special key press */
239 void evSpecialKeyMsg(unsigned key,
240 /* direction */ unsigned dir,
241 /* flags */ unsigned f,
242 /* level */ unsigned l);
243 /* Message the event consumer to process posted events */
244 void kickEventConsumer();
245 void sendStackShotMessage();
246
247 OSDictionary * createFilteredParamPropertiesForService(IOService * service, OSDictionary * dict);
248
249 static void _periodicEvents(IOHIDSystem * self,
250 IOTimerEventSource *timer);
251
252 static void doSpecialKeyMsg(IOHIDSystem * self,
253struct evioSpecialKeyMsg *msg);
254 static void doKickEventConsumer(IOHIDSystem * self);
255
256 static void doProcessKeyboardEQ(IOHIDSystem * self);
257 static void processKeyboardEQ(IOHIDSystem * self, AbsoluteTime * deadline = 0);
258
259 static bool genericNotificationHandler( void * target,
260void * ref, IOService * newService );
261
262 static bool handlePublishNotification( void * target, IOService * newService );
263
264 static bool handleTerminateNotification( void * target, IOService * service );
265
266 static void makeNumberParamProperty( OSDictionary * dict, const char * key,
267 unsigned long long number, unsigned int bits );
268
269 static void makeInt32ArrayParamProperty( OSDictionary * dict, const char * key,
270 UInt32 * array, unsigned int count );
271
272/*
273 * HISTORICAL NOTE:
274 * The following methods were part of the IOHIDSystem(Input) category;
275 * the declarations have now been merged directly into this class.
276 *
277 * Exported Interface Event Driver object input services.
278 */
279
280private:
281 // Schedule next periodic run based on current event system state.
282 void scheduleNextPeriodicEvent();
283 // Message invoked to run periodic events. This method runs in the workloop.
284 void periodicEvents(IOTimerEventSource *timer);
285 // Start the cursor running.
286 bool startCursor();
287 // Repin cursor location.
288 bool resetCursor();
289 // Wait Cursor machinery.
290 void showWaitCursor();
291 void hideWaitCursor();
292 void animateWaitCursor();
293 void changeCursor(int frame);
294 // Return screen number a point lies on.
295 int pointToScreen(IOGPoint * p);
296
297 inline void showCursor();
298 inline void hideCursor();
299 inline void moveCursor();
300 // Claim ownership of event sources.
301 void attachDefaultEventSources();
302 // Give up ownership of event sources.
303 void detachEventSources();
304 bool registerEventSource(IOService * source);
305
306 // Set abs cursor position.
307 void setCursorPosition(IOGPoint * newLoc, bool external, OSObject * sender=0);
308 void _setButtonState(int buttons,
309 /* atTime */ AbsoluteTime ts,
310 OSObject * sender);
311 void _setCursorPosition(IOGPoint * newLoc, bool external, bool proximityChange = false, OSObject * sender=0);
312
313 static bool _idleTimeSerializerCallback(void * target, void * ref, OSSerialize *s);
314
315 void _postMouseMoveEvent(intwhat,
316 IOGPoint *location,
317 AbsoluteTimetheClock,
318 OSObject *sender);
319 void createParameters( void );
320
321/* END HISTORICAL NOTE */
322
323public:
324 static IOHIDSystem * instance(); /* Return the current instance of the */
325 /* EventDriver, or 0 if none. */
326 static void scaleLocationToCurrentScreen(IOGPoint *location, IOGBounds *bounds);
327
328 virtual bool init(OSDictionary * properties = 0);
329 virtual IOHIDSystem * probe(IOService * provider,
330 SInt32 * score);
331 virtual bool start(IOService * provider);
332 virtual IOReturn message(UInt32 type, IOService * provider,
333void * argument);
334 virtual void free();
335 virtual bool attach( IOService * provider );
336 virtual void detach( IOService * provider );
337
338 virtual IOWorkLoop *getWorkLoop() const;
339
340 virtual IOReturn evOpen(void);
341 virtual IOReturn evClose(void);
342
343 virtual IOReturn setProperties( OSObject * properties );
344 virtual IOReturn setParamProperties(OSDictionary * dict);
345
346 /* Create the shared memory area */
347 virtual IOReturn createShmem(void*,void*,void*,void*,void*,void*);
348
349 /* register the IODataQueue for the new user events */
350 virtual IOReturn registerEventQueue(IODataQueue * queue);
351
352 /* Unregister the IODataQueue for the new user events */
353 virtual IOReturn unregisterEventQueue(IODataQueue * queue);
354
355 /* Set the port for event available notify msg */
356 virtual void setEventPort(mach_port_t port);
357 /* Set the port for the special key keypress msg */
358 virtual IOReturn setSpecialKeyPort(
359 /* keyFlavor */ int special_key,
360 /* keyPort */ mach_port_t key_port);
361 virtual mach_port_t specialKeyPort(int special_key);
362
363
364 virtual IOReturn newUserClient(task_t owningTask,
365 /* withToken */ void * security_id,
366 /* ofType */ UInt32 type,
367 /* withProps*/ OSDictionary * properties,
368 /* client */ IOUserClient ** handler);
369
370/*
371 * HISTORICAL NOTE:
372 * The following methods were part of the IOHIPointingEvents protocol;
373 * the declarations have now been merged directly into this class.
374 */
375
376public:
377 /* Mouse event reporting */
378 virtual void relativePointerEvent(int buttons,
379 /* deltaX */ int dx,
380 /* deltaY */ int dy,
381 /* atTime */ AbsoluteTime ts);
382
383 /* Tablet event reporting */
384 virtual void absolutePointerEvent(int buttons,
385 /* at */ IOGPoint * newLoc,
386 /* withBounds */ IOGBounds *bounds,
387 /* inProximity */ bool proximity,
388 /* withPressure */ int pressure,
389 /* withAngle */ int stylusAngle,
390 /* atTime */ AbsoluteTime ts);
391
392 /* Mouse scroll wheel event reporting */
393 virtual void scrollWheelEvent(short deltaAxis1,
394 short deltaAxis2,
395 short deltaAxis3,
396 AbsoluteTime ts);
397
398
399 virtual void tabletEvent(NXEventData *tabletData,
400 AbsoluteTime ts);
401
402 virtual void proximityEvent(NXEventData *proximityData,
403 AbsoluteTime ts);
404
405/*
406 * HISTORICAL NOTE:
407 * The following methods were part of the IOHIKeyboardEvents protocol;
408 * the declarations have now been merged directly into this class.
409 */
410
411public:
412 virtual void keyboardEvent(unsigned eventType,
413 /* flags */ unsigned flags,
414 /* keyCode */ unsigned key,
415 /* charCode */ unsigned charCode,
416 /* charSet */ unsigned charSet,
417 /* originalCharCode */ unsigned origCharCode,
418 /* originalCharSet */ unsigned origCharSet,
419 /* keyboardType */ unsigned keyboardType,
420 /* repeat */ bool repeat,
421 /* atTime */ AbsoluteTime ts);
422
423 virtual void keyboardSpecialEvent( unsigned eventType,
424 /* flags */ unsigned flags,
425 /* keyCode */ unsigned key,
426 /* specialty */ unsigned flavor,
427 /* guid */ UInt64 guid,
428 /* repeat */ bool repeat,
429 /* atTime */ AbsoluteTime ts);
430
431 virtual void updateEventFlags(unsigned flags); /* Does not generate events */
432
433
434
435
436private:
437
438 /*
439 * statics for upstream callouts
440 */
441
442 void _scaleLocationToCurrentScreen(IOGPoint *location, IOGPoint *fraction, IOGBounds *bounds); // Should this one be public???
443
444 static void _relativePointerEvent(IOHIDSystem * self,
445 int buttons,
446 /* deltaX */ int dx,
447 /* deltaY */ int dy,
448 /* atTime */ AbsoluteTime ts,
449 OSObject * sender,
450 void * refcon);
451
452 /* Tablet event reporting */
453 static void _absolutePointerEvent(IOHIDSystem * self,
454 int buttons,
455 /* at */ IOGPoint * newLoc,
456 /* withBounds */ IOGBounds *bounds,
457 /* inProximity */ bool proximity,
458 /* withPressure */ int pressure,
459 /* withAngle */ int stylusAngle,
460 /* atTime */ AbsoluteTime ts,
461 OSObject * sender,
462 void * refcon);
463
464 /* Mouse scroll wheel event reporting */
465 static void _scrollWheelEvent( IOHIDSystem *self,
466 short deltaAxis1,
467 short deltaAxis2,
468 short deltaAxis3,
469 IOFixed fixedDelta1,
470 IOFixed fixedDelta2,
471 IOFixed fixedDelta3,
472 SInt32 pointDeltaAxis1,
473 SInt32 pointDeltaAxis2,
474 SInt32 pointDeltaAxis3,
475 UInt32 options,
476 AbsoluteTime ts,
477 OSObject * sender,
478 void * refcon);
479
480 static void _tabletEvent( IOHIDSystem *self,
481 NXEventData *tabletData,
482 AbsoluteTime ts,
483 OSObject * sender,
484 void * refcon);
485
486 static void _proximityEvent( IOHIDSystem *self,
487 NXEventData *proximityData,
488 AbsoluteTime ts,
489 OSObject * sender,
490 void * refcon);
491
492 static void _keyboardEvent( IOHIDSystem * self,
493 unsigned eventType,
494 /* flags */ unsigned flags,
495 /* keyCode */ unsigned key,
496 /* charCode */ unsigned charCode,
497 /* charSet */ unsigned charSet,
498 /* originalCharCode */ unsigned origCharCode,
499 /* originalCharSet */ unsigned origCharSet,
500 /* keyboardType */ unsigned keyboardType,
501 /* repeat */ bool repeat,
502 /* atTime */ AbsoluteTime ts,
503 OSObject * sender,
504 void * refcon);
505
506 static void _keyboardSpecialEvent(IOHIDSystem * self,
507 unsigned eventType,
508 /* flags */ unsigned flags,
509 /* keyCode */ unsigned key,
510 /* specialty */ unsigned flavor,
511 /* guid */ UInt64 guid,
512 /* repeat */ bool repeat,
513 /* atTime */ AbsoluteTime ts,
514 OSObject * sender,
515 void * refcon);
516
517 static void _updateEventFlags( IOHIDSystem * self,
518 unsigned flags,
519 OSObject * sender,
520 void * refcon); /* Does not generate events */
521
522
523/*
524 * HISTORICAL NOTE:
525 * The following methods were part of the IOUserClient protocol;
526 * the declarations have now been merged directly into this class.
527 */
528
529public:
530
531 virtual IOReturn setEventsEnable(void*,void*,void*,void*,void*,void*);
532 virtual IOReturn setCursorEnable(void*,void*,void*,void*,void*,void*);
533 virtual IOReturn extPostEvent(void*,void*,void*,void*,void*,void*);
534 virtual IOReturn extSetMouseLocation(void*,void*,void*,void*,void*,void*);
535 virtual IOReturn extGetButtonEventNum(void*,void*,void*,void*,void*,void*);
536 IOReturn extSetBounds( IOGBounds * bounds );
537 IOReturn extGetModifierLockState(void*,void*,void*,void*,void*,void*);
538 IOReturn extSetModifierLockState(void*,void*,void*,void*,void*,void*);
539
540/*
541 * HISTORICAL NOTE:
542 * The following methods were part of the IOScreenRegistration protocol;
543 * the declarations have now been merged directly into this class.
544 *
545 * Methods exported by the EventDriver for display systems.
546 *
547 *The screenRegister protocol is used by frame buffer drivers to register
548 *themselves with the Event Driver. These methods are called in response
549 *to an _IOGetParameterInIntArray() call with "IO_Framebuffer_Register" or
550 *"IO_Framebuffer_Unregister".
551 */
552
553public:
554 virtual int registerScreen(IOGraphicsDevice * instance,
555 /* bounds */ IOGBounds * bp);
556// /* shmem */ void ** addr,
557// /* size */ int * size)
558 virtual void unregisterScreen(int index);
559
560/*
561 * HISTORICAL NOTE:
562 * The following methods were part of the IOWorkspaceBounds protocol;
563 * the declarations have now been merged directly into this class.
564 *
565 * Absolute position input devices and some specialized output devices
566 * may need to know the bounding rectangle for all attached displays.
567 * The following method returns a IOGBounds* for the workspace. Please note
568 * that the bounds are kept as signed values, and that on a multi-display
569 * system the minx and miny values may very well be negative.
570 */
571
572public:
573 virtual IOGBounds * workspaceBounds();
574
575/* END HISTORICAL NOTES */
576
577private:
578void relativePointerEvent( int buttons,
579 /* deltaX */ int dx,
580 /* deltaY */ int dy,
581 /* atTime */ AbsoluteTime ts,
582 /* senderID */ OSObject * sender);
583
584 /* Tablet event reporting */
585void absolutePointerEvent( int buttons,
586 /* at */ IOGPoint * newLoc,
587 /* withBounds */ IOGBounds *bounds,
588 /* inProximity */ bool proximity,
589 /* withPressure */ int pressure,
590 /* withAngle */ int stylusAngle,
591 /* atTime */ AbsoluteTime ts,
592 /* senderID */ OSObject * sender);
593
594 /* Mouse scroll wheel event reporting */
595void scrollWheelEvent( short deltaAxis1,
596 short deltaAxis2,
597 short deltaAxis3,
598 IOFixed fixedDelta1,
599 IOFixed fixedDelta2,
600 IOFixed fixedDelta3,
601 SInt32 pointDeltaAxis1,
602 SInt32 pointDeltaAxis2,
603 SInt32 pointDeltaAxis3,
604 UInt32 options,
605 AbsoluteTime ts,
606 OSObject * sender);
607
608void tabletEvent(NXEventData * tabletData,
609 AbsoluteTime ts,
610 OSObject * sender);
611
612void proximityEvent(NXEventData * proximityData,
613 AbsoluteTime ts,
614 OSObject * sender);
615
616void keyboardEvent(unsigned eventType,
617 /* flags */ unsigned flags,
618 /* keyCode */ unsigned key,
619 /* charCode */ unsigned charCode,
620 /* charSet */ unsigned charSet,
621 /* originalCharCode */ unsigned origCharCode,
622 /* originalCharSet */ unsigned origCharSet,
623 /* keyboardType */ unsigned keyboardType,
624 /* repeat */ bool repeat,
625 /* atTime */ AbsoluteTime ts,
626 /* sender */ OSObject * sender);
627
628void keyboardSpecialEvent( unsigned eventType,
629 /* flags */ unsigned flags,
630 /* keyCode */ unsigned key,
631 /* specialty */ unsigned flavor,
632 /* guid */ UInt64 guid,
633 /* repeat */ bool repeat,
634 /* atTime */ AbsoluteTime ts,
635 /* sender */ OSObject * sender);
636
637void updateEventFlags(unsigned flags, OSObject * sender);
638
639/*
640 * COMMAND GATE COMPATIBILITY:
641 * The following method is part of the work needed to make IOHIDSystem
642 * compatible with IOCommandGate. The use of IOCommandQueue has been
643 * deprecated, thus requiring this move. This should allow for less
644 * context switching as all actions formerly run on the I/O Workloop
645 * thread, will now be run on the caller thread. The static methods
646 * will be called from cmdGate->runAction and returns the appropriate
647 * non-static helper method. Arguments are stored in the void* array,
648 * args, and are passed through. Since we are returning in the static
649 * function, gcc3 should translate that to one instruction, thus
650 * minimizing cost.
651 */
652
653staticIOReturndoEvClose (IOHIDSystem *self);
654 IOReturnevCloseGated (void);
655
656staticIOReturndoSetEventsEnablePre (IOHIDSystem *self, void *p1);
657 IOReturnsetEventsEnablePreGated (void *p1);
658
659staticIOReturndoSetEventsEnablePost (IOHIDSystem *self, void *p1);
660 IOReturnsetEventsEnablePostGated (void *p1);
661
662staticIOReturndoUnregisterScreen (IOHIDSystem *self, void * arg0);
663 voidunregisterScreenGated (int index);
664
665staticIOReturndoCreateShmem (IOHIDSystem *self, void * arg0);
666 IOReturncreateShmemGated (void * p1);
667
668staticIOReturndoRegisterEventQueue (IOHIDSystem *self, void * arg0);
669 IOReturnregisterEventQueueGated (void * p1);
670
671staticIOReturndoUnregisterEventQueue (IOHIDSystem *self, void * arg0);
672 IOReturnunregisterEventQueueGated (void * p1);
673
674staticIOReturndoRelativePointerEvent (IOHIDSystem *self, void * args);
675 voidrelativePointerEventGated(int buttons,
676 int dx,
677 int dy,
678 AbsoluteTime ts,
679 OSObject * sender);
680
681staticIOReturndoAbsolutePointerEvent (IOHIDSystem *self, void * args);
682 void absolutePointerEventGated (int buttons,
683 IOGPoint * newLoc,
684 IOGBounds *bounds,
685 bool proximity,
686 int pressure,
687 int stylusAngle,
688 AbsoluteTime ts,
689 OSObject * sender);
690
691staticIOReturndoScrollWheelEvent(IOHIDSystem *self, void * args);
692 voidscrollWheelEventGated (short deltaAxis1,
693 short deltaAxis2,
694 short deltaAxis3,
695 IOFixed fixedDelta1,
696 IOFixed fixedDelta2,
697 IOFixed fixedDelta3,
698 SInt32 pointDeltaAxis1,
699 SInt32 pointDeltaAxis2,
700 SInt32 pointDeltaAxis3,
701 UInt32 options,
702 AbsoluteTime ts,
703 OSObject * sender);
704
705staticIOReturndoTabletEvent (IOHIDSystem *self, void * arg0, void * arg1, void * arg2);
706 voidtabletEventGated (NXEventData *tabletData,
707 AbsoluteTime ts,
708 OSObject * sender);
709
710staticIOReturndoProximityEvent (IOHIDSystem *self, void * arg0, void * arg1, void * arg2);
711 voidproximityEventGated (NXEventData *proximityData,
712 AbsoluteTime ts,
713 OSObject * sender);
714
715staticIOReturndoKeyboardEvent (IOHIDSystem *self, void * args);
716 voidkeyboardEventGated (unsigned eventType,
717 unsigned flags,
718 unsigned key,
719 unsigned charCode,
720 unsigned charSet,
721 unsigned origCharCode,
722 unsigned origCharSet,
723 unsigned keyboardType,
724 bool repeat,
725 AbsoluteTime ts,
726 OSObject * sender);
727
728staticIOReturndoKeyboardSpecialEvent (IOHIDSystem *self, void * args);
729 voidkeyboardSpecialEventGated (
730 unsigned eventType,
731 unsigned flags,
732 unsigned key,
733 unsigned flavor,
734 UInt64 guid,
735 bool repeat,
736 AbsoluteTime ts,
737 OSObject * sender);
738
739staticIOReturndoUpdateEventFlags (IOHIDSystem *self, void * args);
740 voidupdateEventFlagsGated (unsigned flags, OSObject * sender);
741
742staticIOReturndoNewUserClient (IOHIDSystem *self, void * args);
743 IOReturn newUserClientGated (task_t owningTask,
744 void * security_id,
745 UInt32 type,
746 OSDictionary * properties,
747 IOUserClient ** handler);
748
749staticIOReturndoSetCursorEnable (IOHIDSystem *self, void * arg0);
750 IOReturnsetCursorEnableGated (void * p1);
751
752staticIOReturndoExtPostEvent(IOHIDSystem *self, void * arg0, void * arg1, void * arg2, void * arg3);
753 IOReturnextPostEventGated (void * p1, void * p2, void * p3);
754
755staticIOReturndoExtSetMouseLocation (IOHIDSystem *self, void * args);
756 IOReturnextSetMouseLocationGated (void * args);
757
758staticIOReturndoExtGetButtonEventNum (IOHIDSystem *self, void * arg0, void * arg1);
759 IOReturnextGetButtonEventNumGated (void * p1, void * p2);
760
761staticIOReturndoSetParamPropertiesPre (IOHIDSystem *self, void * arg0, void * arg1);
762 IOReturnsetParamPropertiesPreGated (OSDictionary * dict, OSIterator ** pOpenIter);
763
764staticIOReturndoSetParamPropertiesPost (IOHIDSystem *self, void * arg0);
765 IOReturnsetParamPropertiesPostGated (OSDictionary * dict);
766
767staticIOReturndoExtGetToggleState (IOHIDSystem *self, void *p1, void *p2);
768staticIOReturndoExtSetToggleState (IOHIDSystem *self, void *p1, void *p2);
769 IOReturn getCapsLockState(unsigned int *state_O);
770 IOReturn setCapsLockState(unsigned int state_I);
771 IOReturn getNumLockState(unsigned int *state_O);
772 IOReturn setNumLockState(unsigned int state_I);
773
774/* END COMMAND GATE COMPATIBILITY */
775
776public:
777 virtual void setStackShotPort(mach_port_t port);
778
779 virtual UInt32 eventFlags();
780
781 virtual void dispatchEvent(IOHIDEvent *event, IOOptionBits options=0);
782
783};
784
785#endif /* !_IOHIDSYSTEM_H */
786

Archive Download this file

Revision: 296