VirtualBox

Changeset 74439 in vbox


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
Files:
1 added
11 edited

Legend:

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

    r74411 r74439  
    6767#include <VBox/VMMDevCoreTypes.h>
    6868#include <VBox/VBoxGuestCoreTypes.h>
    69 
    70 /*
    71  * The mode of operations.
    72  */
    73 #define VBOX_DRAG_AND_DROP_MODE_OFF           0
    74 #define VBOX_DRAG_AND_DROP_MODE_HOST_TO_GUEST 1
    75 #define VBOX_DRAG_AND_DROP_MODE_GUEST_TO_HOST 2
    76 #define VBOX_DRAG_AND_DROP_MODE_BIDIRECTIONAL 3
    77 
    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)
    96 
    97 /** @def VBOX_DND_FORMATS_DEFAULT
    98  * Default drag'n drop formats.
    99  * Note: If you add new entries here, make sure you test those
    100  *       with all supported guest OSes!
    101  */
    102 #define VBOX_DND_FORMATS_DEFAULT                                                                \
    103     "text/uri-list",                                                                            \
    104     /* Text. */                                                                                 \
    105     "text/html",                                                                                \
    106     "text/plain;charset=utf-8",                                                                 \
    107     "text/plain;charset=utf-16",                                                                \
    108     "text/plain",                                                                               \
    109     "text/richtext",                                                                            \
    110     "UTF8_STRING",                                                                              \
    111     "TEXT",                                                                                     \
    112     "STRING",                                                                                   \
    113     /* OpenOffice formats. */                                                                   \
    114     /* See: https://wiki.openoffice.org/wiki/Documentation/DevGuide/OfficeDev/Common_Application_Features#OpenOffice.org_Clipboard_Data_Formats */ \
    115     "application/x-openoffice-embed-source-xml;windows_formatname=\"Star Embed Source (XML)\"", \
    116     "application/x-openoffice;windows_formatname=\"Bitmap\""
    11769
    11870namespace DragAndDropSvc {
  • trunk/include/VBox/VBoxGuestLib.h

    r74380 r74439  
    3434#include <VBox/VMMDev.h>
    3535#include <VBox/VBoxGuestCoreTypes.h>
     36# ifdef VBOX_WITH_DRAG_AND_DROP
     37#  include <VBox/GuestHost/DragAndDropDefs.h>
     38# endif
    3639
    3740/** @defgroup grp_vboxguest_lib     VirtualBox Guest Additions Library
     
    920923            /** Size (in bytes) of pszFormats (\0 included). */
    921924            uint32_t cbFormats;
    922             /** Allowed DnD actions. */
    923             uint32_t uAllActions;
     925            /** List of allowed DnD actions. */
     926            VBOXDNDACTIONLIST dndLstActionsAllowed;
    924927        } HG_Enter;
    925928        struct
     
    929932            /** Absolute Y position of guest screen. */
    930933            uint32_t uYpos;
    931             /** Proposed DnD action. */
    932             uint32_t uDefAction;
     934            /** Default DnD action. */
     935            VBOXDNDACTION dndActionDefault;
    933936        } HG_Move;
    934937        struct
     
    942945            /** Absolute Y position of guest screen. */
    943946            uint32_t uYpos;
    944             /** Proposed DnD action. */
    945             uint32_t uDefAction;
     947            /** Default DnD action. */
     948            VBOXDNDACTION dndActionDefault;
    946949        } HG_Drop;
    947950        struct
     
    968971            uint32_t cbFormat;
    969972            /** Requested DnD action. */
    970             uint32_t uAction;
     973            VBOXDNDACTION dndActionRequested;
    971974        } GH_Drop;
    972975# endif
     
    982985VBGLR3DECL(void)    VbglR3DnDEventFree(PVBGLR3DNDEVENT pEvent);
    983986
    984 VBGLR3DECL(int)     VbglR3DnDHGSendAckOp(PVBGLR3GUESTDNDCMDCTX pCtx, uint32_t uAction);
     987VBGLR3DECL(int)     VbglR3DnDHGSendAckOp(PVBGLR3GUESTDNDCMDCTX pCtx, VBOXDNDACTION dndAction);
    985988VBGLR3DECL(int)     VbglR3DnDHGSendReqData(PVBGLR3GUESTDNDCMDCTX pCtx, const char *pcszFormat);
    986989VBGLR3DECL(int)     VbglR3DnDHGSendProgress(PVBGLR3GUESTDNDCMDCTX pCtx, uint32_t uStatus, uint8_t uPercent, int rcErr);
    987990#  ifdef VBOX_WITH_DRAG_AND_DROP_GH
    988 VBGLR3DECL(int)     VbglR3DnDGHSendAckPending(PVBGLR3GUESTDNDCMDCTX pCtx, uint32_t uDefAction, uint32_t uAllActions, const char* pcszFormats, uint32_t cbFormats);
     991VBGLR3DECL(int)     VbglR3DnDGHSendAckPending(PVBGLR3GUESTDNDCMDCTX pCtx, VBOXDNDACTION dndActionDefault, VBOXDNDACTIONLIST dndLstActionsAllowed, const char* pcszFormats, uint32_t cbFormats);
    989992VBGLR3DECL(int)     VbglR3DnDGHSendData(PVBGLR3GUESTDNDCMDCTX pCtx, const char *pszFormat, void *pvData, uint32_t cbData);
    990993VBGLR3DECL(int)     VbglR3DnDGHSendError(PVBGLR3GUESTDNDCMDCTX pCtx, int rcOp);
  • 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. */
  • trunk/src/VBox/Additions/common/VBoxGuest/lib/VBoxGuestR3LibDragAndDrop.cpp

    r74383 r74439  
    12121212                                           NULL /* puYPos */,
    12131213                                           NULL /* uDefAction */,
    1214                                            &pEvent->u.HG_Enter.uAllActions,
     1214                                           &pEvent->u.HG_Enter.dndLstActionsAllowed,
    12151215                                           &pEvent->u.HG_Enter.pszFormats,
    12161216                                           &pEvent->u.HG_Enter.cbFormats);
     
    12261226                                           &pEvent->u.HG_Move.uXpos,
    12271227                                           &pEvent->u.HG_Move.uYpos,
    1228                                            &pEvent->u.HG_Move.uDefAction,
     1228                                           &pEvent->u.HG_Move.dndActionDefault,
    12291229                                           NULL /* puAllActions */,
    12301230                                           NULL /* pszFormats */,
     
    12411241                                           &pEvent->u.HG_Drop.uXpos,
    12421242                                           &pEvent->u.HG_Drop.uYpos,
    1243                                            &pEvent->u.HG_Drop.uDefAction,
     1243                                           &pEvent->u.HG_Drop.dndActionDefault,
    12441244                                           NULL /* puAllActions */,
    12451245                                           NULL /* pszFormats */,
     
    12951295                                            &pEvent->u.GH_Drop.pszFormat,
    12961296                                            &pEvent->u.GH_Drop.cbFormat,
    1297                                             &pEvent->u.GH_Drop.uAction);
     1297                                            &pEvent->u.GH_Drop.dndActionRequested);
    12981298                if (RT_SUCCESS(rc))
    12991299                    pEvent->enmType = VBGLR3DNDEVENTTYPE_GH_DROP;
     
    13691369}
    13701370
    1371 VBGLR3DECL(int) VbglR3DnDHGSendAckOp(PVBGLR3GUESTDNDCMDCTX pCtx, uint32_t uAction)
     1371VBGLR3DECL(int) VbglR3DnDHGSendAckOp(PVBGLR3GUESTDNDCMDCTX pCtx, VBOXDNDACTION dndAction)
    13721372{
    13731373    AssertPtrReturn(pCtx, VERR_INVALID_POINTER);
     
    13791379    /** @todo Context ID not used yet. */
    13801380    Msg.u.v3.uContext.SetUInt32(0);
    1381     Msg.u.v3.uAction.SetUInt32(uAction);
     1381    Msg.u.v3.uAction.SetUInt32(dndAction);
    13821382
    13831383    return VbglR3HGCMCall(&Msg.hdr, sizeof(Msg));
     
    14481448 *
    14491449 * @returns IPRT status code.
    1450  * @param   pCtx                DnD context to use.
    1451  * @param   uDefAction          Default action for the operation to report.
    1452  * @param   uAllActions        All available actions for the operation to report.
    1453  * @param   pcszFormats         Available formats for the operation to report.
    1454  * @param   cbFormats           Size (in bytes) of formats to report.
     1450 * @param   pCtx                 DnD context to use.
     1451 * @param   dndActionDefault     Default action for the operation to report.
     1452 * @param   dndLstActionsAllowed All available actions for the operation to report.
     1453 * @param   pcszFormats          Available formats for the operation to report.
     1454 * @param   cbFormats            Size (in bytes) of formats to report.
    14551455 */
    14561456VBGLR3DECL(int) VbglR3DnDGHSendAckPending(PVBGLR3GUESTDNDCMDCTX pCtx,
    1457                                           uint32_t uDefAction, uint32_t uAllActions, const char* pcszFormats, uint32_t cbFormats)
     1457                                          VBOXDNDACTION dndActionDefault, VBOXDNDACTIONLIST dndLstActionsAllowed,
     1458                                          const char* pcszFormats, uint32_t cbFormats)
    14581459{
    14591460    AssertPtrReturn(pCtx,        VERR_INVALID_POINTER);
     
    14701471    /** @todo Context ID not used yet. */
    14711472    Msg.u.v3.uContext.SetUInt32(0);
    1472     Msg.u.v3.uDefAction.SetUInt32(uDefAction);
    1473     Msg.u.v3.uAllActions.SetUInt32(uAllActions);
     1473    Msg.u.v3.uDefAction.SetUInt32(dndActionDefault);
     1474    Msg.u.v3.uAllActions.SetUInt32(dndLstActionsAllowed);
    14741475    Msg.u.v3.pvFormats.SetPtr((void*)pcszFormats, cbFormats);
    14751476    Msg.u.v3.cbFormats.SetUInt32(cbFormats);
  • trunk/src/VBox/Additions/x11/VBoxClient/draganddrop.cpp

    r74411 r74439  
    440440    void destroy();
    441441
    442     int sendFinished(Window hWndSource, uint32_t uAction);
     442    int sendFinished(Window hWndSource, VBOXDNDACTION dndAction);
    443443
    444444public:
     
    504504
    505505    /* Host -> Guest handling. */
    506     int hgEnter(const RTCList<RTCString> &formats, uint32_t actions);
     506    int hgEnter(const RTCList<RTCString> &formats, VBOXDNDACTIONLIST dndListActionsAllowed);
    507507    int hgLeave(void);
    508     int hgMove(uint32_t uPosX, uint32_t uPosY, uint32_t uDefaultAction);
    509     int hgDrop(uint32_t uPosX, uint32_t uPosY, uint32_t uDefaultAction);
     508    int hgMove(uint32_t uPosX, uint32_t uPosY, VBOXDNDACTION dndActionDefault);
     509    int hgDrop(uint32_t uPosX, uint32_t uPosY, VBOXDNDACTION dndActionDefault);
    510510    int hgDataReceive(PVBGLR3GUESTDNDMETADATA pMetaData);
    511511
     
    537537    int             toAtomList(const RTCList<RTCString> &lstFormats, VBoxDnDAtomList &lstAtoms) const;
    538538    int             toAtomList(const void *pvData, uint32_t cbData, VBoxDnDAtomList &lstAtoms) const;
    539     static Atom     toAtomAction(uint32_t uAction);
    540     static int      toAtomActions(uint32_t uActions, VBoxDnDAtomList &lstAtoms);
     539    static Atom     toAtomAction(VBOXDNDACTION dndAction);
     540    static int      toAtomActions(VBOXDNDACTIONLIST dndActionList, VBoxDnDAtomList &lstAtoms);
    541541    static uint32_t toHGCMAction(Atom atom);
    542542    static uint32_t toHGCMActions(const VBoxDnDAtomList &actionsList);
     
    950950                LogFlowThisFunc(("\tReported dead area: x=%RU16, y=%RU16, cx=%RU16, cy=%RU16\n", x, y, cx, cy));
    951951#endif
    952 
    953                 uint32_t uAction = VBOX_DND_ACTION_IGNORE; /* Default is ignoring. */
     952                VBOXDNDACTION dndAction = VBOX_DND_ACTION_IGNORE; /* Default is ignoring. */
    954953                /** @todo Compare this with the allowed actions. */
    955954                if (fAcceptDrop)
    956                     uAction = toHGCMAction(static_cast<Atom>(e.xclient.data.l[XdndStatusAction]));
    957 
    958                 rc = VbglR3DnDHGSendAckOp(&m_dndCtx, uAction);
     955                    dndAction = toHGCMAction(static_cast<Atom>(e.xclient.data.l[XdndStatusAction]));
     956
     957                rc = VbglR3DnDHGSendAckOp(&m_dndCtx, dndAction);
    959958            }
    960959            else if (e.xclient.message_type == xAtom(XA_XdndFinished))
     
    15941593 * @returns IPRT status code.
    15951594 * @param   lstFormats              List of supported formats from the host.
    1596  * @param   uActions                (ORed) List of supported actions from the host.
    1597  */
    1598 int DragInstance::hgEnter(const RTCList<RTCString> &lstFormats, uint32_t uActions)
     1595 * @param   dndListActionsAllowed   (ORed) List of supported actions from the host.
     1596 */
     1597int DragInstance::hgEnter(const RTCList<RTCString> &lstFormats, uint32_t dndListActionsAllowed)
    15991598{
    16001599    LogFlowThisFunc(("mode=%RU32, state=%RU32\n", m_enmMode, m_enmState));
     
    16061605
    16071606#ifdef DEBUG
    1608     LogFlowThisFunc(("uActions=0x%x, lstFormats=%zu: ", uActions, lstFormats.size()));
     1607    LogFlowThisFunc(("dndListActionsAllowed=0x%x, lstFormats=%zu: ", dndListActionsAllowed, lstFormats.size()));
    16091608    for (size_t i = 0; i < lstFormats.size(); ++i)
    16101609        LogFlow(("'%s' ", lstFormats.at(i).c_str()));
     
    16301629        /* Announce the possible actions. */
    16311630        VBoxDnDAtomList lstActions;
    1632         rc = toAtomActions(uActions, lstActions);
     1631        rc = toAtomActions(dndListActionsAllowed, lstActions);
    16331632        if (RT_FAILURE(rc))
    16341633            break;
     
    16671666 * @param   uPosX                   Relative X position within the guest's display area.
    16681667 * @param   uPosY                   Relative Y position within the guest's display area.
    1669  * @param   uDefaultAction          Default action the host wants to perform on the guest
     1668 * @param   dndActionDefault        Default action the host wants to perform on the guest
    16701669 *                                  as soon as the operation successfully finishes.
    16711670 */
    1672 int DragInstance::hgMove(uint32_t uPosX, uint32_t uPosY, uint32_t uDefaultAction)
     1671int DragInstance::hgMove(uint32_t uPosX, uint32_t uPosY, VBOXDNDACTION dndActionDefault)
    16731672{
    16741673    LogFlowThisFunc(("mode=%RU32, state=%RU32\n", m_enmMode, m_enmState));
    1675     LogFlowThisFunc(("uPosX=%RU32, uPosY=%RU32, uAction=%RU32\n", uPosX, uPosY, uDefaultAction));
     1674    LogFlowThisFunc(("uPosX=%RU32, uPosY=%RU32, dndActionDefault=%RU32\n", uPosX, uPosY, dndActionDefault));
    16761675
    16771676    if (   m_enmMode  != HG
     
    18201819         * Send a XdndPosition event with the proposed action to the guest.
    18211820         */
    1822         Atom pa = toAtomAction(uDefaultAction);
     1821        Atom pa = toAtomAction(dndActionDefault);
    18231822        LogFlowThisFunc(("strAction=%s\n", xAtomToString(pa).c_str()));
    18241823
     
    18631862 * @param   uPosX                   Relative X position within the guest's display area.
    18641863 * @param   uPosY                   Relative Y position within the guest's display area.
    1865  * @param   uDefaultAction          Default action the host wants to perform on the guest
     1864 * @param   dndActionDefault        Default action the host wants to perform on the guest
    18661865 *                                  as soon as the operation successfully finishes.
    18671866 */
    1868 int DragInstance::hgDrop(uint32_t uPosX, uint32_t uPosY, uint32_t uDefaultAction)
    1869 {
    1870     RT_NOREF3(uPosX, uPosY, uDefaultAction);
     1867int DragInstance::hgDrop(uint32_t uPosX, uint32_t uPosY, VBOXDNDACTION dndActionDefault)
     1868{
     1869    RT_NOREF3(uPosX, uPosY, dndActionDefault);
    18711870    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));
     1871    LogFlowThisFunc(("uPosX=%RU32, uPosY=%RU32, dndActionDefault=%RU32\n", uPosX, uPosY, dndActionDefault));
    18731872
    18741873    if (   m_enmMode  != HG
     
    19951994
    19961995    RTCString strFormats = "\r\n"; /** @todo If empty, IOCTL fails with VERR_ACCESS_DENIED. */
    1997     uint32_t uDefAction = VBOX_DND_ACTION_IGNORE;
    1998     uint32_t uAllActions = VBOX_DND_ACTION_IGNORE;
     1996    VBOXDNDACTION     dndActionDefault = VBOX_DND_ACTION_IGNORE;
     1997    VBOXDNDACTIONLIST dndActionList    = VBOX_DND_ACTION_IGNORE;
    19991998
    20001999    /* Currently in wrong mode? Bail out. */
     
    20972096        {
    20982097            strFormats   = strFormatsCur;
    2099             uDefAction  = VBOX_DND_ACTION_COPY; /** @todo Handle default action! */
    2100             uAllActions  = VBOX_DND_ACTION_COPY; /** @todo Ditto. */
    2101             uAllActions |= toHGCMActions(m_lstActions);
     2098            dndActionDefault = VBOX_DND_ACTION_COPY; /** @todo Handle default action! */
     2099            dndActionList    = VBOX_DND_ACTION_COPY; /** @todo Ditto. */
     2100            dndActionList  |= toHGCMActions(m_lstActions);
    21022101        }
    21032102
     
    21052104    }
    21062105
    2107     rc2 = VbglR3DnDGHSendAckPending(&m_dndCtx, uDefAction, uAllActions,
     2106    rc2 = VbglR3DnDGHSendAckPending(&m_dndCtx, dndActionDefault, dndActionList,
    21082107                                    strFormats.c_str(), strFormats.length() + 1 /* Include termination */);
    2109     LogFlowThisFunc(("uClientID=%RU32, uDefAction=0x%x, allActions=0x%x, strFormats=%s, rc=%Rrc\n",
    2110                      m_dndCtx.uClientID, uDefAction, uAllActions, strFormats.c_str(), rc2));
     2108    LogFlowThisFunc(("uClientID=%RU32, uDefAction=0x%x, uLstActions=0x%x, strFormats=%s, rc=%Rrc\n",
     2109                     m_dndCtx.uClientID, dndActionDefault, dndActionList, strFormats.c_str(), rc2));
    21112110    if (RT_FAILURE(rc2))
    21122111    {
     
    28222821 *
    28232822 * @returns Converted Atom-based drag'n drop action.
    2824  * @param   uAction                 HGCM drag'n drop actions to convert.
     2823 * @param   dndAction               HGCM drag'n drop actions to convert.
    28252824 */
    28262825/* static */
    2827 Atom DragInstance::toAtomAction(uint32_t uAction)
     2826Atom DragInstance::toAtomAction(VBOXDNDACTION dndAction)
    28282827{
    28292828    /* Ignore is None. */
    2830     return (isDnDCopyAction(uAction) ? xAtom(XA_XdndActionCopy) :
    2831             isDnDMoveAction(uAction) ? xAtom(XA_XdndActionMove) :
    2832             isDnDLinkAction(uAction) ? xAtom(XA_XdndActionLink) :
     2829    return (isDnDCopyAction(dndAction) ? xAtom(XA_XdndActionCopy) :
     2830            isDnDMoveAction(dndAction) ? xAtom(XA_XdndActionMove) :
     2831            isDnDLinkAction(dndAction) ? xAtom(XA_XdndActionLink) :
    28332832            None);
    28342833}
     
    28382837 *
    28392838 * @returns IPRT status code.
    2840  * @param   uActions                HGCM drag'n drop actions to convert.
     2839 * @param   dndActionList           HGCM drag'n drop actions to convert.
    28412840 * @param   lstAtoms                Reference to VBoxDnDAtomList to store actions in.
    28422841 */
    28432842/* static */
    2844 int DragInstance::toAtomActions(uint32_t uActions, VBoxDnDAtomList &lstAtoms)
    2845 {
    2846     if (hasDnDCopyAction(uActions))
     2843int DragInstance::toAtomActions(VBOXDNDACTIONLIST dndActionList, VBoxDnDAtomList &lstAtoms)
     2844{
     2845    if (hasDnDCopyAction(dndActionList))
    28472846        lstAtoms.append(xAtom(XA_XdndActionCopy));
    2848     if (hasDnDMoveAction(uActions))
     2847    if (hasDnDMoveAction(dndActionList))
    28492848        lstAtoms.append(xAtom(XA_XdndActionMove));
    2850     if (hasDnDLinkAction(uActions))
     2849    if (hasDnDLinkAction(dndActionList))
    28512850        lstAtoms.append(xAtom(XA_XdndActionLink));
    28522851
     
    29292928}
    29302929
    2931 int VBoxDnDProxyWnd::sendFinished(Window hWndSource, uint32_t uAction)
     2930int VBoxDnDProxyWnd::sendFinished(Window hWndSource, VBOXDNDACTION dndAction)
    29322931{
    29332932    /* Was the drop accepted by the host? That is, anything than ignoring. */
    2934     bool fDropAccepted = uAction > VBOX_DND_ACTION_IGNORE;
    2935 
    2936     LogFlowFunc(("uAction=%RU32\n", uAction));
     2933    bool fDropAccepted = dndAction > VBOX_DND_ACTION_IGNORE;
     2934
     2935    LogFlowFunc(("dndAction=%RU32\n", dndAction));
    29372936
    29382937    /* Confirm the result of the transfer to the target window. */
     
    29442943    m.message_type = xAtom(XA_XdndFinished);
    29452944    m.format       = 32;
    2946     m.data.l[XdndFinishedWindow] = hWnd;                                                       /* Target window. */
    2947     m.data.l[XdndFinishedFlags]  = fDropAccepted ? RT_BIT(0) : 0;                              /* Was the drop accepted? */
    2948     m.data.l[XdndFinishedAction] = fDropAccepted ? DragInstance::toAtomAction(uAction) : None; /* Action used on accept. */
     2945    m.data.l[XdndFinishedWindow] = hWnd;                                                         /* Target window. */
     2946    m.data.l[XdndFinishedFlags]  = fDropAccepted ? RT_BIT(0) : 0;                                /* Was the drop accepted? */
     2947    m.data.l[XdndFinishedAction] = fDropAccepted ? DragInstance::toAtomAction(dndAction) : None; /* Action used on accept. */
    29492948
    29502949    int xRc = XSendEvent(pDisp, hWndSource, True, NoEventMask, reinterpret_cast<XEvent*>(&m));
     
    31113110                            RTCList<RTCString> lstFormats =
    31123111                                RTCString(pVbglR3Event->u.HG_Enter.pszFormats, pVbglR3Event->u.HG_Enter.cbFormats - 1).split("\r\n");
    3113                             rc = m_pCurDnD->hgEnter(lstFormats, pVbglR3Event->u.HG_Enter.uAllActions);
     3112                            rc = m_pCurDnD->hgEnter(lstFormats, pVbglR3Event->u.HG_Enter.dndLstActionsAllowed);
    31143113                            if (RT_FAILURE(rc))
    31153114                                break;
     
    31313130                    {
    31323131                        rc = m_pCurDnD->hgMove(pVbglR3Event->u.HG_Move.uXpos, pVbglR3Event->u.HG_Move.uYpos,
    3133                                                pVbglR3Event->u.HG_Move.uDefAction);
     3132                                               pVbglR3Event->u.HG_Move.dndActionDefault);
    31343133                        break;
    31353134                    }
     
    31443143                    {
    31453144                        rc = m_pCurDnD->hgDrop(pVbglR3Event->u.HG_Drop.uXpos, pVbglR3Event->u.HG_Drop.uYpos,
    3146                                                pVbglR3Event->u.HG_Drop.uDefAction);
     3145                                               pVbglR3Event->u.HG_Drop.dndActionDefault);
    31473146                        break;
    31483147                    }
     
    31843183                    case VBGLR3DNDEVENTTYPE_GH_DROP:
    31853184                    {
    3186                         rc = m_pCurDnD->ghDropped(pVbglR3Event->u.GH_Drop.pszFormat, pVbglR3Event->u.GH_Drop.uAction);
     3185                        rc = m_pCurDnD->ghDropped(pVbglR3Event->u.GH_Drop.pszFormat, pVbglR3Event->u.GH_Drop.dndActionRequested);
    31873186                        break;
    31883187                    }
  • trunk/src/VBox/HostServices/DragAndDrop/service.cpp

    r74213 r74439  
    3535
    3636#include <VBox/GuestHost/DragAndDrop.h>
     37#include <VBox/GuestHost/DragAndDropDefs.h>
    3738#include <VBox/HostServices/Service.h>
    3839#include <VBox/HostServices/DragAndDropSvc.h>
  • trunk/src/VBox/Main/include/GuestDnDPrivate.h

    r71398 r74439  
    2626#include <VBox/hgcmsvc.h> /* For PVBOXHGCMSVCPARM. */
    2727#include <VBox/GuestHost/DragAndDrop.h>
     28#include <VBox/GuestHost/DragAndDropDefs.h>
    2829#include <VBox/HostServices/DragAndDropSvc.h>
    2930
     
    797798     *  Needed to tell the guest if data has to be
    798799     *  deleted e.g. when moving instead of copying. */
    799     uint32_t                            mAction;
     800    VBOXDNDACTION                       mAction;
    800801    /** Drag'n drop received from the guest.
    801802     *  This can be arbitrary data or an URI list. */
     
    986987    int waitForGuestResponse(RTMSINTERVAL msTimeout = 500) const;
    987988
    988     void setAllActions(uint32_t a) { m_allActions = a; }
    989     uint32_t allActions(void) const { return m_allActions; }
    990 
    991     void setDefAction(uint32_t a) { m_defAction = a; }
    992     uint32_t defAction(void) const { return m_defAction; }
     989    void setActionsAllowed(VBOXDNDACTIONLIST a) { m_dndLstActionsAllowed = a; }
     990    VBOXDNDACTIONLIST getActionsAllowed(void) const { return m_dndLstActionsAllowed; }
     991
     992    void setActionDefault(VBOXDNDACTION a) { m_dndActionDefault = a; }
     993    VBOXDNDACTION getActionDefault(void) const { return m_dndActionDefault; }
    993994
    994995    void setFormats(const GuestDnDMIMEList &lstFormats) { m_lstFormats = lstFormats; }
     
    10181019    /** Default action to perform in case of a
    10191020     *  successful drop. */
    1020     uint32_t              m_defAction;
    1021     /** Actions supported by the guest in case of
    1022      *  a successful drop. */
    1023     uint32_t              m_allActions;
     1021    VBOXDNDACTION         m_dndActionDefault;
     1022    /** Actions supported by the guest in case of a successful drop. */
     1023    VBOXDNDACTIONLIST     m_dndLstActionsAllowed;
    10241024    /** Format(s) requested/supported from the guest. */
    10251025    GuestDnDMIMEList      m_lstFormats;
     
    10941094    static GuestDnDMIMEList         toFilteredFormatList(const GuestDnDMIMEList &lstFormatsSupported, const GuestDnDMIMEList &lstFormatsWanted);
    10951095    static GuestDnDMIMEList         toFilteredFormatList(const GuestDnDMIMEList &lstFormatsSupported, const com::Utf8Str &strFormatsWanted);
    1096     static DnDAction_T              toMainAction(uint32_t uAction);
    1097     static std::vector<DnDAction_T> toMainActions(uint32_t uActions);
    1098     static uint32_t                 toHGCMAction(DnDAction_T enmAction);
    1099     static void                     toHGCMActions(DnDAction_T enmDefAction, uint32_t *puDefAction, const std::vector<DnDAction_T> vecAllowedActions, uint32_t *puAllowedActions);
     1096    static DnDAction_T              toMainAction(VBOXDNDACTION dndAction);
     1097    static std::vector<DnDAction_T> toMainActions(VBOXDNDACTIONLIST dndActionList);
     1098    static VBOXDNDACTION            toHGCMAction(DnDAction_T enmAction);
     1099    static void                     toHGCMActions(DnDAction_T enmDefAction, VBOXDNDACTION *pDefAction, const std::vector<DnDAction_T> vecAllowedActions, VBOXDNDACTIONLIST *pLstAllowedActions);
    11001100    /** @}  */
    11011101
  • trunk/src/VBox/Main/src-client/GuestDnDPrivate.cpp

    r74411 r74439  
    188188GuestDnDResponse::GuestDnDResponse(const ComObjPtr<Guest>& pGuest)
    189189    : m_EventSem(NIL_RTSEMEVENT)
    190     , m_defAction(0)
    191     , m_allActions(0)
     190    , m_dndActionDefault(0)
     191    , m_dndLstActionsAllowed(0)
    192192    , m_pParent(pGuest)
    193193{
     
    214214    LogFlowThisFuncEnter();
    215215
    216     m_defAction  = 0;
    217     m_allActions = 0;
     216    m_dndActionDefault     = 0;
     217    m_dndLstActionsAllowed = 0;
    218218
    219219    m_lstFormats.clear();
     
    384384            AssertReturn(DragAndDropSvc::CB_MAGIC_DND_HG_ACK_OP == pCBData->hdr.uMagic, VERR_INVALID_PARAMETER);
    385385
    386             setDefAction(pCBData->uAction);
     386            setActionDefault(pCBData->uAction);
    387387            rc = notifyAboutGuestResponse();
    388388            break;
     
    453453            {
    454454                setFormats   (GuestDnD::toFormatList(pCBData->pszFormat));
    455                 setDefAction (pCBData->uDefAction);
    456                 setAllActions(pCBData->uAllActions);
     455                setActionDefault (pCBData->uDefAction);
     456                setActionsAllowed(pCBData->uAllActions);
    457457
    458458                rc = VINF_SUCCESS;
     
    671671
    672672/* static */
    673 uint32_t GuestDnD::toHGCMAction(DnDAction_T enmAction)
    674 {
    675     uint32_t uAction = VBOX_DND_ACTION_IGNORE;
     673VBOXDNDACTION GuestDnD::toHGCMAction(DnDAction_T enmAction)
     674{
     675    VBOXDNDACTION dndAction = VBOX_DND_ACTION_IGNORE;
    676676    switch (enmAction)
    677677    {
    678678        case DnDAction_Copy:
    679             uAction = VBOX_DND_ACTION_COPY;
     679            dndAction = VBOX_DND_ACTION_COPY;
    680680            break;
    681681        case DnDAction_Move:
    682             uAction = VBOX_DND_ACTION_MOVE;
     682            dndAction = VBOX_DND_ACTION_MOVE;
    683683            break;
    684684        case DnDAction_Link:
     
    693693    }
    694694
    695     return uAction;
     695    return dndAction;
    696696}
    697697
    698698/* static */
    699 void GuestDnD::toHGCMActions(DnDAction_T                    enmDefAction,
    700                              uint32_t                      *puDefAction,
    701                              const std::vector<DnDAction_T> vecAllowedActions,
    702                              uint32_t                      *puAllowedActions)
    703 {
    704     uint32_t uAllowedActions = VBOX_DND_ACTION_IGNORE;
    705     uint32_t uDefAction      = toHGCMAction(enmDefAction);
    706 
    707     if (!vecAllowedActions.empty())
     699void GuestDnD::toHGCMActions(DnDAction_T                    enmDnDActionDefault,
     700                             VBOXDNDACTION                 *pDnDActionDefault,
     701                             const std::vector<DnDAction_T> vecDnDActionsAllowed,
     702                             VBOXDNDACTIONLIST             *pDnDLstActionsAllowed)
     703{
     704    VBOXDNDACTIONLIST dndLstActionsAllowed = VBOX_DND_ACTION_IGNORE;
     705    VBOXDNDACTION     dndActionDefault     = toHGCMAction(enmDnDActionDefault);
     706
     707    if (!vecDnDActionsAllowed.empty())
    708708    {
    709709        /* First convert the allowed actions to a bit array. */
    710         for (size_t i = 0; i < vecAllowedActions.size(); i++)
    711             uAllowedActions |= toHGCMAction(vecAllowedActions[i]);
     710        for (size_t i = 0; i < vecDnDActionsAllowed.size(); i++)
     711            dndLstActionsAllowed |= toHGCMAction(vecDnDActionsAllowed[i]);
    712712
    713713        /*
     
    715715         * set allowed actions, preferring copy, move (in that order).
    716716         */
    717         if (isDnDIgnoreAction(uDefAction))
    718         {
    719             if (hasDnDCopyAction(uAllowedActions))
    720                 uDefAction = VBOX_DND_ACTION_COPY;
    721             else if (hasDnDMoveAction(uAllowedActions))
    722                 uDefAction = VBOX_DND_ACTION_MOVE;
    723         }
    724     }
    725 
    726     if (puDefAction)
    727         *puDefAction      = uDefAction;
    728     if (puAllowedActions)
    729         *puAllowedActions = uAllowedActions;
     717        if (isDnDIgnoreAction(dndActionDefault))
     718        {
     719            if (hasDnDCopyAction(dndLstActionsAllowed))
     720                dndActionDefault = VBOX_DND_ACTION_COPY;
     721            else if (hasDnDMoveAction(dndLstActionsAllowed))
     722                dndActionDefault = VBOX_DND_ACTION_MOVE;
     723        }
     724    }
     725
     726    if (pDnDActionDefault)
     727        *pDnDActionDefault     = dndActionDefault;
     728    if (pDnDLstActionsAllowed)
     729        *pDnDLstActionsAllowed = dndLstActionsAllowed;
    730730}
    731731
    732732/* static */
    733 DnDAction_T GuestDnD::toMainAction(uint32_t uAction)
     733DnDAction_T GuestDnD::toMainAction(VBOXDNDACTION dndAction)
    734734{
    735735    /* For now it doesn't seems useful to allow a
    736736     * link action between host & guest. Maybe later! */
    737     return isDnDCopyAction(uAction) ? DnDAction_Copy
    738          : isDnDMoveAction(uAction) ? DnDAction_Move
    739          :                            DnDAction_Ignore;
     737    return isDnDCopyAction(dndAction) ? DnDAction_Copy
     738         : isDnDMoveAction(dndAction) ? DnDAction_Move
     739         :                              DnDAction_Ignore;
    740740}
    741741
    742742/* static */
    743 std::vector<DnDAction_T> GuestDnD::toMainActions(uint32_t uActions)
     743std::vector<DnDAction_T> GuestDnD::toMainActions(VBOXDNDACTIONLIST dndActionList)
    744744{
    745745    std::vector<DnDAction_T> vecActions;
     
    748748     * link action between host & guest. Maybe later! */
    749749    RTCList<DnDAction_T> lstActions;
    750     if (hasDnDCopyAction(uActions))
     750    if (hasDnDCopyAction(dndActionList))
    751751        lstActions.append(DnDAction_Copy);
    752     if (hasDnDMoveAction(uActions))
     752    if (hasDnDMoveAction(dndActionList))
    753753        lstActions.append(DnDAction_Move);
    754754
  • trunk/src/VBox/Main/src-client/GuestDnDSourceImpl.cpp

    r74361 r74439  
    279279
    280280        if (   fFetchResult
    281             && isDnDIgnoreAction(pResp->defAction()))
     281            && isDnDIgnoreAction(pResp->getActionDefault()))
    282282            fFetchResult = false;
    283283
     
    299299
    300300                aFormats            = lstFiltered;
    301                 aAllowedActions     = GuestDnD::toMainActions(pResp->allActions());
     301                aAllowedActions     = GuestDnD::toMainActions(pResp->getActionsAllowed());
    302302                if (aDefaultAction)
    303                     *aDefaultAction = GuestDnD::toMainAction(pResp->defAction());
     303                    *aDefaultAction = GuestDnD::toMainAction(pResp->getActionDefault());
    304304
    305305                /* Apply the (filtered) formats list. */
     
    310310        }
    311311
    312         LogFlowFunc(("fFetchResult=%RTbool, allActions=0x%x\n", fFetchResult, pResp->allActions()));
     312        LogFlowFunc(("fFetchResult=%RTbool, lstActionsAllowed=0x%x\n", fFetchResult, pResp->getActionsAllowed()));
    313313    }
    314314
     
    337337        return setError(E_INVALIDARG, tr("Specified format '%s' is not supported"), aFormat.c_str());
    338338
    339     uint32_t uAction = GuestDnD::toHGCMAction(aAction);
    340     if (isDnDIgnoreAction(uAction)) /* If there is no usable action, ignore this request. */
     339    VBOXDNDACTION dndAction = GuestDnD::toHGCMAction(aAction);
     340    if (isDnDIgnoreAction(dndAction)) /* If there is no usable action, ignore this request. */
    341341        return S_OK;
    342342
  • trunk/src/VBox/Main/src-client/GuestDnDTargetImpl.cpp

    r74411 r74439  
    274274    DnDAction_T resAction = DnDAction_Ignore;
    275275
    276     /* Check & convert the drag & drop actions */
    277     uint32_t uDefAction      = 0;
    278     uint32_t uAllowedActions = 0;
    279     GuestDnD::toHGCMActions(aDefaultAction, &uDefAction,
    280                             aAllowedActions, &uAllowedActions);
     276    /* Check & convert the drag & drop actions. */
     277    VBOXDNDACTION     dndActionDefault     = 0;
     278    VBOXDNDACTIONLIST dndActionListAllowed = 0;
     279    GuestDnD::toHGCMActions(aDefaultAction, &dndActionDefault,
     280                            aAllowedActions, &dndActionListAllowed);
     281
    281282    /* If there is no usable action, ignore this request. */
    282     if (isDnDIgnoreAction(uDefAction))
     283    if (isDnDIgnoreAction(dndActionDefault))
    283284        return S_OK;
    284285
     
    316317        Msg.setNextUInt32(aX);
    317318        Msg.setNextUInt32(aY);
    318         Msg.setNextUInt32(uDefAction);
    319         Msg.setNextUInt32(uAllowedActions);
     319        Msg.setNextUInt32(dndActionDefault);
     320        Msg.setNextUInt32(dndActionListAllowed);
    320321        Msg.setNextPointer((void *)strFormats.c_str(), cbFormats);
    321322        Msg.setNextUInt32(cbFormats);
     
    326327            GuestDnDResponse *pResp = GuestDnDInst()->response();
    327328            if (pResp && RT_SUCCESS(pResp->waitForGuestResponse()))
    328                 resAction = GuestDnD::toMainAction(pResp->defAction());
     329                resAction = GuestDnD::toMainAction(pResp->getActionDefault());
    329330        }
    330331    }
     
    363364
    364365    /* Check & convert the drag & drop actions. */
    365     uint32_t uDefAction      = 0;
    366     uint32_t uAllowedActions = 0;
    367     GuestDnD::toHGCMActions(aDefaultAction, &uDefAction,
    368                             aAllowedActions, &uAllowedActions);
     366    VBOXDNDACTION     dndActionDefault     = 0;
     367    VBOXDNDACTIONLIST dndActionListAllowed = 0;
     368    GuestDnD::toHGCMActions(aDefaultAction, &dndActionDefault,
     369                            aAllowedActions, &dndActionListAllowed);
     370
    369371    /* If there is no usable action, ignore this request. */
    370     if (isDnDIgnoreAction(uDefAction))
     372    if (isDnDIgnoreAction(dndActionDefault))
    371373        return S_OK;
    372374
     
    393395        Msg.setNextUInt32(aX);
    394396        Msg.setNextUInt32(aY);
    395         Msg.setNextUInt32(uDefAction);
    396         Msg.setNextUInt32(uAllowedActions);
     397        Msg.setNextUInt32(dndActionDefault);
     398        Msg.setNextUInt32(dndActionListAllowed);
    397399        Msg.setNextPointer((void *)strFormats.c_str(), cbFormats);
    398400        Msg.setNextUInt32(cbFormats);
     
    403405            GuestDnDResponse *pResp = GuestDnDInst()->response();
    404406            if (pResp && RT_SUCCESS(pResp->waitForGuestResponse()))
    405                 resAction = GuestDnD::toMainAction(pResp->defAction());
     407                resAction = GuestDnD::toMainAction(pResp->getActionDefault());
    406408        }
    407409    }
     
    480482
    481483    /* Check & convert the drag & drop actions to HGCM codes. */
    482     uint32_t uDefAction      = VBOX_DND_ACTION_IGNORE;
    483     uint32_t uAllowedActions = 0;
    484     GuestDnD::toHGCMActions(aDefaultAction,  &uDefAction,
    485                             aAllowedActions, &uAllowedActions);
     484    VBOXDNDACTION     dndActionDefault     = VBOX_DND_ACTION_IGNORE;
     485    VBOXDNDACTIONLIST dndActionListAllowed = 0;
     486    GuestDnD::toHGCMActions(aDefaultAction,  &dndActionDefault,
     487                            aAllowedActions, &dndActionListAllowed);
     488
    486489    /* If there is no usable action, ignore this request. */
    487     if (isDnDIgnoreAction(uDefAction))
     490    if (isDnDIgnoreAction(dndActionDefault))
    488491    {
    489492        aFormat = "";
     
    514517        Msg.setNextUInt32(aX);
    515518        Msg.setNextUInt32(aY);
    516         Msg.setNextUInt32(uDefAction);
    517         Msg.setNextUInt32(uAllowedActions);
     519        Msg.setNextUInt32(dndActionDefault);
     520        Msg.setNextUInt32(dndActionListAllowed);
    518521        Msg.setNextPointer((void*)strFormats.c_str(), cbFormats);
    519522        Msg.setNextUInt32(cbFormats);
     
    528531            if (RT_SUCCESS(vrc))
    529532            {
    530                 resAction = GuestDnD::toMainAction(pResp->defAction());
     533                resAction = GuestDnD::toMainAction(pResp->getActionDefault());
    531534
    532535                GuestDnDMIMEList lstFormats = pResp->formats();
     
    534537                {
    535538                    aFormat = lstFormats.at(0);
    536                     LogFlowFunc(("resFormat=%s, resAction=%RU32\n", aFormat.c_str(), pResp->defAction()));
     539                    LogFlowFunc(("resFormat=%s, resAction=%RU32\n", aFormat.c_str(), pResp->getActionDefault()));
    537540                }
    538541                else
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