VirtualBox

Changeset 50592 in vbox for trunk/src/VBox/Main


Ignore:
Timestamp:
Feb 25, 2014 7:56:18 PM (11 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
92463
Message:

6813 src-client/MouseImpl.cpp changes backed out to clear clbr burns

Location:
trunk/src/VBox/Main
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/include/MouseImpl.h

    r50589 r50592  
    1919#define ____H_MOUSEIMPL
    2020
    21 #include "MouseWrap.h"
     21#include "VirtualBoxBase.h"
    2222#include "ConsoleEvents.h"
    2323#include "ConsoleImpl.h"
     
    3131
    3232class ATL_NO_VTABLE Mouse :
    33     public MouseWrap
     33    public VirtualBoxBase
     34    , VBOX_SCRIPTABLE_IMPL(IMouse)
    3435{
    3536public:
     37
     38    VIRTUALBOXBASE_ADD_ERRORINFO_SUPPORT(Mouse, IMouse)
     39
     40    DECLARE_NOT_AGGREGATABLE(Mouse)
     41
     42    DECLARE_PROTECT_FINAL_CONSTRUCT()
     43
     44    BEGIN_COM_MAP(Mouse)
     45        VBOX_DEFAULT_INTERFACE_ENTRIES(IMouse)
     46    END_COM_MAP()
    3647
    3748    DECLARE_EMPTY_CTOR_DTOR (Mouse)
     
    4455    void uninit();
    4556
     57    // IMouse properties
     58    STDMETHOD(COMGETTER(AbsoluteSupported)) (BOOL *absoluteSupported);
     59    STDMETHOD(COMGETTER(RelativeSupported)) (BOOL *relativeSupported);
     60    STDMETHOD(COMGETTER(MultiTouchSupported)) (BOOL *multiTouchSupported);
     61    STDMETHOD(COMGETTER(NeedsHostCursor)) (BOOL *needsHostCursor);
     62
     63    // IMouse methods
     64    STDMETHOD(PutMouseEvent)(LONG dx, LONG dy, LONG dz, LONG dw,
     65                             LONG buttonState);
     66    STDMETHOD(PutMouseEventAbsolute)(LONG x, LONG y, LONG dz, LONG dw,
     67                                     LONG buttonState);
     68    STDMETHOD(PutEventMultiTouch)(LONG aCount, ComSafeArrayIn(LONG64, aContacts), ULONG aScanTime);
     69    STDMETHOD(PutEventMultiTouchString)(LONG aCount, IN_BSTR aContacts, ULONG aScanTime);
     70    STDMETHOD(COMGETTER(EventSource)) (IEventSource ** aEventSource);
     71
    4672    static const PDMDRVREG  DrvReg;
    4773
    48     ConsoleMouseInterface *i_getParent() const
     74    ConsoleMouseInterface *getParent() const
    4975    {
    5076        return mParent;
     
    5278
    5379    /** notify the front-end of guest capability changes */
    54     void i_onVMMDevGuestCapsChange(uint32_t fCaps)
     80    void onVMMDevGuestCapsChange(uint32_t fCaps)
    5581    {
    5682        mfVMMDevGuestCaps = fCaps;
    57         i_sendMouseCapsNotifications();
     83        sendMouseCapsNotifications();
    5884    }
    5985
    6086private:
    6187
    62     // Wrapped IMouse properties
    63     HRESULT getAbsoluteSupported(BOOL *aAbsoluteSupported);
    64     HRESULT getRelativeSupported(BOOL *aRelativeSupported);
    65     HRESULT getMultiTouchSupported(BOOL *aMultiTouchSupported);
    66     HRESULT getNeedsHostCursor(BOOL *aNeedsHostCursor);
    67     HRESULT getEventSource(ComPtr<IEventSource> &aEventSource);
     88    static DECLCALLBACK(void *) drvQueryInterface(PPDMIBASE pInterface, const char *pszIID);
     89    static DECLCALLBACK(void)   mouseReportModes (PPDMIMOUSECONNECTOR pInterface, bool fRel, bool fAbs, bool fMT);
     90    static DECLCALLBACK(int)    drvConstruct(PPDMDRVINS pDrvIns, PCFGMNODE pCfg, uint32_t fFlags);
     91    static DECLCALLBACK(void)   drvDestruct(PPDMDRVINS pDrvIns);
    6892
    69     // Wrapped IMouse methods
    70     HRESULT putMouseEvent(LONG aDx,
    71                           LONG aDy,
    72                           LONG aDz,
    73                           LONG aDw,
    74                           LONG aButtonState);
    75     HRESULT putMouseEventAbsolute(LONG aX,
    76                                   LONG aY,
    77                                   LONG aDz,
    78                                   LONG aDw,
    79                                   LONG aButtonState);
    80     HRESULT putEventMultiTouch(LONG aCount,
    81                                const std::vector<LONG64> &aContacts,
    82                                ULONG aScanTime);
    83     HRESULT putEventMultiTouchString(LONG aCount,
    84                                      const com::Utf8Str &aContacts,
    85                                      ULONG aScanTime);
     93    HRESULT updateVMMDevMouseCaps(uint32_t fCapsAdded, uint32_t fCapsRemoved);
     94    HRESULT reportRelEventToMouseDev(int32_t dx, int32_t dy, int32_t dz,
     95                                 int32_t dw, uint32_t fButtons);
     96    HRESULT reportAbsEventToMouseDev(int32_t x, int32_t y, int32_t dz,
     97                                     int32_t dw, uint32_t fButtons);
     98    HRESULT reportMTEventToMouseDev(int32_t x, int32_t z, uint32_t cContact,
     99                                    uint32_t fContact);
     100    HRESULT reportMultiTouchEventToDevice(uint8_t cContacts, const uint64_t *pau64Contacts, uint32_t u32ScanTime);
     101    HRESULT reportAbsEventToVMMDev(int32_t x, int32_t y);
     102    HRESULT reportAbsEvent(int32_t x, int32_t y, int32_t dz, int32_t dw,
     103                           uint32_t fButtons, bool fUsesVMMDevEvent);
     104    HRESULT convertDisplayRes(LONG x, LONG y, int32_t *pxAdj, int32_t *pyAdj,
     105                              bool *pfValid);
     106    HRESULT putEventMultiTouch(LONG aCount, LONG64 *paContacts, ULONG aScanTime);
    86107
    87 
    88     static DECLCALLBACK(void *) i_drvQueryInterface(PPDMIBASE pInterface, const char *pszIID);
    89     static DECLCALLBACK(void)   i_mouseReportModes(PPDMIMOUSECONNECTOR pInterface, bool fRel, bool fAbs, bool fMT);
    90     static DECLCALLBACK(int)    i_drvConstruct(PPDMDRVINS pDrvIns, PCFGMNODE pCfg, uint32_t fFlags);
    91     static DECLCALLBACK(void)   i_drvDestruct(PPDMDRVINS pDrvIns);
    92 
    93     HRESULT i_updateVMMDevMouseCaps(uint32_t fCapsAdded, uint32_t fCapsRemoved);
    94     HRESULT i_reportRelEventToMouseDev(int32_t dx, int32_t dy, int32_t dz,
    95                                  int32_t dw, uint32_t fButtons);
    96     HRESULT i_reportAbsEventToMouseDev(int32_t x, int32_t y, int32_t dz,
    97                                      int32_t dw, uint32_t fButtons);
    98     HRESULT i_reportMTEventToMouseDev(int32_t x, int32_t z, uint32_t cContact,
    99                                     uint32_t fContact);
    100     HRESULT i_reportMultiTouchEventToDevice(uint8_t cContacts, const uint64_t *pau64Contacts, uint32_t u32ScanTime);
    101     HRESULT i_reportAbsEventToVMMDev(int32_t x, int32_t y);
    102     HRESULT i_reportAbsEvent(int32_t x, int32_t y, int32_t dz, int32_t dw,
    103                              uint32_t fButtons, bool fUsesVMMDevEvent);
    104     HRESULT i_convertDisplayRes(LONG x, LONG y, int32_t *pxAdj, int32_t *pyAdj,
    105                                  bool *pfValid);
    106     HRESULT i_putEventMultiTouch(LONG aCount, LONG64 *paContacts, ULONG aScanTime);
    107 
    108     void i_getDeviceCaps(bool *pfAbs, bool *pfRel, bool *fMT);
    109     void i_sendMouseCapsNotifications(void);
    110     bool i_guestNeedsHostCursor(void);
    111     bool i_vmmdevCanAbs(void);
    112     bool i_deviceCanAbs(void);
    113     bool i_supportsAbs(void);
    114     bool i_supportsRel(void);
    115     bool i_supportsMT(void);
     108    void getDeviceCaps(bool *pfAbs, bool *pfRel, bool *fMT);
     109    void sendMouseCapsNotifications(void);
     110    bool guestNeedsHostCursor(void);
     111    bool vmmdevCanAbs(void);
     112    bool deviceCanAbs(void);
     113    bool supportsAbs(void);
     114    bool supportsRel(void);
     115    bool supportsMT(void);
    116116
    117117    ConsoleMouseInterface * const         mParent;
     
    127127    VBoxEventDesc                mMouseEvent;
    128128
    129     void i_fireMouseEvent(bool fAbsolute, LONG x, LONG y, LONG dz, LONG dw,
    130                           LONG fButtons);
     129    void fireMouseEvent(bool fAbsolute, LONG x, LONG y, LONG dz, LONG dw,
     130                        LONG fButtons);
    131131
    132     void i_fireMultiTouchEvent(uint8_t cContacts,
    133                                const LONG64 *paContacts,
    134                                uint32_t u32ScanTime);
     132    void fireMultiTouchEvent(uint8_t cContacts,
     133                             const LONG64 *paContacts,
     134                             uint32_t u32ScanTime);
    135135};
    136136
  • trunk/src/VBox/Main/src-client/MouseImpl.cpp

    r50589 r50592  
    156156 * thus to the guest.
    157157 * @note all calls out of this object are made with no locks held! */
    158 HRESULT Mouse::i_updateVMMDevMouseCaps(uint32_t fCapsAdded,
    159                                        uint32_t fCapsRemoved)
     158HRESULT Mouse::updateVMMDevMouseCaps(uint32_t fCapsAdded,
     159                                     uint32_t fCapsRemoved)
    160160{
    161161    VMMDevMouseInterface *pVMMDev = mParent->getVMMDevMouseInterface();
     
    179179 * @param absoluteSupported address of result variable
    180180 */
    181 HRESULT Mouse::getAbsoluteSupported(BOOL *aAbsoluteSupported)
    182 {
    183     *aAbsoluteSupported = i_supportsAbs();
     181STDMETHODIMP Mouse::COMGETTER(AbsoluteSupported) (BOOL *absoluteSupported)
     182{
     183    if (!absoluteSupported)
     184        return E_POINTER;
     185
     186    AutoCaller autoCaller(this);
     187    if (FAILED(autoCaller.rc())) return autoCaller.rc();
     188
     189    *absoluteSupported = supportsAbs();
    184190    return S_OK;
    185191}
     
    192198 * @param relativeSupported address of result variable
    193199 */
    194 HRESULT Mouse::getRelativeSupported(BOOL *aRelativeSupported)
    195 {
    196 
    197     *aRelativeSupported = i_supportsRel();
     200STDMETHODIMP Mouse::COMGETTER(RelativeSupported) (BOOL *relativeSupported)
     201{
     202    if (!relativeSupported)
     203        return E_POINTER;
     204
     205    AutoCaller autoCaller(this);
     206    if (FAILED(autoCaller.rc())) return autoCaller.rc();
     207
     208    *relativeSupported = supportsRel();
    198209    return S_OK;
    199210}
     
    206217 * @param multiTouchSupported address of result variable
    207218 */
    208 HRESULT Mouse::getMultiTouchSupported(BOOL *aMultiTouchSupported)
    209 {
    210 
    211     *aMultiTouchSupported = i_supportsMT();
     219STDMETHODIMP Mouse::COMGETTER(MultiTouchSupported) (BOOL *multiTouchSupported)
     220{
     221    if (!multiTouchSupported)
     222        return E_POINTER;
     223
     224    AutoCaller autoCaller(this);
     225    if (FAILED(autoCaller.rc())) return autoCaller.rc();
     226
     227    *multiTouchSupported = supportsMT();
    212228    return S_OK;
    213229}
     
    220236 * @param pfNeedsHostCursor address of result variable
    221237 */
    222 HRESULT Mouse::getNeedsHostCursor(BOOL *aNeedsHostCursor)
    223 {
    224 
    225     *aNeedsHostCursor = i_guestNeedsHostCursor();
     238STDMETHODIMP Mouse::COMGETTER(NeedsHostCursor) (BOOL *pfNeedsHostCursor)
     239{
     240    if (!pfNeedsHostCursor)
     241        return E_POINTER;
     242
     243    AutoCaller autoCaller(this);
     244    if (FAILED(autoCaller.rc())) return autoCaller.rc();
     245
     246    *pfNeedsHostCursor = guestNeedsHostCursor();
    226247    return S_OK;
    227248}
     
    233254 * held down from the format used by the front-end to the format used by PDM
    234255 * and the emulated pointing devices. */
    235 static uint32_t i_mouseButtonsToPDM(LONG buttonState)
     256static uint32_t mouseButtonsToPDM(LONG buttonState)
    236257{
    237258    uint32_t fButtons = 0;
     
    249270}
    250271
    251 HRESULT Mouse::getEventSource(ComPtr<IEventSource> &aEventSource)
    252 {
     272STDMETHODIMP Mouse::COMGETTER(EventSource)(IEventSource ** aEventSource)
     273{
     274    CheckComArgOutPointerValid(aEventSource);
     275
     276    AutoCaller autoCaller(this);
     277    if (FAILED(autoCaller.rc())) return autoCaller.rc();
     278
    253279    // no need to lock - lifetime constant
    254     mEventSource.queryInterfaceTo(aEventSource.asOutParam());
     280    mEventSource.queryInterfaceTo(aEventSource);
     281
    255282    return S_OK;
    256283}
     
    262289 * @returns   COM status code
    263290 */
    264 HRESULT Mouse::i_reportRelEventToMouseDev(int32_t dx, int32_t dy, int32_t dz,
    265                                           int32_t dw, uint32_t fButtons)
     291HRESULT Mouse::reportRelEventToMouseDev(int32_t dx, int32_t dy, int32_t dz,
     292                                        int32_t dw, uint32_t fButtons)
    266293{
    267294    if (dx || dy || dz || dw || fButtons != mfLastButtons)
     
    298325 * @returns   COM status code
    299326 */
    300 HRESULT Mouse::i_reportAbsEventToMouseDev(int32_t x, int32_t y,
    301                                           int32_t dz, int32_t dw, uint32_t fButtons)
     327HRESULT Mouse::reportAbsEventToMouseDev(int32_t x, int32_t y,
     328                                        int32_t dz, int32_t dw, uint32_t fButtons)
    302329{
    303330    if (   x < VMMDEV_MOUSE_RANGE_MIN
     
    335362}
    336363
    337 HRESULT Mouse::i_reportMultiTouchEventToDevice(uint8_t cContacts,
    338                                                const uint64_t *pau64Contacts,
    339                                                uint32_t u32ScanTime)
     364HRESULT Mouse::reportMultiTouchEventToDevice(uint8_t cContacts,
     365                                             const uint64_t *pau64Contacts,
     366                                             uint32_t u32ScanTime)
    340367{
    341368    HRESULT hrc = S_OK;
     
    380407 * @returns   COM status code
    381408 */
    382 HRESULT Mouse::i_reportAbsEventToVMMDev(int32_t x, int32_t y)
     409HRESULT Mouse::reportAbsEventToVMMDev(int32_t x, int32_t y)
    383410{
    384411    VMMDevMouseInterface *pVMMDev = mParent->getVMMDevMouseInterface();
     
    406433 * @returns   COM status code
    407434 */
    408 HRESULT Mouse::i_reportAbsEvent(int32_t x, int32_t y,
    409                                 int32_t dz, int32_t dw, uint32_t fButtons,
    410                                 bool fUsesVMMDevEvent)
     435HRESULT Mouse::reportAbsEvent(int32_t x, int32_t y,
     436                              int32_t dz, int32_t dw, uint32_t fButtons,
     437                              bool fUsesVMMDevEvent)
    411438{
    412439    HRESULT rc;
     
    416443    LONG cJiggle = 0;
    417444
    418     if (i_vmmdevCanAbs())
     445    if (vmmdevCanAbs())
    419446    {
    420447        /*
     
    423450        if (x != mcLastX || y != mcLastY)
    424451        {
    425             rc = i_reportAbsEventToVMMDev(x, y);
     452            rc = reportAbsEventToVMMDev(x, y);
    426453            cJiggle = !fUsesVMMDevEvent;
    427454        }
    428         rc = i_reportRelEventToMouseDev(cJiggle, 0, dz, dw, fButtons);
     455        rc = reportRelEventToMouseDev(cJiggle, 0, dz, dw, fButtons);
    429456    }
    430457    else
    431         rc = i_reportAbsEventToMouseDev(x, y, dz, dw, fButtons);
     458        rc = reportAbsEventToMouseDev(x, y, dz, dw, fButtons);
    432459
    433460    mcLastX = x;
     
    436463}
    437464
    438 void Mouse::i_fireMouseEvent(bool fAbsolute, LONG x, LONG y, LONG dz, LONG dw,
    439                              LONG fButtons)
     465void Mouse::fireMouseEvent(bool fAbsolute, LONG x, LONG y, LONG dz, LONG dw,
     466                           LONG fButtons)
    440467{
    441468    /* If mouse button is pressed, we generate new event, to avoid reusable events coalescing and thus
     
    462489}
    463490
    464 void Mouse::i_fireMultiTouchEvent(uint8_t cContacts,
    465                                   const LONG64 *paContacts,
    466                                   uint32_t u32ScanTime)
     491void Mouse::fireMultiTouchEvent(uint8_t cContacts,
     492                                const LONG64 *paContacts,
     493                                uint32_t u32ScanTime)
    467494{
    468495    com::SafeArray<SHORT> xPositions(cContacts);
     
    501528 * @param fButtons    The mouse button state
    502529 */
    503 HRESULT Mouse::putMouseEvent(LONG dx, LONG dy, LONG dz, LONG dw,
    504                              LONG aButtonState)
     530STDMETHODIMP Mouse::PutMouseEvent(LONG dx, LONG dy, LONG dz, LONG dw,
     531                                  LONG fButtons)
    505532{
    506533    HRESULT rc;
    507534    uint32_t fButtonsAdj;
    508535
     536    AutoCaller autoCaller(this);
     537    if (FAILED(autoCaller.rc())) return autoCaller.rc();
    509538    LogRel3(("%s: dx=%d, dy=%d, dz=%d, dw=%d\n", __PRETTY_FUNCTION__,
    510539                 dx, dy, dz, dw));
    511540
    512     fButtonsAdj = i_mouseButtonsToPDM(aButtonState);
     541    fButtonsAdj = mouseButtonsToPDM(fButtons);
    513542    /* Make sure that the guest knows that we are sending real movement
    514543     * events to the PS/2 device and not just dummy wake-up ones. */
    515     i_updateVMMDevMouseCaps(0, VMMDEV_MOUSE_HOST_WANTS_ABSOLUTE);
    516     rc = i_reportRelEventToMouseDev(dx, dy, dz, dw, fButtonsAdj);
    517 
    518     i_fireMouseEvent(false, dx, dy, dz, dw, aButtonState);
     544    updateVMMDevMouseCaps(0, VMMDEV_MOUSE_HOST_WANTS_ABSOLUTE);
     545    rc = reportRelEventToMouseDev(dx, dy, dz, dw, fButtonsAdj);
     546
     547    fireMouseEvent(false, dx, dy, dz, dw, fButtons);
    519548
    520549    return rc;
     
    536565 * @returns   COM status value
    537566 */
    538 HRESULT Mouse::i_convertDisplayRes(LONG x, LONG y, int32_t *pxAdj, int32_t *pyAdj,
    539                                    bool *pfValid)
     567HRESULT Mouse::convertDisplayRes(LONG x, LONG y, int32_t *pxAdj, int32_t *pyAdj,
     568                                 bool *pfValid)
    540569{
    541570    AssertPtrReturn(pxAdj, E_POINTER);
     
    600629 * @param fButtons   The mouse button state
    601630 */
    602 HRESULT Mouse::putMouseEventAbsolute(LONG x, LONG y, LONG dz, LONG dw,
    603                                      LONG aButtonState)
    604 {
     631STDMETHODIMP Mouse::PutMouseEventAbsolute(LONG x, LONG y, LONG dz, LONG dw,
     632                                          LONG fButtons)
     633{
     634    AutoCaller autoCaller(this);
     635    if (FAILED(autoCaller.rc())) return autoCaller.rc();
     636
    605637    LogRel3(("%s: x=%d, y=%d, dz=%d, dw=%d, fButtons=0x%x\n",
    606              __PRETTY_FUNCTION__, x, y, dz, dw, aButtonState));
     638             __PRETTY_FUNCTION__, x, y, dz, dw, fButtons));
    607639
    608640    int32_t xAdj, yAdj;
     
    613645    /** @note Or maybe not... races are pretty inherent in everything done in
    614646     *        this object and not really bad as far as I can see. */
    615     HRESULT rc = i_convertDisplayRes(x, y, &xAdj, &yAdj, &fValid);
     647    HRESULT rc = convertDisplayRes(x, y, &xAdj, &yAdj, &fValid);
    616648    if (FAILED(rc)) return rc;
    617649
    618     fButtonsAdj = i_mouseButtonsToPDM(aButtonState);
     650    fButtonsAdj = mouseButtonsToPDM(fButtons);
    619651    /* If we are doing old-style (IRQ-less) absolute reporting to the VMM
    620652     * device then make sure the guest is aware of it, so that it knows to
    621653     * ignore relative movement on the PS/2 device. */
    622     i_updateVMMDevMouseCaps(VMMDEV_MOUSE_HOST_WANTS_ABSOLUTE, 0);
     654    updateVMMDevMouseCaps(VMMDEV_MOUSE_HOST_WANTS_ABSOLUTE, 0);
    623655    if (fValid)
    624656    {
    625         rc = i_reportAbsEvent(xAdj, yAdj, dz, dw, fButtonsAdj,
    626                               RT_BOOL(  mfVMMDevGuestCaps
    627                                       & VMMDEV_MOUSE_NEW_PROTOCOL));
    628 
    629         i_fireMouseEvent(true, x, y, dz, dw, aButtonState);
     657        rc = reportAbsEvent(xAdj, yAdj, dz, dw, fButtonsAdj,
     658                            RT_BOOL(  mfVMMDevGuestCaps
     659                                    & VMMDEV_MOUSE_NEW_PROTOCOL));
     660
     661        fireMouseEvent(true, x, y, dz, dw, fButtons);
    630662    }
    631663
     
    642674 * @param aScanTime  Timestamp.
    643675 */
    644 HRESULT Mouse::putEventMultiTouch(LONG aCount,
    645                                   const std::vector<LONG64> &aContacts,
    646                                   ULONG aScanTime)
    647 {
    648     com::SafeArray <LONG64> arrayContacts(aContacts);
     676STDMETHODIMP Mouse::PutEventMultiTouch(LONG aCount,
     677                                       ComSafeArrayIn(LONG64, aContacts),
     678                                       ULONG aScanTime)
     679{
     680    AutoCaller autoCaller(this);
     681    if (FAILED(autoCaller.rc())) return autoCaller.rc();
     682
     683    com::SafeArray <LONG64> arrayContacts(ComSafeArrayInArg(aContacts));
    649684
    650685    LogRel3(("%s: aCount %d(actual %d), aScanTime %u\n",
     
    657692        LONG64* paContacts = arrayContacts.raw();
    658693
    659         rc = i_putEventMultiTouch(aCount, paContacts, aScanTime);
     694        rc = putEventMultiTouch(aCount, paContacts, aScanTime);
    660695    }
    661696    else
     
    675710 * @param aScanTime  Timestamp.
    676711 */
    677 HRESULT Mouse::putEventMultiTouchString(LONG aCount,
    678                                         const com::Utf8Str &aContacts,
    679                                         ULONG aScanTime)
     712STDMETHODIMP Mouse::PutEventMultiTouchString(LONG aCount,
     713                                             IN_BSTR aContacts,
     714                                             ULONG aScanTime)
    680715{
    681716    /** @todo implement: convert the string to LONG64 array and call putEventMultiTouch. */
     
    691726
    692727/* Used by PutEventMultiTouch and PutEventMultiTouchString. */
    693 HRESULT Mouse::i_putEventMultiTouch(LONG aCount,
    694                                     LONG64 *paContacts,
    695                                     ULONG aScanTime)
     728HRESULT Mouse::putEventMultiTouch(LONG aCount,
     729                                  LONG64 *paContacts,
     730                                  ULONG aScanTime)
    696731{
    697732    if (aCount >= 256)
     
    784819    if (SUCCEEDED(rc))
    785820    {
    786         rc = i_reportMultiTouchEventToDevice(cContacts, cContacts? pau64Contacts: NULL, (uint32_t)aScanTime);
     821        rc = reportMultiTouchEventToDevice(cContacts, cContacts? pau64Contacts: NULL, (uint32_t)aScanTime);
    787822
    788823        /* Send the original contact information. */
    789         i_fireMultiTouchEvent(cContacts, cContacts? paContacts: NULL, (uint32_t)aScanTime);
     824        fireMultiTouchEvent(cContacts, cContacts? paContacts: NULL, (uint32_t)aScanTime);
    790825    }
    791826
     
    798833/** Does the guest currently rely on the host to draw the mouse cursor or
    799834 * can it switch to doing it itself in software? */
    800 bool Mouse::i_guestNeedsHostCursor(void)
     835bool Mouse::guestNeedsHostCursor(void)
    801836{
    802837    return RT_BOOL(mfVMMDevGuestCaps & VMMDEV_MOUSE_GUEST_NEEDS_HOST_CURSOR);
     
    806841/** Check what sort of reporting can be done using the devices currently
    807842 * enabled.  Does not consider the VMM device. */
    808 void Mouse::i_getDeviceCaps(bool *pfAbs, bool *pfRel, bool *pfMT)
     843void Mouse::getDeviceCaps(bool *pfAbs, bool *pfRel, bool *pfMT)
    809844{
    810845    bool fAbsDev = false;
     
    834869
    835870/** Does the VMM device currently support absolute reporting? */
    836 bool Mouse::i_vmmdevCanAbs(void)
     871bool Mouse::vmmdevCanAbs(void)
    837872{
    838873    bool fRelDev;
    839874
    840     i_getDeviceCaps(NULL, &fRelDev, NULL);
     875    getDeviceCaps(NULL, &fRelDev, NULL);
    841876    return    (mfVMMDevGuestCaps & VMMDEV_MOUSE_GUEST_CAN_ABSOLUTE)
    842877           && fRelDev;
     
    845880
    846881/** Does the VMM device currently support absolute reporting? */
    847 bool Mouse::i_deviceCanAbs(void)
     882bool Mouse::deviceCanAbs(void)
    848883{
    849884    bool fAbsDev;
    850885
    851     i_getDeviceCaps(&fAbsDev, NULL, NULL);
     886    getDeviceCaps(&fAbsDev, NULL, NULL);
    852887    return fAbsDev;
    853888}
     
    855890
    856891/** Can we currently send relative events to the guest? */
    857 bool Mouse::i_supportsRel(void)
     892bool Mouse::supportsRel(void)
    858893{
    859894    bool fRelDev;
    860895
    861     i_getDeviceCaps(NULL, &fRelDev, NULL);
     896    getDeviceCaps(NULL, &fRelDev, NULL);
    862897    return fRelDev;
    863898}
     
    865900
    866901/** Can we currently send absolute events to the guest? */
    867 bool Mouse::i_supportsAbs(void)
     902bool Mouse::supportsAbs(void)
    868903{
    869904    bool fAbsDev;
    870905
    871     i_getDeviceCaps(&fAbsDev, NULL, NULL);
    872     return fAbsDev || i_vmmdevCanAbs();
     906    getDeviceCaps(&fAbsDev, NULL, NULL);
     907    return fAbsDev || vmmdevCanAbs();
    873908}
    874909
    875910
    876911/** Can we currently send absolute events to the guest? */
    877 bool Mouse::i_supportsMT(void)
     912bool Mouse::supportsMT(void)
    878913{
    879914    bool fMTDev;
    880915
    881     i_getDeviceCaps(NULL, NULL, &fMTDev);
     916    getDeviceCaps(NULL, NULL, &fMTDev);
    882917    return fMTDev;
    883918}
     
    887922 * enabled (including the VMM device) and notify the guest and the front-end.
    888923 */
    889 void Mouse::i_sendMouseCapsNotifications(void)
     924void Mouse::sendMouseCapsNotifications(void)
    890925{
    891926    bool fAbsDev, fRelDev, fMTDev, fCanAbs, fNeedsHostCursor;
     
    894929        AutoReadLock aLock(this COMMA_LOCKVAL_SRC_POS);
    895930
    896         i_getDeviceCaps(&fAbsDev, &fRelDev, &fMTDev);
    897         fCanAbs = i_supportsAbs();
    898         fNeedsHostCursor = i_guestNeedsHostCursor();
     931        getDeviceCaps(&fAbsDev, &fRelDev, &fMTDev);
     932        fCanAbs = supportsAbs();
     933        fNeedsHostCursor = guestNeedsHostCursor();
    899934    }
    900935    if (fAbsDev)
    901         i_updateVMMDevMouseCaps(VMMDEV_MOUSE_HOST_HAS_ABS_DEV, 0);
     936        updateVMMDevMouseCaps(VMMDEV_MOUSE_HOST_HAS_ABS_DEV, 0);
    902937    else
    903         i_updateVMMDevMouseCaps(0, VMMDEV_MOUSE_HOST_HAS_ABS_DEV);
     938        updateVMMDevMouseCaps(0, VMMDEV_MOUSE_HOST_HAS_ABS_DEV);
    904939    /** @todo this call takes the Console lock in order to update the cached
    905940     * callback data atomically.  However I can't see any sign that the cached
     
    913948 * A virtual device is notifying us about its current state and capabilities
    914949 */
    915 DECLCALLBACK(void) Mouse::i_mouseReportModes(PPDMIMOUSECONNECTOR pInterface, bool fRel, bool fAbs, bool fMT)
     950DECLCALLBACK(void) Mouse::mouseReportModes(PPDMIMOUSECONNECTOR pInterface, bool fRel, bool fAbs, bool fMT)
    916951{
    917952    PDRVMAINMOUSE pDrv = RT_FROM_MEMBER(pInterface, DRVMAINMOUSE, IConnector);
     
    929964        pDrv->u32DevCaps &= ~MOUSE_DEVCAP_MULTI_TOUCH;
    930965
    931     pDrv->pMouse->i_sendMouseCapsNotifications();
     966    pDrv->pMouse->sendMouseCapsNotifications();
    932967}
    933968
     
    936971 * @interface_method_impl{PDMIBASE,pfnQueryInterface}
    937972 */
    938 DECLCALLBACK(void *)  Mouse::i_drvQueryInterface(PPDMIBASE pInterface, const char *pszIID)
     973DECLCALLBACK(void *)  Mouse::drvQueryInterface(PPDMIBASE pInterface, const char *pszIID)
    939974{
    940975    PPDMDRVINS      pDrvIns = PDMIBASE_2_PDMDRV(pInterface);
     
    953988 * @param   pDrvIns     The driver instance data.
    954989 */
    955 DECLCALLBACK(void) Mouse::i_drvDestruct(PPDMDRVINS pDrvIns)
     990DECLCALLBACK(void) Mouse::drvDestruct(PPDMDRVINS pDrvIns)
    956991{
    957992    PDMDRV_CHECK_VERSIONS_RETURN_VOID(pDrvIns);
     
    9771012 * @copydoc FNPDMDRVCONSTRUCT
    9781013 */
    979 DECLCALLBACK(int) Mouse::i_drvConstruct(PPDMDRVINS pDrvIns, PCFGMNODE pCfg, uint32_t fFlags)
     1014DECLCALLBACK(int) Mouse::drvConstruct(PPDMDRVINS pDrvIns, PCFGMNODE pCfg, uint32_t fFlags)
    9801015{
    9811016    PDMDRV_CHECK_VERSIONS_RETURN(pDrvIns);
     
    9951030     * IBase.
    9961031     */
    997     pDrvIns->IBase.pfnQueryInterface        = Mouse::i_drvQueryInterface;
    998 
    999     pThis->IConnector.pfnReportModes        = Mouse::i_mouseReportModes;
     1032    pDrvIns->IBase.pfnQueryInterface        = Mouse::drvQueryInterface;
     1033
     1034    pThis->IConnector.pfnReportModes        = Mouse::mouseReportModes;
    10001035
    10011036    /*
     
    10621097    sizeof(DRVMAINMOUSE),
    10631098    /* pfnConstruct */
    1064     Mouse::i_drvConstruct,
     1099    Mouse::drvConstruct,
    10651100    /* pfnDestruct */
    1066     Mouse::i_drvDestruct,
     1101    Mouse::drvDestruct,
    10671102    /* pfnRelocate */
    10681103    NULL,
  • trunk/src/VBox/Main/src-client/VMMDevInterface.cpp

    r50589 r50592  
    339339    Mouse *pMouse = pConsole->getMouse();
    340340    if (pMouse)  /** @todo and if not?  Can that actually happen? */
    341         pMouse->i_onVMMDevGuestCapsChange(fNewCaps & VMMDEV_MOUSE_GUEST_MASK);
     341        pMouse->onVMMDevGuestCapsChange(fNewCaps & VMMDEV_MOUSE_GUEST_MASK);
    342342}
    343343
  • trunk/src/VBox/Main/src-client/xpcom/module.cpp

    r50589 r50592  
    7878NS_DECL_CLASSINFO(Keyboard)
    7979NS_IMPL_THREADSAFE_ISUPPORTS1_CI(Keyboard, IKeyboard)
     80NS_DECL_CLASSINFO(Mouse)
     81NS_IMPL_THREADSAFE_ISUPPORTS1_CI(Mouse, IMouse)
    8082NS_DECL_CLASSINFO(Display)
    8183NS_IMPL_THREADSAFE_ISUPPORTS2_CI(Display, IDisplay, IEventListener)
  • trunk/src/VBox/Main/testcase/Makefile.kmk

    r50591 r50592  
    237237# tstMouseImpl
    238238#
    239 tstMouseImpl_TEMPLATE = VBOXMAINCLIENTTSTEXE
     239tstMouseImpl_TEMPLATE = VBOXMAINTSTEXE
    240240tstMouseImpl_SOURCES  = \
    241241        tstMouseImpl.cpp \
     
    250250        $(VBOX_PATH_SDK)/bindings/xpcom/include/nsprpub \
    251251        $(VBOX_PATH_SDK)/bindings/xpcom/include/xpcom \
    252         $(dir $(VBOX_XML_SCHEMADEFS_H)) \
    253         $(VBOX_MAIN_APIWRAPPER_INCS)
    254 tstMouse_INTERMEDIATES   = $(VBOX_MAIN_APIWRAPPER_GEN_HDRS)
    255 
     252        $(dir $(VBOX_XML_SCHEMADEFS_H))
    256253tstMouseImpl_LIBS      = \
    257254        $(PATH_STAGE_LIB)/VBoxAPIWrap$(VBOX_SUFF_LIB) \
  • trunk/src/VBox/Main/testcase/tstMouseImpl.cpp

    r50589 r50592  
    3030#include <iprt/test.h>
    3131
     32#ifndef RT_OS_WINDOWS
     33NS_DECL_CLASSINFO(Mouse)
     34NS_IMPL_THREADSAFE_ISUPPORTS1_CI(Mouse, IMouse)
     35#endif
    3236
    3337PDMIVMMDEVPORT VMMDevPort;
     
    319323                                                 PDMIMOUSECONNECTOR_IID);
    320324    pConnector->pfnReportModes(pConnector, true, false, false);
    321     pMouse->i_onVMMDevGuestCapsChange(  VMMDEV_MOUSE_GUEST_CAN_ABSOLUTE
    322                                       | VMMDEV_MOUSE_NEW_PROTOCOL);
     325    pMouse->onVMMDevGuestCapsChange(  VMMDEV_MOUSE_GUEST_CAN_ABSOLUTE
     326                                    | VMMDEV_MOUSE_NEW_PROTOCOL);
    323327    pMouse->PutMouseEventAbsolute(0, 0, 0, 0, 0);
    324328    RTTESTI_CHECK_MSG(approxEq(absoluteMouse.x, 0x8000, 200),
     
    350354                                                 PDMIMOUSECONNECTOR_IID);
    351355    pConnector->pfnReportModes(pConnector, true, false, false);
    352     pMouse->i_onVMMDevGuestCapsChange(VMMDEV_MOUSE_GUEST_CAN_ABSOLUTE);
     356    pMouse->onVMMDevGuestCapsChange(VMMDEV_MOUSE_GUEST_CAN_ABSOLUTE);
    353357    pMouse->PutMouseEventAbsolute(320, 240, 0, 0, 0);
    354358    RTTESTI_CHECK_MSG(approxEq(absoluteMouse.x, 0x8000, 200),
     
    380384                                                 PDMIMOUSECONNECTOR_IID);
    381385    pConnector->pfnReportModes(pConnector, false, true, false);
    382     pMouse->i_onVMMDevGuestCapsChange(VMMDEV_MOUSE_NEW_PROTOCOL);
     386    pMouse->onVMMDevGuestCapsChange(VMMDEV_MOUSE_NEW_PROTOCOL);
    383387    pMouse->PutMouseEventAbsolute(0, 0, 0, 0, 0);
    384388    RTTESTI_CHECK_MSG(approxEq(mouseEventAbs.cx, 0x8000, 200),
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette