SharedClipboard.h revision c4e3ff6a6b0826e8ec2d19bfc24bf882f4d4813c
bbfc28b1a00ce00001b2ead074d47254bec3e5cfvboxsync/** @file
9f30b2a88d1c4a96e076a38bdebb87029e91cde7vboxsync *
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync * Shared Clipboard
4684442a126edc2c340731e8fee74714f195bc77vboxsync */
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync
2bee0b79c44fdd60aa91125cee31467b4300234avboxsync/*
b918a7b5e159df188e876b8aef5f971222485c64vboxsync * Copyright (C) 2006-2007 Sun Microsystems, Inc.
54259e443abcd8197f7c3158bb7f69457ca1d1davboxsync *
b918a7b5e159df188e876b8aef5f971222485c64vboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
b918a7b5e159df188e876b8aef5f971222485c64vboxsync * available from http://www.virtualbox.org. This file is free software;
2581ea3f1f32d09a6e2d443661ed4b01e40bfefavboxsync * you can redistribute it and/or modify it under the terms of the GNU
b918a7b5e159df188e876b8aef5f971222485c64vboxsync * General Public License (GPL) as published by the Free Software
d0ce2837ba92386abdaaa79d6176853ccf959a2fvboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
c7267e77a1f8b99136cc3dd57f7c381103edc4e5vboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
bbfc28b1a00ce00001b2ead074d47254bec3e5cfvboxsync *
9d473abea9a9b6597b2b20bedc950ba33a2e73a5vboxsync * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
9d473abea9a9b6597b2b20bedc950ba33a2e73a5vboxsync * Clara, CA 95054 USA or visit http://www.sun.com if you need
7e958a4329e4f9d83f597e26c72121969091e87bvboxsync * additional information or have any questions.
6b13ec38bf7e2771e85570c32ec64c3f9c9105a9vboxsync */
6b13ec38bf7e2771e85570c32ec64c3f9c9105a9vboxsync
01841c69bef459b750890a41141d55401d92f5d4vboxsync#ifndef ___GUESTHOST_VBOXCLIPBOARD__H
0887a65d2e1f7d938381bed11e859caed56cb47evboxsync#define ___GUESTHOST_VBOXCLIPBOARD__H
9d473abea9a9b6597b2b20bedc950ba33a2e73a5vboxsync
9d473abea9a9b6597b2b20bedc950ba33a2e73a5vboxsync#include <iprt/cdefs.h>
9d473abea9a9b6597b2b20bedc950ba33a2e73a5vboxsync#include <iprt/types.h>
9d473abea9a9b6597b2b20bedc950ba33a2e73a5vboxsync
9d473abea9a9b6597b2b20bedc950ba33a2e73a5vboxsyncenum {
c7267e77a1f8b99136cc3dd57f7c381103edc4e5vboxsync /** The number of milliseconds before the clipboard times out. */
bbfc28b1a00ce00001b2ead074d47254bec3e5cfvboxsync CLIPBOARDTIMEOUT = 5000
bbfc28b1a00ce00001b2ead074d47254bec3e5cfvboxsync};
bbfc28b1a00ce00001b2ead074d47254bec3e5cfvboxsync
104ee9b130538e40654d7732282799493cdd5e7dvboxsync/** Opaque data structure for the X11/VBox frontend/glue code. */
0887a65d2e1f7d938381bed11e859caed56cb47evboxsyncstruct _VBOXCLIPBOARDCONTEXT;
bbfc28b1a00ce00001b2ead074d47254bec3e5cfvboxsynctypedef struct _VBOXCLIPBOARDCONTEXT VBOXCLIPBOARDCONTEXT;
bbfc28b1a00ce00001b2ead074d47254bec3e5cfvboxsync
bbfc28b1a00ce00001b2ead074d47254bec3e5cfvboxsync/** Opaque data structure for the X11/VBox backend code. */
bbfc28b1a00ce00001b2ead074d47254bec3e5cfvboxsyncstruct _VBOXCLIPBOARDCONTEXTX11;
bbfc28b1a00ce00001b2ead074d47254bec3e5cfvboxsynctypedef struct _VBOXCLIPBOARDCONTEXTX11 VBOXCLIPBOARDCONTEXTX11;
bbfc28b1a00ce00001b2ead074d47254bec3e5cfvboxsync
bbfc28b1a00ce00001b2ead074d47254bec3e5cfvboxsync/** Does X11 or VBox currently own the clipboard? */
enum g_eOwner { NONE = 0, X11, VB };
/** A structure containing information about where to store a request
* for the X11 clipboard contents. */
struct _VBOXCLIPBOARDREQUEST
{
/** The buffer to write X11 clipboard data to (valid during a request
* for the clipboard contents) */
void *pv;
/** The size of the buffer to write X11 clipboard data to (valid during
* a request for the clipboard contents) */
unsigned cb;
/** The size of the X11 clipboard data written to the buffer (valid
* during a request for the clipboard contents) */
uint32_t *pcbActual;
/** The clipboard context this request is associated with */
VBOXCLIPBOARDCONTEXTX11 *pCtx;
};
typedef struct _VBOXCLIPBOARDREQUEST VBOXCLIPBOARDREQUEST;
/* APIs exported by the X11 backend */
extern int VBoxX11ClipboardInitX11(VBOXCLIPBOARDCONTEXT *pFrontend,
VBOXCLIPBOARDCONTEXTX11 **ppBackend);
extern int VBoxX11ClipboardTermX11(VBOXCLIPBOARDCONTEXTX11 *pBackend);
extern int VBoxX11ClipboardStartX11(VBOXCLIPBOARDCONTEXTX11 *pBackend,
enum g_eOwner owner);
extern void VBoxX11ClipboardRequestSyncX11(VBOXCLIPBOARDCONTEXTX11 *pBackend);
extern void VBoxX11ClipboardStopX11(VBOXCLIPBOARDCONTEXTX11 *pBackend);
extern void VBoxX11ClipboardAnnounceVBoxFormat(VBOXCLIPBOARDCONTEXTX11
*pBackend, uint32_t u32Formats);
extern int VBoxX11ClipboardReadX11Data(VBOXCLIPBOARDCONTEXTX11 *pBackend,
uint32_t u32Format,
VBOXCLIPBOARDREQUEST *pRequest);
/* APIs exported by the X11/VBox frontend */
extern int VBoxX11ClipboardReadVBoxData(VBOXCLIPBOARDCONTEXT *pCtx,
uint32_t u32Format, void **ppv,
uint32_t *pcb);
extern void VBoxX11ClipboardReportX11Formats(VBOXCLIPBOARDCONTEXT *pCtx,
uint32_t u32Formats);
#endif /* ___GUESTHOST_VBOXCLIPBOARD__H */