VirtualBox

Changeset 74409 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Sep 21, 2018 3:18:29 PM (6 years ago)
Author:
vboxsync
Message:

DnD/VBoxClient: Renaming, logging, comments.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/x11/VBoxClient/draganddrop.cpp

    r74382 r74409  
    484484public:
    485485
    486     int  init(uint32_t u32ScreenId);
     486    int  init(uint32_t uScreenID);
    487487    void uninit(void);
    488488    void reset(void);
     
    506506    int hgEnter(const RTCList<RTCString> &formats, uint32_t actions);
    507507    int hgLeave(void);
    508     int hgMove(uint32_t u32xPos, uint32_t u32yPos, uint32_t uDefaultAction);
    509     int hgDrop(uint32_t u32xPos, uint32_t u32yPos, uint32_t uDefaultAction);
     508    int hgMove(uint32_t uPosX, uint32_t uPosY, uint32_t uDefaultAction);
     509    int hgDrop(uint32_t uPosX, uint32_t uPosY, uint32_t uDefaultAction);
    510510    int hgDataReceive(PVBGLR3GUESTDNDMETADATA pMetaData);
    511511
     
    551551    Display                    *m_pDisplay;
    552552    /** X screen ID to operate on. */
    553     int                         m_screenId;
     553    int                         m_screenID;
    554554    /** Pointer to X screen operating on. */
    555555    Screen                     *m_pScreen;
     
    732732 *
    733733 * @return  IPRT status code.
    734  * @param   u32ScreenID             X' screen ID to use.
    735  */
    736 int DragInstance::init(uint32_t u32ScreenID)
     734 * @param   uScreenID             X' screen ID to use.
     735 */
     736int DragInstance::init(uint32_t uScreenID)
    737737{
    738738    int rc = VbglR3DnDConnect(&m_dndCtx);
     
    758758         * Enough screens configured in the x11 server?
    759759         */
    760         if ((int)u32ScreenID > ScreenCount(m_pDisplay))
     760        if ((int)uScreenID > ScreenCount(m_pDisplay))
    761761        {
    762762            rc = VERR_INVALID_PARAMETER;
     
    765765#if 0
    766766        /* Get the screen number from the x11 server. */
    767         pDrag->screen = ScreenOfDisplay(m_pDisplay, u32ScreenId);
     767        pDrag->screen = ScreenOfDisplay(m_pDisplay, uScreenID);
    768768        if (!pDrag->screen)
    769769        {
     
    772772        }
    773773#endif
    774         m_screenId = u32ScreenID;
     774        m_screenID = uScreenID;
    775775
    776776        /* Now query the corresponding root window of this screen. */
    777         m_wndRoot = RootWindow(m_pDisplay, m_screenId);
     777        m_wndRoot = RootWindow(m_pDisplay, m_screenID);
    778778        if (!m_wndRoot)
    779779        {
     
    794794        attr.do_not_propagate_mask = NoEventMask;
    795795#ifdef VBOX_DND_DEBUG_WND
    796         attr.background_pixel      = XWhitePixel(m_pDisplay, m_screenId);
    797         attr.border_pixel          = XBlackPixel(m_pDisplay, m_screenId);
     796        attr.background_pixel      = XWhitePixel(m_pDisplay, m_screenID);
     797        attr.border_pixel          = XBlackPixel(m_pDisplay, m_screenID);
    798798        m_wndProxy.hWnd = XCreateWindow(m_pDisplay, m_wndRoot                /* Parent */,
    799799                                   100, 100,                                 /* Position */
     
    839839        XFlush(m_pDisplay);
    840840#endif
    841         logInfo("Proxy window=0x%x, root window=0x%x ...\n", m_wndProxy.hWnd, m_wndRoot);
     841        logInfo("Proxy window=%RU32, root window=%RU32 ...\n", m_wndProxy.hWnd, m_wndRoot);
    842842
    843843        /* Set the window's name for easier lookup. */
     
    855855    }
    856856    else
    857         logError("Initializing drag instance for screen %RU32 failed with rc=%Rrc\n", u32ScreenID, rc);
     857        logError("Initializing drag instance for screen %RU32 failed with rc=%Rrc\n", uScreenID, rc);
    858858
    859859    LogFlowFuncLeaveRC(rc);
     
    10091009                char *pszWndName = wndX11GetNameA(wndSelection);
    10101010                AssertPtr(pszWndName);
    1011                 LogFlowThisFunc(("wndSelection=%#x ('%s'), wndProxy=%#x\n", wndSelection, pszWndName, m_wndProxy.hWnd));
     1011                LogFlowThisFunc(("wndSelection=%RU32 ('%s'), wndProxy=%RU32\n", wndSelection, pszWndName, m_wndProxy.hWnd));
    10121012                RTStrFree(pszWndName);
    10131013
     
    10861086                Atom    atmAction = m_curVer >= 2 /* Actions other than "copy" or only supported since protocol version 2. */
    10871087                                  ? e.xclient.data.l[XdndPositionAction] : xAtom(XA_XdndActionCopy);
    1088                 LogFlowThisFunc(("XA_XdndPosition: wndProxy=%#x, wndCur=%#x, x=%RI32, y=%RI32, strAction=%s\n",
     1088                LogFlowThisFunc(("XA_XdndPosition: wndProxy=%RU32, wndCur=%RU32, x=%RI32, y=%RI32, strAction=%s\n",
    10891089                                 m_wndProxy.hWnd, m_wndCur, RT_HIWORD(iPos), RT_LOWORD(iPos),
    10901090                                 xAtomToString(atmAction).c_str()));
     
    11491149                rc = RTSemEventSignal(m_eventQueueEvent);
    11501150            }
    1151             else
     1151            else /* Unhandled event, abort. */
    11521152            {
    11531153                logInfo("Unhandled event from wnd=%#x, msg=%s\n", e.xclient.window, xAtomToString(e.xclient.message_type).c_str());
     
    13391339                                              reinterpret_cast<const unsigned char*>(pvData), cbData);
    13401340
    1341                     LogFlowFunc(("Changing property '%s' (target '%s') of window=0x%x: %s\n",
     1341                    LogFlowFunc(("Changing property '%s' (target '%s') of window=%RU32: %s\n",
    13421342                                 xAtomToString(pReq->property).c_str(),
    13431343                                 xAtomToString(pReq->target).c_str(),
     
    16651665 *
    16661666 * @returns IPRT status code.
    1667  * @param   u32xPos                 Relative X position within the guest's display area.
    1668  * @param   u32yPos                 Relative Y position within the guest's display area.
     1667 * @param   uPosX                   Relative X position within the guest's display area.
     1668 * @param   uPosY                   Relative Y position within the guest's display area.
    16691669 * @param   uDefaultAction          Default action the host wants to perform on the guest
    16701670 *                                  as soon as the operation successfully finishes.
    16711671 */
    1672 int DragInstance::hgMove(uint32_t u32xPos, uint32_t u32yPos, uint32_t uDefaultAction)
     1672int DragInstance::hgMove(uint32_t uPosX, uint32_t uPosY, uint32_t uDefaultAction)
    16731673{
    16741674    LogFlowThisFunc(("mode=%RU32, state=%RU32\n", m_enmMode, m_enmState));
    1675     LogFlowThisFunc(("u32xPos=%RU32, u32yPos=%RU32, uAction=%RU32\n", u32xPos, u32yPos, uDefaultAction));
     1675    LogFlowThisFunc(("uPosX=%RU32, uPosY=%RU32, uAction=%RU32\n", uPosX, uPosY, uDefaultAction));
    16761676
    16771677    if (   m_enmMode  != HG
     
    16851685
    16861686    /* Move the mouse cursor within the guest. */
    1687     mouseCursorMove(u32xPos, u32yPos);
     1687    mouseCursorMove(uPosX, uPosY);
    16881688
    16891689    long newVer = -1; /* This means the current window is _not_ XdndAware. */
     
    18151815        Assert(wndCursor != None);
    18161816
    1817         LogFlowThisFunc(("XA_XdndPosition: xPos=%RU32, yPos=%RU32 to window=%#x\n", u32xPos, u32yPos, wndCursor));
     1817        LogFlowThisFunc(("XA_XdndPosition: xPos=%RU32, yPos=%RU32 to window=%#x\n", uPosX, uPosY, wndCursor));
    18181818
    18191819        /*
     
    18311831        m.format       = 32;
    18321832        m.data.l[XdndPositionWindow]    = m_wndProxy.hWnd;               /* X window ID of source window. */
    1833         m.data.l[XdndPositionXY]        = RT_MAKE_U32(u32yPos, u32xPos); /* Cursor coordinates relative to the root window. */
     1833        m.data.l[XdndPositionXY]        = RT_MAKE_U32(uPosY, uPosX);    /* Cursor coordinates relative to the root window. */
    18341834        m.data.l[XdndPositionTimeStamp] = CurrentTime;                   /* Timestamp for retrieving data. */
    18351835        m.data.l[XdndPositionAction]    = pa;                            /* Actions requested by the user. */
     
    18611861 *
    18621862 * @returns IPRT status code.
    1863  * @param   u32xPos                 Relative X position within the guest's display area.
    1864  * @param   u32yPos                 Relative Y position within the guest's display area.
     1863 * @param   uPosX                   Relative X position within the guest's display area.
     1864 * @param   uPosY                   Relative Y position within the guest's display area.
    18651865 * @param   uDefaultAction          Default action the host wants to perform on the guest
    18661866 *                                  as soon as the operation successfully finishes.
    18671867 */
    1868 int DragInstance::hgDrop(uint32_t u32xPos, uint32_t u32yPos, uint32_t uDefaultAction)
    1869 {
    1870 
    1871 
    1872     /** @todo r=bird: Please, stop using 'u32' as a prefix unless you've got a _real_ _important_ reason for needing the bit count. */
    1873 
    1874 
    1875     RT_NOREF3(u32xPos, u32yPos, uDefaultAction);
    1876     LogFlowThisFunc(("wndCur=%#x, wndProxy=%#x, mode=%RU32, state=%RU32\n", m_wndCur, m_wndProxy.hWnd, m_enmMode, m_enmState));
    1877     LogFlowThisFunc(("u32xPos=%RU32, u32yPos=%RU32, uAction=%RU32\n", u32xPos, u32yPos, uDefaultAction));
     1868int DragInstance::hgDrop(uint32_t uPosX, uint32_t uPosY, uint32_t uDefaultAction)
     1869{
     1870    RT_NOREF3(uPosX, uPosY, uDefaultAction);
     1871    LogFlowThisFunc(("wndCur=%RU32, wndProxy=%RU32, mode=%RU32, state=%RU32\n", m_wndCur, m_wndProxy.hWnd, m_enmMode, m_enmState));
     1872    LogFlowThisFunc(("uPosX=%RU32, uPosY=%RU32, uAction=%RU32\n", uPosX, uPosY, uDefaultAction));
    18781873
    18791874    if (   m_enmMode  != HG
     
    20052000    /* Currently in wrong mode? Bail out. */
    20062001    if (m_enmMode == HG)
     2002    {
    20072003        rc = VERR_INVALID_STATE;
     2004    }
    20082005    /* Message already processed successfully? */
    20092006    else if (   m_enmMode  == GH
     
    20842081            RTStrFree(pszWndName);
    20852082        }
     2083        else
     2084            logInfo("No guest source window\n");
    20862085    }
    20872086
     
    21542153    XWindowAttributes xwa;
    21552154    XGetWindowAttributes(m_pDisplay, m_wndCur, &xwa);
    2156     LogFlowThisFunc(("wndProxy=%#x, wndCur=%#x, x=%d, y=%d, width=%d, height=%d\n",
     2155    LogFlowThisFunc(("wndProxy=%RU32, wndCur=%RU32, x=%d, y=%d, width=%d, height=%d\n",
    21572156                     m_wndProxy.hWnd, m_wndCur, xwa.x, xwa.y, xwa.width, xwa.height));
    21582157
     
    23162315    {
    23172316        int rc2 = VbglR3DnDGHSendError(&m_dndCtx, rc);
    2318         LogFlowThisFunc(("Sending error to host resulted in %Rrc\n", rc2)); NOREF(rc2);
     2317        LogFlowThisFunc(("Sending error %Rrc to host resulted in %Rrc\n", rc, rc2)); NOREF(rc2);
    23192318        /* This is not fatal for us, just ignore. */
    23202319    }
     
    25262525                                    &iRootX, &iRootY, &iChildX, &iChildY, &iMask);
    25272526
    2528     LogFlowThisFunc(("fInRootWnd=%RTbool, wndRoot=0x%x, wndChild=0x%x, iRootX=%d, iRootY=%d\n",
     2527    LogFlowThisFunc(("fInRootWnd=%RTbool, wndRoot=%RU32, wndChild=%RU32, iRootX=%d, iRootY=%d\n",
    25292528                     RT_BOOL(fInRootWnd), wndRoot, wndChild, iRootX, iRootY)); NOREF(fInRootWnd);
    25302529
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