1 | /** @file
|
---|
2 | *
|
---|
3 | * Shared Clipboard
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2006-2007 innotek GmbH
|
---|
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_HGCM
|
---|
22 | #include <VBox/log.h>
|
---|
23 |
|
---|
24 | enum {
|
---|
25 | /** The number of milliseconds before the clipboard times out. */
|
---|
26 | CLIPBOARDTIMEOUT = 2000
|
---|
27 | };
|
---|
28 |
|
---|
29 | struct _VBOXCLIPBOARDCONTEXT;
|
---|
30 | typedef struct _VBOXCLIPBOARDCONTEXT VBOXCLIPBOARDCONTEXT;
|
---|
31 |
|
---|
32 |
|
---|
33 | typedef struct _VBOXCLIPBOARDCLIENTDATA
|
---|
34 | {
|
---|
35 | struct _VBOXCLIPBOARDCLIENTDATA *pNext;
|
---|
36 | struct _VBOXCLIPBOARDCLIENTDATA *pPrev;
|
---|
37 |
|
---|
38 | VBOXCLIPBOARDCONTEXT *pCtx;
|
---|
39 |
|
---|
40 | uint32_t u32ClientID;
|
---|
41 |
|
---|
42 | bool fAsync: 1; /* Guest is waiting for a message. */
|
---|
43 |
|
---|
44 | bool fMsgQuit: 1;
|
---|
45 | bool fMsgReadData: 1;
|
---|
46 | bool fMsgFormats: 1;
|
---|
47 |
|
---|
48 | struct {
|
---|
49 | VBOXHGCMCALLHANDLE callHandle;
|
---|
50 | VBOXHGCMSVCPARM *paParms;
|
---|
51 | } async;
|
---|
52 |
|
---|
53 | struct {
|
---|
54 | void *pv;
|
---|
55 | uint32_t cb;
|
---|
56 | uint32_t u32Format;
|
---|
57 | } data;
|
---|
58 |
|
---|
59 | uint32_t u32AvailableFormats;
|
---|
60 | uint32_t u32RequestedFormat;
|
---|
61 |
|
---|
62 | } VBOXCLIPBOARDCLIENTDATA;
|
---|
63 |
|
---|
64 | /*
|
---|
65 | * The service functions. Locking is between the service thread and the platform dependent windows thread.
|
---|
66 | */
|
---|
67 | bool vboxSvcClipboardLock (void);
|
---|
68 | void vboxSvcClipboardUnlock (void);
|
---|
69 |
|
---|
70 | void vboxSvcClipboardReportMsg (VBOXCLIPBOARDCLIENTDATA *pClient, uint32_t u32Msg, uint32_t u32Formats);
|
---|
71 |
|
---|
72 |
|
---|
73 | /*
|
---|
74 | * Platform dependent functions.
|
---|
75 | */
|
---|
76 | int vboxClipboardInit (void);
|
---|
77 | void vboxClipboardDestroy (void);
|
---|
78 |
|
---|
79 | int vboxClipboardConnect (VBOXCLIPBOARDCLIENTDATA *pClient);
|
---|
80 | void vboxClipboardDisconnect (VBOXCLIPBOARDCLIENTDATA *pClient);
|
---|
81 |
|
---|
82 | void vboxClipboardFormatAnnounce (VBOXCLIPBOARDCLIENTDATA *pClient, uint32_t u32Formats);
|
---|
83 |
|
---|
84 | int vboxClipboardReadData (VBOXCLIPBOARDCLIENTDATA *pClient, uint32_t u32Format, void *pv, uint32_t cb, uint32_t *pcbActual);
|
---|
85 |
|
---|
86 | void vboxClipboardWriteData (VBOXCLIPBOARDCLIENTDATA *pClient, void *pv, uint32_t cb, uint32_t u32Format);
|
---|
87 |
|
---|
88 | int vboxClipboardSync (VBOXCLIPBOARDCLIENTDATA *pClient);
|
---|
89 |
|
---|
90 | #endif /* __VBOXCLIPBOARD__H */
|
---|