1 | /* $Id: VBoxClipboard.h 78578 2019-05-18 14:48:13Z 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 | #include <VBox/GuestHost/SharedClipboard.h>
|
---|
28 |
|
---|
29 | typedef struct _VBOXCLIPBOARDCLIENTDATA
|
---|
30 | {
|
---|
31 | struct _VBOXCLIPBOARDCLIENTDATA *pNext;
|
---|
32 | struct _VBOXCLIPBOARDCLIENTDATA *pPrev;
|
---|
33 |
|
---|
34 | VBOXCLIPBOARDCONTEXT *pCtx;
|
---|
35 |
|
---|
36 | uint32_t u32ClientID;
|
---|
37 |
|
---|
38 | /** The guest is waiting for a message. */
|
---|
39 | bool fAsync;
|
---|
40 | /** The guest is waiting for data from the host */
|
---|
41 | bool fReadPending;
|
---|
42 | /** Whether the host host has sent a quit message. */
|
---|
43 | bool fHostMsgQuit;
|
---|
44 | /** Whether the host host has requested reading clipboard data from the guest. */
|
---|
45 | bool fHostMsgReadData;
|
---|
46 | /** Whether the host host has reported its available formats. */
|
---|
47 | bool fHostMsgFormats;
|
---|
48 |
|
---|
49 | struct {
|
---|
50 | VBOXHGCMCALLHANDLE callHandle;
|
---|
51 | VBOXHGCMSVCPARM *paParms;
|
---|
52 | } async;
|
---|
53 |
|
---|
54 | struct {
|
---|
55 | VBOXHGCMCALLHANDLE callHandle;
|
---|
56 | VBOXHGCMSVCPARM *paParms;
|
---|
57 | } asyncRead;
|
---|
58 |
|
---|
59 | struct {
|
---|
60 | void *pv;
|
---|
61 | uint32_t cb;
|
---|
62 | uint32_t u32Format;
|
---|
63 | } data;
|
---|
64 |
|
---|
65 | uint32_t u32AvailableFormats;
|
---|
66 | uint32_t u32RequestedFormat;
|
---|
67 |
|
---|
68 | } VBOXCLIPBOARDCLIENTDATA, *PVBOXCLIPBOARDCLIENTDATA;
|
---|
69 |
|
---|
70 | /*
|
---|
71 | * The service functions. Locking is between the service thread and the platform dependent windows thread.
|
---|
72 | */
|
---|
73 | void vboxSvcClipboardReportMsg(VBOXCLIPBOARDCLIENTDATA *pClient, uint32_t u32Msg, uint32_t u32Formats);
|
---|
74 | void vboxSvcClipboardCompleteReadData(VBOXCLIPBOARDCLIENTDATA *pClient, int rc, uint32_t cbActual);
|
---|
75 |
|
---|
76 | /*
|
---|
77 | * Platform-dependent implementations.
|
---|
78 | */
|
---|
79 | int VBoxClipboardSvcImplInit(void);
|
---|
80 | void VBoxClipboardSvcImplDestroy(void);
|
---|
81 |
|
---|
82 | int VBoxClipboardSvcImplConnect(VBOXCLIPBOARDCLIENTDATA *pClient, bool fHeadless);
|
---|
83 | void VBoxClipboardSvcImplDisconnect(VBOXCLIPBOARDCLIENTDATA *pClient);
|
---|
84 | void VBoxClipboardSvcImplFormatAnnounce(VBOXCLIPBOARDCLIENTDATA *pClient, uint32_t u32Formats);
|
---|
85 | int VBoxClipboardSvcImplReadData(VBOXCLIPBOARDCLIENTDATA *pClient, uint32_t u32Format, void *pv, uint32_t cb, uint32_t *pcbActual);
|
---|
86 | void VBoxClipboardSvcImplWriteData(VBOXCLIPBOARDCLIENTDATA *pClient, void *pv, uint32_t cb, uint32_t u32Format);
|
---|
87 | int VBoxClipboardSvcImplSync(VBOXCLIPBOARDCLIENTDATA *pClient);
|
---|
88 |
|
---|
89 | /* Host unit testing interface */
|
---|
90 | #ifdef UNIT_TEST
|
---|
91 | uint32_t TestClipSvcGetMode(void);
|
---|
92 | #endif
|
---|
93 |
|
---|
94 | #endif /* !VBOX_INCLUDED_SRC_SharedClipboard_VBoxClipboard_h */
|
---|
95 |
|
---|