Changeset 87452 in vbox for trunk/src/VBox/Additions/x11/VBoxClient/clipboard.cpp
- Timestamp:
- Jan 27, 2021 5:11:25 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/x11/VBoxClient/clipboard.cpp
r87082 r87452 58 58 59 59 60 #ifdef VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS 61 static DECLCALLBACK(int) vbclShClOnTransferInitCallback(PSHCLTRANSFERCALLBACKDATA pData) 62 { 63 # ifdef VBOX_WITH_SHARED_CLIPBOARD_FUSE 64 return ShClFuseOnTransferInitCallback(pData); 65 # else 66 RT_NOREF(pData); 67 return VERR_NOT_IMPLEMENTED; 68 # endif 69 } 70 71 static DECLCALLBACK(int) vbclShClOnTransferStartCallback(PSHCLTRANSFERCALLBACKDATA pData) 72 { 73 # ifdef VBOX_WITH_SHARED_CLIPBOARD_FUSE 74 return ShClFuseOnTransferStartCallback(pData); 75 # else 76 RT_NOREF(pData); 77 return VERR_NOT_IMPLEMENTED; 78 # endif 79 } 80 81 static DECLCALLBACK(void) vbclShClOnTransferCompleteCallback(PSHCLTRANSFERCALLBACKDATA pData, int rc) 82 { 83 # ifdef VBOX_WITH_SHARED_CLIPBOARD_FUSE 84 return ShClFuseOnTransferCompleteCallback(pData, rc); 85 # else 86 RT_NOREF(pData, rc); 87 # endif 88 } 89 90 static DECLCALLBACK(void) vbclShClOnTransferErrorCallback(PSHCLTRANSFERCALLBACKDATA pData, int rc) 91 { 92 # ifdef VBOX_WITH_SHARED_CLIPBOARD_FUSE 93 return ShClFuseOnTransferErrorCallback(pData, rc); 94 # else 95 RT_NOREF(pData, rc); 96 # endif 97 } 98 #endif /* VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS */ 99 100 /** 101 * Callback implementation for getting clipboard data from the host. 102 * 103 * @returns VBox status code. VERR_NO_DATA if no data available. 104 * @param pCtx Our context information. 105 * @param uFmt The format of the data being requested. 106 * @param ppv Returns an allocated buffer with data read from the host on success. 107 * Needs to be free'd with RTMemFree() by the caller. 108 * @param pcb Returns the amount of data read (in bytes) on success. 109 */ 60 /** @copydoc ShClX11RequestDataForX11Callback */ 110 61 DECLCALLBACK(int) ShClX11RequestDataForX11Callback(PSHCLCONTEXT pCtx, SHCLFORMAT uFmt, void **ppv, uint32_t *pcb) 111 62 { … … 118 69 { 119 70 //rc = VbglR3ClipboardRootListRead() 120 121 71 rc = VERR_NO_DATA; 122 72 } … … 194 144 }; 195 145 196 /** 197 * Tell the host that new clipboard formats are available. 198 * 199 * @param pCtx Our context information. 200 * @param fFormats The formats to report. 201 */ 146 /** @copydoc ShClX11ReportFormatsCallback */ 202 147 DECLCALLBACK(void) ShClX11ReportFormatsCallback(PSHCLCONTEXT pCtx, SHCLFORMATS fFormats) 203 148 { … … 211 156 } 212 157 213 /** 214 * This is called by the backend to tell us that a request for data from 215 * X11 has completed. 216 * 217 * @param pCtx Our context information. 218 * @param rcCompletion The completion status of the request. 219 * @param pReq The request structure that we passed in when we started 220 * the request. We RTMemFree() this in this function. 221 * @param pv The clipboard data returned from X11 if the request succeeded (see @a rc). 222 * @param cb The size of the data in @a pv. 223 */ 158 /** @copydoc ShClX11RequestFromX11CompleteCallback */ 224 159 DECLCALLBACK(void) ShClX11RequestFromX11CompleteCallback(PSHCLCONTEXT pCtx, 225 160 int rcCompletion, CLIPREADCBREQ *pReq, void *pv, uint32_t cb) … … 397 332 static DECLCALLBACK(int) vbclShClInit(void) 398 333 { 399 int rc; 400 401 #ifdef VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS 402 /* Install callbacks. */ 403 RT_ZERO(g_Ctx.CmdCtx.Transfers.Callbacks); 404 405 g_Ctx.CmdCtx.Transfers.Callbacks.pvUser = &g_Ctx; /* Assign context as user-provided callback data. */ 406 g_Ctx.CmdCtx.Transfers.Callbacks.cbUser = sizeof(SHCLCONTEXT); 407 408 g_Ctx.CmdCtx.Transfers.Callbacks.pfnTransferInitialize = vbclShClOnTransferInitCallback; 409 g_Ctx.CmdCtx.Transfers.Callbacks.pfnTransferStart = vbclShClOnTransferStartCallback; 410 g_Ctx.CmdCtx.Transfers.Callbacks.pfnTransferComplete = vbclShClOnTransferCompleteCallback; 411 g_Ctx.CmdCtx.Transfers.Callbacks.pfnTransferError = vbclShClOnTransferErrorCallback; 412 413 rc = ShClTransferCtxInit(&g_Ctx.TransferCtx); 414 #else 415 rc = VINF_SUCCESS; 416 #endif 334 int rc = ShClTransferCtxInit(&g_Ctx.TransferCtx); 417 335 418 336 LogFlowFuncLeaveRC(rc);
Note:
See TracChangeset
for help on using the changeset viewer.