VirtualBox

Ignore:
Timestamp:
Oct 13, 2015 11:49:33 AM (9 years ago)
Author:
vboxsync
Message:

DnD: Updates.

  • Introduced protocol changelog in DragAndDropSvc.h.
  • Implemented protocol v3 with HOST_DND_HG_SND_DATA_HDR message for doing proper object accounting, among other parameters like checksumming and compression flags.
  • Encapsulated a lot of functionality in class hierarchies.
  • Renamed a lot of functions to make the usage more clear.
  • Various other bugfixes.
File:
1 edited

Legend:

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

    r58157 r58212  
    2222#include <VBox/VBoxGuestLib.h>
    2323#include "VBox/HostServices/DragAndDropSvc.h"
     24
     25using namespace DragAndDropSvc;
    2426
    2527#include <iprt/asm.h>
     
    520522            switch (pEvent->Event.uType)
    521523            {
    522                 case DragAndDropSvc::HOST_DND_HG_EVT_ENTER:
     524                case HOST_DND_HG_EVT_ENTER:
    523525                {
    524526                    LogFlowThisFunc(("HOST_DND_HG_EVT_ENTER\n"));
     
    540542                }
    541543
    542                 case DragAndDropSvc::HOST_DND_HG_EVT_MOVE:
     544                case HOST_DND_HG_EVT_MOVE:
    543545                {
    544546                    LogFlowThisFunc(("HOST_DND_HG_EVT_MOVE: %d,%d\n",
     
    550552                }
    551553
    552                 case DragAndDropSvc::HOST_DND_HG_EVT_LEAVE:
     554                case HOST_DND_HG_EVT_LEAVE:
    553555                {
    554556                    LogFlowThisFunc(("HOST_DND_HG_EVT_LEAVE\n"));
     
    558560                }
    559561
    560                 case DragAndDropSvc::HOST_DND_HG_EVT_DROPPED:
     562                case HOST_DND_HG_EVT_DROPPED:
    561563                {
    562564                    LogFlowThisFunc(("HOST_DND_HG_EVT_DROPPED\n"));
     
    566568                }
    567569
    568                 case DragAndDropSvc::HOST_DND_HG_SND_DATA:
     570                case HOST_DND_HG_SND_DATA:
     571                    /* Protocol v1 + v2: Also contains the header data.
     572                    /* Note: Fall through is intentional. */
     573                case HOST_DND_HG_SND_DATA_HDR:
    569574                {
    570575                    LogFlowThisFunc(("HOST_DND_HG_SND_DATA\n"));
     
    575580                }
    576581
    577                 case DragAndDropSvc::HOST_DND_HG_EVT_CANCEL:
     582                case HOST_DND_HG_EVT_CANCEL:
    578583                {
    579584                    LogFlowThisFunc(("HOST_DND_HG_EVT_CANCEL\n"));
     
    583588                }
    584589
    585                 case DragAndDropSvc::HOST_DND_GH_REQ_PENDING:
     590                case HOST_DND_GH_REQ_PENDING:
    586591                {
    587592                    LogFlowThisFunc(("HOST_DND_GH_REQ_PENDING\n"));
     
    595600                }
    596601
    597                 case DragAndDropSvc::HOST_DND_GH_EVT_DROPPED:
     602                case HOST_DND_GH_EVT_DROPPED:
    598603                {
    599604                    LogFlowThisFunc(("HOST_DND_GH_EVT_DROPPED\n"));
     
    616621            switch (pEvent->Event.uType)
    617622            {
    618                 case DragAndDropSvc::HOST_DND_HG_EVT_ENTER:
    619                 case DragAndDropSvc::HOST_DND_HG_EVT_MOVE:
    620                 case DragAndDropSvc::HOST_DND_HG_EVT_DROPPED:
     623                case HOST_DND_HG_EVT_ENTER:
     624                case HOST_DND_HG_EVT_MOVE:
     625                case HOST_DND_HG_EVT_DROPPED:
    621626#ifdef VBOX_WITH_DRAG_AND_DROP_GH
    622                 case DragAndDropSvc::HOST_DND_GH_EVT_DROPPED:
     627                case HOST_DND_GH_EVT_DROPPED:
    623628#endif
    624629                {
     
    628633                }
    629634
    630                 case DragAndDropSvc::HOST_DND_HG_SND_DATA:
     635                case HOST_DND_HG_SND_DATA:
     636                case HOST_DND_HG_SND_DATA_HDR:
    631637                {
    632638                    if (pEvent->Event.pszFormats)
     
    945951    if (RT_SUCCESS(rc))
    946952    {
    947         rc = VbglR3DnDHGAcknowledgeOperation(&mDnDCtx, uActionNotify);
     953        rc = VbglR3DnDHGSendAckOp(&mDnDCtx, uActionNotify);
    948954        if (RT_FAILURE(rc))
    949955            LogFlowThisFunc(("Acknowledging operation failed with rc=%Rrc\n", rc));
     
    10151021            {
    10161022                LogRel(("DnD: Requesting data as '%s' ...\n", mFormatRequested.c_str()));
    1017                 rc = VbglR3DnDHGRequestData(&mDnDCtx, mFormatRequested.c_str());
     1023                rc = VbglR3DnDHGSendReqData(&mDnDCtx, mFormatRequested.c_str());
    10181024                if (RT_FAILURE(rc))
    10191025                    LogFlowThisFunc(("Requesting data failed with rc=%Rrc\n", rc));
     
    12151221        uAllActions = uDefAction;
    12161222
    1217         rc = VbglR3DnDGHAcknowledgePending(&mDnDCtx,
    1218                                            uDefAction, uAllActions, strFormats.c_str());
     1223        rc = VbglR3DnDGHSendAckPending(&mDnDCtx,
     1224                                       uDefAction, uAllActions,
     1225                                       strFormats.c_str(), strFormats.length() + 1 /* Include termination */);
    12191226        if (RT_FAILURE(rc))
    12201227        {
     
    17611768        /* Note: pEvent will be free'd by the consumer later. */
    17621769
    1763         rc = VbglR3DnDProcessNextMessage(&pCtx->cmdCtx, &pEvent->Event);
    1764         LogFlowFunc(("VbglR3DnDProcessNextMessage returned uType=%RU32, rc=%Rrc\n",
    1765                      pEvent->Event.uType, rc));
     1770        rc = VbglR3DnDRecvNextMsg(&pCtx->cmdCtx, &pEvent->Event);
     1771        LogFlowFunc(("VbglR3DnDRecvNextMsg: uType=%RU32, rc=%Rrc\n", pEvent->Event.uType, rc));
    17661772
    17671773        if (   RT_SUCCESS(rc)
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