VirtualBox

Changeset 101680 in vbox


Ignore:
Timestamp:
Oct 31, 2023 11:51:23 AM (15 months ago)
Author:
vboxsync
Message:

Additions: X11/Wayland: Add common code for clipboard processing, bugref:10194.

Location:
trunk/src/VBox/Additions/x11/VBoxClient
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/x11/VBoxClient/clipboard.h

    r100272 r101680  
    3232#endif
    3333
     34#include <VBox/GuestHost/SharedClipboard-x11.h>
     35#include <VBox/VBoxGuestLib.h>
     36#include <iprt/thread.h>
     37
     38/**
     39 * Callback to notify guest that host has new clipboard data in the specified formats.
     40 *
     41 * @returns VBox status code.
     42 * @param   fFormats        The formats available.
     43 *                          Optional and can be NULL.
     44 */
     45typedef DECLCALLBACKTYPE(int, FNHOSTCLIPREPORTFMTS, (SHCLFORMATS fFormats));
     46typedef FNHOSTCLIPREPORTFMTS *PFNHOSTCLIPREPORTFMTS;
     47
     48/**
     49 * Callback to notify guest that host wants to read clipboard data in specified format.
     50 *
     51 * @returns VBox status code.
     52 * @param   uFmt            The format in which the data should be read
     53 *                          (VBOX_SHCL_FMT_XXX).
     54 */
     55typedef DECLCALLBACKTYPE(int, FNHOSTCLIPREAD, (SHCLFORMAT uFmt));
     56typedef FNHOSTCLIPREAD *PFNHOSTCLIPREAD;
     57
     58
    3459/**
    3560 * Struct keeping am X11 Shared Clipboard context.
     
    5883extern SHCLCONTEXT g_Ctx;
    5984
     85/**
     86 * Create thread and wait until it started.
     87 *
     88 * @returns IPRT status code.
     89 * @param   pThread     Pointer to thread data.
     90 * @param   pfnThread   Pointer to thread main loop function.
     91 * @param   pszName     Thread name.
     92 * @param   pvUser      User data.
     93 */
     94extern RTDECL(int) VBClClipboardThreadStart(PRTTHREAD pThread, PFNRTTHREAD pfnThread, const char *pszName, void *pvUser);
     95
     96/**
     97 * Read and process one event from the host clipboard service.
     98 *
     99 * @returns VBox status code.
     100 * @param   pCtx            Host Shared Clipboard service connection context.
     101 * @param   ppfnCallbacks   Callbacks to reach guest Shared Clipboard service.
     102 */
     103extern RTDECL(int) VBClClipboardReadHostEvent(PSHCLCONTEXT pCtx, const PFNHOSTCLIPREPORTFMTS pfnReportHostFmts,
     104                                              const PFNHOSTCLIPREAD pfnReadGuestFmt);
     105
     106/**
     107 * Read entire host clipboard buffer in given format.
     108 *
     109 * This function will allocate clipboard buffer of necessary size and
     110 * place host clipboard content into it. Buffer needs to be freed by caller.
     111 *
     112 * @returns VBox status code.
     113 * @param   pCtx            Host Shared Clipboard service connection context.
     114 * @param   ppfnCallbacks   Callbacks to reach guest Shared Clipboard service.
     115 */
     116extern RTDECL(int) VBClClipboardReadHostClipboard(PVBGLR3SHCLCMDCTX pCtx, SHCLFORMAT uFmt, void **ppv, uint32_t *pcb);
     117
    60118#endif /* !GA_INCLUDED_SRC_x11_VBoxClient_clipboard_h */
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