Changeset 80664 in vbox for trunk/include
- Timestamp:
- Sep 9, 2019 10:00:04 AM (6 years ago)
- svn:sync-xref-src-repo-rev:
- 133195
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/GuestHost/SharedClipboard-win.h
r80662 r80664 52 52 #endif 53 53 54 #define VBOX_CLIPBOARD_WNDCLASS_NAME"VBoxSharedClipboardClass"54 #define SHCL_WIN_WNDCLASS_NAME "VBoxSharedClipboardClass" 55 55 56 56 /** See: https://docs.microsoft.com/en-us/windows/desktop/dataxchg/html-clipboard-format 57 57 * 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" 59 59 60 60 /** Default timeout (in ms) for passing down messages down the clipboard chain. */ 61 #define VBOX_CLIPBOARD_CBCHAIN_TIMEOUT_MS 500061 #define SHCL_WIN_CBCHAIN_TIMEOUT_MS 5000 62 62 63 63 /** Reports clipboard formats. */ 64 #define VBOX_CLIPBOARD_WM_REPORT_FORMATS WM_USER64 #define SHCL_WIN_WM_REPORT_FORMATS WM_USER 65 65 /** Reads data from the clipboard and sends it to the destination. */ 66 #define VBOX_CLIPBOARD_WM_READ_DATA WM_USER + 166 #define SHCL_WIN_WM_READ_DATA WM_USER + 1 67 67 #ifdef VBOX_WITH_SHARED_CLIPBOARD_URI_LIST 68 68 /** Starts a reading transfer from the guest. */ 69 # define VBOX_CLIPBOARD_WM_URI_START_READ WM_USER + 269 # define SHCL_WIN_WM_URI_START_READ WM_USER + 2 70 70 /** Starts a writing transfer to the guest. */ 71 # define VBOX_CLIPBOARD_WM_URI_START_WRITE WM_USER + 371 # define SHCL_WIN_WM_URI_START_WRITE WM_USER + 3 72 72 #endif 73 73 … … 106 106 { 107 107 /** Window handle of our (invisible) clipbaord window. */ 108 HWND 108 HWND hWnd; 109 109 /** Window handle which is next to us in the clipboard chain. */ 110 HWND 110 HWND hWndNextInChain; 111 111 /** Window handle of the clipboard owner *if* we are the owner. */ 112 HWND 112 HWND hWndClipboardOwnerUs; 113 113 /** Structure for maintaining the new clipboard API. */ 114 114 SHCLWINAPINEW newAPI; … … 117 117 } SHCLWINCTX, *PSHCLWINCTX; 118 118 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);119 int SharedClipboardWinOpen(HWND hWnd); 120 int SharedClipboardWinClose(void); 121 int SharedClipboardWinClear(void); 122 123 int SharedClipboardWinCheckAndInitNewAPI(PSHCLWINAPINEW pAPI); 124 bool SharedClipboardWinIsNewAPI(PSHCLWINAPINEW pAPI); 125 126 int SharedClipboardWinChainAdd(PSHCLWINCTX pCtx); 127 int SharedClipboardWinChainRemove(PSHCLWINCTX pCtx); 128 VOID CALLBACK SharedClipboardWinChainPingProc(HWND hWnd, UINT uMsg, ULONG_PTR dwData, LRESULT lResult); 129 LRESULT SharedClipboardWinChainPassToNext(PSHCLWINCTX pWinCtx, UINT msg, WPARAM wParam, LPARAM lParam); 130 131 SHCLFORMAT SharedClipboardWinClipboardFormatToVBox(UINT uFormat); 132 int SharedClipboardWinGetFormats(PSHCLWINCTX pCtx, PSHCLFORMATDATA pFormats); 133 133 134 134 #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);135 int SharedClipboardWinDropFilesToStringList(DROPFILES *pDropFiles, char **papszList, uint32_t *pcbList); 136 #endif 137 138 int SharedClipboardWinGetCFHTMLHeaderValue(const char *pszSrc, const char *pszOption, uint32_t *puValue); 139 bool SharedClipboardWinIsCFHTML(const char *pszSource); 140 int SharedClipboardWinConvertCFHTMLToMIME(const char *pszSource, const uint32_t cch, char **ppszOutput, uint32_t *pcbOutput); 141 int SharedClipboardWinConvertMIMEToCFHTML(const char *pszSource, size_t cb, char **ppszOutput, uint32_t *pcbOutput); 142 143 LRESULT SharedClipboardWinHandleWMChangeCBChain(PSHCLWINCTX pWinCtx, HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam); 144 int SharedClipboardWinHandleWMDestroy(PSHCLWINCTX pWinCtx); 145 int SharedClipboardWinHandleWMRenderAllFormats(PSHCLWINCTX pWinCtx, HWND hWnd); 146 int SharedClipboardWinHandleWMTimer(PSHCLWINCTX pWinCtx); 147 148 int SharedClipboardWinAnnounceFormats(PSHCLWINCTX pWinCtx, SHCLFORMATS fFormats); 149 149 #ifdef VBOX_WITH_SHARED_CLIPBOARD_URI_LIST 150 int VBoxClipboardWinURITransferCreate(PSHCLWINCTX pWinCtx, PSHCLURITRANSFER pTransfer);151 void VBoxClipboardWinURITransferDestroy(PSHCLWINCTX pWinCtx, PSHCLURITRANSFER pTransfer);150 int SharedClipboardWinURITransferCreate(PSHCLWINCTX pWinCtx, PSHCLURITRANSFER pTransfer); 151 void SharedClipboardWinURITransferDestroy(PSHCLWINCTX pWinCtx, PSHCLURITRANSFER pTransfer); 152 152 #endif 153 153 … … 158 158 # endif 159 159 160 class VBoxClipboardWinDataObject : public IDataObject //, public IDataObjectAsyncCapability160 class SharedClipboardWinDataObject : public IDataObject //, public IDataObjectAsyncCapability 161 161 { 162 162 public: … … 170 170 public: 171 171 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); 175 175 176 176 public: /* IUnknown methods. */ … … 235 235 { 236 236 /** Relative path of the object. */ 237 Utf8Str 237 Utf8Str strPath; 238 238 /** Related (cached) object information. */ 239 239 SHCLFSOBJINFO objInfo; … … 248 248 LPFORMATETC m_pFormatEtc; 249 249 LPSTGMEDIUM m_pStgMedium; 250 PSHCLURITRANSFER m_pTransfer;250 PSHCLURITRANSFER m_pTransfer; 251 251 IStream *m_pStream; 252 252 ULONG m_uObjIdx; … … 262 262 }; 263 263 264 class VBoxClipboardWinEnumFormatEtc : public IEnumFORMATETC265 { 266 public: 267 268 VBoxClipboardWinEnumFormatEtc(LPFORMATETC pFormatEtc, ULONG cFormats);269 virtual ~ VBoxClipboardWinEnumFormatEtc(void);264 class SharedClipboardWinEnumFormatEtc : public IEnumFORMATETC 265 { 266 public: 267 268 SharedClipboardWinEnumFormatEtc(LPFORMATETC pFormatEtc, ULONG cFormats); 269 virtual ~SharedClipboardWinEnumFormatEtc(void); 270 270 271 271 public: /* IUnknown methods. */ … … 299 299 * through HGCM. Needed on Windows hosts and guests. 300 300 */ 301 class VBoxClipboardWinStreamImpl : public IStream302 { 303 public: 304 305 VBoxClipboardWinStreamImpl(VBoxClipboardWinDataObject *pParent, PSHCLURITRANSFER pTransfer,306 const Utf8Str &strPath, PSHCLFSOBJINFO pObjInfo);307 virtual ~ VBoxClipboardWinStreamImpl(void);301 class SharedClipboardWinStreamImpl : public IStream 302 { 303 public: 304 305 SharedClipboardWinStreamImpl(SharedClipboardWinDataObject *pParent, PSHCLURITRANSFER pTransfer, 306 const Utf8Str &strPath, PSHCLFSOBJINFO pObjInfo); 307 virtual ~SharedClipboardWinStreamImpl(void); 308 308 309 309 public: /* IUnknown methods. */ … … 329 329 public: /* Own methods. */ 330 330 331 static HRESULT Create( VBoxClipboardWinDataObject *pParent, PSHCLURITRANSFER pTransfer, const Utf8Str &strPath,331 static HRESULT Create(SharedClipboardWinDataObject *pParent, PSHCLURITRANSFER pTransfer, const Utf8Str &strPath, 332 332 PSHCLFSOBJINFO pObjInfo, IStream **ppStream); 333 333 private: 334 334 335 335 /** Pointer to the parent data object. */ 336 VBoxClipboardWinDataObject*m_pParent;336 SharedClipboardWinDataObject *m_pParent; 337 337 /** The stream object's current reference count. */ 338 338 LONG m_lRefCount; 339 339 /** Pointer to the associated URI transfer. */ 340 PSHCLURITRANSFER m_pURITransfer;340 PSHCLURITRANSFER m_pURITransfer; 341 341 /** The object handle to use. */ 342 SHCLOBJHANDLE m_hObj;342 SHCLOBJHANDLE m_hObj; 343 343 /** Object path. */ 344 344 Utf8Str m_strPath; 345 345 /** (Cached) object information. */ 346 SHCLFSOBJINFO m_objInfo;346 SHCLFSOBJINFO m_objInfo; 347 347 /** Number of bytes already processed. */ 348 348 uint64_t m_cbProcessed; … … 369 369 /** Pointer to data object to use for this transfer. 370 370 * Can be NULL if not being used. */ 371 VBoxClipboardWinDataObject *pDataObj;371 SharedClipboardWinDataObject *pDataObj; 372 372 }; 373 373 # endif /* VBOX_WITH_SHARED_CLIPBOARD_URI_LIST */
Note:
See TracChangeset
for help on using the changeset viewer.