VirtualBox

Changeset 18586 in vbox for trunk/src/VBox/HostServices


Ignore:
Timestamp:
Mar 31, 2009 9:10:20 PM (16 years ago)
Author:
vboxsync
Message:

HostServices/SharedClipboard/X11: added opaque data pointers to the X11 backend APIs, as yet unused

File:
1 edited

Legend:

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

    r18585 r18586  
    5454    RTSEMMUTEX clipboardMutex;
    5555
     56    /** Pointer to the opaque X11 backend structure */
     57    VBOXCLIPBOARDCONTEXTX11 *pBackend;
    5658    /** Pointer to the client data structure */
    5759    VBOXCLIPBOARDCLIENTDATA *pClient;
     
    8587         * data from X11. */
    8688        LogFunc(("host requested guest clipboard data after guest had disconnected.\n"));
    87         VBoxX11ClipboardAnnounceVBoxFormat(0);
     89        VBoxX11ClipboardAnnounceVBoxFormat(pCtx->pBackend, 0);
    8890        pCtx->waiter = NONE;
    8991        return VERR_TIMEOUT;
     
    162164{
    163165    int rc = VINF_SUCCESS;
     166    VBOXCLIPBOARDCONTEXTX11 *pBackend = NULL;
     167
    164168    LogRel(("Initializing host clipboard service\n"));
    165169    RTSemEventCreate(&g_ctxHost.waitForData);
    166170    RTSemMutexCreate(&g_ctxHost.clipboardMutex);
    167     rc = VBoxX11ClipboardInitX11(&g_ctxHost);
     171    rc = VBoxX11ClipboardInitX11(&g_ctxHost, &pBackend);
    168172    if (RT_FAILURE(rc))
    169173    {
     
    172176        LogRel(("Failed to start the host shared clipboard service.\n"));
    173177    }
     178    else
     179        g_ctxHost.pBackend = pBackend;
    174180    return rc;
    175181}
     
    197203     *         even if we are not waiting. */
    198204    RTSemEventSignal(g_ctxHost.waitForData);
    199     rc = VBoxX11ClipboardTermX11();
     205    rc = VBoxX11ClipboardTermX11(g_ctxHost.pBackend);
    200206    if (RT_SUCCESS(rc))
    201207    {
     
    225231    /** The pClient pointer is a dummy anyway, as we only support a single
    226232     * client at a time. */
    227     rc = VBoxX11ClipboardStartX11(X11 /* initial owner */);
     233    rc = VBoxX11ClipboardStartX11(g_ctxHost.pBackend,
     234                                  X11 /* initial owner */);
    228235    return rc;
    229236}
     
    246253    vboxSvcClipboardReportMsg (g_ctxHost.pClient,
    247254                               VBOX_SHARED_CLIPBOARD_HOST_MSG_FORMATS, 0);
    248     VBoxX11ClipboardRequestSyncX11();
     255    VBoxX11ClipboardRequestSyncX11(g_ctxHost.pBackend);
    249256
    250257    return VINF_SUCCESS;
     
    261268    RTSemMutexRequest(g_ctxHost.clipboardMutex, RT_INDEFINITE_WAIT);
    262269    g_ctxHost.pClient = NULL;
    263     VBoxX11ClipboardStopX11();
     270    VBoxX11ClipboardStopX11(g_ctxHost.pBackend);
    264271    RTSemMutexRelease(g_ctxHost.clipboardMutex);
    265272}
     
    274281void vboxClipboardFormatAnnounce (VBOXCLIPBOARDCLIENTDATA *pClient, uint32_t u32Formats)
    275282{
    276     VBoxX11ClipboardAnnounceVBoxFormat (u32Formats);
     283    VBoxX11ClipboardAnnounceVBoxFormat (g_ctxHost.pBackend, u32Formats);
    277284}
    278285
     
    302309    request.cb = cb;
    303310    request.pcbActual = pcbActual;
    304     rc = VBoxX11ClipboardReadX11Data(u32Format, &request);
     311    rc = VBoxX11ClipboardReadX11Data(g_ctxHost.pBackend, u32Format, &request);
    305312    g_ctxHost.waiter = NONE;
    306313    return rc;
     
    316323 * @note   Host glue code
    317324 */
    318 void vboxClipboardWriteData (VBOXCLIPBOARDCLIENTDATA *pClient, void *pv, uint32_t cb, uint32_t u32Format)
     325void vboxClipboardWriteData (VBOXCLIPBOARDCLIENTDATA *pClient,
     326                             void *pv, uint32_t cb, uint32_t u32Format)
    319327{
    320328/* Assume that if this gets called at all then the X11 backend is running. */
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