Changeset 85681 in vbox for trunk/src/VBox/Additions/WINNT
- Timestamp:
- Aug 11, 2020 9:36:37 AM (5 years ago)
- svn:sync-xref-src-repo-rev:
- 139817
- Location:
- trunk/src/VBox/Additions/WINNT/VBoxTray
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxDnD.h
r85371 r85681 29 29 class VBoxDnDWnd; 30 30 31 /** 32 * Class for implementing IDataObject for VBoxTray's DnD support. 33 */ 31 34 class VBoxDnDDataObject : public IDataObject 32 35 { … … 80 83 LONG lindex = -1, DWORD dwAspect = DVASPECT_CONTENT, DVTARGETDEVICE *pTargetDevice = NULL); 81 84 85 /** Current drag and drop status. */ 82 86 Status mStatus; 87 /** Internal reference count of this object. */ 83 88 LONG mRefCount; 89 /** Number of native formats registered. This can be a different number than supplied with m_lstFormats. */ 84 90 ULONG mcFormats; 91 /** Array of registered FORMATETC structs. Matches m_cFormats. */ 85 92 LPFORMATETC mpFormatEtc; 93 /** Array of registered STGMEDIUM structs. Matches m_cFormats. */ 86 94 LPSTGMEDIUM mpStgMedium; 95 /** Event semaphore used for waiting on status changes. */ 87 96 RTSEMEVENT mEventDropped; 97 /** Format of currently retrieved data. */ 88 98 RTCString mstrFormat; 99 /** The retrieved data as a raw buffer. */ 89 100 void *mpvData; 101 /** Raw buffer size (in bytes). */ 90 102 size_t mcbData; 91 103 }; 92 104 105 /** 106 * Class for implementing IDropSource for VBoxTray's DnD support. 107 */ 93 108 class VBoxDnDDropSource : public IDropSource 94 109 { … … 125 140 }; 126 141 142 /** 143 * Class for implementing IDropTarget for VBoxTray's DnD support. 144 */ 127 145 class VBoxDnDDropTarget : public IDropTarget 128 146 { … … 153 171 public: 154 172 173 /** Returns the data as mutable raw. Use with caution! */ 155 174 void *DataMutableRaw(void) const { return mpvData; } 175 176 /** Returns the data size (in bytes). */ 156 177 size_t DataSize(void) const { return mcbData; } 178 157 179 RTCString Formats(void) const; 158 180 int WaitForDrop(RTMSINTERVAL msTimeout); … … 181 203 }; 182 204 205 /** 206 * Class for implementing IEnumFORMATETC for VBoxTray's DnD support. 207 */ 183 208 class VBoxDnDEnumFormatEtc : public IEnumFORMATETC 184 209 { … … 206 231 private: 207 232 233 /** Reference count of this object. */ 208 234 LONG m_lRefCount; 235 /** Current index for format iteration. */ 209 236 ULONG m_nIndex; 237 /** Number of format this object contains. */ 210 238 ULONG m_nNumFormats; 239 /** Array of FORMATETC formats this object contains. Matches m_nNumFormats. */ 211 240 LPFORMATETC m_pFormatEtc; 212 241 }; … … 215 244 class VBoxDnDWnd; 216 245 217 /* 246 /** 218 247 * A drag'n drop event from the host. 219 248 */ … … 371 400 * window messages. */ 372 401 RTTHREAD hThread; 402 /** Critical section to serialize access. */ 373 403 RTCRITSECT mCritSect; 404 /** Event semaphore to wait for new DnD events. */ 374 405 RTSEMEVENT mEventSem; 375 406 #ifdef RT_OS_WINDOWS … … 393 424 bool mfMouseButtonDown; 394 425 # ifdef VBOX_WITH_DRAG_AND_DROP_GH 395 /** IDropTarget implementation for guest -> host396 * support. */426 /** Pointer to IDropTarget implementation for 427 * guest -> host support. */ 397 428 VBoxDnDDropTarget *pDropTarget; 398 429 # endif /* VBOX_WITH_DRAG_AND_DROP_GH */ -
trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxDnDDataObject.cpp
r85371 r85681 173 173 } 174 174 175 /**176 * Retrieves the data stored in this object and store the result in177 * pMedium.178 *179 * @return IPRT status code.180 * @return HRESULT181 * @param pFormatEtc182 * @param pMedium183 */184 175 STDMETHODIMP VBoxDnDDataObject::GetData(LPFORMATETC pFormatEtc, LPSTGMEDIUM pMedium) 185 176 { … … 416 407 } 417 408 418 /**419 * Only required for IStream / IStorage interfaces.420 *421 * @return IPRT status code.422 * @return HRESULT423 * @param pFormatEtc424 * @param pMedium425 */426 409 STDMETHODIMP VBoxDnDDataObject::GetDataHere(LPFORMATETC pFormatEtc, LPSTGMEDIUM pMedium) 427 410 { … … 431 414 } 432 415 433 /**434 * Query if this objects supports a specific format.435 *436 * @return IPRT status code.437 * @return HRESULT438 * @param pFormatEtc439 */440 416 STDMETHODIMP VBoxDnDDataObject::QueryGetData(LPFORMATETC pFormatEtc) 441 417 { … … 496 472 */ 497 473 474 /** 475 * Aborts waiting for data being "dropped". 476 * 477 * @returns VBox status code. 478 */ 498 479 int VBoxDnDDataObject::Abort(void) 499 480 { … … 503 484 } 504 485 486 /** 487 * Static helper function to convert a CLIPFORMAT to a string and return it. 488 * 489 * @returns Pointer to converted stringified CLIPFORMAT, or "unknown" if not found / invalid. 490 * @param fmt CLIPFORMAT to return string for. 491 */ 505 492 /* static */ 506 493 const char* VBoxDnDDataObject::ClipboardFormatToString(CLIPFORMAT fmt) … … 586 573 } 587 574 575 /** 576 * Checks whether a given FORMATETC is supported by this data object and returns its index. 577 * 578 * @returns \c true if format is supported, \c false if not. 579 * @param pFormatEtc Pointer to FORMATETC to check for. 580 * @param puIndex Where to store the index if format is supported. 581 */ 588 582 bool VBoxDnDDataObject::LookupFormatEtc(LPFORMATETC pFormatEtc, ULONG *puIndex) 589 583 { … … 632 626 } 633 627 628 /** 629 * Registers a new format with this data object. 630 * 631 * @param pFormatEtc Where to store the new format into. 632 * @param clipFormat Clipboard format to register. 633 * @param tyMed Format medium type to register. 634 * @param lIndex Format index to register. 635 * @param dwAspect Format aspect to register. 636 * @param pTargetDevice Format target device to register. 637 */ 634 638 void VBoxDnDDataObject::RegisterFormat(LPFORMATETC pFormatEtc, CLIPFORMAT clipFormat, 635 639 TYMED tyMed, LONG lIndex, DWORD dwAspect, … … 648 652 } 649 653 654 /** 655 * Sets the current status of this data object. 656 * 657 * @param status New status to set. 658 */ 650 659 void VBoxDnDDataObject::SetStatus(Status status) 651 660 { … … 654 663 } 655 664 665 /** 666 * Signals that data has been "dropped". 667 * 668 * @returns VBox status code. 669 * @param strFormat Format of data (MIME string). 670 * @param pvData Pointer to data. 671 * @param cbData Size (in bytes) of data. 672 */ 656 673 int VBoxDnDDataObject::Signal(const RTCString &strFormat, 657 674 const void *pvData, size_t cbData) -
trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxDnDDropTarget.cpp
r85520 r85681 94 94 } 95 95 96 /** 97 * Static helper function to dump supported formats of a data object. 98 * 99 * @param pDataObject Pointer to data object to dump formats for. 100 */ 96 101 /* static */ 97 102 void VBoxDnDDropTarget::DumpFormats(IDataObject *pDataObject) … … 559 564 } 560 565 566 /** 567 * Static helper function to return a drop effect for a given key state and allowed effects. 568 * 569 * @returns Resolved drop effect. 570 * @param grfKeyState Key state to determine drop effect for. 571 * @param dwAllowedEffects Allowed drop effects to determine drop effect for. 572 */ 561 573 /* static */ 562 574 DWORD VBoxDnDDropTarget::GetDropEffect(DWORD grfKeyState, DWORD dwAllowedEffects) … … 588 600 } 589 601 602 /** 603 * Resets a drop target object. 604 */ 590 605 void VBoxDnDDropTarget::reset(void) 591 606 { … … 604 619 } 605 620 621 /** 622 * Returns the currently supported formats of a drop target. 623 * 624 * @returns Supported formats. 625 */ 606 626 RTCString VBoxDnDDropTarget::Formats(void) const 607 627 { … … 609 629 } 610 630 631 /** 632 * Waits for a drop event to happen. 633 * 634 * @returns VBox status code. 635 * @param msTimeout Timeout (in ms) to wait for drop event. 636 */ 611 637 int VBoxDnDDropTarget::WaitForDrop(RTMSINTERVAL msTimeout) 612 638 {
Note:
See TracChangeset
for help on using the changeset viewer.