1 | /* $Id: VBoxClipboard.h 76570 2019-01-01 04:36:36Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * Shared Clipboard Service - Internal Header.
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2006-2019 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 VBOX_INCLUDED_SRC_SharedClipboard_VBoxClipboard_h
|
---|
19 | #define VBOX_INCLUDED_SRC_SharedClipboard_VBoxClipboard_h
|
---|
20 | #ifndef RT_WITHOUT_PRAGMA_ONCE
|
---|
21 | # pragma once
|
---|
22 | #endif
|
---|
23 |
|
---|
24 | #include <VBox/hgcmsvc.h>
|
---|
25 | #include <VBox/log.h>
|
---|
26 |
|
---|
27 | struct _VBOXCLIPBOARDCONTEXT;
|
---|
28 | typedef struct _VBOXCLIPBOARDCONTEXT VBOXCLIPBOARDCONTEXT;
|
---|
29 |
|
---|
30 |
|
---|
31 | typedef struct _VBOXCLIPBOARDCLIENTDATA
|
---|
32 | {
|
---|
33 | struct _VBOXCLIPBOARDCLIENTDATA *pNext;
|
---|
34 | struct _VBOXCLIPBOARDCLIENTDATA *pPrev;
|
---|
35 |
|
---|
36 | VBOXCLIPBOARDCONTEXT *pCtx;
|
---|
37 |
|
---|
38 | uint32_t u32ClientID;
|
---|
39 |
|
---|
40 | bool fAsync; /* Guest is waiting for a message. */
|
---|
41 | bool fReadPending; /* The guest is waiting for data from the host */
|
---|
42 |
|
---|
43 | bool fMsgQuit;
|
---|
44 | bool fMsgReadData;
|
---|
45 | bool fMsgFormats;
|
---|
46 |
|
---|
47 | struct {
|
---|
48 | VBOXHGCMCALLHANDLE callHandle;
|
---|
49 | VBOXHGCMSVCPARM *paParms;
|
---|
50 | } async;
|
---|
51 |
|
---|
52 | struct {
|
---|
53 | VBOXHGCMCALLHANDLE callHandle;
|
---|
54 | VBOXHGCMSVCPARM *paParms;
|
---|
55 | } asyncRead;
|
---|
56 |
|
---|
57 | struct {
|
---|
58 | void *pv;
|
---|
59 | uint32_t cb;
|
---|
60 | uint32_t u32Format;
|
---|
61 | } data;
|
---|
62 |
|
---|
63 | uint32_t u32AvailableFormats;
|
---|
64 | uint32_t u32RequestedFormat;
|
---|
65 |
|
---|
66 | } VBOXCLIPBOARDCLIENTDATA;
|
---|
67 |
|
---|
68 | /*
|
---|
69 | * The service functions. Locking is between the service thread and the platform dependent windows thread.
|
---|
70 | */
|
---|
71 | bool vboxSvcClipboardLock (void);
|
---|
72 | void vboxSvcClipboardUnlock (void);
|
---|
73 |
|
---|
74 | void vboxSvcClipboardReportMsg (VBOXCLIPBOARDCLIENTDATA *pClient, uint32_t u32Msg, uint32_t u32Formats);
|
---|
75 |
|
---|
76 | void vboxSvcClipboardCompleteReadData(VBOXCLIPBOARDCLIENTDATA *pClient, int rc, uint32_t cbActual);
|
---|
77 |
|
---|
78 | bool vboxSvcClipboardGetHeadless(void);
|
---|
79 |
|
---|
80 | /*
|
---|
81 | * Platform dependent functions.
|
---|
82 | */
|
---|
83 | int vboxClipboardInit (void);
|
---|
84 | void vboxClipboardDestroy (void);
|
---|
85 |
|
---|
86 | int vboxClipboardConnect (VBOXCLIPBOARDCLIENTDATA *pClient, bool fHeadless);
|
---|
87 | void vboxClipboardDisconnect (VBOXCLIPBOARDCLIENTDATA *pClient);
|
---|
88 |
|
---|
89 | void vboxClipboardFormatAnnounce (VBOXCLIPBOARDCLIENTDATA *pClient, uint32_t u32Formats);
|
---|
90 |
|
---|
91 | int vboxClipboardReadData (VBOXCLIPBOARDCLIENTDATA *pClient, uint32_t u32Format, void *pv, uint32_t cb, uint32_t *pcbActual);
|
---|
92 |
|
---|
93 | void vboxClipboardWriteData (VBOXCLIPBOARDCLIENTDATA *pClient, void *pv, uint32_t cb, uint32_t u32Format);
|
---|
94 |
|
---|
95 | int vboxClipboardSync (VBOXCLIPBOARDCLIENTDATA *pClient);
|
---|
96 |
|
---|
97 | /* Host unit testing interface */
|
---|
98 | #ifdef UNIT_TEST
|
---|
99 | uint32_t TestClipSvcGetMode(void);
|
---|
100 | #endif
|
---|
101 |
|
---|
102 | #endif /* !VBOX_INCLUDED_SRC_SharedClipboard_VBoxClipboard_h */
|
---|
103 |
|
---|