VirtualBox

Changeset 80664 in vbox for trunk/include


Ignore:
Timestamp:
Sep 9, 2019 10:00:04 AM (6 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
133195
Message:

Shared Clipboard: More renaming + unification.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/GuestHost/SharedClipboard-win.h

    r80662 r80664  
    5252#endif
    5353
    54 #define VBOX_CLIPBOARD_WNDCLASS_NAME         "VBoxSharedClipboardClass"
     54#define SHCL_WIN_WNDCLASS_NAME        "VBoxSharedClipboardClass"
    5555
    5656/** See: https://docs.microsoft.com/en-us/windows/desktop/dataxchg/html-clipboard-format
    5757 *       Do *not* change the name, as this will break compatbility with other (legacy) applications! */
    58 #define VBOX_CLIPBOARD_WIN_REGFMT_HTML       "HTML Format"
     58#define SHCL_WIN_REGFMT_HTML          "HTML Format"
    5959
    6060/** Default timeout (in ms) for passing down messages down the clipboard chain. */
    61 #define VBOX_CLIPBOARD_CBCHAIN_TIMEOUT_MS   5000
     61#define SHCL_WIN_CBCHAIN_TIMEOUT_MS   5000
    6262
    6363/** Reports clipboard formats. */
    64 #define VBOX_CLIPBOARD_WM_REPORT_FORMATS    WM_USER
     64#define SHCL_WIN_WM_REPORT_FORMATS    WM_USER
    6565/** Reads data from the clipboard and sends it to the destination. */
    66 #define VBOX_CLIPBOARD_WM_READ_DATA         WM_USER + 1
     66#define SHCL_WIN_WM_READ_DATA         WM_USER + 1
    6767#ifdef VBOX_WITH_SHARED_CLIPBOARD_URI_LIST
    6868/** Starts a reading transfer from the guest. */
    69 # define VBOX_CLIPBOARD_WM_URI_START_READ   WM_USER + 2
     69# define SHCL_WIN_WM_URI_START_READ   WM_USER + 2
    7070/** Starts a writing transfer to the guest. */
    71 # define VBOX_CLIPBOARD_WM_URI_START_WRITE  WM_USER + 3
     71# define SHCL_WIN_WM_URI_START_WRITE  WM_USER + 3
    7272#endif
    7373
     
    106106{
    107107    /** Window handle of our (invisible) clipbaord window. */
    108     HWND                        hWnd;
     108    HWND               hWnd;
    109109    /** Window handle which is next to us in the clipboard chain. */
    110     HWND                        hWndNextInChain;
     110    HWND               hWndNextInChain;
    111111    /** Window handle of the clipboard owner *if* we are the owner. */
    112     HWND                        hWndClipboardOwnerUs;
     112    HWND               hWndClipboardOwnerUs;
    113113    /** Structure for maintaining the new clipboard API. */
    114114    SHCLWINAPINEW      newAPI;
     
    117117} SHCLWINCTX, *PSHCLWINCTX;
    118118
    119 int VBoxClipboardWinOpen(HWND hWnd);
    120 int VBoxClipboardWinClose(void);
    121 int VBoxClipboardWinClear(void);
    122 
    123 int VBoxClipboardWinCheckAndInitNewAPI(PSHCLWINAPINEW pAPI);
    124 bool VBoxClipboardWinIsNewAPI(PSHCLWINAPINEW pAPI);
    125 
    126 int VBoxClipboardWinChainAdd(PSHCLWINCTX pCtx);
    127 int VBoxClipboardWinChainRemove(PSHCLWINCTX pCtx);
    128 VOID CALLBACK VBoxClipboardWinChainPingProc(HWND hWnd, UINT uMsg, ULONG_PTR dwData, LRESULT lResult);
    129 LRESULT VBoxClipboardWinChainPassToNext(PSHCLWINCTX pWinCtx, UINT msg, WPARAM wParam, LPARAM lParam);
    130 
    131 SHCLFORMAT VBoxClipboardWinClipboardFormatToVBox(UINT uFormat);
    132 int VBoxClipboardWinGetFormats(PSHCLWINCTX pCtx, PSHCLFORMATDATA pFormats);
     119int SharedClipboardWinOpen(HWND hWnd);
     120int SharedClipboardWinClose(void);
     121int SharedClipboardWinClear(void);
     122
     123int SharedClipboardWinCheckAndInitNewAPI(PSHCLWINAPINEW pAPI);
     124bool SharedClipboardWinIsNewAPI(PSHCLWINAPINEW pAPI);
     125
     126int SharedClipboardWinChainAdd(PSHCLWINCTX pCtx);
     127int SharedClipboardWinChainRemove(PSHCLWINCTX pCtx);
     128VOID CALLBACK SharedClipboardWinChainPingProc(HWND hWnd, UINT uMsg, ULONG_PTR dwData, LRESULT lResult);
     129LRESULT SharedClipboardWinChainPassToNext(PSHCLWINCTX pWinCtx, UINT msg, WPARAM wParam, LPARAM lParam);
     130
     131SHCLFORMAT SharedClipboardWinClipboardFormatToVBox(UINT uFormat);
     132int SharedClipboardWinGetFormats(PSHCLWINCTX pCtx, PSHCLFORMATDATA pFormats);
    133133
    134134#ifdef VBOX_WITH_SHARED_CLIPBOARD_URI_LIST
    135 int VBoxClipboardWinDropFilesToStringList(DROPFILES *pDropFiles, char **papszList, uint32_t *pcbList);
    136 #endif
    137 
    138 int VBoxClipboardWinGetCFHTMLHeaderValue(const char *pszSrc, const char *pszOption, uint32_t *puValue);
    139 bool VBoxClipboardWinIsCFHTML(const char *pszSource);
    140 int VBoxClipboardWinConvertCFHTMLToMIME(const char *pszSource, const uint32_t cch, char **ppszOutput, uint32_t *pcbOutput);
    141 int VBoxClipboardWinConvertMIMEToCFHTML(const char *pszSource, size_t cb, char **ppszOutput, uint32_t *pcbOutput);
    142 
    143 LRESULT VBoxClipboardWinHandleWMChangeCBChain(PSHCLWINCTX pWinCtx, HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
    144 int VBoxClipboardWinHandleWMDestroy(PSHCLWINCTX pWinCtx);
    145 int VBoxClipboardWinHandleWMRenderAllFormats(PSHCLWINCTX pWinCtx, HWND hWnd);
    146 int VBoxClipboardWinHandleWMTimer(PSHCLWINCTX pWinCtx);
    147 
    148 int VBoxClipboardWinAnnounceFormats(PSHCLWINCTX pWinCtx, SHCLFORMATS fFormats);
     135int SharedClipboardWinDropFilesToStringList(DROPFILES *pDropFiles, char **papszList, uint32_t *pcbList);
     136#endif
     137
     138int SharedClipboardWinGetCFHTMLHeaderValue(const char *pszSrc, const char *pszOption, uint32_t *puValue);
     139bool SharedClipboardWinIsCFHTML(const char *pszSource);
     140int SharedClipboardWinConvertCFHTMLToMIME(const char *pszSource, const uint32_t cch, char **ppszOutput, uint32_t *pcbOutput);
     141int SharedClipboardWinConvertMIMEToCFHTML(const char *pszSource, size_t cb, char **ppszOutput, uint32_t *pcbOutput);
     142
     143LRESULT SharedClipboardWinHandleWMChangeCBChain(PSHCLWINCTX pWinCtx, HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
     144int SharedClipboardWinHandleWMDestroy(PSHCLWINCTX pWinCtx);
     145int SharedClipboardWinHandleWMRenderAllFormats(PSHCLWINCTX pWinCtx, HWND hWnd);
     146int SharedClipboardWinHandleWMTimer(PSHCLWINCTX pWinCtx);
     147
     148int SharedClipboardWinAnnounceFormats(PSHCLWINCTX pWinCtx, SHCLFORMATS fFormats);
    149149#ifdef VBOX_WITH_SHARED_CLIPBOARD_URI_LIST
    150 int VBoxClipboardWinURITransferCreate(PSHCLWINCTX pWinCtx, PSHCLURITRANSFER pTransfer);
    151 void VBoxClipboardWinURITransferDestroy(PSHCLWINCTX pWinCtx, PSHCLURITRANSFER pTransfer);
     150int SharedClipboardWinURITransferCreate(PSHCLWINCTX pWinCtx, PSHCLURITRANSFER pTransfer);
     151void SharedClipboardWinURITransferDestroy(PSHCLWINCTX pWinCtx, PSHCLURITRANSFER pTransfer);
    152152#endif
    153153
     
    158158#  endif
    159159
    160 class VBoxClipboardWinDataObject : public IDataObject //, public IDataObjectAsyncCapability
     160class SharedClipboardWinDataObject : public IDataObject //, public IDataObjectAsyncCapability
    161161{
    162162public:
     
    170170public:
    171171
    172     VBoxClipboardWinDataObject(PSHCLURITRANSFER pTransfer,
    173                                LPFORMATETC pFormatEtc = NULL, LPSTGMEDIUM pStgMed = NULL, ULONG cFormats = 0);
    174     virtual ~VBoxClipboardWinDataObject(void);
     172    SharedClipboardWinDataObject(PSHCLURITRANSFER pTransfer,
     173                                 LPFORMATETC pFormatEtc = NULL, LPSTGMEDIUM pStgMed = NULL, ULONG cFormats = 0);
     174    virtual ~SharedClipboardWinDataObject(void);
    175175
    176176public: /* IUnknown methods. */
     
    235235    {
    236236        /** Relative path of the object. */
    237         Utf8Str                  strPath;
     237        Utf8Str       strPath;
    238238        /** Related (cached) object information. */
    239239        SHCLFSOBJINFO objInfo;
     
    248248    LPFORMATETC                 m_pFormatEtc;
    249249    LPSTGMEDIUM                 m_pStgMedium;
    250     PSHCLURITRANSFER m_pTransfer;
     250    PSHCLURITRANSFER            m_pTransfer;
    251251    IStream                    *m_pStream;
    252252    ULONG                       m_uObjIdx;
     
    262262};
    263263
    264 class VBoxClipboardWinEnumFormatEtc : public IEnumFORMATETC
    265 {
    266 public:
    267 
    268     VBoxClipboardWinEnumFormatEtc(LPFORMATETC pFormatEtc, ULONG cFormats);
    269     virtual ~VBoxClipboardWinEnumFormatEtc(void);
     264class SharedClipboardWinEnumFormatEtc : public IEnumFORMATETC
     265{
     266public:
     267
     268    SharedClipboardWinEnumFormatEtc(LPFORMATETC pFormatEtc, ULONG cFormats);
     269    virtual ~SharedClipboardWinEnumFormatEtc(void);
    270270
    271271public: /* IUnknown methods. */
     
    299299 * through HGCM. Needed on Windows hosts and guests.
    300300 */
    301 class VBoxClipboardWinStreamImpl : public IStream
    302 {
    303 public:
    304 
    305     VBoxClipboardWinStreamImpl(VBoxClipboardWinDataObject *pParent, PSHCLURITRANSFER pTransfer,
    306                                const Utf8Str &strPath, PSHCLFSOBJINFO pObjInfo);
    307     virtual ~VBoxClipboardWinStreamImpl(void);
     301class SharedClipboardWinStreamImpl : public IStream
     302{
     303public:
     304
     305    SharedClipboardWinStreamImpl(SharedClipboardWinDataObject *pParent, PSHCLURITRANSFER pTransfer,
     306                                 const Utf8Str &strPath, PSHCLFSOBJINFO pObjInfo);
     307    virtual ~SharedClipboardWinStreamImpl(void);
    308308
    309309public: /* IUnknown methods. */
     
    329329public: /* Own methods. */
    330330
    331     static HRESULT Create(VBoxClipboardWinDataObject *pParent, PSHCLURITRANSFER pTransfer, const Utf8Str &strPath,
     331    static HRESULT Create(SharedClipboardWinDataObject *pParent, PSHCLURITRANSFER pTransfer, const Utf8Str &strPath,
    332332                          PSHCLFSOBJINFO pObjInfo, IStream **ppStream);
    333333private:
    334334
    335335    /** Pointer to the parent data object. */
    336     VBoxClipboardWinDataObject    *m_pParent;
     336    SharedClipboardWinDataObject  *m_pParent;
    337337    /** The stream object's current reference count. */
    338338    LONG                           m_lRefCount;
    339339    /** Pointer to the associated URI transfer. */
    340     PSHCLURITRANSFER    m_pURITransfer;
     340    PSHCLURITRANSFER               m_pURITransfer;
    341341    /** The object handle to use. */
    342     SHCLOBJHANDLE       m_hObj;
     342    SHCLOBJHANDLE                  m_hObj;
    343343    /** Object path. */
    344344    Utf8Str                        m_strPath;
    345345    /** (Cached) object information. */
    346     SHCLFSOBJINFO       m_objInfo;
     346    SHCLFSOBJINFO                  m_objInfo;
    347347    /** Number of bytes already processed. */
    348348    uint64_t                       m_cbProcessed;
     
    369369    /** Pointer to data object to use for this transfer.
    370370     *  Can be NULL if not being used. */
    371     VBoxClipboardWinDataObject *pDataObj;
     371    SharedClipboardWinDataObject *pDataObj;
    372372};
    373373# endif /* VBOX_WITH_SHARED_CLIPBOARD_URI_LIST */
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