home *** CD-ROM | disk | FTP | other *** search
/ Mac Magazin/MacEasy 96 / maccd 96.iso / utilities / Mac OS X / DoubleCommand 1.3 / Source / IOHIDSystem.h < prev    next >
Encoding:
C/C++ Source or Header  |  2002-07-08  |  24.5 KB  |  623 lines

  1.  
  2.  
  3. /*
  4.  * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved.
  5.  *
  6.  * @APPLE_LICENSE_HEADER_START@
  7.  * 
  8.  * The contents of this file constitute Original Code as defined in and
  9.  * are subject to the Apple Public Source License Version 1.1 (the
  10.  * "License").  You may not use this file except in compliance with the
  11.  * License.  Please obtain a copy of the License at
  12.  * http://www.apple.com/publicsource and read it before using this file.
  13.  * 
  14.  * This Original Code and all software distributed under the License are
  15.  * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
  16.  * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
  17.  * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
  18.  * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT.  Please see the
  19.  * License for the specific language governing rights and limitations
  20.  * under the License.
  21.  * 
  22.  * @APPLE_LICENSE_HEADER_END@
  23.  */
  24. /*     Copyright (c) 1992 NeXT Computer, Inc.  All rights reserved. 
  25.  *
  26.  * EventDriver.h - Exported Interface Event Driver object.
  27.  *
  28.  *        The EventDriver is a pseudo-device driver.
  29.  *
  30.  * HISTORY
  31.  * 19 Mar 1992    Mike Paquette at NeXT
  32.  *      Created. 
  33.  * 4  Aug 1993      Erik Kay at NeXT
  34.  *    API cleanup
  35.  */
  36.  
  37. #ifndef    _IOHIDSYSTEM_H
  38. #define _IOHIDSYSTEM_H
  39.  
  40. #include <IOKit/IOTimerEventSource.h>
  41. #include <IOKit/IOInterruptEventSource.h>
  42. #include <IOKit/IOMessage.h>
  43. #include <IOKit/IOService.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. #include <IOKit/graphics/IOGraphicsDevice.h>
  50. #include <IOKit/hidsystem/IOHIDevice.h>
  51. #include <IOKit/hidsystem/IOHIDShared.h>
  52. #include <IOKit/hidsystem/IOHIDTypes.h>
  53. #include <IOKit/hidsystem/IOLLEvent.h>
  54. #include "ev_keymap.h"        /* For NX_NUM_SCANNED_SPECIALKEYS */
  55.  
  56. // this should be unique across the entire system
  57. #define sub_iokit_hidsystem            err_sub(14)
  58. #define kIOHIDSystem508MouseClickMessage     iokit_family_msg(sub_iokit_hidsystem, 1)
  59.  
  60.            
  61. class IOHIDSystem : public IOService
  62. {
  63.     OSDeclareDefaultStructors(IOHIDSystem);
  64.  
  65.     friend class IOHIDUserClient;
  66.     friend class IOHIDParamUserClient;
  67.  
  68. private:
  69.     IOWorkLoop *        workLoop;
  70.     IOTimerEventSource *      timerES;
  71.         IOInterruptEventSource * eventConsumerES;
  72.         IOCommandGate *        cmdGate;
  73.     IOUserClient *        serverConnect;
  74.     IOUserClient *        paramConnect;
  75.         IONotifier *        publishNotify;
  76.         IONotifier *        terminateNotify;
  77.         
  78.         OSArray *        ioHIDevices;
  79.  
  80.     // Ports on which we hold send rights
  81.     mach_port_t    eventPort;    // Send msg here when event queue
  82.                     // goes non-empty
  83.     mach_port_t    _specialKeyPort[NX_NUM_SCANNED_SPECIALKEYS]; // Special key msgs
  84.     void        *eventMsg;    // Msg to be sent to Window Server.
  85.  
  86.     // Shared memory area information
  87.         IOBufferMemoryDescriptor * globalMemory;
  88.     vm_offset_t    shmem_addr;    // kernel address of shared memory
  89.     vm_size_t    shmem_size;    // size of shared memory
  90.  
  91.     // Pointers to structures which occupy the shared memory area.
  92.     volatile void    *evs;        // Pointer to private driver shmem
  93.     volatile EvGlobals *evg;    // Pointer to EvGlobals (shmem)
  94.     // Internal variables related to the shared memory area
  95.     int        lleqSize;    // # of entries in low-level queue
  96.                         // FIXME: why is this ivar lleqSize an ivar? {Dan]
  97.  
  98.     // Screens list
  99.     vm_size_t    evScreenSize;    // Byte size of evScreen array
  100.     void        *evScreen;    // array of screens known to driver
  101.     volatile void    *lastShmemPtr;    // Pointer used to index thru shmem
  102.                     // while assigning shared areas to
  103.                     // drivers.
  104.     int        screens;    // running total of allocated screens
  105.     UInt32        cursorScreens;    // bit mask of screens with cursor present
  106.         UInt32        cursorPinScreen;// a screen to pin against
  107.     Bounds        cursorPin;    // Range to which cursor is pinned
  108.                     // while on this screen.
  109.     Bounds        workSpace;    // Bounds of full workspace.
  110.     // Event Status state - This includes things like event timestamps,
  111.     // time til screen dim, and related things manipulated through the
  112.     // Event Status API.
  113.     //
  114.     Point    pointerLoc;    // Current pointing device location
  115.                 // The value leads evg->cursorLoc.
  116.         Point    pointerDelta;    // The cumulative pointer delta values since
  117.                                 // previous mouse move event was posted
  118.     Point    clickLoc;    // location of last mouse click
  119.     Point   clickSpaceThresh;    // max mouse delta to be a doubleclick
  120.     int    clickState;    // Current click state
  121.     unsigned char lastPressure;    // last pressure seen
  122.     bool    lastProximity;    // last proximity state seen
  123.  
  124.     SInt32    curVolume;    // Value of volume setting.
  125.     SInt32    dimmedBrightness;// Value of screen brightness when autoDim
  126.                 // has turned on.
  127.     SInt32    curBright;    // The current brightness is cached here while
  128.                 // the driver is open.  This number is always
  129.                 // the user-specified brightness level; if the
  130.                 // screen is autodimmed, the actual brightness
  131.                 // level in the monitor will be less.
  132.     SInt32 autoDimmed;    // Is screen currently autodimmed?
  133.     bool evOpenCalled;    // Has the driver been opened?
  134.     bool evInitialized;    // Has the first-open-only initialization run?
  135.     bool eventsOpen;    // Boolean: has evmmap been called yet?
  136.     bool cursorStarted;    // periodic events running?
  137.     bool cursorEnabled;    // cursor positioning ok?
  138.     bool cursorCoupled;    // cursor positioning on pointer moves ok?
  139.     bool cursorPinned;    // cursor positioning on pointer moves ok?
  140.  
  141.     short leftENum;        // Unique ID for last left down event
  142.     short rightENum;    // Unique ID for last right down event
  143.     
  144.     // The periodic event mechanism timestamps and state
  145.     // are recorded here.
  146.     AbsoluteTime thisPeriodicRun;
  147.         AbsoluteTime periodicEventDelta;// Time between periodic events
  148.                                         // todo: make infinite
  149.         AbsoluteTime clickTime;        // Timestamps used to determine doubleclicks
  150.         AbsoluteTime clickTimeThresh;
  151.         AbsoluteTime autoDimPeriod;    // How long since last user action before
  152.                                         // we autodim screen?  User preference item,
  153.                                         // set by InitMouse and evsioctl
  154.         AbsoluteTime autoDimTime;    // Time value when we will autodim screen,
  155.                                         // if autoDimmed is 0.
  156.                                         // Set in LLEventPost.
  157.  
  158.         AbsoluteTime waitSustain;    // Sustain time before removing cursor
  159.         AbsoluteTime waitSusTime;    // Sustain counter
  160.         AbsoluteTime waitFrameRate;    // Ticks per wait cursor frame
  161.         AbsoluteTime waitFrameTime;    // Wait cursor frame timer
  162.  
  163.         AbsoluteTime postedVBLTime;    // Used to post mouse events once per frame
  164.         AbsoluteTime lastEventTime;
  165.         AbsoluteTime lastMoveTime;
  166.         SInt32 accumDX;
  167.         SInt32 accumDY;
  168.  
  169.     // Flags used in scheduling periodic event callbacks
  170.     bool        needSetCursorPosition;
  171.     bool        needToKickEventConsumer;
  172.         
  173.         IOService *    displayManager;    // points to display manager
  174.         IOPMPowerFlags    displayState;
  175.  
  176.         OSDictionary *  savedParameters;    // keep user settings
  177.         
  178.         char *        registryName;        // cache our name
  179.         UInt32        maxWaitCursorFrame;    // animation frames
  180.     UInt32        firstWaitCursorFrame;    //
  181.  
  182. private:
  183.   inline short getUniqueEventNum();
  184.  
  185.   virtual IOReturn powerStateDidChangeTo( IOPMPowerFlags, unsigned long, IOService * );
  186.  /* Resets */
  187.   void _resetMouseParameters();
  188.   void _resetKeyboardParameters();
  189.  
  190.   /* Initialize the shared memory area */
  191.   void     initShmem();
  192.   /* Dispatch low level events through shared memory to the WindowServer */
  193.   void postEvent(int           what,
  194.           /* at */       Point *       location,
  195.           /* atTime */   AbsoluteTime  ts,
  196.           /* withData */ NXEventData * myData);
  197.   /* Dispatch mechanisms for screen state changes */
  198.   void evDispatch(
  199.             /* command */ EvCmd evcmd);
  200.   /* Dispatch mechanism for special key press */
  201.   void evSpecialKeyMsg(unsigned key,
  202.                /* direction */ unsigned dir,
  203.                /* flags */     unsigned f,
  204.                /* level */     unsigned l);
  205.   /* Message the event consumer to process posted events */
  206.   void kickEventConsumer();
  207.  
  208.   static void _periodicEvents(IOHIDSystem * self,
  209.                               IOTimerEventSource *timer);
  210.  
  211.   static void doSpecialKeyMsg(IOHIDSystem * self,
  212.                     struct evioSpecialKeyMsg *msg);
  213.   static void doKickEventConsumer(IOHIDSystem * self);
  214.  
  215.   static bool publishNotificationHandler( void * target, 
  216.                 void * ref, IOService * newService );
  217.                                 
  218.   static bool terminateNotificationHandler( void * target, 
  219.                 void * ref, IOService * service );
  220.                                 
  221.   static void makeParamProperty( OSDictionary * dict, const char * key,
  222.                             const void * bytes, unsigned int length );
  223.  
  224. /*
  225.  * HISTORICAL NOTE:
  226.  *   The following methods were part of the IOHIDSystem(Input) category;
  227.  *   the declarations have now been merged directly into this class.
  228.  *
  229.  * Exported Interface Event Driver object input services.
  230.  */
  231.  
  232. private:
  233.   // Schedule next periodic run based on current event system state.
  234.   void scheduleNextPeriodicEvent();
  235.   // Message invoked to run periodic events.  This method runs in the workloop.
  236.   void periodicEvents(IOTimerEventSource *timer);
  237.   // Start the cursor running.
  238.   bool startCursor();
  239.   // Repin cursor location.
  240.   bool resetCursor();
  241.   // Wait Cursor machinery.
  242.   void showWaitCursor();
  243.   void hideWaitCursor();
  244.   void animateWaitCursor();
  245.   void changeCursor(int frame);
  246.   // Return screen number a point lies on.
  247.   int  pointToScreen(Point * p);
  248.   // Set the undimmed brightness.
  249.   void setBrightness(int b);
  250.   // Return undimmed brightness.
  251.   int  brightness();
  252.   // Set the dimmed brightness.
  253.   void setAutoDimBrightness(int b);
  254.   // Return dimmed brightness.
  255.   int  autoDimBrightness();
  256.   // Return the current brightness.
  257.   int  currentBrightness();
  258.   // Dim all displays.
  259.   void doAutoDim();
  260.   // Return display brightness to normal.
  261.   void undoAutoDim();
  262.   // Force dim/undim.
  263.   void forceAutoDimState(bool dim);
  264.   // Audio volume control.
  265.   void setAudioVolume(int v);
  266.   // Audio volume control, from ext user.
  267.   void setUserAudioVolume(int v);
  268.   // Return audio volume.
  269.   int  audioVolume();
  270.   // Propagate state out to screens.
  271.   inline void setBrightness();
  272.  
  273.   inline void showCursor();
  274.   inline void hideCursor();
  275.   inline void moveCursor();
  276.   // Claim ownership of event sources.
  277.   void attachDefaultEventSources();
  278.   // Give up ownership of event sources.
  279.   void detachEventSources();
  280.   bool registerEventSource(IOHIDevice * source);
  281.  
  282.   // Set abs cursor position.
  283.   void setCursorPosition(Point * newLoc, bool external);
  284.   void _setButtonState(int buttons,
  285.                        /* atTime */ AbsoluteTime ts);
  286.   void _setCursorPosition(Point * newLoc, bool external);
  287.  
  288.   void _postMouseMoveEvent(int        what,
  289.                            Point *    location,
  290.                            AbsoluteTime    theClock);
  291.   void createParameters( void );
  292.  
  293. /* END HISTORICAL NOTE */
  294.  
  295. public:
  296.   static IOHIDSystem * instance();     /* Return the current instance of the */
  297.                        /* EventDriver, or 0 if none. */
  298.  
  299.   virtual bool init(OSDictionary * properties = 0);
  300.   virtual IOHIDSystem * probe(IOService *    provider,
  301.                               SInt32 * score);
  302.   virtual bool start(IOService * provider);
  303.   virtual IOReturn message(UInt32 type, IOService * provider,
  304.                 void * argument);
  305.   virtual void free();
  306.  
  307.   virtual IOWorkLoop *getWorkLoop() const;
  308.  
  309.   virtual IOReturn evOpen(void);
  310.   virtual IOReturn evClose(void);
  311.  
  312.   virtual IOReturn  setProperties( OSObject * properties );
  313.   virtual IOReturn  setParamProperties(OSDictionary * dict);
  314.   virtual bool         updateProperties(void);
  315.   virtual bool      serializeProperties( OSSerialize * s ) const;
  316.  
  317.   /* Create the shared memory area */
  318.   virtual IOReturn createShmem(void*,void*,void*,void*,void*,void*);
  319.   /* Set the port for event available notify msg */
  320.   virtual void     setEventPort(mach_port_t port);
  321.   /* Set the port for the special key keypress msg */
  322.   virtual IOReturn setSpecialKeyPort(
  323.                      /* keyFlavor */ int         special_key,
  324.                      /* keyPort */   mach_port_t key_port);
  325.   virtual mach_port_t specialKeyPort(int special_key);
  326.  
  327.  
  328.   virtual IOReturn newUserClient(task_t         owningTask,
  329.                  /* withToken */ void *         security_id,
  330.                  /* ofType */    UInt32         type,
  331.                  /* client */    IOUserClient ** handler);
  332.  
  333. /*
  334.  * HISTORICAL NOTE:
  335.  *   The following methods were part of the IOHIPointingEvents protocol;
  336.  *   the declarations have now been merged directly into this class.
  337.  */
  338.  
  339. public: 
  340.   /* Mouse event reporting */
  341.   virtual void relativePointerEvent(int        buttons,
  342.                        /* deltaX */ int        dx,
  343.                        /* deltaY */ int        dy,
  344.                        /* atTime */ AbsoluteTime ts);
  345.  
  346.   /* Tablet event reporting */
  347.   virtual void absolutePointerEvent(int        buttons,
  348.                  /* at */           Point *    newLoc,
  349.                  /* withBounds */   Bounds *   bounds,
  350.                  /* inProximity */  bool       proximity,
  351.                  /* withPressure */ int        pressure,
  352.                  /* withAngle */    int        stylusAngle,
  353.                  /* atTime */       AbsoluteTime ts);
  354.  
  355.   /* Mouse scroll wheel event reporting */
  356.   virtual void scrollWheelEvent(short deltaAxis1,
  357.                                 short deltaAxis2,
  358.                                 short deltaAxis3,
  359.                                 AbsoluteTime ts);
  360.   
  361.  
  362.   virtual void tabletEvent(NXEventData *tabletData,
  363.                            AbsoluteTime ts);
  364.  
  365.   virtual void proximityEvent(NXEventData *proximityData,
  366.                               AbsoluteTime ts);
  367.  
  368. /*
  369.  * HISTORICAL NOTE:
  370.  *   The following methods were part of the IOHIKeyboardEvents protocol;
  371.  *   the declarations have now been merged directly into this class.
  372.  */
  373.  
  374. public:
  375.   virtual void keyboardEvent(unsigned   eventType,
  376.       /* flags */            unsigned   flags,
  377.       /* keyCode */          unsigned   key,
  378.       /* charCode */         unsigned   charCode,
  379.       /* charSet */          unsigned   charSet,
  380.       /* originalCharCode */ unsigned   origCharCode,
  381.       /* originalCharSet */  unsigned   origCharSet,
  382.       /* keyboardType */     unsigned   keyboardType,
  383.       /* repeat */           bool       repeat,
  384.       /* atTime */           AbsoluteTime ts);
  385.  
  386.   virtual void keyboardSpecialEvent(   unsigned   eventType,
  387.                     /* flags */        unsigned   flags,
  388.                     /* keyCode  */     unsigned   key,
  389.                     /* specialty */    unsigned   flavor,
  390.                     /* guid */            UInt64     guid,
  391.                     /* repeat */       bool       repeat,
  392.                     /* atTime */       AbsoluteTime ts);
  393.  
  394.   virtual void updateEventFlags(unsigned flags);  /* Does not generate events */
  395.  
  396.  
  397.  
  398.  
  399. private:
  400.  
  401.   /*
  402.    * statics for upstream callouts
  403.    */
  404.  
  405.   void _scaleLocationToCurrentScreen(Point *location, Bounds *bounds);  // Should this one be public???
  406.  
  407.   static void _relativePointerEvent( IOHIDSystem * self,
  408.                     int        buttons,
  409.                        /* deltaX */ int        dx,
  410.                        /* deltaY */ int        dy,
  411.                        /* atTime */ AbsoluteTime ts);
  412.  
  413.   /* Tablet event reporting */
  414.   static void _absolutePointerEvent(IOHIDSystem * self,
  415.                     int        buttons,
  416.                  /* at */           Point *    newLoc,
  417.                  /* withBounds */   Bounds *   bounds,
  418.                  /* inProximity */  bool       proximity,
  419.                  /* withPressure */ int        pressure,
  420.                  /* withAngle */    int        stylusAngle,
  421.                  /* atTime */       AbsoluteTime ts);
  422.  
  423.   /* Mouse scroll wheel event reporting */
  424.   static void _scrollWheelEvent(IOHIDSystem *self,
  425.                                 short deltaAxis1,
  426.                                 short deltaAxis2,
  427.                                 short deltaAxis3,
  428.                                 AbsoluteTime ts);
  429.  
  430.   static void _tabletEvent(IOHIDSystem *self,
  431.                            NXEventData *tabletData,
  432.                            AbsoluteTime ts);
  433.  
  434.   static void _proximityEvent(IOHIDSystem *self,
  435.                               NXEventData *proximityData,
  436.                               AbsoluteTime ts);
  437.  
  438.   static void _keyboardEvent( IOHIDSystem * self,
  439.                  unsigned   eventType,
  440.       /* flags */            unsigned   flags,
  441.       /* keyCode */          unsigned   key,
  442.       /* charCode */         unsigned   charCode,
  443.       /* charSet */          unsigned   charSet,
  444.       /* originalCharCode */ unsigned   origCharCode,
  445.       /* originalCharSet */  unsigned   origCharSet,
  446.       /* keyboardType */     unsigned   keyboardType,
  447.       /* repeat */           bool       repeat,
  448.       /* atTime */           AbsoluteTime ts);
  449.   static void _keyboardSpecialEvent(     IOHIDSystem * self,
  450.                                         unsigned   eventType,
  451.                     /* flags */         unsigned   flags,
  452.                     /* keyCode  */      unsigned   key,
  453.                     /* specialty */     unsigned   flavor,
  454.                     /* guid */          UInt64     guid,
  455.                     /* repeat */        bool       repeat,
  456.                     /* atTime */        AbsoluteTime ts);
  457.   static void _updateEventFlags( IOHIDSystem * self,
  458.                 unsigned flags);  /* Does not generate events */
  459.  
  460.  
  461. /*
  462.  * HISTORICAL NOTE:
  463.  *   The following methods were part of the IOUserClient protocol;
  464.  *   the declarations have now been merged directly into this class.
  465.  */
  466.  
  467. public:
  468.  
  469.   virtual IOReturn setEventsEnable(void*,void*,void*,void*,void*,void*);
  470.   virtual IOReturn setCursorEnable(void*,void*,void*,void*,void*,void*);
  471.   virtual IOReturn extPostEvent(void*,void*,void*,void*,void*,void*);
  472.   virtual IOReturn extSetMouseLocation(void*,void*,void*,void*,void*,void*);
  473.   virtual IOReturn extGetButtonEventNum(void*,void*,void*,void*,void*,void*);
  474.   IOReturn extSetBounds( IOGBounds * bounds );
  475.  
  476. /*
  477.  * HISTORICAL NOTE:
  478.  *   The following methods were part of the IOScreenRegistration protocol;
  479.  *   the declarations have now been merged directly into this class.
  480.  *
  481.  * Methods exported by the EventDriver for display systems.
  482.  *
  483.  *    The screenRegister protocol is used by frame buffer drivers to register
  484.  *    themselves with the Event Driver.  These methods are called in response
  485.  *    to an _IOGetParameterInIntArray() call with "IO_Framebuffer_Register" or
  486.  *    "IO_Framebuffer_Unregister".
  487.  */
  488.  
  489. public:
  490.   virtual int registerScreen(IOGraphicsDevice * instance,
  491.              /* bounds */    Bounds * bp);
  492. //           /* shmem */     void **  addr,
  493. //           /* size */      int *    size)
  494.   virtual void unregisterScreen(int index);
  495.     
  496. /*
  497.  * HISTORICAL NOTE:
  498.  *   The following methods were part of the IOWorkspaceBounds protocol;
  499.  *   the declarations have now been merged directly into this class.
  500.  *
  501.  * Absolute position input devices and some specialized output devices
  502.  * may need to know the bounding rectangle for all attached displays.
  503.  * The following method returns a Bounds* for the workspace.  Please note
  504.  * that the bounds are kept as signed values, and that on a multi-display
  505.  * system the minx and miny values may very well be negative.
  506.  */
  507.  
  508. public:
  509.   virtual Bounds * workspaceBounds();
  510.  
  511. /* END HISTORICAL NOTES */
  512.  
  513. /*
  514.  * COMMAND GATE COMPATIBILITY:
  515.  *   The following method is part of the work needed to make IOHIDSystem
  516.  *   compatible with IOCommandGate.  The use of IOCommandQueue has been
  517.  *   deprecated, thus requiring this move.  This should allow for less
  518.  *   context switching as all actions formerly run on the I/O Workloop
  519.  *   thread, will now be run on the caller thread.  The static methods
  520.  *   will be called from cmdGate->runAction and returns the appropriate 
  521.  *   non-static helper method.  Arguments are stored in the void* array, 
  522.  *   args, and are passed through.   Since we are returning in the static
  523.  *   function, gcc3 should translate that to one instruction, thus 
  524.  *   minimizing cost.
  525.  */ 
  526.  
  527. static    IOReturn    doEvClose (IOHIDSystem *self);
  528.         IOReturn    evCloseGated (void);
  529.         
  530. static    IOReturn    doResetMouseParameters (IOHIDSystem *self);
  531.         void        resetMouseParametersGated (void);
  532.         
  533. static    IOReturn    doUnregisterScreen (IOHIDSystem *self, void * arg0);
  534.         void        unregisterScreenGated (int index);
  535.  
  536. static    IOReturn    doCreateShmem (IOHIDSystem *self, void * arg0);
  537.         IOReturn    createShmemGated (void * p1);
  538.  
  539. static    IOReturn    doRelativePointerEvent (IOHIDSystem *self, void * arg0, void * arg1, 
  540.                                                     void * arg2, void * arg3);
  541.         void        relativePointerEventGated(int buttons, 
  542.                                                     int dx, 
  543.                                                     int dy, 
  544.                                                     AbsoluteTime ts);
  545.  
  546. static    IOReturn    doAbsolutePointerEvent (IOHIDSystem *self, void * args);        
  547.         void         absolutePointerEventGated (int buttons,
  548.                                                     Point *    newLoc,
  549.                                                     Bounds *   bounds,
  550.                                                     bool       proximity,
  551.                                                     int        pressure,
  552.                                                     int        stylusAngle,
  553.                                                     AbsoluteTime ts);
  554.  
  555. static    IOReturn    doScrollWheelEvent(IOHIDSystem *self, void * arg0, void * arg1, 
  556.                                                     void * arg2, void * arg3);        
  557.         void        scrollWheelEventGated (short deltaAxis1,
  558.                                                 short deltaAxis2,
  559.                                                 short deltaAxis3,
  560.                                                 AbsoluteTime ts);
  561.  
  562. static    IOReturn    doTabletEvent (IOHIDSystem *self, void * arg0, void * arg1);        
  563.         void        tabletEventGated (NXEventData *tabletData, AbsoluteTime ts);
  564.  
  565. static    IOReturn    doProximityEvent (IOHIDSystem *self, void * arg0, void * arg1);        
  566.         void        proximityEventGated (NXEventData *proximityData, AbsoluteTime ts);
  567.  
  568. static    IOReturn    doKeyboardEvent (IOHIDSystem *self, void * args);        
  569.         void        keyboardEventGated (unsigned   eventType,
  570.                                             unsigned   flags,
  571.                                             unsigned   key,
  572.                                             unsigned   charCode,
  573.                                             unsigned   charSet,
  574.                                             unsigned   origCharCode,
  575.                                             unsigned   origCharSet,
  576.                                             unsigned   keyboardType,
  577.                                             bool       repeat,
  578.                                             AbsoluteTime ts);
  579.  
  580. static    IOReturn    doKeyboardSpecialEvent (IOHIDSystem *self, void * args);        
  581.         void        keyboardSpecialEventGated (   
  582.                                             unsigned   eventType,
  583.                                             unsigned   flags,
  584.                                             unsigned   key,
  585.                                             unsigned   flavor,
  586.                                             UInt64     guid,
  587.                                             bool       repeat,
  588.                                             AbsoluteTime ts);
  589.  
  590. static    IOReturn    doUpdateEventFlags (IOHIDSystem *self, void * arg0);        
  591.         void        updateEventFlagsGated (unsigned flags);
  592.  
  593. static    IOReturn    doNewUserClient (IOHIDSystem *self, void * arg0, void * arg1, 
  594.                                                     void * arg2, void * arg3);        
  595.         IOReturn     newUserClientGated (task_t owningTask,
  596.                                             void * security_id,
  597.                                             UInt32 type,
  598.                                             IOUserClient ** handler);
  599.  
  600. static    IOReturn    doSetCursorEnable (IOHIDSystem *self, void * arg0);        
  601.         IOReturn    setCursorEnableGated (void * p1);
  602.  
  603. static    IOReturn    doExtPostEvent (IOHIDSystem *self, void * arg0);        
  604.         IOReturn    extPostEventGated (void * p1);
  605.  
  606. static    IOReturn    doExtSetMouseLocation (IOHIDSystem *self, void * args);        
  607.         IOReturn    extSetMouseLocationGated (void * args);
  608.  
  609. static    IOReturn    doExtGetButtonEventNum (IOHIDSystem *self, void * arg0, void * arg1);        
  610.         IOReturn    extGetButtonEventNumGated (void * p1, void * p2);
  611.  
  612. static    bool        doUpdateProperties (IOHIDSystem *self);        
  613.         bool        updatePropertiesGated (void);
  614.  
  615. static    IOReturn    doSetParamProperties (IOHIDSystem *self, void * arg0);        
  616.         IOReturn    setParamPropertiesGated (OSDictionary * dict);
  617.         
  618. /* END COMMAND GATE COMPATIBILITY */
  619.  
  620. };
  621.  
  622. #endif /* !_IOHIDSYSTEM_H */
  623.