VBoxClipboard.h revision 68e0f2909a5fe490fd5c33346b911815ca5b02a5
7b57f6ec6175ce1ee53e1ea49c24ff06f3723379vboxsync/** @file
7b57f6ec6175ce1ee53e1ea49c24ff06f3723379vboxsync *
7b57f6ec6175ce1ee53e1ea49c24ff06f3723379vboxsync * Shared Clipboard
7b57f6ec6175ce1ee53e1ea49c24ff06f3723379vboxsync */
7b57f6ec6175ce1ee53e1ea49c24ff06f3723379vboxsync
7b57f6ec6175ce1ee53e1ea49c24ff06f3723379vboxsync/*
c58f1213e628a545081c70e26c6b67a841cff880vboxsync * Copyright (C) 2006-2007 Sun Microsystems, Inc.
7b57f6ec6175ce1ee53e1ea49c24ff06f3723379vboxsync *
7b57f6ec6175ce1ee53e1ea49c24ff06f3723379vboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
7b57f6ec6175ce1ee53e1ea49c24ff06f3723379vboxsync * available from http://www.virtualbox.org. This file is free software;
7b57f6ec6175ce1ee53e1ea49c24ff06f3723379vboxsync * you can redistribute it and/or modify it under the terms of the GNU
7b57f6ec6175ce1ee53e1ea49c24ff06f3723379vboxsync * General Public License (GPL) as published by the Free Software
7b57f6ec6175ce1ee53e1ea49c24ff06f3723379vboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
7b57f6ec6175ce1ee53e1ea49c24ff06f3723379vboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
7b57f6ec6175ce1ee53e1ea49c24ff06f3723379vboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
7b57f6ec6175ce1ee53e1ea49c24ff06f3723379vboxsync *
7b57f6ec6175ce1ee53e1ea49c24ff06f3723379vboxsync * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
7b57f6ec6175ce1ee53e1ea49c24ff06f3723379vboxsync * Clara, CA 95054 USA or visit http://www.sun.com if you need
7b57f6ec6175ce1ee53e1ea49c24ff06f3723379vboxsync * additional information or have any questions.
7b57f6ec6175ce1ee53e1ea49c24ff06f3723379vboxsync */
7b57f6ec6175ce1ee53e1ea49c24ff06f3723379vboxsync
7b57f6ec6175ce1ee53e1ea49c24ff06f3723379vboxsync#ifndef __VBOXCLIPBOARD__H
367dfc76faea958fa6765efde770d4cc30f51295vboxsync#define __VBOXCLIPBOARD__H
367dfc76faea958fa6765efde770d4cc30f51295vboxsync
367dfc76faea958fa6765efde770d4cc30f51295vboxsync#define LOG_GROUP LOG_GROUP_HGCM
7b57f6ec6175ce1ee53e1ea49c24ff06f3723379vboxsync#include <VBox/log.h>
83c0ea1a66c25cde355b1f784bebe75928012d83vboxsync
83c0ea1a66c25cde355b1f784bebe75928012d83vboxsyncstruct _VBOXCLIPBOARDCONTEXT;
7b57f6ec6175ce1ee53e1ea49c24ff06f3723379vboxsynctypedef struct _VBOXCLIPBOARDCONTEXT VBOXCLIPBOARDCONTEXT;
ba6206b9b2f863489c4b95178af0dbda929f6cc1vboxsync
ba6206b9b2f863489c4b95178af0dbda929f6cc1vboxsync
7b57f6ec6175ce1ee53e1ea49c24ff06f3723379vboxsynctypedef struct _VBOXCLIPBOARDCLIENTDATA
7b57f6ec6175ce1ee53e1ea49c24ff06f3723379vboxsync{
7b57f6ec6175ce1ee53e1ea49c24ff06f3723379vboxsync struct _VBOXCLIPBOARDCLIENTDATA *pNext;
7b57f6ec6175ce1ee53e1ea49c24ff06f3723379vboxsync struct _VBOXCLIPBOARDCLIENTDATA *pPrev;
7b57f6ec6175ce1ee53e1ea49c24ff06f3723379vboxsync
7b57f6ec6175ce1ee53e1ea49c24ff06f3723379vboxsync VBOXCLIPBOARDCONTEXT *pCtx;
7b57f6ec6175ce1ee53e1ea49c24ff06f3723379vboxsync
7b57f6ec6175ce1ee53e1ea49c24ff06f3723379vboxsync uint32_t u32ClientID;
7b57f6ec6175ce1ee53e1ea49c24ff06f3723379vboxsync
7b57f6ec6175ce1ee53e1ea49c24ff06f3723379vboxsync bool fAsync: 1; /* Guest is waiting for a message. */
7b57f6ec6175ce1ee53e1ea49c24ff06f3723379vboxsync
7b57f6ec6175ce1ee53e1ea49c24ff06f3723379vboxsync bool fMsgQuit: 1;
7b57f6ec6175ce1ee53e1ea49c24ff06f3723379vboxsync bool fMsgReadData: 1;
7b57f6ec6175ce1ee53e1ea49c24ff06f3723379vboxsync bool fMsgFormats: 1;
7b57f6ec6175ce1ee53e1ea49c24ff06f3723379vboxsync
7b57f6ec6175ce1ee53e1ea49c24ff06f3723379vboxsync struct {
7b57f6ec6175ce1ee53e1ea49c24ff06f3723379vboxsync VBOXHGCMCALLHANDLE callHandle;
7b57f6ec6175ce1ee53e1ea49c24ff06f3723379vboxsync VBOXHGCMSVCPARM *paParms;
7b57f6ec6175ce1ee53e1ea49c24ff06f3723379vboxsync } async;
7b57f6ec6175ce1ee53e1ea49c24ff06f3723379vboxsync
7b57f6ec6175ce1ee53e1ea49c24ff06f3723379vboxsync struct {
7b57f6ec6175ce1ee53e1ea49c24ff06f3723379vboxsync void *pv;
7b57f6ec6175ce1ee53e1ea49c24ff06f3723379vboxsync uint32_t cb;
7b57f6ec6175ce1ee53e1ea49c24ff06f3723379vboxsync uint32_t u32Format;
7b57f6ec6175ce1ee53e1ea49c24ff06f3723379vboxsync } data;
7b57f6ec6175ce1ee53e1ea49c24ff06f3723379vboxsync
7b57f6ec6175ce1ee53e1ea49c24ff06f3723379vboxsync uint32_t u32AvailableFormats;
082180a39ac3c7041b0e7f70e77c735a55baec15vboxsync uint32_t u32RequestedFormat;
082180a39ac3c7041b0e7f70e77c735a55baec15vboxsync
082180a39ac3c7041b0e7f70e77c735a55baec15vboxsync} VBOXCLIPBOARDCLIENTDATA;
db328d9a0c557c268222858740db4860d4f22a95vboxsync
7b57f6ec6175ce1ee53e1ea49c24ff06f3723379vboxsync/*
db328d9a0c557c268222858740db4860d4f22a95vboxsync * The service functions. Locking is between the service thread and the platform dependent windows thread.
db328d9a0c557c268222858740db4860d4f22a95vboxsync */
db328d9a0c557c268222858740db4860d4f22a95vboxsyncbool vboxSvcClipboardLock (void);
db328d9a0c557c268222858740db4860d4f22a95vboxsyncvoid vboxSvcClipboardUnlock (void);
db328d9a0c557c268222858740db4860d4f22a95vboxsync
db328d9a0c557c268222858740db4860d4f22a95vboxsyncvoid vboxSvcClipboardReportMsg (VBOXCLIPBOARDCLIENTDATA *pClient, uint32_t u32Msg, uint32_t u32Formats);
db328d9a0c557c268222858740db4860d4f22a95vboxsync
db328d9a0c557c268222858740db4860d4f22a95vboxsync
db328d9a0c557c268222858740db4860d4f22a95vboxsync/*
db328d9a0c557c268222858740db4860d4f22a95vboxsync * Platform dependent functions.
db328d9a0c557c268222858740db4860d4f22a95vboxsync */
db328d9a0c557c268222858740db4860d4f22a95vboxsyncint vboxClipboardInit (void);
db328d9a0c557c268222858740db4860d4f22a95vboxsyncvoid vboxClipboardDestroy (void);
db328d9a0c557c268222858740db4860d4f22a95vboxsync
db328d9a0c557c268222858740db4860d4f22a95vboxsyncint vboxClipboardConnect (VBOXCLIPBOARDCLIENTDATA *pClient);
db328d9a0c557c268222858740db4860d4f22a95vboxsyncvoid vboxClipboardDisconnect (VBOXCLIPBOARDCLIENTDATA *pClient);
db328d9a0c557c268222858740db4860d4f22a95vboxsync
7b57f6ec6175ce1ee53e1ea49c24ff06f3723379vboxsyncvoid vboxClipboardFormatAnnounce (VBOXCLIPBOARDCLIENTDATA *pClient, uint32_t u32Formats);
7b57f6ec6175ce1ee53e1ea49c24ff06f3723379vboxsync
7b57f6ec6175ce1ee53e1ea49c24ff06f3723379vboxsyncint vboxClipboardReadData (VBOXCLIPBOARDCLIENTDATA *pClient, uint32_t u32Format, void *pv, uint32_t cb, uint32_t *pcbActual);
7b57f6ec6175ce1ee53e1ea49c24ff06f3723379vboxsync
7b57f6ec6175ce1ee53e1ea49c24ff06f3723379vboxsyncvoid vboxClipboardWriteData (VBOXCLIPBOARDCLIENTDATA *pClient, void *pv, uint32_t cb, uint32_t u32Format);
7b57f6ec6175ce1ee53e1ea49c24ff06f3723379vboxsync
7b57f6ec6175ce1ee53e1ea49c24ff06f3723379vboxsyncint vboxClipboardSync (VBOXCLIPBOARDCLIENTDATA *pClient);
7b57f6ec6175ce1ee53e1ea49c24ff06f3723379vboxsync
7b57f6ec6175ce1ee53e1ea49c24ff06f3723379vboxsync#endif /* __VBOXCLIPBOARD__H */
7b57f6ec6175ce1ee53e1ea49c24ff06f3723379vboxsync