VirtualBox

Changeset 19535 in vbox for trunk


Ignore:
Timestamp:
May 8, 2009 4:16:44 PM (16 years ago)
Author:
vboxsync
Message:

GuestHost/SharedClipboard/x11: removed some debugging code

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/GuestHost/SharedClipboard/x11-clipboard.cpp

    r19534 r19535  
    5555#include <VBox/HostServices/VBoxClipboardSvc.h>
    5656
    57 /** Do we want to test Utf8 by disabling other text formats? */
    58 static bool g_testUtf8 = false;
    59 /** Do we want to test compount text by disabling other text formats? */
    60 static bool g_testCText = false;
    61 /** Are we currently debugging the clipboard code? */
    62 static bool g_debugClipboard = false;
    63 
    6457/** The different clipboard formats which we support. */
    6558enum CLIPFORMAT
     
    7972    const char *pcszAtom;
    8073    /** The format corresponding to the name */
    81     CLIPFORMAT enmFormat;
     74    CLIPFORMAT  enmFormat;
    8275    /** The corresponding VBox clipboard format */
    83     uint32_t   u32VBoxFormat;
     76    uint32_t    u32VBoxFormat;
    8477} g_aFormats[] =
    8578{
     
    548541    unsigned cAtoms = *pcLen;
    549542    CLIPFORMAT enmBestTarget = INVALID;
    550     CLIPFORMAT enmRequiredTarget = INVALID;
    551543    Atom atomBestTarget = None;
    552544
     
    561553        return;
    562554    }
    563 
    564     /* Debugging stuff */
    565     if (g_testUtf8)
    566         enmRequiredTarget = UTF8;
    567     else if (g_testCText)
    568         enmRequiredTarget = CTEXT;
    569555
    570556    for (unsigned i = 0; i < cAtoms; ++i)
     
    576562            if (atomTargets[i] == formatAtom)
    577563            {
    578                 if (   enmBestTarget < g_aFormats[j].enmFormat
    579                     /* debugging stuff */
    580                     && (   enmRequiredTarget == INVALID
    581                         || enmRequiredTarget == g_aFormats[j].enmFormat))
     564                if (   enmBestTarget < g_aFormats[j].enmFormat)
    582565                {
    583566                    enmBestTarget = g_aFormats[j].enmFormat;
     
    587570            }
    588571        }
    589         if (g_debugClipboard)
    590         {
    591             char *szAtomName = XGetAtomName(XtDisplay(pCtx->widget),
    592                                             atomTargets[i]);
    593             if (szAtomName != 0)
    594             {
    595                 Log2 (("%s: the host offers target %s\n", __PRETTY_FUNCTION__,
    596                        szAtomName));
    597                 XFree(szAtomName);
    598             }
    599         }
    600572    }
    601573    pCtx->atomX11TextFormat = atomBestTarget;
     
    603575    {
    604576        uint32_t u32Formats = 0;
    605         if (g_debugClipboard)
    606         {
    607             if (atomBestTarget != None)
    608             {
    609                 char *szAtomName = XGetAtomName(XtDisplay(pCtx->widget),
    610                                                 atomBestTarget);
    611                 Log2 (("%s: switching to host text target %s.  Available targets are:\n",
    612                        __PRETTY_FUNCTION__, szAtomName));
    613                 XFree(szAtomName);
    614             }
    615             else
    616                 Log2(("%s: no supported host text target found.  Available targets are:\n",
    617                       __PRETTY_FUNCTION__));
    618             for (unsigned i = 0; i < cAtoms; ++i)
    619             {
    620                 char *szAtomName = XGetAtomName(XtDisplay(pCtx->widget),
    621                                                 atomTargets[i]);
    622                 if (szAtomName != 0)
    623                 {
    624                     Log2 (("%s:     %s\n", __PRETTY_FUNCTION__, szAtomName));
    625                     XFree(szAtomName);
    626                 }
    627             }
    628         }
    629577        pCtx->X11TextFormat = enmBestTarget;
    630578        if (enmBestTarget != INVALID)
     
    825773        g_fHaveX11 = false;
    826774        return pCtx;
    827     }
    828 
    829     if (RTEnvGet("VBOX_CBTEST_UTF8"))
    830     {
    831         g_testUtf8 = true;
    832         LogRel(("Host clipboard: testing Utf8\n"));
    833     }
    834     else if (RTEnvGet("VBOX_CBTEST_CTEXT"))
    835     {
    836         g_testCText = true;
    837         LogRel(("Host clipboard: testing compound text\n"));
    838     }
    839     else if (RTEnvGet("VBOX_CBDEBUG"))
    840     {
    841         g_debugClipboard = true;
    842         LogRel(("Host clipboard: enabling additional debugging output\n"));
    843775    }
    844776
     
    982914    atomTargets[cTargets + 1] = clipGetAtom(pCtx->widget, "MULTIPLE");
    983915    atomTargets[cTargets + 2] = clipGetAtom(pCtx->widget, "TIMESTAMP");
    984     if (g_debugClipboard)
    985     {
    986         for (unsigned i = 0; i < cTargets + 3; i++)
    987         {
    988             char *szAtomName = XGetAtomName(XtDisplay(pCtx->widget), atomTargets[i]);
    989             if (szAtomName != 0)
    990             {
    991                 Log2 (("%s: returning target %s\n", __PRETTY_FUNCTION__,
    992                        szAtomName));
    993                 XFree(szAtomName);
    994             }
    995             else
    996             {
    997                 Log(("%s: invalid atom %d in the list!\n", __PRETTY_FUNCTION__,
    998                      atomTargets[i]));
    999             }
    1000         }
    1001     }
    1002916    *atomTypeReturn = XA_ATOM;
    1003917    *pValReturn = reinterpret_cast<XtPointer>(atomTargets);
     
    13111225        LogFlowFunc(("rc = false\n"));
    13121226        return false;
    1313     }
    1314     if (g_debugClipboard)
    1315     {
    1316         char *szAtomName = XGetAtomName(XtDisplay(pCtx->widget), *atomTarget);
    1317         if (szAtomName != 0)
    1318         {
    1319             Log2 (("%s: request for format %s\n", __PRETTY_FUNCTION__, szAtomName));
    1320             XFree(szAtomName);
    1321         }
    1322         else
    1323         {
    1324             LogFunc (("request for invalid target atom %d!\n", *atomTarget));
    1325         }
    13261227    }
    13271228    if (*atomTarget == clipGetAtom(pCtx->widget, "TARGETS"))
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette