Changeset 85402 in vbox for trunk/src/VBox/Main/include
- Timestamp:
- Jul 21, 2020 3:10:32 PM (4 years ago)
- Location:
- trunk/src/VBox/Main/include
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/include/GuestDnDPrivate.h
r85376 r85402 58 58 59 59 GuestDnDCallbackEvent(void) 60 : m SemEvent(NIL_RTSEMEVENT)61 , m Rc(VINF_SUCCESS) { }60 : m_SemEvent(NIL_RTSEMEVENT) 61 , m_Rc(VINF_SUCCESS) { } 62 62 63 63 virtual ~GuestDnDCallbackEvent(void); … … 69 69 int Notify(int rc = VINF_SUCCESS); 70 70 71 int Result(void) const { return m Rc; }71 int Result(void) const { return m_Rc; } 72 72 73 73 int Wait(RTMSINTERVAL msTimeout); … … 76 76 77 77 /** Event semaphore to notify on error/completion. */ 78 RTSEMEVENT m SemEvent;78 RTSEMEVENT m_SemEvent; 79 79 /** Callback result. */ 80 int m Rc;80 int m_Rc; 81 81 }; 82 82 … … 96 96 } 97 97 98 uint32_t add(const void *pvDataAdd, uint32_t cbDataAdd)98 size_t add(const void *pvDataAdd, size_t cbDataAdd) 99 99 { 100 100 LogFlowThisFunc(("pvDataAdd=%p, cbDataAdd=%zu\n", pvDataAdd, cbDataAdd)); … … 116 116 } 117 117 118 uint32_t add(const std::vector<BYTE> &vecAdd)118 size_t add(const std::vector<BYTE> &vecAdd) 119 119 { 120 120 if (!vecAdd.size()) … … 142 142 } 143 143 144 int resize( uint32_t cbSize)144 int resize(size_t cbSize) 145 145 { 146 146 if (!cbSize) … … 184 184 void *pvData; 185 185 /** Used bytes of meta data. Must not exceed cbAllocated. */ 186 uint32_tcbData;186 size_t cbData; 187 187 /** Size (in bytes) of allocated meta data. */ 188 uint32_tcbAllocated;188 size_t cbAllocated; 189 189 }; 190 190 … … 203 203 } 204 204 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); 208 208 Assert(cbProcessed + cbDataAdd <= cbTotal); 209 209 cbProcessed += cbDataAdd; … … 213 213 bool isComplete(void) const 214 214 { 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)); 217 217 Assert(cbProcessed <= cbTotal); 218 218 return (cbProcessed == cbTotal); … … 221 221 uint8_t getPercentComplete(void) const 222 222 { 223 const uint64_t cbTotal = Meta.cbData + cbExtra;223 const size_t cbTotal = Meta.cbData + cbExtra; 224 224 return (uint8_t)(cbProcessed * 100 / RT_MAX(cbTotal, 1)); 225 225 } 226 226 227 uint64_t getRemaining(void) const228 { 229 const uint64_t cbTotal = Meta.cbData + cbExtra;227 size_t getRemaining(void) const 228 { 229 const size_t cbTotal = Meta.cbData + cbExtra; 230 230 AssertReturn(cbProcessed <= cbTotal, 0); 231 231 return cbTotal - cbProcessed; 232 232 } 233 233 234 uint64_t getTotal(void) const234 size_t getTotal(void) const 235 235 { 236 236 return Meta.cbData + cbExtra; … … 248 248 * This might be an URI list or just plain raw data, 249 249 * according to the format being sent. */ 250 GuestDnDMetaData Meta;250 GuestDnDMetaData Meta; 251 251 /** Extra data to send/receive (in bytes). Can be 0 for raw data. 252 252 * For (file) transfers this is the total size for all files. */ 253 uint64_tcbExtra;253 size_t cbExtra; 254 254 /** Overall size (in bytes) of processed data. */ 255 uint64_tcbProcessed;255 size_t cbProcessed; 256 256 }; 257 257 … … 334 334 { 335 335 GuestDnDTransferSendData() 336 : mfObjState(0)337 { 338 RT_ZERO( mList);336 : fObjState(0) 337 { 338 RT_ZERO(List); 339 339 } 340 340 … … 346 346 void destroy(void) 347 347 { 348 DnDTransferListDestroy(& mList);348 DnDTransferListDestroy(&List); 349 349 } 350 350 351 351 void reset(void) 352 352 { 353 DnDTransferListReset(& mList);354 mfObjState = 0;353 DnDTransferListReset(&List); 354 fObjState = 0; 355 355 356 356 GuestDnDTransferData::reset(); … … 358 358 359 359 /** Transfer List to handle. */ 360 DNDTRANSFERLIST mList;360 DNDTRANSFERLIST List; 361 361 /** Current state of object in transfer. 362 362 * This is needed for keeping compatibility to old(er) DnD HGCM protocols. 363 363 * 364 364 * At the moment we only support transferring one object at a time. */ 365 uint32_t mfObjState;365 uint32_t fObjState; 366 366 }; 367 367 … … 372 372 { 373 373 /** Pointer to guest target class this context belongs to. */ 374 GuestDnDTarget * mpTarget;374 GuestDnDTarget *pTarget; 375 375 /** Pointer to guest response class this context belongs to. */ 376 GuestDnDResponse * mpResp;376 GuestDnDResponse *pResp; 377 377 /** Flag indicating whether a file transfer is active and 378 378 * initiated by the host. */ 379 bool mIsActive;379 bool fIsActive; 380 380 /** Target (VM) screen ID. */ 381 uint32_t mScreenID;381 uint32_t uScreenID; 382 382 /** Drag'n drop format requested by the guest. */ 383 com::Utf8Str mFmtReq;383 com::Utf8Str strFmtReq; 384 384 /** Transfer data structure. */ 385 GuestDnDTransferSendData mTransfer;385 GuestDnDTransferSendData Transfer; 386 386 /** Callback event to use. */ 387 GuestDnDCallbackEvent mCBEvent;387 GuestDnDCallbackEvent EventCallback; 388 388 }; 389 389 … … 392 392 GuestDnDTransferRecvData() 393 393 { 394 RT_ZERO( mDroppedFiles);395 RT_ZERO( mList);396 RT_ZERO( mObj);394 RT_ZERO(DroppedFiles); 395 RT_ZERO(List); 396 RT_ZERO(ObjCur); 397 397 } 398 398 … … 404 404 void destroy(void) 405 405 { 406 DnDTransferListDestroy(& mList);406 DnDTransferListDestroy(&List); 407 407 } 408 408 409 409 void reset(void) 410 410 { 411 DnDDroppedFilesClose(& mDroppedFiles);412 DnDTransferListReset(& mList);413 DnDTransferObjectReset(& mObj);411 DnDDroppedFilesClose(&DroppedFiles); 412 DnDTransferListReset(&List); 413 DnDTransferObjectReset(&ObjCur); 414 414 415 415 GuestDnDTransferData::reset(); … … 418 418 /** The "VirtualBox Dropped Files" directory on the host we're going 419 419 * to utilize for transferring files from guest to the host. */ 420 DNDDROPPEDFILES mDroppedFiles;420 DNDDROPPEDFILES DroppedFiles; 421 421 /** Transfer List to handle. 422 422 * Currently we only support one transfer list at a time. */ 423 DNDTRANSFERLIST mList;423 DNDTRANSFERLIST List; 424 424 /** Current transfer object being handled. 425 425 * Currently we only support one transfer object at a time. */ 426 DNDTRANSFEROBJECT mObj;426 DNDTRANSFEROBJECT ObjCur; 427 427 }; 428 428 … … 433 433 { 434 434 /** Pointer to guest source class this context belongs to. */ 435 GuestDnDSource * mpSource;435 GuestDnDSource *pSource; 436 436 /** Pointer to guest response class this context belongs to. */ 437 GuestDnDResponse * mpResp;437 GuestDnDResponse *pResp; 438 438 /** Flag indicating whether a file transfer is active and 439 439 * initiated by the host. */ 440 bool mIsActive;440 bool fIsActive; 441 441 /** Formats offered by the guest (and supported by the host). */ 442 GuestDnDMIMEList mFmtOffered;443 /** Original drop format requested to receive fromthe guest. */444 com::Utf8Str mFmtReq;442 GuestDnDMIMEList lstFmtOffered; 443 /** Drag'n drop format requested by the guest. */ 444 com::Utf8Str strFmtReq; 445 445 /** Intermediate drop format to be received from the guest. 446 446 * Some original drop formats require a different intermediate … … 451 451 * then pointing to the file path on the host with the data 452 452 * in "text/plain" format returned. */ 453 com::Utf8Str mFmtRecv;453 com::Utf8Str strFmtRecv; 454 454 /** Desired drop action to perform on the host. 455 455 * Needed to tell the guest if data has to be 456 456 * deleted e.g. when moving instead of copying. */ 457 VBOXDNDACTION mAction;457 VBOXDNDACTION enmAction; 458 458 /** Transfer data structure. */ 459 GuestDnDTransferRecvData mTransfer;459 GuestDnDTransferRecvData Transfer; 460 460 /** Callback event to use. */ 461 GuestDnDCallbackEvent mCBEvent;461 GuestDnDCallbackEvent EventCallback; 462 462 }; 463 463 … … 618 618 /** Pointer to user-supplied data. */ 619 619 void *pvUser; 620 621 620 } GuestDnDCallback; 622 621 … … 813 812 814 813 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); 816 815 int waitForEvent(GuestDnDCallbackEvent *pEvent, GuestDnDResponse *pResp, RTMSINTERVAL msTimeout); 817 816 … … 834 833 { 835 834 /** Number of active transfers (guest->host or host->guest). */ 836 uint32_t m_cTransfersPending;835 uint32_t cTransfersPending; 837 836 /** The DnD protocol version to use, depending on the 838 837 * installed Guest Additions. See DragAndDropSvc.h for 839 838 * a protocol changelog. */ 840 uint32_t m_uProtocolVersion;839 uint32_t uProtocolVersion; 841 840 /** Outgoing message queue (FIFO). */ 842 GuestDnDMsgList m_lstMsgOut;843 } m DataBase;841 GuestDnDMsgList lstMsgOut; 842 } m_DataBase; 844 843 }; 845 844 #endif /* !MAIN_INCLUDED_GuestDnDPrivate_h */ -
trunk/src/VBox/Main/include/GuestDnDSourceImpl.h
r85371 r85402 94 94 * @{ */ 95 95 static DECLCALLBACK(int) i_receiveRawDataCallback(uint32_t uMsg, void *pvParms, size_t cbParms, void *pvUser); 96 static DECLCALLBACK(int) i_receive URIDataCallback(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); 97 97 /** @} */ 98 98 -
trunk/src/VBox/Main/include/GuestDnDTargetImpl.h
r85371 r85402 81 81 /** @name Callbacks for dispatch handler. 82 82 * @{ */ 83 static DECLCALLBACK(int) i_send URIDataCallback(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); 84 84 /** @} */ 85 85
Note:
See TracChangeset
for help on using the changeset viewer.