VirtualBox

Changeset 97762 in vbox


Ignore:
Timestamp:
Dec 7, 2022 4:59:03 PM (2 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
154826
Message:

DnD: Added VBOXDNDSTATE enum + string conversion function.

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/GuestHost/DragAndDrop.h

    r97730 r97762  
    105105const char *DnDGuestMsgToStr(uint32_t uMsg);
    106106const char *DnDActionToStr(VBOXDNDACTION uAction);
     107const char *DnDStateToStr(VBOXDNDSTATE enmState);
    107108
    108109bool DnDMIMEHasFileURLs(const char *pcszFormat, size_t cchFormatMax);
  • trunk/include/VBox/GuestHost/DragAndDropDefs.h

    r96407 r97762  
    9090    "application/x-openoffice;windows_formatname=\"Bitmap\""
    9191
     92/**
     93 * Enumeration for keeping a DnD state.
     94 */
     95typedef enum
     96{
     97    VBOXDNDSTATE_UNKNOWN = 0,
     98    VBOXDNDSTATE_ENTERED,
     99    VBOXDNDSTATE_LEFT,
     100    VBOXDNDSTATE_QUERY_FORMATS,
     101    VBOXDNDSTATE_QUERY_STATUS,
     102    VBOXDNDSTATE_DRAGGING,
     103    VBOXDNDSTATE_DROP_STARTED,
     104    VBOXDNDSTATE_DROP_ENDED,
     105    VBOXDNDSTATE_CANCELLED,
     106    VBOXDNDSTATE_ERROR
     107} VBOXDNDSTATE;
     108/** Pointer to a DnD state. */
     109typedef VBOXDNDSTATE *PVBOXDNDSTATE;
     110
    92111#endif /* !VBOX_INCLUDED_GuestHost_DragAndDropDefs_h */
    93112
  • trunk/src/VBox/GuestHost/DragAndDrop/DnDUtils.cpp

    r97748 r97762  
    117117}
    118118
     119/**
     120 * Converts a VBOXDNDSTATE to a string.
     121 *
     122 * @returns Stringified version of VBOXDNDSTATE.
     123 * @param   enmState            DnD state to convert.
     124 */
     125const char *DnDStateToStr(VBOXDNDSTATE enmState)
     126{
     127    switch (enmState)
     128    {
     129        case VBOXDNDSTATE_UNKNOWN:       return "unknown";
     130        case VBOXDNDSTATE_ENTERED:       return "entered VM window";
     131        case VBOXDNDSTATE_LEFT:          return "left VM window";
     132        case VBOXDNDSTATE_QUERY_FORMATS: return "querying formats";
     133        case VBOXDNDSTATE_QUERY_STATUS:  return "querying status";
     134        case VBOXDNDSTATE_DRAGGING:      return "dragging";
     135        case VBOXDNDSTATE_DROP_STARTED:  return "drop started";
     136        case VBOXDNDSTATE_DROP_ENDED:    return "drop ended";
     137        case VBOXDNDSTATE_CANCELLED:     return "cancelled";
     138        case VBOXDNDSTATE_ERROR:         return "error";
     139        default:
     140            break;
     141    }
     142    AssertMsgFailedReturn(("Unknown enmState=%d\n", enmState), "bad");
     143}
     144
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