Index: /trunk/src/VBox/Main/include/MouseImpl.h
===================================================================
--- /trunk/src/VBox/Main/include/MouseImpl.h	(revision 50591)
+++ /trunk/src/VBox/Main/include/MouseImpl.h	(revision 50592)
@@ -19,5 +19,5 @@
 #define ____H_MOUSEIMPL
 
-#include "MouseWrap.h"
+#include "VirtualBoxBase.h"
 #include "ConsoleEvents.h"
 #include "ConsoleImpl.h"
@@ -31,7 +31,18 @@
 
 class ATL_NO_VTABLE Mouse :
-    public MouseWrap
+    public VirtualBoxBase
+    , VBOX_SCRIPTABLE_IMPL(IMouse)
 {
 public:
+
+    VIRTUALBOXBASE_ADD_ERRORINFO_SUPPORT(Mouse, IMouse)
+
+    DECLARE_NOT_AGGREGATABLE(Mouse)
+
+    DECLARE_PROTECT_FINAL_CONSTRUCT()
+
+    BEGIN_COM_MAP(Mouse)
+        VBOX_DEFAULT_INTERFACE_ENTRIES(IMouse)
+    END_COM_MAP()
 
     DECLARE_EMPTY_CTOR_DTOR (Mouse)
@@ -44,7 +55,22 @@
     void uninit();
 
+    // IMouse properties
+    STDMETHOD(COMGETTER(AbsoluteSupported)) (BOOL *absoluteSupported);
+    STDMETHOD(COMGETTER(RelativeSupported)) (BOOL *relativeSupported);
+    STDMETHOD(COMGETTER(MultiTouchSupported)) (BOOL *multiTouchSupported);
+    STDMETHOD(COMGETTER(NeedsHostCursor)) (BOOL *needsHostCursor);
+
+    // IMouse methods
+    STDMETHOD(PutMouseEvent)(LONG dx, LONG dy, LONG dz, LONG dw,
+                             LONG buttonState);
+    STDMETHOD(PutMouseEventAbsolute)(LONG x, LONG y, LONG dz, LONG dw,
+                                     LONG buttonState);
+    STDMETHOD(PutEventMultiTouch)(LONG aCount, ComSafeArrayIn(LONG64, aContacts), ULONG aScanTime);
+    STDMETHOD(PutEventMultiTouchString)(LONG aCount, IN_BSTR aContacts, ULONG aScanTime);
+    STDMETHOD(COMGETTER(EventSource)) (IEventSource ** aEventSource);
+
     static const PDMDRVREG  DrvReg;
 
-    ConsoleMouseInterface *i_getParent() const
+    ConsoleMouseInterface *getParent() const
     {
         return mParent;
@@ -52,66 +78,40 @@
 
     /** notify the front-end of guest capability changes */
-    void i_onVMMDevGuestCapsChange(uint32_t fCaps)
+    void onVMMDevGuestCapsChange(uint32_t fCaps)
     {
         mfVMMDevGuestCaps = fCaps;
-        i_sendMouseCapsNotifications();
+        sendMouseCapsNotifications();
     }
 
 private:
 
-    // Wrapped IMouse properties
-    HRESULT getAbsoluteSupported(BOOL *aAbsoluteSupported);
-    HRESULT getRelativeSupported(BOOL *aRelativeSupported);
-    HRESULT getMultiTouchSupported(BOOL *aMultiTouchSupported);
-    HRESULT getNeedsHostCursor(BOOL *aNeedsHostCursor);
-    HRESULT getEventSource(ComPtr<IEventSource> &aEventSource);
+    static DECLCALLBACK(void *) drvQueryInterface(PPDMIBASE pInterface, const char *pszIID);
+    static DECLCALLBACK(void)   mouseReportModes (PPDMIMOUSECONNECTOR pInterface, bool fRel, bool fAbs, bool fMT);
+    static DECLCALLBACK(int)    drvConstruct(PPDMDRVINS pDrvIns, PCFGMNODE pCfg, uint32_t fFlags);
+    static DECLCALLBACK(void)   drvDestruct(PPDMDRVINS pDrvIns);
 
-    // Wrapped IMouse methods
-    HRESULT putMouseEvent(LONG aDx,
-                          LONG aDy,
-                          LONG aDz,
-                          LONG aDw,
-                          LONG aButtonState);
-    HRESULT putMouseEventAbsolute(LONG aX,
-                                  LONG aY,
-                                  LONG aDz,
-                                  LONG aDw,
-                                  LONG aButtonState);
-    HRESULT putEventMultiTouch(LONG aCount,
-                               const std::vector<LONG64> &aContacts,
-                               ULONG aScanTime);
-    HRESULT putEventMultiTouchString(LONG aCount,
-                                     const com::Utf8Str &aContacts,
-                                     ULONG aScanTime);
+    HRESULT updateVMMDevMouseCaps(uint32_t fCapsAdded, uint32_t fCapsRemoved);
+    HRESULT reportRelEventToMouseDev(int32_t dx, int32_t dy, int32_t dz,
+                                 int32_t dw, uint32_t fButtons);
+    HRESULT reportAbsEventToMouseDev(int32_t x, int32_t y, int32_t dz,
+                                     int32_t dw, uint32_t fButtons);
+    HRESULT reportMTEventToMouseDev(int32_t x, int32_t z, uint32_t cContact,
+                                    uint32_t fContact);
+    HRESULT reportMultiTouchEventToDevice(uint8_t cContacts, const uint64_t *pau64Contacts, uint32_t u32ScanTime);
+    HRESULT reportAbsEventToVMMDev(int32_t x, int32_t y);
+    HRESULT reportAbsEvent(int32_t x, int32_t y, int32_t dz, int32_t dw,
+                           uint32_t fButtons, bool fUsesVMMDevEvent);
+    HRESULT convertDisplayRes(LONG x, LONG y, int32_t *pxAdj, int32_t *pyAdj,
+                              bool *pfValid);
+    HRESULT putEventMultiTouch(LONG aCount, LONG64 *paContacts, ULONG aScanTime);
 
-
-    static DECLCALLBACK(void *) i_drvQueryInterface(PPDMIBASE pInterface, const char *pszIID);
-    static DECLCALLBACK(void)   i_mouseReportModes(PPDMIMOUSECONNECTOR pInterface, bool fRel, bool fAbs, bool fMT);
-    static DECLCALLBACK(int)    i_drvConstruct(PPDMDRVINS pDrvIns, PCFGMNODE pCfg, uint32_t fFlags);
-    static DECLCALLBACK(void)   i_drvDestruct(PPDMDRVINS pDrvIns);
-
-    HRESULT i_updateVMMDevMouseCaps(uint32_t fCapsAdded, uint32_t fCapsRemoved);
-    HRESULT i_reportRelEventToMouseDev(int32_t dx, int32_t dy, int32_t dz,
-                                 int32_t dw, uint32_t fButtons);
-    HRESULT i_reportAbsEventToMouseDev(int32_t x, int32_t y, int32_t dz,
-                                     int32_t dw, uint32_t fButtons);
-    HRESULT i_reportMTEventToMouseDev(int32_t x, int32_t z, uint32_t cContact,
-                                    uint32_t fContact);
-    HRESULT i_reportMultiTouchEventToDevice(uint8_t cContacts, const uint64_t *pau64Contacts, uint32_t u32ScanTime);
-    HRESULT i_reportAbsEventToVMMDev(int32_t x, int32_t y);
-    HRESULT i_reportAbsEvent(int32_t x, int32_t y, int32_t dz, int32_t dw,
-                             uint32_t fButtons, bool fUsesVMMDevEvent);
-    HRESULT i_convertDisplayRes(LONG x, LONG y, int32_t *pxAdj, int32_t *pyAdj,
-                                 bool *pfValid);
-    HRESULT i_putEventMultiTouch(LONG aCount, LONG64 *paContacts, ULONG aScanTime);
-
-    void i_getDeviceCaps(bool *pfAbs, bool *pfRel, bool *fMT);
-    void i_sendMouseCapsNotifications(void);
-    bool i_guestNeedsHostCursor(void);
-    bool i_vmmdevCanAbs(void);
-    bool i_deviceCanAbs(void);
-    bool i_supportsAbs(void);
-    bool i_supportsRel(void);
-    bool i_supportsMT(void);
+    void getDeviceCaps(bool *pfAbs, bool *pfRel, bool *fMT);
+    void sendMouseCapsNotifications(void);
+    bool guestNeedsHostCursor(void);
+    bool vmmdevCanAbs(void);
+    bool deviceCanAbs(void);
+    bool supportsAbs(void);
+    bool supportsRel(void);
+    bool supportsMT(void);
 
     ConsoleMouseInterface * const         mParent;
@@ -127,10 +127,10 @@
     VBoxEventDesc                mMouseEvent;
 
-    void i_fireMouseEvent(bool fAbsolute, LONG x, LONG y, LONG dz, LONG dw,
-                          LONG fButtons);
+    void fireMouseEvent(bool fAbsolute, LONG x, LONG y, LONG dz, LONG dw,
+                        LONG fButtons);
 
-    void i_fireMultiTouchEvent(uint8_t cContacts,
-                               const LONG64 *paContacts,
-                               uint32_t u32ScanTime);
+    void fireMultiTouchEvent(uint8_t cContacts,
+                             const LONG64 *paContacts,
+                             uint32_t u32ScanTime);
 };
 
Index: /trunk/src/VBox/Main/src-client/MouseImpl.cpp
===================================================================
--- /trunk/src/VBox/Main/src-client/MouseImpl.cpp	(revision 50591)
+++ /trunk/src/VBox/Main/src-client/MouseImpl.cpp	(revision 50592)
@@ -156,6 +156,6 @@
  * thus to the guest.
  * @note all calls out of this object are made with no locks held! */
-HRESULT Mouse::i_updateVMMDevMouseCaps(uint32_t fCapsAdded,
-                                       uint32_t fCapsRemoved)
+HRESULT Mouse::updateVMMDevMouseCaps(uint32_t fCapsAdded,
+                                     uint32_t fCapsRemoved)
 {
     VMMDevMouseInterface *pVMMDev = mParent->getVMMDevMouseInterface();
@@ -179,7 +179,13 @@
  * @param absoluteSupported address of result variable
  */
-HRESULT Mouse::getAbsoluteSupported(BOOL *aAbsoluteSupported)
-{
-    *aAbsoluteSupported = i_supportsAbs();
+STDMETHODIMP Mouse::COMGETTER(AbsoluteSupported) (BOOL *absoluteSupported)
+{
+    if (!absoluteSupported)
+        return E_POINTER;
+
+    AutoCaller autoCaller(this);
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
+
+    *absoluteSupported = supportsAbs();
     return S_OK;
 }
@@ -192,8 +198,13 @@
  * @param relativeSupported address of result variable
  */
-HRESULT Mouse::getRelativeSupported(BOOL *aRelativeSupported)
-{
-
-    *aRelativeSupported = i_supportsRel();
+STDMETHODIMP Mouse::COMGETTER(RelativeSupported) (BOOL *relativeSupported)
+{
+    if (!relativeSupported)
+        return E_POINTER;
+
+    AutoCaller autoCaller(this);
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
+
+    *relativeSupported = supportsRel();
     return S_OK;
 }
@@ -206,8 +217,13 @@
  * @param multiTouchSupported address of result variable
  */
-HRESULT Mouse::getMultiTouchSupported(BOOL *aMultiTouchSupported)
-{
-
-    *aMultiTouchSupported = i_supportsMT();
+STDMETHODIMP Mouse::COMGETTER(MultiTouchSupported) (BOOL *multiTouchSupported)
+{
+    if (!multiTouchSupported)
+        return E_POINTER;
+
+    AutoCaller autoCaller(this);
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
+
+    *multiTouchSupported = supportsMT();
     return S_OK;
 }
@@ -220,8 +236,13 @@
  * @param pfNeedsHostCursor address of result variable
  */
-HRESULT Mouse::getNeedsHostCursor(BOOL *aNeedsHostCursor)
-{
-
-    *aNeedsHostCursor = i_guestNeedsHostCursor();
+STDMETHODIMP Mouse::COMGETTER(NeedsHostCursor) (BOOL *pfNeedsHostCursor)
+{
+    if (!pfNeedsHostCursor)
+        return E_POINTER;
+
+    AutoCaller autoCaller(this);
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
+
+    *pfNeedsHostCursor = guestNeedsHostCursor();
     return S_OK;
 }
@@ -233,5 +254,5 @@
  * held down from the format used by the front-end to the format used by PDM
  * and the emulated pointing devices. */
-static uint32_t i_mouseButtonsToPDM(LONG buttonState)
+static uint32_t mouseButtonsToPDM(LONG buttonState)
 {
     uint32_t fButtons = 0;
@@ -249,8 +270,14 @@
 }
 
-HRESULT Mouse::getEventSource(ComPtr<IEventSource> &aEventSource)
-{
+STDMETHODIMP Mouse::COMGETTER(EventSource)(IEventSource ** aEventSource)
+{
+    CheckComArgOutPointerValid(aEventSource);
+
+    AutoCaller autoCaller(this);
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
+
     // no need to lock - lifetime constant
-    mEventSource.queryInterfaceTo(aEventSource.asOutParam());
+    mEventSource.queryInterfaceTo(aEventSource);
+
     return S_OK;
 }
@@ -262,6 +289,6 @@
  * @returns   COM status code
  */
-HRESULT Mouse::i_reportRelEventToMouseDev(int32_t dx, int32_t dy, int32_t dz,
-                                          int32_t dw, uint32_t fButtons)
+HRESULT Mouse::reportRelEventToMouseDev(int32_t dx, int32_t dy, int32_t dz,
+                                        int32_t dw, uint32_t fButtons)
 {
     if (dx || dy || dz || dw || fButtons != mfLastButtons)
@@ -298,6 +325,6 @@
  * @returns   COM status code
  */
-HRESULT Mouse::i_reportAbsEventToMouseDev(int32_t x, int32_t y,
-                                          int32_t dz, int32_t dw, uint32_t fButtons)
+HRESULT Mouse::reportAbsEventToMouseDev(int32_t x, int32_t y,
+                                        int32_t dz, int32_t dw, uint32_t fButtons)
 {
     if (   x < VMMDEV_MOUSE_RANGE_MIN
@@ -335,7 +362,7 @@
 }
 
-HRESULT Mouse::i_reportMultiTouchEventToDevice(uint8_t cContacts,
-                                               const uint64_t *pau64Contacts,
-                                               uint32_t u32ScanTime)
+HRESULT Mouse::reportMultiTouchEventToDevice(uint8_t cContacts,
+                                             const uint64_t *pau64Contacts,
+                                             uint32_t u32ScanTime)
 {
     HRESULT hrc = S_OK;
@@ -380,5 +407,5 @@
  * @returns   COM status code
  */
-HRESULT Mouse::i_reportAbsEventToVMMDev(int32_t x, int32_t y)
+HRESULT Mouse::reportAbsEventToVMMDev(int32_t x, int32_t y)
 {
     VMMDevMouseInterface *pVMMDev = mParent->getVMMDevMouseInterface();
@@ -406,7 +433,7 @@
  * @returns   COM status code
  */
-HRESULT Mouse::i_reportAbsEvent(int32_t x, int32_t y,
-                                int32_t dz, int32_t dw, uint32_t fButtons,
-                                bool fUsesVMMDevEvent)
+HRESULT Mouse::reportAbsEvent(int32_t x, int32_t y,
+                              int32_t dz, int32_t dw, uint32_t fButtons,
+                              bool fUsesVMMDevEvent)
 {
     HRESULT rc;
@@ -416,5 +443,5 @@
     LONG cJiggle = 0;
 
-    if (i_vmmdevCanAbs())
+    if (vmmdevCanAbs())
     {
         /*
@@ -423,11 +450,11 @@
         if (x != mcLastX || y != mcLastY)
         {
-            rc = i_reportAbsEventToVMMDev(x, y);
+            rc = reportAbsEventToVMMDev(x, y);
             cJiggle = !fUsesVMMDevEvent;
         }
-        rc = i_reportRelEventToMouseDev(cJiggle, 0, dz, dw, fButtons);
+        rc = reportRelEventToMouseDev(cJiggle, 0, dz, dw, fButtons);
     }
     else
-        rc = i_reportAbsEventToMouseDev(x, y, dz, dw, fButtons);
+        rc = reportAbsEventToMouseDev(x, y, dz, dw, fButtons);
 
     mcLastX = x;
@@ -436,6 +463,6 @@
 }
 
-void Mouse::i_fireMouseEvent(bool fAbsolute, LONG x, LONG y, LONG dz, LONG dw,
-                             LONG fButtons)
+void Mouse::fireMouseEvent(bool fAbsolute, LONG x, LONG y, LONG dz, LONG dw,
+                           LONG fButtons)
 {
     /* If mouse button is pressed, we generate new event, to avoid reusable events coalescing and thus
@@ -462,7 +489,7 @@
 }
 
-void Mouse::i_fireMultiTouchEvent(uint8_t cContacts,
-                                  const LONG64 *paContacts,
-                                  uint32_t u32ScanTime)
+void Mouse::fireMultiTouchEvent(uint8_t cContacts,
+                                const LONG64 *paContacts,
+                                uint32_t u32ScanTime)
 {
     com::SafeArray<SHORT> xPositions(cContacts);
@@ -501,20 +528,22 @@
  * @param fButtons    The mouse button state
  */
-HRESULT Mouse::putMouseEvent(LONG dx, LONG dy, LONG dz, LONG dw,
-                             LONG aButtonState)
+STDMETHODIMP Mouse::PutMouseEvent(LONG dx, LONG dy, LONG dz, LONG dw,
+                                  LONG fButtons)
 {
     HRESULT rc;
     uint32_t fButtonsAdj;
 
+    AutoCaller autoCaller(this);
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
     LogRel3(("%s: dx=%d, dy=%d, dz=%d, dw=%d\n", __PRETTY_FUNCTION__,
                  dx, dy, dz, dw));
 
-    fButtonsAdj = i_mouseButtonsToPDM(aButtonState);
+    fButtonsAdj = mouseButtonsToPDM(fButtons);
     /* Make sure that the guest knows that we are sending real movement
      * events to the PS/2 device and not just dummy wake-up ones. */
-    i_updateVMMDevMouseCaps(0, VMMDEV_MOUSE_HOST_WANTS_ABSOLUTE);
-    rc = i_reportRelEventToMouseDev(dx, dy, dz, dw, fButtonsAdj);
-
-    i_fireMouseEvent(false, dx, dy, dz, dw, aButtonState);
+    updateVMMDevMouseCaps(0, VMMDEV_MOUSE_HOST_WANTS_ABSOLUTE);
+    rc = reportRelEventToMouseDev(dx, dy, dz, dw, fButtonsAdj);
+
+    fireMouseEvent(false, dx, dy, dz, dw, fButtons);
 
     return rc;
@@ -536,6 +565,6 @@
  * @returns   COM status value
  */
-HRESULT Mouse::i_convertDisplayRes(LONG x, LONG y, int32_t *pxAdj, int32_t *pyAdj,
-                                   bool *pfValid)
+HRESULT Mouse::convertDisplayRes(LONG x, LONG y, int32_t *pxAdj, int32_t *pyAdj,
+                                 bool *pfValid)
 {
     AssertPtrReturn(pxAdj, E_POINTER);
@@ -600,9 +629,12 @@
  * @param fButtons   The mouse button state
  */
-HRESULT Mouse::putMouseEventAbsolute(LONG x, LONG y, LONG dz, LONG dw,
-                                     LONG aButtonState)
-{
+STDMETHODIMP Mouse::PutMouseEventAbsolute(LONG x, LONG y, LONG dz, LONG dw,
+                                          LONG fButtons)
+{
+    AutoCaller autoCaller(this);
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
+
     LogRel3(("%s: x=%d, y=%d, dz=%d, dw=%d, fButtons=0x%x\n",
-             __PRETTY_FUNCTION__, x, y, dz, dw, aButtonState));
+             __PRETTY_FUNCTION__, x, y, dz, dw, fButtons));
 
     int32_t xAdj, yAdj;
@@ -613,19 +645,19 @@
     /** @note Or maybe not... races are pretty inherent in everything done in
      *        this object and not really bad as far as I can see. */
-    HRESULT rc = i_convertDisplayRes(x, y, &xAdj, &yAdj, &fValid);
+    HRESULT rc = convertDisplayRes(x, y, &xAdj, &yAdj, &fValid);
     if (FAILED(rc)) return rc;
 
-    fButtonsAdj = i_mouseButtonsToPDM(aButtonState);
+    fButtonsAdj = mouseButtonsToPDM(fButtons);
     /* If we are doing old-style (IRQ-less) absolute reporting to the VMM
      * device then make sure the guest is aware of it, so that it knows to
      * ignore relative movement on the PS/2 device. */
-    i_updateVMMDevMouseCaps(VMMDEV_MOUSE_HOST_WANTS_ABSOLUTE, 0);
+    updateVMMDevMouseCaps(VMMDEV_MOUSE_HOST_WANTS_ABSOLUTE, 0);
     if (fValid)
     {
-        rc = i_reportAbsEvent(xAdj, yAdj, dz, dw, fButtonsAdj,
-                              RT_BOOL(  mfVMMDevGuestCaps
-                                      & VMMDEV_MOUSE_NEW_PROTOCOL));
-
-        i_fireMouseEvent(true, x, y, dz, dw, aButtonState);
+        rc = reportAbsEvent(xAdj, yAdj, dz, dw, fButtonsAdj,
+                            RT_BOOL(  mfVMMDevGuestCaps
+                                    & VMMDEV_MOUSE_NEW_PROTOCOL));
+
+        fireMouseEvent(true, x, y, dz, dw, fButtons);
     }
 
@@ -642,9 +674,12 @@
  * @param aScanTime  Timestamp.
  */
-HRESULT Mouse::putEventMultiTouch(LONG aCount,
-                                  const std::vector<LONG64> &aContacts,
-                                  ULONG aScanTime)
-{
-    com::SafeArray <LONG64> arrayContacts(aContacts);
+STDMETHODIMP Mouse::PutEventMultiTouch(LONG aCount,
+                                       ComSafeArrayIn(LONG64, aContacts),
+                                       ULONG aScanTime)
+{
+    AutoCaller autoCaller(this);
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
+
+    com::SafeArray <LONG64> arrayContacts(ComSafeArrayInArg(aContacts));
 
     LogRel3(("%s: aCount %d(actual %d), aScanTime %u\n",
@@ -657,5 +692,5 @@
         LONG64* paContacts = arrayContacts.raw();
 
-        rc = i_putEventMultiTouch(aCount, paContacts, aScanTime);
+        rc = putEventMultiTouch(aCount, paContacts, aScanTime);
     }
     else
@@ -675,7 +710,7 @@
  * @param aScanTime  Timestamp.
  */
-HRESULT Mouse::putEventMultiTouchString(LONG aCount,
-                                        const com::Utf8Str &aContacts,
-                                        ULONG aScanTime)
+STDMETHODIMP Mouse::PutEventMultiTouchString(LONG aCount,
+                                             IN_BSTR aContacts,
+                                             ULONG aScanTime)
 {
     /** @todo implement: convert the string to LONG64 array and call putEventMultiTouch. */
@@ -691,7 +726,7 @@
 
 /* Used by PutEventMultiTouch and PutEventMultiTouchString. */
-HRESULT Mouse::i_putEventMultiTouch(LONG aCount,
-                                    LONG64 *paContacts,
-                                    ULONG aScanTime)
+HRESULT Mouse::putEventMultiTouch(LONG aCount,
+                                  LONG64 *paContacts,
+                                  ULONG aScanTime)
 {
     if (aCount >= 256)
@@ -784,8 +819,8 @@
     if (SUCCEEDED(rc))
     {
-        rc = i_reportMultiTouchEventToDevice(cContacts, cContacts? pau64Contacts: NULL, (uint32_t)aScanTime);
+        rc = reportMultiTouchEventToDevice(cContacts, cContacts? pau64Contacts: NULL, (uint32_t)aScanTime);
 
         /* Send the original contact information. */
-        i_fireMultiTouchEvent(cContacts, cContacts? paContacts: NULL, (uint32_t)aScanTime);
+        fireMultiTouchEvent(cContacts, cContacts? paContacts: NULL, (uint32_t)aScanTime);
     }
 
@@ -798,5 +833,5 @@
 /** Does the guest currently rely on the host to draw the mouse cursor or
  * can it switch to doing it itself in software? */
-bool Mouse::i_guestNeedsHostCursor(void)
+bool Mouse::guestNeedsHostCursor(void)
 {
     return RT_BOOL(mfVMMDevGuestCaps & VMMDEV_MOUSE_GUEST_NEEDS_HOST_CURSOR);
@@ -806,5 +841,5 @@
 /** Check what sort of reporting can be done using the devices currently
  * enabled.  Does not consider the VMM device. */
-void Mouse::i_getDeviceCaps(bool *pfAbs, bool *pfRel, bool *pfMT)
+void Mouse::getDeviceCaps(bool *pfAbs, bool *pfRel, bool *pfMT)
 {
     bool fAbsDev = false;
@@ -834,9 +869,9 @@
 
 /** Does the VMM device currently support absolute reporting? */
-bool Mouse::i_vmmdevCanAbs(void)
+bool Mouse::vmmdevCanAbs(void)
 {
     bool fRelDev;
 
-    i_getDeviceCaps(NULL, &fRelDev, NULL);
+    getDeviceCaps(NULL, &fRelDev, NULL);
     return    (mfVMMDevGuestCaps & VMMDEV_MOUSE_GUEST_CAN_ABSOLUTE)
            && fRelDev;
@@ -845,9 +880,9 @@
 
 /** Does the VMM device currently support absolute reporting? */
-bool Mouse::i_deviceCanAbs(void)
+bool Mouse::deviceCanAbs(void)
 {
     bool fAbsDev;
 
-    i_getDeviceCaps(&fAbsDev, NULL, NULL);
+    getDeviceCaps(&fAbsDev, NULL, NULL);
     return fAbsDev;
 }
@@ -855,9 +890,9 @@
 
 /** Can we currently send relative events to the guest? */
-bool Mouse::i_supportsRel(void)
+bool Mouse::supportsRel(void)
 {
     bool fRelDev;
 
-    i_getDeviceCaps(NULL, &fRelDev, NULL);
+    getDeviceCaps(NULL, &fRelDev, NULL);
     return fRelDev;
 }
@@ -865,19 +900,19 @@
 
 /** Can we currently send absolute events to the guest? */
-bool Mouse::i_supportsAbs(void)
+bool Mouse::supportsAbs(void)
 {
     bool fAbsDev;
 
-    i_getDeviceCaps(&fAbsDev, NULL, NULL);
-    return fAbsDev || i_vmmdevCanAbs();
+    getDeviceCaps(&fAbsDev, NULL, NULL);
+    return fAbsDev || vmmdevCanAbs();
 }
 
 
 /** Can we currently send absolute events to the guest? */
-bool Mouse::i_supportsMT(void)
+bool Mouse::supportsMT(void)
 {
     bool fMTDev;
 
-    i_getDeviceCaps(NULL, NULL, &fMTDev);
+    getDeviceCaps(NULL, NULL, &fMTDev);
     return fMTDev;
 }
@@ -887,5 +922,5 @@
  * enabled (including the VMM device) and notify the guest and the front-end.
  */
-void Mouse::i_sendMouseCapsNotifications(void)
+void Mouse::sendMouseCapsNotifications(void)
 {
     bool fAbsDev, fRelDev, fMTDev, fCanAbs, fNeedsHostCursor;
@@ -894,12 +929,12 @@
         AutoReadLock aLock(this COMMA_LOCKVAL_SRC_POS);
 
-        i_getDeviceCaps(&fAbsDev, &fRelDev, &fMTDev);
-        fCanAbs = i_supportsAbs();
-        fNeedsHostCursor = i_guestNeedsHostCursor();
+        getDeviceCaps(&fAbsDev, &fRelDev, &fMTDev);
+        fCanAbs = supportsAbs();
+        fNeedsHostCursor = guestNeedsHostCursor();
     }
     if (fAbsDev)
-        i_updateVMMDevMouseCaps(VMMDEV_MOUSE_HOST_HAS_ABS_DEV, 0);
+        updateVMMDevMouseCaps(VMMDEV_MOUSE_HOST_HAS_ABS_DEV, 0);
     else
-        i_updateVMMDevMouseCaps(0, VMMDEV_MOUSE_HOST_HAS_ABS_DEV);
+        updateVMMDevMouseCaps(0, VMMDEV_MOUSE_HOST_HAS_ABS_DEV);
     /** @todo this call takes the Console lock in order to update the cached
      * callback data atomically.  However I can't see any sign that the cached
@@ -913,5 +948,5 @@
  * A virtual device is notifying us about its current state and capabilities
  */
-DECLCALLBACK(void) Mouse::i_mouseReportModes(PPDMIMOUSECONNECTOR pInterface, bool fRel, bool fAbs, bool fMT)
+DECLCALLBACK(void) Mouse::mouseReportModes(PPDMIMOUSECONNECTOR pInterface, bool fRel, bool fAbs, bool fMT)
 {
     PDRVMAINMOUSE pDrv = RT_FROM_MEMBER(pInterface, DRVMAINMOUSE, IConnector);
@@ -929,5 +964,5 @@
         pDrv->u32DevCaps &= ~MOUSE_DEVCAP_MULTI_TOUCH;
 
-    pDrv->pMouse->i_sendMouseCapsNotifications();
+    pDrv->pMouse->sendMouseCapsNotifications();
 }
 
@@ -936,5 +971,5 @@
  * @interface_method_impl{PDMIBASE,pfnQueryInterface}
  */
-DECLCALLBACK(void *)  Mouse::i_drvQueryInterface(PPDMIBASE pInterface, const char *pszIID)
+DECLCALLBACK(void *)  Mouse::drvQueryInterface(PPDMIBASE pInterface, const char *pszIID)
 {
     PPDMDRVINS      pDrvIns = PDMIBASE_2_PDMDRV(pInterface);
@@ -953,5 +988,5 @@
  * @param   pDrvIns     The driver instance data.
  */
-DECLCALLBACK(void) Mouse::i_drvDestruct(PPDMDRVINS pDrvIns)
+DECLCALLBACK(void) Mouse::drvDestruct(PPDMDRVINS pDrvIns)
 {
     PDMDRV_CHECK_VERSIONS_RETURN_VOID(pDrvIns);
@@ -977,5 +1012,5 @@
  * @copydoc FNPDMDRVCONSTRUCT
  */
-DECLCALLBACK(int) Mouse::i_drvConstruct(PPDMDRVINS pDrvIns, PCFGMNODE pCfg, uint32_t fFlags)
+DECLCALLBACK(int) Mouse::drvConstruct(PPDMDRVINS pDrvIns, PCFGMNODE pCfg, uint32_t fFlags)
 {
     PDMDRV_CHECK_VERSIONS_RETURN(pDrvIns);
@@ -995,7 +1030,7 @@
      * IBase.
      */
-    pDrvIns->IBase.pfnQueryInterface        = Mouse::i_drvQueryInterface;
-
-    pThis->IConnector.pfnReportModes        = Mouse::i_mouseReportModes;
+    pDrvIns->IBase.pfnQueryInterface        = Mouse::drvQueryInterface;
+
+    pThis->IConnector.pfnReportModes        = Mouse::mouseReportModes;
 
     /*
@@ -1062,7 +1097,7 @@
     sizeof(DRVMAINMOUSE),
     /* pfnConstruct */
-    Mouse::i_drvConstruct,
+    Mouse::drvConstruct,
     /* pfnDestruct */
-    Mouse::i_drvDestruct,
+    Mouse::drvDestruct,
     /* pfnRelocate */
     NULL,
Index: /trunk/src/VBox/Main/src-client/VMMDevInterface.cpp
===================================================================
--- /trunk/src/VBox/Main/src-client/VMMDevInterface.cpp	(revision 50591)
+++ /trunk/src/VBox/Main/src-client/VMMDevInterface.cpp	(revision 50592)
@@ -339,5 +339,5 @@
     Mouse *pMouse = pConsole->getMouse();
     if (pMouse)  /** @todo and if not?  Can that actually happen? */
-        pMouse->i_onVMMDevGuestCapsChange(fNewCaps & VMMDEV_MOUSE_GUEST_MASK);
+        pMouse->onVMMDevGuestCapsChange(fNewCaps & VMMDEV_MOUSE_GUEST_MASK);
 }
 
Index: /trunk/src/VBox/Main/src-client/xpcom/module.cpp
===================================================================
--- /trunk/src/VBox/Main/src-client/xpcom/module.cpp	(revision 50591)
+++ /trunk/src/VBox/Main/src-client/xpcom/module.cpp	(revision 50592)
@@ -78,4 +78,6 @@
 NS_DECL_CLASSINFO(Keyboard)
 NS_IMPL_THREADSAFE_ISUPPORTS1_CI(Keyboard, IKeyboard)
+NS_DECL_CLASSINFO(Mouse)
+NS_IMPL_THREADSAFE_ISUPPORTS1_CI(Mouse, IMouse)
 NS_DECL_CLASSINFO(Display)
 NS_IMPL_THREADSAFE_ISUPPORTS2_CI(Display, IDisplay, IEventListener)
Index: /trunk/src/VBox/Main/testcase/Makefile.kmk
===================================================================
--- /trunk/src/VBox/Main/testcase/Makefile.kmk	(revision 50591)
+++ /trunk/src/VBox/Main/testcase/Makefile.kmk	(revision 50592)
@@ -237,5 +237,5 @@
 # tstMouseImpl
 #
-tstMouseImpl_TEMPLATE = VBOXMAINCLIENTTSTEXE
+tstMouseImpl_TEMPLATE = VBOXMAINTSTEXE
 tstMouseImpl_SOURCES  = \
 	tstMouseImpl.cpp \
@@ -250,8 +250,5 @@
 	$(VBOX_PATH_SDK)/bindings/xpcom/include/nsprpub \
 	$(VBOX_PATH_SDK)/bindings/xpcom/include/xpcom \
-	$(dir $(VBOX_XML_SCHEMADEFS_H)) \
- 	$(VBOX_MAIN_APIWRAPPER_INCS)
-tstMouse_INTERMEDIATES   = $(VBOX_MAIN_APIWRAPPER_GEN_HDRS)
-
+	$(dir $(VBOX_XML_SCHEMADEFS_H))
 tstMouseImpl_LIBS      = \
 	$(PATH_STAGE_LIB)/VBoxAPIWrap$(VBOX_SUFF_LIB) \
Index: /trunk/src/VBox/Main/testcase/tstMouseImpl.cpp
===================================================================
--- /trunk/src/VBox/Main/testcase/tstMouseImpl.cpp	(revision 50591)
+++ /trunk/src/VBox/Main/testcase/tstMouseImpl.cpp	(revision 50592)
@@ -30,4 +30,8 @@
 #include <iprt/test.h>
 
+#ifndef RT_OS_WINDOWS
+NS_DECL_CLASSINFO(Mouse)
+NS_IMPL_THREADSAFE_ISUPPORTS1_CI(Mouse, IMouse)
+#endif
 
 PDMIVMMDEVPORT VMMDevPort;
@@ -319,6 +323,6 @@
                                                  PDMIMOUSECONNECTOR_IID);
     pConnector->pfnReportModes(pConnector, true, false, false);
-    pMouse->i_onVMMDevGuestCapsChange(  VMMDEV_MOUSE_GUEST_CAN_ABSOLUTE
-                                      | VMMDEV_MOUSE_NEW_PROTOCOL);
+    pMouse->onVMMDevGuestCapsChange(  VMMDEV_MOUSE_GUEST_CAN_ABSOLUTE
+                                    | VMMDEV_MOUSE_NEW_PROTOCOL);
     pMouse->PutMouseEventAbsolute(0, 0, 0, 0, 0);
     RTTESTI_CHECK_MSG(approxEq(absoluteMouse.x, 0x8000, 200),
@@ -350,5 +354,5 @@
                                                  PDMIMOUSECONNECTOR_IID);
     pConnector->pfnReportModes(pConnector, true, false, false);
-    pMouse->i_onVMMDevGuestCapsChange(VMMDEV_MOUSE_GUEST_CAN_ABSOLUTE);
+    pMouse->onVMMDevGuestCapsChange(VMMDEV_MOUSE_GUEST_CAN_ABSOLUTE);
     pMouse->PutMouseEventAbsolute(320, 240, 0, 0, 0);
     RTTESTI_CHECK_MSG(approxEq(absoluteMouse.x, 0x8000, 200),
@@ -380,5 +384,5 @@
                                                  PDMIMOUSECONNECTOR_IID);
     pConnector->pfnReportModes(pConnector, false, true, false);
-    pMouse->i_onVMMDevGuestCapsChange(VMMDEV_MOUSE_NEW_PROTOCOL);
+    pMouse->onVMMDevGuestCapsChange(VMMDEV_MOUSE_NEW_PROTOCOL);
     pMouse->PutMouseEventAbsolute(0, 0, 0, 0, 0);
     RTTESTI_CHECK_MSG(approxEq(mouseEventAbs.cx, 0x8000, 200),
