VirtualBox

Changeset 74411 in vbox for trunk


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

DnD: Renamed action names, added typedefs for DnD actions.

Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/HostServices/DragAndDropSvc.h

    r74335 r74411  
    7676#define VBOX_DRAG_AND_DROP_MODE_BIDIRECTIONAL 3
    7777
    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. */
     84typedef uint32_t VBOXDNDACTION;
     85/** A list of (OR'ed) DnD actions. */
     86typedef 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)
    9196
    9297/** @def VBOX_DND_FORMATS_DEFAULT
  • trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxDnD.cpp

    r74380 r74411  
    9494      mEventSem(NIL_RTSEMEVENT),
    9595      hWnd(NULL),
    96       uAllActions(DND_IGNORE_ACTION),
     96      uAllActions(VBOX_DND_ACTION_IGNORE),
    9797      mfMouseButtonDown(false),
    9898#ifdef VBOX_WITH_DRAG_AND_DROP_GH
     
    878878        if (uAllActions)
    879879        {
    880             if (uAllActions & DND_COPY_ACTION)
     880            if (uAllActions & VBOX_DND_ACTION_COPY)
    881881                startupInfo.dwOKEffects |= DROPEFFECT_COPY;
    882             if (uAllActions & DND_MOVE_ACTION)
     882            if (uAllActions & VBOX_DND_ACTION_MOVE)
    883883                startupInfo.dwOKEffects |= DROPEFFECT_MOVE;
    884             if (uAllActions & DND_LINK_ACTION)
     884            if (uAllActions & VBOX_DND_ACTION_LINK)
    885885                startupInfo.dwOKEffects |= DROPEFFECT_LINK;
    886886        }
     
    925925    int rc;
    926926
    927     uint32_t uActionNotify = DND_IGNORE_ACTION;
     927    uint32_t uActionNotify = VBOX_DND_ACTION_IGNORE;
    928928    if (mMode == HG)
    929929    {
     
    11961196    if (RT_SUCCESS(rc))
    11971197    {
    1198         uint32_t uDefAction = DND_IGNORE_ACTION;
     1198        uint32_t uDefAction = VBOX_DND_ACTION_IGNORE;
    11991199
    12001200        AssertPtr(pDropTarget);
     
    12021202        if (!strFormats.isEmpty())
    12031203        {
    1204             uDefAction = DND_COPY_ACTION;
     1204            uDefAction = VBOX_DND_ACTION_COPY;
    12051205
    12061206            LogFlowFunc(("Acknowledging pDropTarget=0x%p, uDefAction=0x%x, uAllActions=0x%x, strFormats=%s\n",
     
    15501550
    15511551    this->lstFmtActive.clear();
    1552     this->uAllActions = DND_IGNORE_ACTION;
     1552    this->uAllActions = VBOX_DND_ACTION_IGNORE;
    15531553
    15541554    int rc2 = setMode(Unknown);
  • trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxDnDDropSource.cpp

    r69500 r74411  
    3737      mpWndParent(pParent),
    3838      mdwCurEffect(0),
    39       muCurAction(DND_IGNORE_ACTION)
     39      muCurAction(VBOX_DND_ACTION_IGNORE)
    4040{
    4141    LogFlowFuncEnter();
     
    105105    {
    106106        mdwCurEffect = 0;
    107         muCurAction = DND_IGNORE_ACTION;
     107        muCurAction = VBOX_DND_ACTION_IGNORE;
    108108
    109109        LogFlowFunc(("Canceled\n"));
     
    130130STDMETHODIMP VBoxDnDDropSource::GiveFeedback(DWORD dwEffect)
    131131{
    132     uint32_t uAction = DND_IGNORE_ACTION;
     132    uint32_t uAction = VBOX_DND_ACTION_IGNORE;
    133133
    134134#if 1
     
    138138    {
    139139        if (dwEffect & DROPEFFECT_COPY)
    140             uAction |= DND_COPY_ACTION;
     140            uAction |= VBOX_DND_ACTION_COPY;
    141141        if (dwEffect & DROPEFFECT_MOVE)
    142             uAction |= DND_MOVE_ACTION;
     142            uAction |= VBOX_DND_ACTION_MOVE;
    143143        if (dwEffect & DROPEFFECT_LINK)
    144             uAction |= DND_LINK_ACTION;
     144            uAction |= VBOX_DND_ACTION_LINK;
    145145    }
    146146
  • trunk/src/VBox/Additions/x11/VBoxClient/draganddrop.cpp

    r74409 r74411  
    951951#endif
    952952
    953                 uint32_t uAction = DND_IGNORE_ACTION; /* Default is ignoring. */
     953                uint32_t uAction = VBOX_DND_ACTION_IGNORE; /* Default is ignoring. */
    954954                /** @todo Compare this with the allowed actions. */
    955955                if (fAcceptDrop)
     
    11111111
    11121112                /** @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;
    11141114
    11151115                int xRc = XSendEvent(m_pDisplay, e.xclient.data.l[XdndPositionWindow],
     
    11391139
    11401140                    /* 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);
    11421142
    11431143                    /* Start over. */
     
    11541154
    11551155                /* 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);
    11571157
    11581158                /* Start over. */
     
    18431843    {
    18441844        /* 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);
    18461846    }
    18471847    else
     
    19951995
    19961996    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;
    19991999
    20002000    /* Currently in wrong mode? Bail out. */
     
    20972097        {
    20982098            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. */
    21012101            uAllActions |= toHGCMActions(m_lstActions);
    21022102        }
     
    22952295                    /* Cancel the operation -- inform the source window by
    22962296                     * 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);
    22982298                }
    22992299
     
    28632863uint32_t DragInstance::toHGCMAction(Atom atom)
    28642864{
    2865     uint32_t uAction = DND_IGNORE_ACTION;
     2865    uint32_t uAction = VBOX_DND_ACTION_IGNORE;
    28662866
    28672867    if (atom == xAtom(XA_XdndActionCopy))
    2868         uAction = DND_COPY_ACTION;
     2868        uAction = VBOX_DND_ACTION_COPY;
    28692869    else if (atom == xAtom(XA_XdndActionMove))
    2870         uAction = DND_MOVE_ACTION;
     2870        uAction = VBOX_DND_ACTION_MOVE;
    28712871    else if (atom == xAtom(XA_XdndActionLink))
    2872         uAction = DND_LINK_ACTION;
     2872        uAction = VBOX_DND_ACTION_LINK;
    28732873
    28742874    return uAction;
     
    28842884uint32_t DragInstance::toHGCMActions(const VBoxDnDAtomList &lstActions)
    28852885{
    2886     uint32_t uActions = DND_IGNORE_ACTION;
     2886    uint32_t uActions = VBOX_DND_ACTION_IGNORE;
    28872887
    28882888    for (size_t i = 0; i < lstActions.size(); i++)
     
    29322932{
    29332933    /* 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;
    29352935
    29362936    LogFlowFunc(("uAction=%RU32\n", uAction));
  • trunk/src/VBox/Main/src-client/GuestDnDPrivate.cpp

    r72980 r74411  
    673673uint32_t GuestDnD::toHGCMAction(DnDAction_T enmAction)
    674674{
    675     uint32_t uAction = DND_IGNORE_ACTION;
     675    uint32_t uAction = VBOX_DND_ACTION_IGNORE;
    676676    switch (enmAction)
    677677    {
    678678        case DnDAction_Copy:
    679             uAction = DND_COPY_ACTION;
     679            uAction = VBOX_DND_ACTION_COPY;
    680680            break;
    681681        case DnDAction_Move:
    682             uAction = DND_MOVE_ACTION;
     682            uAction = VBOX_DND_ACTION_MOVE;
    683683            break;
    684684        case DnDAction_Link:
     
    702702                             uint32_t                      *puAllowedActions)
    703703{
    704     uint32_t uAllowedActions = DND_IGNORE_ACTION;
     704    uint32_t uAllowedActions = VBOX_DND_ACTION_IGNORE;
    705705    uint32_t uDefAction      = toHGCMAction(enmDefAction);
    706706
     
    718718        {
    719719            if (hasDnDCopyAction(uAllowedActions))
    720                 uDefAction = DND_COPY_ACTION;
     720                uDefAction = VBOX_DND_ACTION_COPY;
    721721            else if (hasDnDMoveAction(uAllowedActions))
    722                 uDefAction = DND_MOVE_ACTION;
     722                uDefAction = VBOX_DND_ACTION_MOVE;
    723723        }
    724724    }
  • trunk/src/VBox/Main/src-client/GuestDnDTargetImpl.cpp

    r73941 r74411  
    480480
    481481    /* Check & convert the drag & drop actions to HGCM codes. */
    482     uint32_t uDefAction      = DND_IGNORE_ACTION;
     482    uint32_t uDefAction      = VBOX_DND_ACTION_IGNORE;
    483483    uint32_t uAllowedActions = 0;
    484484    GuestDnD::toHGCMActions(aDefaultAction,  &uDefAction,
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