VirtualBox

Changeset 83621 in vbox for trunk


Ignore:
Timestamp:
Apr 8, 2020 3:02:16 PM (5 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
137049
Message:

SharedClipboard/darwin: Logging. bugref:9620

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/HostServices/VBoxClipboardSvc.h

    r82852 r83621  
    122122/** Request data for a specific format from the guest.
    123123 *
    124  * Two parameters, first the 32-bit message ID followed by a  a 32-bit
    125  * format bit (VBOX_SHCL_FMT_XXX).  The guest will respond by issuing a
     124 * Two parameters, first the 32-bit message ID followed by a 32-bit format bit
     125 * (VBOX_SHCL_FMT_XXX).  The guest will respond by issuing a
    126126 * VBOX_SHCL_GUEST_FN_DATA_WRITE.
    127127 *
     
    161161 * @note  The host may sometimes incorrectly set more than one format bit, in
    162162 *        which case it's up to the guest to pick which to write back.
    163  * @since 6.3.2
     163 * @since 6.1.2
    164164 */
    165165#define VBOX_SHCL_HOST_MSG_READ_DATA_CID                    5
  • trunk/src/VBox/GuestHost/SharedClipboard/clipboard-common.cpp

    r82968 r83621  
    871871        RT_CASE_RET_STR(VBOX_SHCL_HOST_MSG_READ_DATA);
    872872        RT_CASE_RET_STR(VBOX_SHCL_HOST_MSG_FORMATS_REPORT);
     873        RT_CASE_RET_STR(VBOX_SHCL_HOST_MSG_CANCELED);
     874        RT_CASE_RET_STR(VBOX_SHCL_HOST_MSG_READ_DATA_CID);
    873875        RT_CASE_RET_STR(VBOX_SHCL_HOST_MSG_TRANSFER_STATUS);
    874876        RT_CASE_RET_STR(VBOX_SHCL_HOST_MSG_TRANSFER_ROOT_LIST_HDR_READ);
  • trunk/src/VBox/HostServices/SharedClipboard/VBoxSharedClipboardSvc.cpp

    r82894 r83621  
    12091209    while (fFormats)
    12101210    {
    1211         SHCLFORMAT fFormat = VBOX_SHCL_FMT_NONE;
    1212 
     1211        /* Pick the next format to get from the mask: */
    12131212        /** @todo Make format reporting precedence configurable? */
     1213        SHCLFORMAT fFormat;
    12141214        if (fFormats & VBOX_SHCL_FMT_UNICODETEXT)
    12151215            fFormat = VBOX_SHCL_FMT_UNICODETEXT;
     
    12191219            fFormat = VBOX_SHCL_FMT_HTML;
    12201220        else
    1221             AssertStmt(fFormats == VBOX_SHCL_FMT_NONE, fFormat = VBOX_SHCL_FMT_NONE);
    1222 
    1223         if (fFormat == VBOX_SHCL_FMT_NONE)
    1224             break;
    1225 
    1226         /* Remove format from format list. */
     1221            AssertMsgFailedBreak(("%#x\n", fFormats));
     1222
     1223        /* Remove it from the mask. */
    12271224        fFormats &= ~fFormat;
    12281225
     
    13431340int ShClSvcHostReportFormats(PSHCLCLIENT pClient, SHCLFORMATS fFormats)
    13441341{
    1345     LogFlowFuncEnter();
    1346     AssertPtrReturn(pClient,  VERR_INVALID_POINTER);
     1342    LogFlowFunc(("fFormats=%#x\n", fFormats));
     1343    AssertPtrReturn(pClient, VERR_INVALID_POINTER);
    13471344
    13481345#ifdef VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS
  • trunk/src/VBox/HostServices/SharedClipboard/darwin-pasteboard.cpp

    r82968 r83621  
    8585int queryNewPasteboardFormats(PasteboardRef pPasteboard, uint32_t *pfFormats, bool *pfChanged)
    8686{
    87     Log(("queryNewPasteboardFormats\n"));
    88 
    8987    OSStatus err = noErr;
     88    *pfFormats = 0;
    9089    *pfChanged = true;
    9190
     
    9796    {
    9897        *pfChanged = false;
     98        Log2(("queryNewPasteboardFormats: no change\n"));
    9999        return VINF_SUCCESS;
    100100    }
     
    104104    err = PasteboardGetItemCount(pPasteboard, &itemCount);
    105105    if (itemCount < 1)
     106    {
     107        Log(("queryNewPasteboardFormats: changed: No items on the pasteboard\n"));
    106108        return VINF_SUCCESS;
     109    }
    107110
    108111    /* The id of the first element in the pasteboard */
     
    121124            {
    122125                CFStringRef flavorType;
    123                 flavorType = static_cast <CFStringRef>(CFArrayGetValueAtIndex(flavorTypeArray,
    124                                                                                flavorIndex));
     126                flavorType = static_cast <CFStringRef>(CFArrayGetValueAtIndex(flavorTypeArray, flavorIndex));
    125127                /* Currently only unicode supported */
    126                 if (UTTypeConformsTo(flavorType, kUTTypeUTF8PlainText) ||
    127                     UTTypeConformsTo(flavorType, kUTTypeUTF16PlainText))
    128                 {
    129                     Log(("Unicode flavor detected.\n"));
     128                if (   UTTypeConformsTo(flavorType, kUTTypeUTF8PlainText)
     129                    || UTTypeConformsTo(flavorType, kUTTypeUTF16PlainText))
     130                {
     131                    Log(("queryNewPasteboardFormats: Unicode flavor detected.\n"));
    130132                    *pfFormats |= VBOX_SHCL_FMT_UNICODETEXT;
    131133                }
    132134                else if (UTTypeConformsTo(flavorType, kUTTypeBMP))
    133135                {
    134                     Log(("BMP flavor detected.\n"));
     136                    Log(("queryNewPasteboardFormats: BMP flavor detected.\n"));
    135137                    *pfFormats |= VBOX_SHCL_FMT_BITMAP;
    136138                }
     
    140142    }
    141143
    142     Log(("queryNewPasteboardFormats: rc = %02X\n", rc));
     144    Log(("queryNewPasteboardFormats: changed: *pfFormats=%#x\n", *pfFormats));
    143145    return rc;
    144146}
Note: See TracChangeset for help on using the changeset viewer.

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