VirtualBox

Ignore:
Timestamp:
Jul 22, 2020 10:31:03 AM (5 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
139450
Message:

DnD/TransferList: Added DnDTransferListObjRemove().

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/GuestHost/DragAndDrop/DnDTransferList.cpp

    r85408 r85411  
    737737
    738738/**
    739  * Removes the first DnD transfer object from a transfer list.
    740  *
    741  * @param   pList               Transfer list to remove first entry for.
    742  */
    743 void DnDTransferListObjRemoveFirst(PDNDTRANSFERLIST pList)
     739 * Removes an object from a transfer list, internal version.
     740 *
     741 * @param   pList               Transfer list to remove object from.
     742 * @param   pObj                Object to remove. The object will be free'd and the pointer is invalid after calling.
     743 */
     744static void dndTransferListObjRemoveInternal(PDNDTRANSFERLIST pList, PDNDTRANSFEROBJECT pObj)
    744745{
    745746    AssertPtrReturnVoid(pList);
    746 
    747     if (!pList->cObj)
    748         return;
    749 
    750     PDNDTRANSFEROBJECT pObj = RTListGetFirst(&pList->lstObj, DNDTRANSFEROBJECT, Node);
    751     AssertPtr(pObj);
     747    AssertPtrReturnVoid(pObj);
     748
     749    /** @todo Validate if \a pObj is part of \a pList. */
    752750
    753751    uint64_t cbSize = DnDTransferObjectGetSize(pObj);
     
    756754
    757755    dndTransferListObjFree(pList, pObj);
     756}
     757
     758/**
     759 * Removes an object from a transfer list.
     760 *
     761 * @param   pList               Transfer list to remove object from.
     762 * @param   pObj                Object to remove. The object will be free'd and the pointer is invalid after calling.
     763 */
     764void DnDTransferListObjRemove(PDNDTRANSFERLIST pList, PDNDTRANSFEROBJECT pObj)
     765{
     766    return dndTransferListObjRemoveInternal(pList, pObj);
     767}
     768
     769/**
     770 * Removes the first DnD transfer object from a transfer list.
     771 *
     772 * @param   pList               Transfer list to remove first entry for.
     773 */
     774void DnDTransferListObjRemoveFirst(PDNDTRANSFERLIST pList)
     775{
     776    AssertPtrReturnVoid(pList);
     777
     778    if (!pList->cObj)
     779        return;
     780
     781    PDNDTRANSFEROBJECT pObj = RTListGetFirst(&pList->lstObj, DNDTRANSFEROBJECT, Node);
     782    AssertPtr(pObj);
     783
     784    dndTransferListObjRemoveInternal(pList, pObj);
    758785}
    759786
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette