VirtualBox

Ignore:
Timestamp:
Sep 24, 2018 12:30:47 PM (6 years ago)
Author:
vboxsync
Message:

DnD: Added typedefs for DNDACTION and DNDACTIONLIST to emphasize usage, did some renaming to clean things up.

Location:
trunk/src/VBox/Additions/WINNT/VBoxTray
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxDnD.cpp

    r74411 r74439  
    9494      mEventSem(NIL_RTSEMEVENT),
    9595      hWnd(NULL),
    96       uAllActions(VBOX_DND_ACTION_IGNORE),
     96      dndLstActionsAllowed(VBOX_DND_ACTION_IGNORE),
    9797      mfMouseButtonDown(false),
    9898#ifdef VBOX_WITH_DRAG_AND_DROP_GH
     
    477477                    hide();
    478478
    479                     LogFlowThisFunc(("Starting drag and drop: uAllActions=0x%x, dwOKEffects=0x%x ...\n",
    480                                      uAllActions, startupInfo.dwOKEffects));
     479                    LogFlowThisFunc(("Starting drag and drop: dndLstActionsAllowed=0x%x, dwOKEffects=0x%x ...\n",
     480                                     dndLstActionsAllowed, startupInfo.dwOKEffects));
    481481
    482482                    AssertPtr(startupInfo.pDataObject);
     
    561561                        RTCList<RTCString> lstFormats =
    562562                            RTCString(pVbglR3Event->u.HG_Enter.pszFormats, pVbglR3Event->u.HG_Enter.cbFormats - 1).split("\r\n");
    563                         rc = OnHgEnter(lstFormats, pVbglR3Event->u.HG_Enter.uAllActions);
     563                        rc = OnHgEnter(lstFormats, pVbglR3Event->u.HG_Enter.dndLstActionsAllowed);
    564564                        if (RT_FAILURE(rc))
    565565                            break;
     
    580580                {
    581581                    rc = OnHgMove(pVbglR3Event->u.HG_Move.uXpos, pVbglR3Event->u.HG_Move.uYpos,
    582                                   pVbglR3Event->u.HG_Move.uDefAction);
     582                                  pVbglR3Event->u.HG_Move.dndActionDefault);
    583583                    break;
    584584                }
     
    628628                case VBGLR3DNDEVENTTYPE_GH_DROP:
    629629                {
    630                     rc = OnGhDrop(pVbglR3Event->u.GH_Drop.pszFormat, pVbglR3Event->u.GH_Drop.uAction);
     630                    rc = OnGhDrop(pVbglR3Event->u.GH_Drop.pszFormat, pVbglR3Event->u.GH_Drop.dndActionRequested);
    631631                    break;
    632632                }
     
    769769 * @return  IPRT status code.
    770770 * @param   lstFormats              Supported formats offered by the host.
    771  * @param   uAllActions             Supported actions offered by the host.
    772  */
    773 int VBoxDnDWnd::OnHgEnter(const RTCList<RTCString> &lstFormats, uint32_t uAllActions)
     771 * @param   dndLstActionsAllowed    Supported actions offered by the host.
     772 */
     773int VBoxDnDWnd::OnHgEnter(const RTCList<RTCString> &lstFormats, VBOXDNDACTIONLIST dndLstActionsAllowed)
    774774{
    775775    if (mMode == GH) /* Wrong mode? Bail out. */
     
    777777
    778778#ifdef DEBUG
    779     LogFlowThisFunc(("uActions=0x%x, lstFormats=%zu: ", uAllActions, lstFormats.size()));
     779    LogFlowThisFunc(("dndActionList=0x%x, lstFormats=%zu: ", dndLstActionsAllowed, lstFormats.size()));
    780780    for (size_t i = 0; i < lstFormats.size(); i++)
    781781        LogFlow(("'%s' ", lstFormats.at(i).c_str()));
     
    791791    {
    792792        /* Save all allowed actions. */
    793         this->uAllActions = uAllActions;
     793        this->dndLstActionsAllowed = dndLstActionsAllowed;
    794794
    795795        /*
     
    876876        /* Translate our drop actions into allowed Windows drop effects. */
    877877        startupInfo.dwOKEffects = DROPEFFECT_NONE;
    878         if (uAllActions)
    879         {
    880             if (uAllActions & VBOX_DND_ACTION_COPY)
     878        if (dndLstActionsAllowed)
     879        {
     880            if (dndLstActionsAllowed & VBOX_DND_ACTION_COPY)
    881881                startupInfo.dwOKEffects |= DROPEFFECT_COPY;
    882             if (uAllActions & VBOX_DND_ACTION_MOVE)
     882            if (dndLstActionsAllowed & VBOX_DND_ACTION_MOVE)
    883883                startupInfo.dwOKEffects |= DROPEFFECT_MOVE;
    884             if (uAllActions & VBOX_DND_ACTION_LINK)
     884            if (dndLstActionsAllowed & VBOX_DND_ACTION_LINK)
    885885                startupInfo.dwOKEffects |= DROPEFFECT_LINK;
    886886        }
     
    11961196    if (RT_SUCCESS(rc))
    11971197    {
    1198         uint32_t uDefAction = VBOX_DND_ACTION_IGNORE;
     1198        uint32_t dndActionDefault = VBOX_DND_ACTION_IGNORE;
    11991199
    12001200        AssertPtr(pDropTarget);
     
    12021202        if (!strFormats.isEmpty())
    12031203        {
    1204             uDefAction = VBOX_DND_ACTION_COPY;
    1205 
    1206             LogFlowFunc(("Acknowledging pDropTarget=0x%p, uDefAction=0x%x, uAllActions=0x%x, strFormats=%s\n",
    1207                          pDropTarget, uDefAction, uAllActions, strFormats.c_str()));
     1204            dndActionDefault = VBOX_DND_ACTION_COPY;
     1205
     1206            LogFlowFunc(("Acknowledging pDropTarget=0x%p, dndActionDefault=0x%x, dndLstActionsAllowed=0x%x, strFormats=%s\n",
     1207                         pDropTarget, dndActionDefault, dndLstActionsAllowed, strFormats.c_str()));
    12081208        }
    12091209        else
     
    12141214
    12151215        /** @todo Support more than one action at a time. */
    1216         uAllActions = uDefAction;
     1216        dndLstActionsAllowed = dndActionDefault;
    12171217
    12181218        int rc2 = VbglR3DnDGHSendAckPending(&mDnDCtx,
    1219                                             uDefAction, uAllActions,
     1219                                            dndActionDefault, dndLstActionsAllowed,
    12201220                                            strFormats.c_str(), (uint32_t)strFormats.length() + 1 /* Include termination */);
    12211221        if (RT_FAILURE(rc2))
     
    15501550
    15511551    this->lstFmtActive.clear();
    1552     this->uAllActions = VBOX_DND_ACTION_IGNORE;
     1552    this->dndLstActionsAllowed = VBOX_DND_ACTION_IGNORE;
    15531553
    15541554    int rc2 = setMode(Unknown);
  • trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxDnD.h

    r74380 r74439  
    380380     *  drag'n drop operation. */
    381381    RTCList<RTCString>         lstFmtActive;
    382     /** Flags of all current drag'n drop
    383      *  actions allowed. */
    384     uint32_t                   uAllActions;
     382    /** List of all current drag'n drop actions allowed. */
     383    VBOXDNDACTIONLIST          dndLstActionsAllowed;
    385384    /** The startup information required
    386385     *  for the actual DoDragDrop() call. */
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