VirtualBox

Ignore:
Timestamp:
Oct 30, 2024 12:04:20 PM (5 months ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
165683
Message:

Additions: Linux/Wayland: Rename IPC stuff to be more generic (for both Clipboard and DnD), bugref:10796.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/x11/VBoxClient/vboxwl.cpp

    r106786 r106788  
    9191
    9292/** Clipboard IPC flow object. */
    93 vbcl::ipc::clipboard::ClipboardIpc *g_oClipboardIpc;
     93vbcl::ipc::data::DataIpc *g_oDataIpc;
    9494
    9595
     
    133133            if (RT_SUCCESS(rc))
    134134            {
    135                 g_oClipboardIpc->m_pvClipboardBuf.set((uint64_t)pvBufOut);
    136                 g_oClipboardIpc->m_cbClipboardBuf.set((uint64_t)cbBufOut);
     135                g_oDataIpc->m_pvClipboardBuf.set((uint64_t)pvBufOut);
     136                g_oDataIpc->m_cbClipboardBuf.set((uint64_t)cbBufOut);
    137137                g_tsGtkQuit = RTTimeMilliTS();
    138138            }
     
    225225
    226226        /* Set formats to be sent to the host. */
    227         g_oClipboardIpc->m_fFmts.set(fFormats);
     227        g_oDataIpc->m_fFmts.set(fFormats);
    228228
    229229        /* Wait for host to send clipboard format it wants to copy from guest. */
    230         uFmt = g_oClipboardIpc->m_uFmt.wait();
    231         if (uFmt != g_oClipboardIpc->m_uFmt.defaults())
     230        uFmt = g_oDataIpc->m_uFmt.wait();
     231        if (uFmt != g_oDataIpc->m_uFmt.defaults())
    232232        {
    233233            /* Find target which matches to host format among reported by guest. */
     
    274274
    275275    /* Set clipboard format which guest wants to send it to the host. */
    276     g_oClipboardIpc->m_uFmt.set(uFmt);
     276    g_oDataIpc->m_uFmt.set(uFmt);
    277277
    278278    /* Wait for the host to send clipboard data in requested format. */
    279     uint32_t cbBuf = g_oClipboardIpc->m_cbClipboardBuf.wait();
    280     void *pvBuf = (void *)g_oClipboardIpc->m_pvClipboardBuf.wait();
    281 
    282     if (   cbBuf != g_oClipboardIpc->m_cbClipboardBuf.defaults()
    283         && pvBuf != (void *)g_oClipboardIpc->m_pvClipboardBuf.defaults())
     279    uint32_t cbBuf = g_oDataIpc->m_cbClipboardBuf.wait();
     280    void *pvBuf = (void *)g_oDataIpc->m_pvClipboardBuf.wait();
     281
     282    if (   cbBuf != g_oDataIpc->m_cbClipboardBuf.defaults()
     283        && pvBuf != (void *)g_oDataIpc->m_pvClipboardBuf.defaults())
    284284    {
    285285        void *pBufOut;
     
    362362
    363363    /* Wait for host to report available clipboard formats from its buffer. */
    364     fFmts = g_oClipboardIpc->m_fFmts.wait();
    365     if (fFmts != g_oClipboardIpc->m_fFmts.defaults())
     364    fFmts = g_oDataIpc->m_fFmts.wait();
     365    if (fFmts != g_oDataIpc->m_fFmts.defaults())
    366366    {
    367367        GtkTargetList *aTargetList = gtk_target_list_new(0, 0);
     
    524524
    525525    if      (g_enmSessionType == VBCL_WL_CLIPBOARD_SESSION_TYPE_COPY_TO_GUEST)
    526         rc = g_oClipboardIpc->flow(vbcl::ipc::clipboard::HGCopyFlow, hIpcSession);
     526        rc = g_oDataIpc->flow(vbcl::ipc::data::HGCopyFlow, hIpcSession);
    527527    else if (g_enmSessionType == VBCL_WL_CLIPBOARD_SESSION_TYPE_ANNOUNCE_TO_HOST)
    528         rc = g_oClipboardIpc->flow(vbcl::ipc::clipboard::GHAnnounceAndCopyFlow, hIpcSession);
     528        rc = g_oDataIpc->flow(vbcl::ipc::data::GHAnnounceAndCopyFlow, hIpcSession);
    529529    else if (g_enmSessionType == VBCL_WL_CLIPBOARD_SESSION_TYPE_COPY_TO_HOST)
    530         rc = g_oClipboardIpc->flow(vbcl::ipc::clipboard::GHCopyFlow, hIpcSession);
     530        rc = g_oDataIpc->flow(vbcl::ipc::data::GHCopyFlow, hIpcSession);
    531531
    532532    return rc;
     
    579579        if (RT_SUCCESS(rc))
    580580        {
    581             g_oClipboardIpc = new vbcl::ipc::clipboard::ClipboardIpc();
    582             if (RT_VALID_PTR(g_oClipboardIpc))
     581            g_oDataIpc = new vbcl::ipc::data::DataIpc();
     582            if (RT_VALID_PTR(g_oDataIpc))
    583583            {
    584                 g_oClipboardIpc->init(vbcl::ipc::FLOW_DIRECTION_CLIENT, g_uSessionId);
     584                g_oDataIpc->init(vbcl::ipc::FLOW_DIRECTION_CLIENT, g_uSessionId);
    585585
    586586                rc = vboxwl_ipc_flow(hIpcSession);
     
    596596                            g_uSessionId, rc, rcThread);
    597597
    598                 g_oClipboardIpc->reset();
    599                 delete g_oClipboardIpc;
     598                g_oDataIpc->reset();
     599                delete g_oDataIpc;
    600600            }
    601601            else
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