- Timestamp:
- Sep 21, 2018 3:36:16 PM (6 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/HostServices/DragAndDropSvc.h
r74335 r74411 76 76 #define VBOX_DRAG_AND_DROP_MODE_BIDIRECTIONAL 3 77 77 78 #define DND_IGNORE_ACTION UINT32_C(0) 79 #define DND_COPY_ACTION RT_BIT_32(0) 80 #define DND_MOVE_ACTION RT_BIT_32(1) 81 #define DND_LINK_ACTION RT_BIT_32(2) 82 83 #define hasDnDCopyAction(a) ((a) & DND_COPY_ACTION) 84 #define hasDnDMoveAction(a) ((a) & DND_MOVE_ACTION) 85 #define hasDnDLinkAction(a) ((a) & DND_LINK_ACTION) 86 87 #define isDnDIgnoreAction(a) ((a) == DND_IGNORE_ACTION) 88 #define isDnDCopyAction(a) ((a) == DND_COPY_ACTION) 89 #define isDnDMoveAction(a) ((a) == DND_MOVE_ACTION) 90 #define isDnDLinkAction(a) ((a) == DND_LINK_ACTION) 78 #define VBOX_DND_ACTION_IGNORE UINT32_C(0) 79 #define VBOX_DND_ACTION_COPY RT_BIT_32(0) 80 #define VBOX_DND_ACTION_MOVE RT_BIT_32(1) 81 #define VBOX_DND_ACTION_LINK RT_BIT_32(2) 82 83 /** A single DnD action. */ 84 typedef uint32_t VBOXDNDACTION; 85 /** A list of (OR'ed) DnD actions. */ 86 typedef uint32_t VBOXDNDACTIONLIST; 87 88 #define hasDnDCopyAction(a) ((a) & VBOX_DND_ACTION_COPY) 89 #define hasDnDMoveAction(a) ((a) & VBOX_DND_ACTION_MOVE) 90 #define hasDnDLinkAction(a) ((a) & VBOX_DND_ACTION_LINK) 91 92 #define isDnDIgnoreAction(a) ((a) == VBOX_DND_ACTION_IGNORE) 93 #define isDnDCopyAction(a) ((a) == VBOX_DND_ACTION_COPY) 94 #define isDnDMoveAction(a) ((a) == VBOX_DND_ACTION_MOVE) 95 #define isDnDLinkAction(a) ((a) == VBOX_DND_ACTION_LINK) 91 96 92 97 /** @def VBOX_DND_FORMATS_DEFAULT -
trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxDnD.cpp
r74380 r74411 94 94 mEventSem(NIL_RTSEMEVENT), 95 95 hWnd(NULL), 96 uAllActions( DND_IGNORE_ACTION),96 uAllActions(VBOX_DND_ACTION_IGNORE), 97 97 mfMouseButtonDown(false), 98 98 #ifdef VBOX_WITH_DRAG_AND_DROP_GH … … 878 878 if (uAllActions) 879 879 { 880 if (uAllActions & DND_COPY_ACTION)880 if (uAllActions & VBOX_DND_ACTION_COPY) 881 881 startupInfo.dwOKEffects |= DROPEFFECT_COPY; 882 if (uAllActions & DND_MOVE_ACTION)882 if (uAllActions & VBOX_DND_ACTION_MOVE) 883 883 startupInfo.dwOKEffects |= DROPEFFECT_MOVE; 884 if (uAllActions & DND_LINK_ACTION)884 if (uAllActions & VBOX_DND_ACTION_LINK) 885 885 startupInfo.dwOKEffects |= DROPEFFECT_LINK; 886 886 } … … 925 925 int rc; 926 926 927 uint32_t uActionNotify = DND_IGNORE_ACTION;927 uint32_t uActionNotify = VBOX_DND_ACTION_IGNORE; 928 928 if (mMode == HG) 929 929 { … … 1196 1196 if (RT_SUCCESS(rc)) 1197 1197 { 1198 uint32_t uDefAction = DND_IGNORE_ACTION;1198 uint32_t uDefAction = VBOX_DND_ACTION_IGNORE; 1199 1199 1200 1200 AssertPtr(pDropTarget); … … 1202 1202 if (!strFormats.isEmpty()) 1203 1203 { 1204 uDefAction = DND_COPY_ACTION;1204 uDefAction = VBOX_DND_ACTION_COPY; 1205 1205 1206 1206 LogFlowFunc(("Acknowledging pDropTarget=0x%p, uDefAction=0x%x, uAllActions=0x%x, strFormats=%s\n", … … 1550 1550 1551 1551 this->lstFmtActive.clear(); 1552 this->uAllActions = DND_IGNORE_ACTION;1552 this->uAllActions = VBOX_DND_ACTION_IGNORE; 1553 1553 1554 1554 int rc2 = setMode(Unknown); -
trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxDnDDropSource.cpp
r69500 r74411 37 37 mpWndParent(pParent), 38 38 mdwCurEffect(0), 39 muCurAction( DND_IGNORE_ACTION)39 muCurAction(VBOX_DND_ACTION_IGNORE) 40 40 { 41 41 LogFlowFuncEnter(); … … 105 105 { 106 106 mdwCurEffect = 0; 107 muCurAction = DND_IGNORE_ACTION;107 muCurAction = VBOX_DND_ACTION_IGNORE; 108 108 109 109 LogFlowFunc(("Canceled\n")); … … 130 130 STDMETHODIMP VBoxDnDDropSource::GiveFeedback(DWORD dwEffect) 131 131 { 132 uint32_t uAction = DND_IGNORE_ACTION;132 uint32_t uAction = VBOX_DND_ACTION_IGNORE; 133 133 134 134 #if 1 … … 138 138 { 139 139 if (dwEffect & DROPEFFECT_COPY) 140 uAction |= DND_COPY_ACTION;140 uAction |= VBOX_DND_ACTION_COPY; 141 141 if (dwEffect & DROPEFFECT_MOVE) 142 uAction |= DND_MOVE_ACTION;142 uAction |= VBOX_DND_ACTION_MOVE; 143 143 if (dwEffect & DROPEFFECT_LINK) 144 uAction |= DND_LINK_ACTION;144 uAction |= VBOX_DND_ACTION_LINK; 145 145 } 146 146 -
trunk/src/VBox/Additions/x11/VBoxClient/draganddrop.cpp
r74409 r74411 951 951 #endif 952 952 953 uint32_t uAction = DND_IGNORE_ACTION; /* Default is ignoring. */953 uint32_t uAction = VBOX_DND_ACTION_IGNORE; /* Default is ignoring. */ 954 954 /** @todo Compare this with the allowed actions. */ 955 955 if (fAcceptDrop) … … 1111 1111 1112 1112 /** @todo Handle default action! */ 1113 m.data.l[XdndStatusAction] = fAcceptDrop ? toAtomAction( DND_COPY_ACTION) : None;1113 m.data.l[XdndStatusAction] = fAcceptDrop ? toAtomAction(VBOX_DND_ACTION_COPY) : None; 1114 1114 1115 1115 int xRc = XSendEvent(m_pDisplay, e.xclient.data.l[XdndPositionWindow], … … 1139 1139 1140 1140 /* Let the source know. */ 1141 rc = m_wndProxy.sendFinished(m_wndCur, DND_IGNORE_ACTION);1141 rc = m_wndProxy.sendFinished(m_wndCur, VBOX_DND_ACTION_IGNORE); 1142 1142 1143 1143 /* Start over. */ … … 1154 1154 1155 1155 /* Let the source know. */ 1156 rc = m_wndProxy.sendFinished(m_wndCur, DND_IGNORE_ACTION);1156 rc = m_wndProxy.sendFinished(m_wndCur, VBOX_DND_ACTION_IGNORE); 1157 1157 1158 1158 /* Start over. */ … … 1843 1843 { 1844 1844 /* No window to process, so send a ignore ack event to the host. */ 1845 rc = VbglR3DnDHGSendAckOp(&m_dndCtx, DND_IGNORE_ACTION);1845 rc = VbglR3DnDHGSendAckOp(&m_dndCtx, VBOX_DND_ACTION_IGNORE); 1846 1846 } 1847 1847 else … … 1995 1995 1996 1996 RTCString strFormats = "\r\n"; /** @todo If empty, IOCTL fails with VERR_ACCESS_DENIED. */ 1997 uint32_t uDefAction = DND_IGNORE_ACTION;1998 uint32_t uAllActions = DND_IGNORE_ACTION;1997 uint32_t uDefAction = VBOX_DND_ACTION_IGNORE; 1998 uint32_t uAllActions = VBOX_DND_ACTION_IGNORE; 1999 1999 2000 2000 /* Currently in wrong mode? Bail out. */ … … 2097 2097 { 2098 2098 strFormats = strFormatsCur; 2099 uDefAction = DND_COPY_ACTION; /** @todo Handle default action! */2100 uAllActions = DND_COPY_ACTION; /** @todo Ditto. */2099 uDefAction = VBOX_DND_ACTION_COPY; /** @todo Handle default action! */ 2100 uAllActions = VBOX_DND_ACTION_COPY; /** @todo Ditto. */ 2101 2101 uAllActions |= toHGCMActions(m_lstActions); 2102 2102 } … … 2295 2295 /* Cancel the operation -- inform the source window by 2296 2296 * sending a XdndFinished message so that the source can toss the required data. */ 2297 rc = m_wndProxy.sendFinished(wndSource, DND_IGNORE_ACTION);2297 rc = m_wndProxy.sendFinished(wndSource, VBOX_DND_ACTION_IGNORE); 2298 2298 } 2299 2299 … … 2863 2863 uint32_t DragInstance::toHGCMAction(Atom atom) 2864 2864 { 2865 uint32_t uAction = DND_IGNORE_ACTION;2865 uint32_t uAction = VBOX_DND_ACTION_IGNORE; 2866 2866 2867 2867 if (atom == xAtom(XA_XdndActionCopy)) 2868 uAction = DND_COPY_ACTION;2868 uAction = VBOX_DND_ACTION_COPY; 2869 2869 else if (atom == xAtom(XA_XdndActionMove)) 2870 uAction = DND_MOVE_ACTION;2870 uAction = VBOX_DND_ACTION_MOVE; 2871 2871 else if (atom == xAtom(XA_XdndActionLink)) 2872 uAction = DND_LINK_ACTION;2872 uAction = VBOX_DND_ACTION_LINK; 2873 2873 2874 2874 return uAction; … … 2884 2884 uint32_t DragInstance::toHGCMActions(const VBoxDnDAtomList &lstActions) 2885 2885 { 2886 uint32_t uActions = DND_IGNORE_ACTION;2886 uint32_t uActions = VBOX_DND_ACTION_IGNORE; 2887 2887 2888 2888 for (size_t i = 0; i < lstActions.size(); i++) … … 2932 2932 { 2933 2933 /* Was the drop accepted by the host? That is, anything than ignoring. */ 2934 bool fDropAccepted = uAction > DND_IGNORE_ACTION;2934 bool fDropAccepted = uAction > VBOX_DND_ACTION_IGNORE; 2935 2935 2936 2936 LogFlowFunc(("uAction=%RU32\n", uAction)); -
trunk/src/VBox/Main/src-client/GuestDnDPrivate.cpp
r72980 r74411 673 673 uint32_t GuestDnD::toHGCMAction(DnDAction_T enmAction) 674 674 { 675 uint32_t uAction = DND_IGNORE_ACTION;675 uint32_t uAction = VBOX_DND_ACTION_IGNORE; 676 676 switch (enmAction) 677 677 { 678 678 case DnDAction_Copy: 679 uAction = DND_COPY_ACTION;679 uAction = VBOX_DND_ACTION_COPY; 680 680 break; 681 681 case DnDAction_Move: 682 uAction = DND_MOVE_ACTION;682 uAction = VBOX_DND_ACTION_MOVE; 683 683 break; 684 684 case DnDAction_Link: … … 702 702 uint32_t *puAllowedActions) 703 703 { 704 uint32_t uAllowedActions = DND_IGNORE_ACTION;704 uint32_t uAllowedActions = VBOX_DND_ACTION_IGNORE; 705 705 uint32_t uDefAction = toHGCMAction(enmDefAction); 706 706 … … 718 718 { 719 719 if (hasDnDCopyAction(uAllowedActions)) 720 uDefAction = DND_COPY_ACTION;720 uDefAction = VBOX_DND_ACTION_COPY; 721 721 else if (hasDnDMoveAction(uAllowedActions)) 722 uDefAction = DND_MOVE_ACTION;722 uDefAction = VBOX_DND_ACTION_MOVE; 723 723 } 724 724 } -
trunk/src/VBox/Main/src-client/GuestDnDTargetImpl.cpp
r73941 r74411 480 480 481 481 /* Check & convert the drag & drop actions to HGCM codes. */ 482 uint32_t uDefAction = DND_IGNORE_ACTION;482 uint32_t uDefAction = VBOX_DND_ACTION_IGNORE; 483 483 uint32_t uAllowedActions = 0; 484 484 GuestDnD::toHGCMActions(aDefaultAction, &uDefAction,
Note:
See TracChangeset
for help on using the changeset viewer.