VirtualBox

Changeset 85402 in vbox for trunk/src/VBox/Main/include


Ignore:
Timestamp:
Jul 21, 2020 3:10:32 PM (4 years ago)
Author:
vboxsync
Message:

DnD/Main: Renaming; use size_t where appropriate.

Location:
trunk/src/VBox/Main/include
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/include/GuestDnDPrivate.h

    r85376 r85402  
    5858
    5959    GuestDnDCallbackEvent(void)
    60         : mSemEvent(NIL_RTSEMEVENT)
    61         , mRc(VINF_SUCCESS) { }
     60        : m_SemEvent(NIL_RTSEMEVENT)
     61        , m_Rc(VINF_SUCCESS) { }
    6262
    6363    virtual ~GuestDnDCallbackEvent(void);
     
    6969    int Notify(int rc = VINF_SUCCESS);
    7070
    71     int Result(void) const { return mRc; }
     71    int Result(void) const { return m_Rc; }
    7272
    7373    int Wait(RTMSINTERVAL msTimeout);
     
    7676
    7777    /** Event semaphore to notify on error/completion. */
    78     RTSEMEVENT mSemEvent;
     78    RTSEMEVENT m_SemEvent;
    7979    /** Callback result. */
    80     int        mRc;
     80    int        m_Rc;
    8181};
    8282
     
    9696    }
    9797
    98     uint32_t add(const void *pvDataAdd, uint32_t cbDataAdd)
     98    size_t add(const void *pvDataAdd, size_t cbDataAdd)
    9999    {
    100100        LogFlowThisFunc(("pvDataAdd=%p, cbDataAdd=%zu\n", pvDataAdd, cbDataAdd));
     
    116116    }
    117117
    118     uint32_t add(const std::vector<BYTE> &vecAdd)
     118    size_t add(const std::vector<BYTE> &vecAdd)
    119119    {
    120120        if (!vecAdd.size())
     
    142142    }
    143143
    144     int resize(uint32_t cbSize)
     144    int resize(size_t cbSize)
    145145    {
    146146        if (!cbSize)
     
    184184    void        *pvData;
    185185    /** Used bytes of meta data. Must not exceed cbAllocated. */
    186     uint32_t     cbData;
     186    size_t       cbData;
    187187    /** Size (in bytes) of allocated meta data. */
    188     uint32_t     cbAllocated;
     188    size_t       cbAllocated;
    189189};
    190190
     
    203203    }
    204204
    205     uint64_t addProcessed(uint32_t cbDataAdd)
    206     {
    207         const uint64_t cbTotal = Meta.cbData + cbExtra; RT_NOREF(cbTotal);
     205    size_t addProcessed(size_t cbDataAdd)
     206    {
     207        const size_t cbTotal = Meta.cbData + cbExtra; RT_NOREF(cbTotal);
    208208        Assert(cbProcessed + cbDataAdd <= cbTotal);
    209209        cbProcessed += cbDataAdd;
     
    213213    bool isComplete(void) const
    214214    {
    215         const uint64_t cbTotal = Meta.cbData + cbExtra;
    216         LogFlowFunc(("cbProcessed=%RU64, cbTotal=%RU64\n", cbProcessed, cbTotal));
     215        const size_t cbTotal = Meta.cbData + cbExtra;
     216        LogFlowFunc(("cbProcessed=%zu, cbTotal=%zu\n", cbProcessed, cbTotal));
    217217        Assert(cbProcessed <= cbTotal);
    218218        return (cbProcessed == cbTotal);
     
    221221    uint8_t getPercentComplete(void) const
    222222    {
    223         const uint64_t cbTotal = Meta.cbData + cbExtra;
     223        const size_t cbTotal = Meta.cbData + cbExtra;
    224224        return (uint8_t)(cbProcessed * 100 / RT_MAX(cbTotal, 1));
    225225    }
    226226
    227     uint64_t getRemaining(void) const
    228     {
    229         const uint64_t cbTotal = Meta.cbData + cbExtra;
     227    size_t getRemaining(void) const
     228    {
     229        const size_t cbTotal = Meta.cbData + cbExtra;
    230230        AssertReturn(cbProcessed <= cbTotal, 0);
    231231        return cbTotal - cbProcessed;
    232232    }
    233233
    234     uint64_t getTotal(void) const
     234    size_t getTotal(void) const
    235235    {
    236236        return Meta.cbData + cbExtra;
     
    248248     *  This might be an URI list or just plain raw data,
    249249     *  according to the format being sent. */
    250     GuestDnDMetaData  Meta;
     250    GuestDnDMetaData   Meta;
    251251    /** Extra data to send/receive (in bytes). Can be 0 for raw data.
    252252     *  For (file) transfers this is the total size for all files. */
    253     uint64_t          cbExtra;
     253    size_t             cbExtra;
    254254    /** Overall size (in bytes) of processed data. */
    255     uint64_t          cbProcessed;
     255    size_t             cbProcessed;
    256256};
    257257
     
    334334{
    335335    GuestDnDTransferSendData()
    336         : mfObjState(0)
    337     {
    338         RT_ZERO(mList);
     336        : fObjState(0)
     337    {
     338        RT_ZERO(List);
    339339    }
    340340
     
    346346    void destroy(void)
    347347    {
    348         DnDTransferListDestroy(&mList);
     348        DnDTransferListDestroy(&List);
    349349    }
    350350
    351351    void reset(void)
    352352    {
    353         DnDTransferListReset(&mList);
    354         mfObjState = 0;
     353        DnDTransferListReset(&List);
     354        fObjState = 0;
    355355
    356356        GuestDnDTransferData::reset();
     
    358358
    359359    /** Transfer List to handle. */
    360     DNDTRANSFERLIST                     mList;
     360    DNDTRANSFERLIST                     List;
    361361    /** Current state of object in transfer.
    362362     *  This is needed for keeping compatibility to old(er) DnD HGCM protocols.
    363363     *
    364364     *  At the moment we only support transferring one object at a time. */
    365     uint32_t                            mfObjState;
     365    uint32_t                            fObjState;
    366366};
    367367
     
    372372{
    373373    /** Pointer to guest target class this context belongs to. */
    374     GuestDnDTarget                     *mpTarget;
     374    GuestDnDTarget                     *pTarget;
    375375    /** Pointer to guest response class this context belongs to. */
    376     GuestDnDResponse                   *mpResp;
     376    GuestDnDResponse                   *pResp;
    377377    /** Flag indicating whether a file transfer is active and
    378378     *  initiated by the host. */
    379     bool                                mIsActive;
     379    bool                                fIsActive;
    380380    /** Target (VM) screen ID. */
    381     uint32_t                            mScreenID;
     381    uint32_t                            uScreenID;
    382382    /** Drag'n drop format requested by the guest. */
    383     com::Utf8Str                        mFmtReq;
     383    com::Utf8Str                        strFmtReq;
    384384    /** Transfer data structure. */
    385     GuestDnDTransferSendData            mTransfer;
     385    GuestDnDTransferSendData            Transfer;
    386386    /** Callback event to use. */
    387     GuestDnDCallbackEvent               mCBEvent;
     387    GuestDnDCallbackEvent               EventCallback;
    388388};
    389389
     
    392392    GuestDnDTransferRecvData()
    393393    {
    394         RT_ZERO(mDroppedFiles);
    395         RT_ZERO(mList);
    396         RT_ZERO(mObj);
     394        RT_ZERO(DroppedFiles);
     395        RT_ZERO(List);
     396        RT_ZERO(ObjCur);
    397397    }
    398398
     
    404404    void destroy(void)
    405405    {
    406         DnDTransferListDestroy(&mList);
     406        DnDTransferListDestroy(&List);
    407407    }
    408408
    409409    void reset(void)
    410410    {
    411         DnDDroppedFilesClose(&mDroppedFiles);
    412         DnDTransferListReset(&mList);
    413         DnDTransferObjectReset(&mObj);
     411        DnDDroppedFilesClose(&DroppedFiles);
     412        DnDTransferListReset(&List);
     413        DnDTransferObjectReset(&ObjCur);
    414414
    415415        GuestDnDTransferData::reset();
     
    418418    /** The "VirtualBox Dropped Files" directory on the host we're going
    419419     *  to utilize for transferring files from guest to the host. */
    420     DNDDROPPEDFILES                     mDroppedFiles;
     420    DNDDROPPEDFILES                     DroppedFiles;
    421421    /** Transfer List to handle.
    422422     *  Currently we only support one transfer list at a time. */
    423     DNDTRANSFERLIST                     mList;
     423    DNDTRANSFERLIST                     List;
    424424    /** Current transfer object being handled.
    425425     *  Currently we only support one transfer object at a time. */
    426     DNDTRANSFEROBJECT                   mObj;
     426    DNDTRANSFEROBJECT                   ObjCur;
    427427};
    428428
     
    433433{
    434434    /** Pointer to guest source class this context belongs to. */
    435     GuestDnDSource                     *mpSource;
     435    GuestDnDSource                     *pSource;
    436436    /** Pointer to guest response class this context belongs to. */
    437     GuestDnDResponse                   *mpResp;
     437    GuestDnDResponse                   *pResp;
    438438    /** Flag indicating whether a file transfer is active and
    439439     *  initiated by the host. */
    440     bool                                mIsActive;
     440    bool                                fIsActive;
    441441    /** Formats offered by the guest (and supported by the host). */
    442     GuestDnDMIMEList                    mFmtOffered;
    443     /** Original drop format requested to receive from the guest. */
    444     com::Utf8Str                        mFmtReq;
     442    GuestDnDMIMEList                    lstFmtOffered;
     443    /** Drag'n drop format requested by the guest. */
     444    com::Utf8Str                        strFmtReq;
    445445    /** Intermediate drop format to be received from the guest.
    446446     *  Some original drop formats require a different intermediate
     
    451451     *  then pointing to the file path on the host with the data
    452452     *  in "text/plain" format returned. */
    453     com::Utf8Str                        mFmtRecv;
     453    com::Utf8Str                        strFmtRecv;
    454454    /** Desired drop action to perform on the host.
    455455     *  Needed to tell the guest if data has to be
    456456     *  deleted e.g. when moving instead of copying. */
    457     VBOXDNDACTION                       mAction;
     457    VBOXDNDACTION                       enmAction;
    458458    /** Transfer data structure. */
    459     GuestDnDTransferRecvData            mTransfer;
     459    GuestDnDTransferRecvData            Transfer;
    460460    /** Callback event to use. */
    461     GuestDnDCallbackEvent               mCBEvent;
     461    GuestDnDCallbackEvent               EventCallback;
    462462};
    463463
     
    618618    /** Pointer to user-supplied data. */
    619619    void                *pvUser;
    620 
    621620} GuestDnDCallback;
    622621
     
    813812
    814813    int sendCancel(void);
    815     int updateProgress(GuestDnDData *pData, GuestDnDResponse *pResp, uint32_t cbDataAdd = 0);
     814    int updateProgress(GuestDnDData *pData, GuestDnDResponse *pResp, size_t cbDataAdd = 0);
    816815    int waitForEvent(GuestDnDCallbackEvent *pEvent, GuestDnDResponse *pResp, RTMSINTERVAL msTimeout);
    817816
     
    834833    {
    835834        /** Number of active transfers (guest->host or host->guest). */
    836         uint32_t                    m_cTransfersPending;
     835        uint32_t                    cTransfersPending;
    837836        /** The DnD protocol version to use, depending on the
    838837         *  installed Guest Additions. See DragAndDropSvc.h for
    839838         *  a protocol changelog. */
    840         uint32_t                    m_uProtocolVersion;
     839        uint32_t                    uProtocolVersion;
    841840        /** Outgoing message queue (FIFO). */
    842         GuestDnDMsgList             m_lstMsgOut;
    843     } mDataBase;
     841        GuestDnDMsgList             lstMsgOut;
     842    } m_DataBase;
    844843};
    845844#endif /* !MAIN_INCLUDED_GuestDnDPrivate_h */
  • trunk/src/VBox/Main/include/GuestDnDSourceImpl.h

    r85371 r85402  
    9494     * @{ */
    9595    static DECLCALLBACK(int) i_receiveRawDataCallback(uint32_t uMsg, void *pvParms, size_t cbParms, void *pvUser);
    96     static DECLCALLBACK(int) i_receiveURIDataCallback(uint32_t uMsg, void *pvParms, size_t cbParms, void *pvUser);
     96    static DECLCALLBACK(int) i_receiveTransferDataCallback(uint32_t uMsg, void *pvParms, size_t cbParms, void *pvUser);
    9797    /** @}  */
    9898
  • trunk/src/VBox/Main/include/GuestDnDTargetImpl.h

    r85371 r85402  
    8181    /** @name Callbacks for dispatch handler.
    8282     * @{ */
    83     static DECLCALLBACK(int) i_sendURIDataCallback(uint32_t uMsg, void *pvParms, size_t cbParms, void *pvUser);
     83    static DECLCALLBACK(int) i_sendTransferDataCallback(uint32_t uMsg, void *pvParms, size_t cbParms, void *pvUser);
    8484    /** @}  */
    8585
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