b26977a29bd8af11e3059ef8fb47a92a1241f20dvboxsync/** @file
7420e5ee5565b181c144eabb14da0da9e8cce657vboxsync * Shared Clipboard - Common Guest and Host Code.
b26977a29bd8af11e3059ef8fb47a92a1241f20dvboxsync */
b26977a29bd8af11e3059ef8fb47a92a1241f20dvboxsync
b26977a29bd8af11e3059ef8fb47a92a1241f20dvboxsync/*
7420e5ee5565b181c144eabb14da0da9e8cce657vboxsync * Copyright (C) 2006-2011 Oracle Corporation
b26977a29bd8af11e3059ef8fb47a92a1241f20dvboxsync *
b26977a29bd8af11e3059ef8fb47a92a1241f20dvboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
b26977a29bd8af11e3059ef8fb47a92a1241f20dvboxsync * available from http://www.virtualbox.org. This file is free software;
b26977a29bd8af11e3059ef8fb47a92a1241f20dvboxsync * you can redistribute it and/or modify it under the terms of the GNU
b26977a29bd8af11e3059ef8fb47a92a1241f20dvboxsync * General Public License (GPL) as published by the Free Software
b26977a29bd8af11e3059ef8fb47a92a1241f20dvboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
b26977a29bd8af11e3059ef8fb47a92a1241f20dvboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
b26977a29bd8af11e3059ef8fb47a92a1241f20dvboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
b26977a29bd8af11e3059ef8fb47a92a1241f20dvboxsync *
e5501b5897a4a5958157bed31ee5647cfa770333vboxsync * The contents of this file may alternatively be used under the terms
e5501b5897a4a5958157bed31ee5647cfa770333vboxsync * of the Common Development and Distribution License Version 1.0
e5501b5897a4a5958157bed31ee5647cfa770333vboxsync * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
e5501b5897a4a5958157bed31ee5647cfa770333vboxsync * VirtualBox OSE distribution, in which case the provisions of the
e5501b5897a4a5958157bed31ee5647cfa770333vboxsync * CDDL are applicable instead of those of the GPL.
e5501b5897a4a5958157bed31ee5647cfa770333vboxsync *
e5501b5897a4a5958157bed31ee5647cfa770333vboxsync * You may elect to license modified versions of this file under the
e5501b5897a4a5958157bed31ee5647cfa770333vboxsync * terms and conditions of either the GPL or the CDDL or both.
b26977a29bd8af11e3059ef8fb47a92a1241f20dvboxsync */
b26977a29bd8af11e3059ef8fb47a92a1241f20dvboxsync
7420e5ee5565b181c144eabb14da0da9e8cce657vboxsync#ifndef ___VBox_GuestHost_SharedClipboard_h
7420e5ee5565b181c144eabb14da0da9e8cce657vboxsync#define ___VBox_GuestHost_SharedClipboard_h
b26977a29bd8af11e3059ef8fb47a92a1241f20dvboxsync
b26977a29bd8af11e3059ef8fb47a92a1241f20dvboxsync#include <iprt/cdefs.h>
b26977a29bd8af11e3059ef8fb47a92a1241f20dvboxsync#include <iprt/types.h>
b26977a29bd8af11e3059ef8fb47a92a1241f20dvboxsync
7420e5ee5565b181c144eabb14da0da9e8cce657vboxsyncenum
7420e5ee5565b181c144eabb14da0da9e8cce657vboxsync{
b26977a29bd8af11e3059ef8fb47a92a1241f20dvboxsync /** The number of milliseconds before the clipboard times out. */
8a0ee4ffcd453884e357b4d5984ae3b7146abb6fvboxsync#ifndef TESTCASE
289fdd35bf70c71ed32075f45c3af244431ffa71vboxsync CLIPBOARD_TIMEOUT = 5000
8a0ee4ffcd453884e357b4d5984ae3b7146abb6fvboxsync#else
8a0ee4ffcd453884e357b4d5984ae3b7146abb6fvboxsync CLIPBOARD_TIMEOUT = 1
8a0ee4ffcd453884e357b4d5984ae3b7146abb6fvboxsync#endif
b26977a29bd8af11e3059ef8fb47a92a1241f20dvboxsync};
b26977a29bd8af11e3059ef8fb47a92a1241f20dvboxsync
3226d4d605c81794a1e11ee873dfbe83e1033c05vboxsync/** Opaque data structure for the X11/VBox frontend/glue code. */
b26977a29bd8af11e3059ef8fb47a92a1241f20dvboxsyncstruct _VBOXCLIPBOARDCONTEXT;
b26977a29bd8af11e3059ef8fb47a92a1241f20dvboxsynctypedef struct _VBOXCLIPBOARDCONTEXT VBOXCLIPBOARDCONTEXT;
b26977a29bd8af11e3059ef8fb47a92a1241f20dvboxsync
3226d4d605c81794a1e11ee873dfbe83e1033c05vboxsync/** Opaque data structure for the X11/VBox backend code. */
2feb1c8e55e737875aba0cfd07e4bd5544621c7bvboxsyncstruct _CLIPBACKEND;
2feb1c8e55e737875aba0cfd07e4bd5544621c7bvboxsynctypedef struct _CLIPBACKEND CLIPBACKEND;
3226d4d605c81794a1e11ee873dfbe83e1033c05vboxsync
7420e5ee5565b181c144eabb14da0da9e8cce657vboxsync/** Opaque request structure for clipboard data.
7420e5ee5565b181c144eabb14da0da9e8cce657vboxsync * @todo All use of single and double underscore prefixes is banned! */
0c9a567f96569cf5db84e72ccf1ce8d3d21363c6vboxsyncstruct _CLIPREADCBREQ;
0c9a567f96569cf5db84e72ccf1ce8d3d21363c6vboxsynctypedef struct _CLIPREADCBREQ CLIPREADCBREQ;
0c9a567f96569cf5db84e72ccf1ce8d3d21363c6vboxsync
b26977a29bd8af11e3059ef8fb47a92a1241f20dvboxsync/* APIs exported by the X11 backend */
fa995cb0311abdf0d0995b668120baf9dd31aa97vboxsyncextern CLIPBACKEND *ClipConstructX11(VBOXCLIPBOARDCONTEXT *pFrontend, bool fHeadless);
8a0ee4ffcd453884e357b4d5984ae3b7146abb6fvboxsyncextern void ClipDestructX11(CLIPBACKEND *pBackend);
7420e5ee5565b181c144eabb14da0da9e8cce657vboxsync#ifdef __cplusplus
ba820dc19180b3240c3c37b6001d3e6173ab22c5vboxsyncextern int ClipStartX11(CLIPBACKEND *pBackend, bool grab = false);
7420e5ee5565b181c144eabb14da0da9e8cce657vboxsync#else
7420e5ee5565b181c144eabb14da0da9e8cce657vboxsyncextern int ClipStartX11(CLIPBACKEND *pBackend, bool grab);
7420e5ee5565b181c144eabb14da0da9e8cce657vboxsync#endif
8a0ee4ffcd453884e357b4d5984ae3b7146abb6fvboxsyncextern int ClipStopX11(CLIPBACKEND *pBackend);
8a0ee4ffcd453884e357b4d5984ae3b7146abb6fvboxsyncextern void ClipAnnounceFormatToX11(CLIPBACKEND *pBackend,
8a0ee4ffcd453884e357b4d5984ae3b7146abb6fvboxsync uint32_t u32Formats);
8a0ee4ffcd453884e357b4d5984ae3b7146abb6fvboxsyncextern int ClipRequestDataFromX11(CLIPBACKEND *pBackend, uint32_t u32Format,
0c9a567f96569cf5db84e72ccf1ce8d3d21363c6vboxsync CLIPREADCBREQ *pReq);
b26977a29bd8af11e3059ef8fb47a92a1241f20dvboxsync
b26977a29bd8af11e3059ef8fb47a92a1241f20dvboxsync/* APIs exported by the X11/VBox frontend */
8a0ee4ffcd453884e357b4d5984ae3b7146abb6fvboxsyncextern int ClipRequestDataForX11(VBOXCLIPBOARDCONTEXT *pCtx,
0c9a567f96569cf5db84e72ccf1ce8d3d21363c6vboxsync uint32_t u32Format, void **ppv,
0c9a567f96569cf5db84e72ccf1ce8d3d21363c6vboxsync uint32_t *pcb);
8a0ee4ffcd453884e357b4d5984ae3b7146abb6fvboxsyncextern void ClipReportX11Formats(VBOXCLIPBOARDCONTEXT *pCtx,
7420e5ee5565b181c144eabb14da0da9e8cce657vboxsync uint32_t u32Formats);
b4125206636c650121449eb57dc4384de21e00d6vboxsyncextern void ClipCompleteDataRequestFromX11(VBOXCLIPBOARDCONTEXT *pCtx, int rc,
0c9a567f96569cf5db84e72ccf1ce8d3d21363c6vboxsync CLIPREADCBREQ *pReq, void *pv,
0c9a567f96569cf5db84e72ccf1ce8d3d21363c6vboxsync uint32_t cb);
7420e5ee5565b181c144eabb14da0da9e8cce657vboxsync#endif
7420e5ee5565b181c144eabb14da0da9e8cce657vboxsync