Changeset 13846 in vbox for trunk/src/VBox
- Timestamp:
- Nov 5, 2008 10:44:32 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostServices/SharedClipboard/x11.cpp
r13837 r13846 20 20 * additional information or have any questions. 21 21 */ 22 23 #define USE_UTF1624 #define USE_UTF825 #define USE_CTEXT26 22 27 23 #include <vector> … … 62 58 /** Do we want to test compount text by disabling other text formats? */ 63 59 static bool g_testCText = false; 60 /** Are we currently debugging the clipboard code? */ 61 static bool g_debugClipboard = false; 64 62 65 63 /** The different clipboard formats which we support. */ … … 565 563 break; 566 564 } 567 #ifdef DEBUG 568 char *szAtomName = XGetAtomName(XtDisplay(g_ctx.widget), atomTargets[i]); 569 if (szAtomName != 0) 570 { 571 Log3 (("vboxClipboardTargetsProc: the host offers target %s\n", szAtomName)); 572 XFree(szAtomName); 573 } 574 #endif 575 } 576 g_ctx.atomHostTextFormat = atomBestTarget; 577 if ((eBestTarget != g_ctx.hostTextFormat) || (g_ctx.notifyGuest == true)) 578 { 579 uint32_t u32Formats = 0; 580 #ifdef DEBUG 581 if (atomBestTarget != None) 582 { 583 char *szAtomName = XGetAtomName(XtDisplay(g_ctx.widget), atomBestTarget); 584 Log2 (("vboxClipboardTargetsProc: switching to host text target %s. Available targets are:\n", 585 szAtomName)); 586 XFree(szAtomName); 587 } 588 else 589 { 590 Log2(("vboxClipboardTargetsProc: no supported host text target found. Available targets are:\n")); 591 } 592 for (unsigned i = 0; i < cAtoms; ++i) 565 if (g_debugClipboard) 593 566 { 594 567 char *szAtomName = XGetAtomName(XtDisplay(g_ctx.widget), atomTargets[i]); 595 568 if (szAtomName != 0) 596 569 { 597 Log2 (("vboxClipboardTargetsProc: 570 Log2 (("vboxClipboardTargetsProc: the host offers target %s\n", szAtomName)); 598 571 XFree(szAtomName); 599 572 } 600 573 } 601 #endif 574 } 575 g_ctx.atomHostTextFormat = atomBestTarget; 576 if ((eBestTarget != g_ctx.hostTextFormat) || (g_ctx.notifyGuest == true)) 577 { 578 uint32_t u32Formats = 0; 579 if (g_debugClipboard) 580 { 581 if (atomBestTarget != None) 582 { 583 char *szAtomName = XGetAtomName(XtDisplay(g_ctx.widget), atomBestTarget); 584 Log2 (("vboxClipboardTargetsProc: switching to host text target %s. Available targets are:\n", 585 szAtomName)); 586 XFree(szAtomName); 587 } 588 else 589 { 590 Log2(("vboxClipboardTargetsProc: no supported host text target found. Available targets are:\n")); 591 } 592 for (unsigned i = 0; i < cAtoms; ++i) 593 { 594 char *szAtomName = XGetAtomName(XtDisplay(g_ctx.widget), atomTargets[i]); 595 if (szAtomName != 0) 596 { 597 Log2 (("vboxClipboardTargetsProc: %s\n", szAtomName)); 598 XFree(szAtomName); 599 } 600 } 601 } 602 602 g_ctx.hostTextFormat = eBestTarget; 603 603 if (eBestTarget != INVALID) … … 769 769 LogRel(("Host clipboard: testing compound text\n")); 770 770 } 771 else if (RTEnvGet("VBOX_CBDEBUG")) 772 { 773 g_debugClipboard = true; 774 LogRel(("Host clipboard: enabling additional debugging output\n")); 775 } 771 776 772 777 g_fHaveX11 = true; … … 932 937 atomTargets[cTargets + 1] = g_ctx.atomMultiple; 933 938 atomTargets[cTargets + 2] = g_ctx.atomTimestamp; 934 #ifdef DEBUG 935 for (unsigned i = 0; i < cTargets + 3; i++) 936 { 937 char *szAtomName = XGetAtomName(XtDisplay(g_ctx.widget), atomTargets[i]); 938 if (szAtomName != 0) 939 { 940 Log2 (("vboxClipboardConvertTargets: returning target %s\n", szAtomName)); 941 XFree(szAtomName); 939 if (g_debugClipboard) 940 { 941 for (unsigned i = 0; i < cTargets + 3; i++) 942 { 943 char *szAtomName = XGetAtomName(XtDisplay(g_ctx.widget), atomTargets[i]); 944 if (szAtomName != 0) 945 { 946 Log2 (("vboxClipboardConvertTargets: returning target %s\n", szAtomName)); 947 XFree(szAtomName); 948 } 949 else 950 { 951 Log(("vboxClipboardConvertTargets: invalid atom %d in the list!\n", atomTargets[i])); 952 } 942 953 } 943 else 944 { 945 Log(("vboxClipboardConvertTargets: invalid atom %d in the list!\n", atomTargets[i])); 946 } 947 } 948 #endif 954 } 949 955 *atomTypeReturn = XA_ATOM; 950 956 *pValReturn = reinterpret_cast<XtPointer>(atomTargets); … … 1269 1275 return false; 1270 1276 } 1271 #ifdef DEBUG 1272 char *szAtomName = XGetAtomName(XtDisplay(g_ctx.widget), *atomTarget); 1273 if (szAtomName != 0) 1274 { 1275 Log2 (("vboxClipboardConvertProc: request for format %s\n", szAtomName)); 1276 XFree(szAtomName); 1277 } 1278 else 1279 { 1280 Log(("vboxClipboardConvertProc: request for invalid target atom %d!\n", *atomTarget)); 1281 } 1282 #endif 1277 if (g_debugClipboard) 1278 { 1279 char *szAtomName = XGetAtomName(XtDisplay(g_ctx.widget), *atomTarget); 1280 if (szAtomName != 0) 1281 { 1282 Log2 (("vboxClipboardConvertProc: request for format %s\n", szAtomName)); 1283 XFree(szAtomName); 1284 } 1285 else 1286 { 1287 Log(("vboxClipboardConvertProc: request for invalid target atom %d!\n", *atomTarget)); 1288 } 1289 } 1283 1290 if (*atomTarget == g_ctx.atomTargets) 1284 1291 {
Note:
See TracChangeset
for help on using the changeset viewer.