VirtualBox

Ignore:
Timestamp:
Jan 23, 2010 12:51:04 AM (15 years ago)
Author:
vboxsync
Message:

pdmifs.h: the final batch of refactored interface ID code.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Input/DevPS2.cpp

    r25971 r25985  
    229229    {
    230230        /** The base interface for the keyboard port. */
    231         PDMIBASE                            Base;
     231        PDMIBASE                            IBase;
    232232        /** The keyboard port base interface. */
    233         PDMIKEYBOARDPORT                    Port;
     233        PDMIKEYBOARDPORT                    IPort;
    234234
    235235        /** The base interface of the attached keyboard driver. */
     
    248248    {
    249249        /** The base interface for the mouse port. */
    250         PDMIBASE                            Base;
     250        PDMIBASE                            IBase;
    251251        /** The mouse port base interface. */
    252         PDMIMOUSEPORT                       Port;
     252        PDMIMOUSEPORT                       IPort;
    253253
    254254        /** The base interface of the attached mouse driver. */
     
    13601360static DECLCALLBACK(void *)  kbdKeyboardQueryInterface(PPDMIBASE pInterface, const char *pszIID)
    13611361{
    1362     KBDState *pThis = RT_FROM_MEMBER(pInterface, KBDState, Keyboard.Base);
    1363     if (RTUuidCompare2Strs(pszIID, PDMIBASE_IID) == 0)
    1364         return &pThis->Keyboard.Base;
    1365     if (RTUuidCompare2Strs(pszIID, PDMIKEYBOARDPORT_IID) == 0)
    1366         return &pThis->Keyboard.Port;
     1362    KBDState *pThis = RT_FROM_MEMBER(pInterface, KBDState, Keyboard.IBase);
     1363    PDMIBASE_RETURN_INTERFACE(pszIID, PDMIBASE, &pThis->Keyboard.IBase);
     1364    PDMIBASE_RETURN_INTERFACE(pszIID, PDMIKEYBOARDPORT, &pThis->Keyboard.IPort);
    13671365    return NULL;
    13681366}
     
    13751373 *
    13761374 * @returns VBox status code.
    1377  * @param   pInterface      Pointer to the keyboard port interface (KBDState::Keyboard.Port).
     1375 * @param   pInterface      Pointer to the keyboard port interface (KBDState::Keyboard.IPort).
    13781376 * @param   u8KeyCode       The keycode.
    13791377 */
    13801378static DECLCALLBACK(int) kbdKeyboardPutEvent(PPDMIKEYBOARDPORT pInterface, uint8_t u8KeyCode)
    13811379{
    1382     KBDState *pThis = RT_FROM_MEMBER(pInterface, KBDState, Keyboard.Port);
     1380    KBDState *pThis = RT_FROM_MEMBER(pInterface, KBDState, Keyboard.IPort);
    13831381    int rc = PDMCritSectEnter(&pThis->CritSect, VERR_SEM_BUSY);
    13841382    AssertReleaseRC(rc);
     
    13981396static DECLCALLBACK(void *)  kbdMouseQueryInterface(PPDMIBASE pInterface, const char *pszIID)
    13991397{
    1400     KBDState *pThis = RT_FROM_MEMBER(pInterface, KBDState, Mouse.Base);
    1401     if (RTUuidCompare2Strs(pszIID, PDMIBASE_IID) == 0)
    1402         return &pThis->Mouse.Base;
    1403     if (RTUuidCompare2Strs(pszIID, PDMIMOUSEPORT_IID) == 0)
    1404         return &pThis->Mouse.Port;
     1398    KBDState *pThis = RT_FROM_MEMBER(pInterface, KBDState, Mouse.IBase);
     1399    PDMIBASE_RETURN_INTERFACE(pszIID, PDMIBASE, &pThis->Mouse.IBase);
     1400    PDMIBASE_RETURN_INTERFACE(pszIID, PDMIMOUSEPORT, &pThis->Mouse.IPort);
    14051401    return NULL;
    14061402}
     
    14131409 *
    14141410 * @returns VBox status code.
    1415  * @param   pInterface      Pointer to the mouse port interface (KBDState::Mouse.Port).
     1411 * @param   pInterface      Pointer to the mouse port interface (KBDState::Mouse.IPort).
    14161412 * @param   i32DeltaX       The X delta.
    14171413 * @param   i32DeltaY       The Y delta.
     
    14211417static DECLCALLBACK(int) kbdMousePutEvent(PPDMIMOUSEPORT pInterface, int32_t i32DeltaX, int32_t i32DeltaY, int32_t i32DeltaZ, int32_t i32DeltaW, uint32_t fButtonStates)
    14221418{
    1423     KBDState *pThis = RT_FROM_MEMBER(pInterface, KBDState, Mouse.Port);
     1419    KBDState *pThis = RT_FROM_MEMBER(pInterface, KBDState, Mouse.IPort);
    14241420    int rc = PDMCritSectEnter(&pThis->CritSect, VERR_SEM_BUSY);
    14251421    AssertReleaseRC(rc);
     
    14641460        /* LUN #0: keyboard */
    14651461        case 0:
    1466             rc = PDMDevHlpDriverAttach(pDevIns, iLUN, &pThis->Keyboard.Base, &pThis->Keyboard.pDrvBase, "Keyboard Port");
     1462            rc = PDMDevHlpDriverAttach(pDevIns, iLUN, &pThis->Keyboard.IBase, &pThis->Keyboard.pDrvBase, "Keyboard Port");
    14671463            if (RT_SUCCESS(rc))
    14681464            {
     
    14851481        /* LUN #1: aux/mouse */
    14861482        case 1:
    1487             rc = PDMDevHlpDriverAttach(pDevIns, iLUN, &pThis->Mouse.Base, &pThis->Mouse.pDrvBase, "Aux (Mouse) Port");
     1483            rc = PDMDevHlpDriverAttach(pDevIns, iLUN, &pThis->Mouse.IBase, &pThis->Mouse.pDrvBase, "Aux (Mouse) Port");
    14881484            if (RT_SUCCESS(rc))
    14891485            {
     
    16231619    pThis->pDevInsR0 = PDMDEVINS_2_R0PTR(pDevIns);
    16241620    pThis->pDevInsRC = PDMDEVINS_2_RCPTR(pDevIns);
    1625     pThis->Keyboard.Base.pfnQueryInterface = kbdKeyboardQueryInterface;
    1626     pThis->Keyboard.Port.pfnPutEvent        = kbdKeyboardPutEvent;
    1627 
    1628     pThis->Mouse.Base.pfnQueryInterface     = kbdMouseQueryInterface;
    1629     pThis->Mouse.Port.pfnPutEvent           = kbdMousePutEvent;
     1621    pThis->Keyboard.IBase.pfnQueryInterface = kbdKeyboardQueryInterface;
     1622    pThis->Keyboard.IPort.pfnPutEvent       = kbdKeyboardPutEvent;
     1623
     1624    pThis->Mouse.IBase.pfnQueryInterface    = kbdMouseQueryInterface;
     1625    pThis->Mouse.IPort.pfnPutEvent          = kbdMousePutEvent;
    16301626
    16311627    /*
Note: See TracChangeset for help on using the changeset viewer.

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