Changeset 74409 in vbox for trunk/src/VBox
- Timestamp:
- Sep 21, 2018 3:18:29 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/x11/VBoxClient/draganddrop.cpp
r74382 r74409 484 484 public: 485 485 486 int init(uint32_t u 32ScreenId);486 int init(uint32_t uScreenID); 487 487 void uninit(void); 488 488 void reset(void); … … 506 506 int hgEnter(const RTCList<RTCString> &formats, uint32_t actions); 507 507 int hgLeave(void); 508 int hgMove(uint32_t u 32xPos, uint32_t u32yPos, uint32_t uDefaultAction);509 int hgDrop(uint32_t u 32xPos, 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); 510 510 int hgDataReceive(PVBGLR3GUESTDNDMETADATA pMetaData); 511 511 … … 551 551 Display *m_pDisplay; 552 552 /** X screen ID to operate on. */ 553 int m_screenI d;553 int m_screenID; 554 554 /** Pointer to X screen operating on. */ 555 555 Screen *m_pScreen; … … 732 732 * 733 733 * @return IPRT status code. 734 * @param u 32ScreenID X' screen ID to use.735 */ 736 int DragInstance::init(uint32_t u 32ScreenID)734 * @param uScreenID X' screen ID to use. 735 */ 736 int DragInstance::init(uint32_t uScreenID) 737 737 { 738 738 int rc = VbglR3DnDConnect(&m_dndCtx); … … 758 758 * Enough screens configured in the x11 server? 759 759 */ 760 if ((int)u 32ScreenID > ScreenCount(m_pDisplay))760 if ((int)uScreenID > ScreenCount(m_pDisplay)) 761 761 { 762 762 rc = VERR_INVALID_PARAMETER; … … 765 765 #if 0 766 766 /* Get the screen number from the x11 server. */ 767 pDrag->screen = ScreenOfDisplay(m_pDisplay, u 32ScreenId);767 pDrag->screen = ScreenOfDisplay(m_pDisplay, uScreenID); 768 768 if (!pDrag->screen) 769 769 { … … 772 772 } 773 773 #endif 774 m_screenI d = u32ScreenID;774 m_screenID = uScreenID; 775 775 776 776 /* Now query the corresponding root window of this screen. */ 777 m_wndRoot = RootWindow(m_pDisplay, m_screenI d);777 m_wndRoot = RootWindow(m_pDisplay, m_screenID); 778 778 if (!m_wndRoot) 779 779 { … … 794 794 attr.do_not_propagate_mask = NoEventMask; 795 795 #ifdef VBOX_DND_DEBUG_WND 796 attr.background_pixel = XWhitePixel(m_pDisplay, m_screenI d);797 attr.border_pixel = XBlackPixel(m_pDisplay, m_screenI d);796 attr.background_pixel = XWhitePixel(m_pDisplay, m_screenID); 797 attr.border_pixel = XBlackPixel(m_pDisplay, m_screenID); 798 798 m_wndProxy.hWnd = XCreateWindow(m_pDisplay, m_wndRoot /* Parent */, 799 799 100, 100, /* Position */ … … 839 839 XFlush(m_pDisplay); 840 840 #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); 842 842 843 843 /* Set the window's name for easier lookup. */ … … 855 855 } 856 856 else 857 logError("Initializing drag instance for screen %RU32 failed with rc=%Rrc\n", u 32ScreenID, rc);857 logError("Initializing drag instance for screen %RU32 failed with rc=%Rrc\n", uScreenID, rc); 858 858 859 859 LogFlowFuncLeaveRC(rc); … … 1009 1009 char *pszWndName = wndX11GetNameA(wndSelection); 1010 1010 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)); 1012 1012 RTStrFree(pszWndName); 1013 1013 … … 1086 1086 Atom atmAction = m_curVer >= 2 /* Actions other than "copy" or only supported since protocol version 2. */ 1087 1087 ? 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", 1089 1089 m_wndProxy.hWnd, m_wndCur, RT_HIWORD(iPos), RT_LOWORD(iPos), 1090 1090 xAtomToString(atmAction).c_str())); … … 1149 1149 rc = RTSemEventSignal(m_eventQueueEvent); 1150 1150 } 1151 else 1151 else /* Unhandled event, abort. */ 1152 1152 { 1153 1153 logInfo("Unhandled event from wnd=%#x, msg=%s\n", e.xclient.window, xAtomToString(e.xclient.message_type).c_str()); … … 1339 1339 reinterpret_cast<const unsigned char*>(pvData), cbData); 1340 1340 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", 1342 1342 xAtomToString(pReq->property).c_str(), 1343 1343 xAtomToString(pReq->target).c_str(), … … 1665 1665 * 1666 1666 * @returns IPRT status code. 1667 * @param u 32xPosRelative X position within the guest's display area.1668 * @param u 32yPosRelative 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. 1669 1669 * @param uDefaultAction Default action the host wants to perform on the guest 1670 1670 * as soon as the operation successfully finishes. 1671 1671 */ 1672 int DragInstance::hgMove(uint32_t u 32xPos, uint32_t u32yPos, uint32_t uDefaultAction)1672 int DragInstance::hgMove(uint32_t uPosX, uint32_t uPosY, uint32_t uDefaultAction) 1673 1673 { 1674 1674 LogFlowThisFunc(("mode=%RU32, state=%RU32\n", m_enmMode, m_enmState)); 1675 LogFlowThisFunc(("u 32xPos=%RU32, u32yPos=%RU32, uAction=%RU32\n", u32xPos, u32yPos, uDefaultAction));1675 LogFlowThisFunc(("uPosX=%RU32, uPosY=%RU32, uAction=%RU32\n", uPosX, uPosY, uDefaultAction)); 1676 1676 1677 1677 if ( m_enmMode != HG … … 1685 1685 1686 1686 /* Move the mouse cursor within the guest. */ 1687 mouseCursorMove(u 32xPos, u32yPos);1687 mouseCursorMove(uPosX, uPosY); 1688 1688 1689 1689 long newVer = -1; /* This means the current window is _not_ XdndAware. */ … … 1815 1815 Assert(wndCursor != None); 1816 1816 1817 LogFlowThisFunc(("XA_XdndPosition: xPos=%RU32, yPos=%RU32 to window=%#x\n", u 32xPos, u32yPos, wndCursor));1817 LogFlowThisFunc(("XA_XdndPosition: xPos=%RU32, yPos=%RU32 to window=%#x\n", uPosX, uPosY, wndCursor)); 1818 1818 1819 1819 /* … … 1831 1831 m.format = 32; 1832 1832 m.data.l[XdndPositionWindow] = m_wndProxy.hWnd; /* X window ID of source window. */ 1833 m.data.l[XdndPositionXY] = RT_MAKE_U32(u 32yPos, 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. */ 1834 1834 m.data.l[XdndPositionTimeStamp] = CurrentTime; /* Timestamp for retrieving data. */ 1835 1835 m.data.l[XdndPositionAction] = pa; /* Actions requested by the user. */ … … 1861 1861 * 1862 1862 * @returns IPRT status code. 1863 * @param u 32xPosRelative X position within the guest's display area.1864 * @param u 32yPosRelative 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. 1865 1865 * @param uDefaultAction Default action the host wants to perform on the guest 1866 1866 * as soon as the operation successfully finishes. 1867 1867 */ 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)); 1868 int 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)); 1878 1873 1879 1874 if ( m_enmMode != HG … … 2005 2000 /* Currently in wrong mode? Bail out. */ 2006 2001 if (m_enmMode == HG) 2002 { 2007 2003 rc = VERR_INVALID_STATE; 2004 } 2008 2005 /* Message already processed successfully? */ 2009 2006 else if ( m_enmMode == GH … … 2084 2081 RTStrFree(pszWndName); 2085 2082 } 2083 else 2084 logInfo("No guest source window\n"); 2086 2085 } 2087 2086 … … 2154 2153 XWindowAttributes xwa; 2155 2154 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", 2157 2156 m_wndProxy.hWnd, m_wndCur, xwa.x, xwa.y, xwa.width, xwa.height)); 2158 2157 … … 2316 2315 { 2317 2316 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); 2319 2318 /* This is not fatal for us, just ignore. */ 2320 2319 } … … 2526 2525 &iRootX, &iRootY, &iChildX, &iChildY, &iMask); 2527 2526 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", 2529 2528 RT_BOOL(fInRootWnd), wndRoot, wndChild, iRootX, iRootY)); NOREF(fInRootWnd); 2530 2529
Note:
See TracChangeset
for help on using the changeset viewer.