Changeset 93505 in vbox for trunk/src/VBox/Additions/x11/VBoxClient/clipboard.cpp
- Timestamp:
- Jan 31, 2022 4:38:49 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/x11/VBoxClient/clipboard.cpp
r93495 r93505 58 58 59 59 60 DECLCALLBACK(int) ShClX11RequestDataCallback(PSHCLCONTEXT pCtx, SHCLFORMAT uFmt, void **ppv, uint32_t *pcb) 61 { 60 static DECLCALLBACK(int) vbclOnRequestDataFromSourceCallback(PSHCLCONTEXT pCtx, 61 SHCLFORMAT uFmt, void **ppv, uint32_t *pcb, void *pvUser) 62 { 63 RT_NOREF(pvUser); 64 62 65 LogFlowFunc(("pCtx=%p, uFmt=%#x\n", pCtx, uFmt)); 63 66 … … 140 143 { 141 144 /** The data format that was requested. */ 142 SHCLFORMAT Format;145 SHCLFORMAT uFmt; 143 146 }; 144 147 145 DECLCALLBACK(void) ShClX11ReportFormatsCallback(PSHCLCONTEXT pCtx, SHCLFORMATS fFormats)146 { 147 RT_NOREF(p Ctx);148 static DECLCALLBACK(int) vbclReportFormatsCallback(PSHCLCONTEXT pCtx, uint32_t fFormats, void *pvUser) 149 { 150 RT_NOREF(pvUser); 148 151 149 152 LogFlowFunc(("fFormats=%#x\n", fFormats)); 150 153 151 int rc2 = VbglR3ClipboardReportFormats(pCtx->CmdCtx.idClient, fFormats); 152 RT_NOREF(rc2); 153 LogFlowFuncLeaveRC(rc2); 154 } 155 156 DECLCALLBACK(void) ShClX11ReportDataCallback(PSHCLCONTEXT pCtx, int rcCompletion, 157 CLIPREADCBREQ *pReq, void *pv, uint32_t cb) 158 { 159 LogFlowFunc(("rcCompletion=%Rrc, Format=0x%x, pv=%p, cb=%RU32\n", rcCompletion, pReq->Format, pv, cb)); 160 RT_NOREF(rcCompletion); 154 int rc = VbglR3ClipboardReportFormats(pCtx->CmdCtx.idClient, fFormats); 155 LogFlowFuncLeaveRC(rc); 156 157 return rc; 158 } 159 160 static DECLCALLBACK(int) vbclOnSendDataToDestCallback(PSHCLCONTEXT pCtx, void *pv, uint32_t cb, void *pvUser) 161 { 162 PSHCLX11READDATAREQ pData = (PSHCLX11READDATAREQ)pvUser; 163 AssertPtrReturn(pData, VERR_INVALID_POINTER); 164 165 LogFlowFunc(("rcCompletion=%Rrc, Format=0x%x, pv=%p, cb=%RU32\n", pData->rcCompletion, pData->pReq->uFmt, pv, cb)); 161 166 162 167 Assert((cb == 0 && pv == NULL) || (cb != 0 && pv != NULL)); 163 rcCompletion = VbglR3ClipboardWriteDataEx(&pCtx->CmdCtx, pReq->Format, pv, cb); 164 165 RTMemFree(pReq); 166 167 LogFlowFuncLeaveRC(rcCompletion); 168 pData->rcCompletion = VbglR3ClipboardWriteDataEx(&pCtx->CmdCtx, pData->pReq->uFmt, pv, cb); 169 170 RTMemFree(pData->pReq); 171 172 LogFlowFuncLeaveRC(pData->rcCompletion); 173 174 return VINF_SUCCESS; 168 175 } 169 176 … … 177 184 LogFlowFuncEnter(); 178 185 179 int rc = ShClX11Init(&g_Ctx.X11, NULL /* pCallbacks */, &g_Ctx, false /* fHeadless */); 186 SHCLCALLBACKS Callbacks; 187 RT_ZERO(Callbacks); 188 Callbacks.pfnReportFormats = vbclReportFormatsCallback; 189 Callbacks.pfnOnRequestDataFromSource = vbclOnRequestDataFromSourceCallback; 190 Callbacks.pfnOnSendDataToDest = vbclOnSendDataToDestCallback; 191 192 int rc = ShClX11Init(&g_Ctx.X11, &Callbacks, &g_Ctx, false /* fHeadless */); 180 193 if (RT_SUCCESS(rc)) 181 194 { … … 269 282 if (pReq) 270 283 { 271 pReq-> Format = pEvent->u.fReadData;272 ShClX11ReadDataFromX11(&g_Ctx.X11, pReq-> Format, pReq);284 pReq->uFmt = pEvent->u.fReadData; 285 ShClX11ReadDataFromX11(&g_Ctx.X11, pReq->uFmt, pReq); 273 286 } 274 287 else
Note:
See TracChangeset
for help on using the changeset viewer.