Changeset 19875 in vbox for trunk/src/VBox/GuestHost/SharedClipboard
- Timestamp:
- May 20, 2009 9:18:53 PM (16 years ago)
- svn:sync-xref-src-repo-rev:
- 47568
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified trunk/src/VBox/GuestHost/SharedClipboard/x11-clipboard.cpp ¶
r19842 r19875 1353 1353 * a request for the clipboard contents) */ 1354 1354 unsigned mSize; 1355 /** The opaque context structure for completing the request */1356 CLIPREADX11CBCONTEXT *mReadCtx;1357 1355 /** The format VBox would like the data in */ 1358 1356 uint32_t mFormat; … … 1425 1423 rc = VERR_NOT_IMPLEMENTED; 1426 1424 XtFree((char *)pvSrc); 1427 ClipCompleteDataRequestFromX11(pReq->m ReadCtx, rc, cbActual);1425 ClipCompleteDataRequestFromX11(pReq->mCtx->pFrontend, rc, cbActual); 1428 1426 RTMemFree(pReq); 1429 1427 if (RT_SUCCESS(rc)) … … 1479 1477 /* The clipboard callback was never scheduled, so we must signal 1480 1478 * that the request processing is finished and clean up ourselves. */ 1481 ClipCompleteDataRequestFromX11(pReq->m ReadCtx, rc, 0);1479 ClipCompleteDataRequestFromX11(pReq->mCtx->pFrontend, rc, 0); 1482 1480 RTMemFree(pReq); 1483 1481 } … … 1498 1496 */ 1499 1497 int ClipRequestDataFromX11(CLIPBACKEND *pCtx, uint32_t u32Format, void *pv, 1500 uint32_t cb , CLIPREADX11CBCONTEXT *pReadCtx)1498 uint32_t cb) 1501 1499 { 1502 1500 /* … … 1513 1511 pReq->mBuffer = pv; 1514 1512 pReq->mSize = cb; 1515 pReq->mReadCtx = pReadCtx;1516 1513 pReq->mFormat = u32Format; 1517 1514 pReq->mCtx = pCtx; … … 1953 1950 } 1954 1951 1955 struct _CLIPREADX11CBCONTEXT 1956 { 1957 int rc; 1958 uint32_t cbActual; 1959 }; 1960 1961 void ClipCompleteDataRequestFromX11(CLIPREADX11CBCONTEXT *pCtx, int rc, 1952 static int g_completedRC = VINF_SUCCESS; 1953 static int g_completedActual = 0; 1954 1955 void ClipCompleteDataRequestFromX11(VBOXCLIPBOARDCONTEXT *pCtx, int rc, 1962 1956 uint32_t cbActual) 1963 1957 { 1964 pCtx->rc = rc; 1965 pCtx->cbActual = cbActual; 1958 g_completedRC = rc; 1959 g_completedActual = cbActual; 1960 } 1961 1962 static void clipGetCompletedRequest(int *prc, uint32_t *pcbActual) 1963 { 1964 *prc = g_completedRC; 1965 *pcbActual = g_completedActual; 1966 1966 } 1967 1967 … … 1984 1984 { 1985 1985 char pc[MAX_BUF_SIZE]; 1986 CLIPREADX11CBCONTEXT readCtx; 1986 ClipRequestDataFromX11(pCtx, VBOX_SHARED_CLIPBOARD_FMT_UNICODETEXT, 1987 (void *) pc, cbBuf); 1988 int rc = VINF_SUCCESS; 1987 1989 uint32_t cbActual = 0; 1988 ClipRequestDataFromX11(pCtx, VBOX_SHARED_CLIPBOARD_FMT_UNICODETEXT, 1989 (void *) pc, cbBuf, &readCtx); 1990 int rc = readCtx.rc; 1991 cbActual = readCtx.cbActual; 1990 clipGetCompletedRequest(&rc, &cbActual); 1992 1991 if (rc != rcExp) 1993 1992 RTPrintf("Wrong return code, expected %Rrc, got %Rrc\n", rcExp, … … 2042 2041 { 2043 2042 char pc[MAX_BUF_SIZE]; 2044 CLIPREADX11CBCONTEXT readCtx; 2043 ClipRequestDataFromX11(pCtx, VBOX_SHARED_CLIPBOARD_FMT_UNICODETEXT, 2044 (void *) pc, cbBuf); 2045 int rc = VINF_SUCCESS; 2045 2046 uint32_t cbActual = 0; 2046 ClipRequestDataFromX11(pCtx, VBOX_SHARED_CLIPBOARD_FMT_UNICODETEXT, 2047 (void *) pc, cbBuf, &readCtx); 2048 int rc = readCtx.rc; 2049 cbActual = readCtx.cbActual; 2047 clipGetCompletedRequest(&rc, &cbActual); 2050 2048 if (rc != rcExp) 2051 2049 RTPrintf("Wrong return code, expected %Rrc, got %Rrc\n", rcExp, … … 2272 2270 clipSetSelectionValues("UTF8_STRING", XA_STRING, NULL, 2273 2271 0, 8); 2274 CLIPREADX11CBCONTEXT readCtx;2275 2272 ClipRequestDataFromX11(pCtx, VBOX_SHARED_CLIPBOARD_FMT_UNICODETEXT, 2276 (void *) pc, sizeof(pc), &readCtx); 2277 rc = readCtx.rc; 2278 cbActual = readCtx.cbActual; 2273 (void *) pc, sizeof(pc)); 2274 clipGetCompletedRequest(&rc, &cbActual); 2279 2275 if (rc != VERR_NO_DATA) 2280 2276 { … … 2285 2281 /*** request for an invalid VBox format from X11 ***/ 2286 2282 RTPrintf(TEST_NAME ": TESTING a request for an invalid VBox format from X11\n"); 2287 ClipRequestDataFromX11(pCtx, 0xffff, (void *) pc, sizeof(pc), &readCtx); 2288 rc = readCtx.rc; 2289 cbActual = readCtx.cbActual; 2283 ClipRequestDataFromX11(pCtx, 0xffff, (void *) pc, sizeof(pc)); 2284 clipGetCompletedRequest(&rc, &cbActual); 2290 2285 if (rc != VERR_NOT_IMPLEMENTED) 2291 2286 { … … 2442 2437 {} 2443 2438 2444 void ClipCompleteDataRequestFromX11( CLIPREADX11CBCONTEXT *pCtx, int rc,2439 void ClipCompleteDataRequestFromX11(VBOXCLIPBOARDCONTEXT *pCtx, int rc, 2445 2440 uint32_t cbActual) 2446 2441 {}
Note:
See TracChangeset
for help on using the changeset viewer.