1 | /** @file
|
---|
2 | *
|
---|
3 | * Shared Clipboard
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2006-2007 Oracle Corporation
|
---|
8 | *
|
---|
9 | * This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
10 | * available from http://www.virtualbox.org. This file is free software;
|
---|
11 | * you can redistribute it and/or modify it under the terms of the GNU
|
---|
12 | * General Public License (GPL) as published by the Free Software
|
---|
13 | * Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
14 | * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
15 | * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
16 | */
|
---|
17 |
|
---|
18 | #ifndef __VBOXCLIPBOARD__H
|
---|
19 | #define __VBOXCLIPBOARD__H
|
---|
20 |
|
---|
21 | #define LOG_GROUP LOG_GROUP_SHARED_CLIPBOARD
|
---|
22 | #include <VBox/log.h>
|
---|
23 |
|
---|
24 | struct _VBOXCLIPBOARDCONTEXT;
|
---|
25 | typedef struct _VBOXCLIPBOARDCONTEXT VBOXCLIPBOARDCONTEXT;
|
---|
26 |
|
---|
27 |
|
---|
28 | typedef struct _VBOXCLIPBOARDCLIENTDATA
|
---|
29 | {
|
---|
30 | struct _VBOXCLIPBOARDCLIENTDATA *pNext;
|
---|
31 | struct _VBOXCLIPBOARDCLIENTDATA *pPrev;
|
---|
32 |
|
---|
33 | VBOXCLIPBOARDCONTEXT *pCtx;
|
---|
34 |
|
---|
35 | uint32_t u32ClientID;
|
---|
36 |
|
---|
37 | bool fAsync; /* Guest is waiting for a message. */
|
---|
38 | bool fReadPending; /* The guest is waiting for data from the host */
|
---|
39 |
|
---|
40 | bool fMsgQuit;
|
---|
41 | bool fMsgReadData;
|
---|
42 | bool fMsgFormats;
|
---|
43 |
|
---|
44 | struct {
|
---|
45 | VBOXHGCMCALLHANDLE callHandle;
|
---|
46 | VBOXHGCMSVCPARM *paParms;
|
---|
47 | } async;
|
---|
48 |
|
---|
49 | struct {
|
---|
50 | VBOXHGCMCALLHANDLE callHandle;
|
---|
51 | VBOXHGCMSVCPARM *paParms;
|
---|
52 | } asyncRead;
|
---|
53 |
|
---|
54 | struct {
|
---|
55 | void *pv;
|
---|
56 | uint32_t cb;
|
---|
57 | uint32_t u32Format;
|
---|
58 | } data;
|
---|
59 |
|
---|
60 | uint32_t u32AvailableFormats;
|
---|
61 | uint32_t u32RequestedFormat;
|
---|
62 |
|
---|
63 | } VBOXCLIPBOARDCLIENTDATA;
|
---|
64 |
|
---|
65 | /*
|
---|
66 | * The service functions. Locking is between the service thread and the platform dependent windows thread.
|
---|
67 | */
|
---|
68 | bool vboxSvcClipboardLock (void);
|
---|
69 | void vboxSvcClipboardUnlock (void);
|
---|
70 |
|
---|
71 | void vboxSvcClipboardReportMsg (VBOXCLIPBOARDCLIENTDATA *pClient, uint32_t u32Msg, uint32_t u32Formats);
|
---|
72 |
|
---|
73 | void vboxSvcClipboardCompleteReadData(VBOXCLIPBOARDCLIENTDATA *pClient, int rc, uint32_t cbActual);
|
---|
74 |
|
---|
75 |
|
---|
76 | /*
|
---|
77 | * Platform dependent functions.
|
---|
78 | */
|
---|
79 | int vboxClipboardInit (void);
|
---|
80 | void vboxClipboardDestroy (void);
|
---|
81 |
|
---|
82 | int vboxClipboardConnect (VBOXCLIPBOARDCLIENTDATA *pClient);
|
---|
83 | void vboxClipboardDisconnect (VBOXCLIPBOARDCLIENTDATA *pClient);
|
---|
84 |
|
---|
85 | void vboxClipboardFormatAnnounce (VBOXCLIPBOARDCLIENTDATA *pClient, uint32_t u32Formats);
|
---|
86 |
|
---|
87 | int vboxClipboardReadData (VBOXCLIPBOARDCLIENTDATA *pClient, uint32_t u32Format, void *pv, uint32_t cb, uint32_t *pcbActual);
|
---|
88 |
|
---|
89 | void vboxClipboardWriteData (VBOXCLIPBOARDCLIENTDATA *pClient, void *pv, uint32_t cb, uint32_t u32Format);
|
---|
90 |
|
---|
91 | int vboxClipboardSync (VBOXCLIPBOARDCLIENTDATA *pClient);
|
---|
92 |
|
---|
93 | #endif /* __VBOXCLIPBOARD__H */
|
---|