1 | /* $Id: VBoxSharedClipboardSvc-x11-stubs.cpp 79036 2019-06-07 14:56:19Z vboxsync $*/
|
---|
2 | /** @file
|
---|
3 | * Shared Clipboard Service - Linux host, a stub version with no functionality for use on headless hosts.
|
---|
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 |
|
---|
19 | /*********************************************************************************************************************************
|
---|
20 | * Header Files *
|
---|
21 | *********************************************************************************************************************************/
|
---|
22 | #define LOG_GROUP LOG_GROUP_SHARED_CLIPBOARD
|
---|
23 | #include <VBox/HostServices/VBoxClipboardSvc.h>
|
---|
24 |
|
---|
25 | #include <iprt/alloc.h>
|
---|
26 | #include <iprt/asm.h> /* For atomic operations */
|
---|
27 | #include <iprt/assert.h>
|
---|
28 | #include <iprt/mem.h>
|
---|
29 | #include <iprt/string.h>
|
---|
30 | #include <iprt/thread.h>
|
---|
31 | #include <iprt/process.h>
|
---|
32 | #include <iprt/semaphore.h>
|
---|
33 | #include <string.h>
|
---|
34 | #include <stdio.h>
|
---|
35 | #include <stdint.h>
|
---|
36 |
|
---|
37 | #include "VBoxSharedClipboardSvc-internal.h"
|
---|
38 |
|
---|
39 |
|
---|
40 | /** Initialise the host side of the shared clipboard - called by the hgcm layer. */
|
---|
41 | int VBoxClipboardSvcImplInit(void)
|
---|
42 | {
|
---|
43 | LogFlowFunc(("called, returning VINF_SUCCESS\n"));
|
---|
44 | return VINF_SUCCESS;
|
---|
45 | }
|
---|
46 |
|
---|
47 | /** Terminate the host side of the shared clipboard - called by the hgcm layer. */
|
---|
48 | void VBoxClipboardSvcImplDestroy(void)
|
---|
49 | {
|
---|
50 | LogFlowFunc(("called, returning\n"));
|
---|
51 | }
|
---|
52 |
|
---|
53 | /**
|
---|
54 | * Enable the shared clipboard - called by the hgcm clipboard subsystem.
|
---|
55 | *
|
---|
56 | * @param pClientData Structure containing context information about the guest system
|
---|
57 | * @param fHeadless Whether headless.
|
---|
58 | * @returns RT status code
|
---|
59 | */
|
---|
60 | int VBoxClipboardSvcImplConnect(PVBOXCLIPBOARDCLIENTDATA pClientData, bool fHeadless)
|
---|
61 | {
|
---|
62 | RT_NOREF(pClientData, fHeadless);
|
---|
63 | LogFlowFunc(("called, returning VINF_SUCCESS\n"));
|
---|
64 | return VINF_SUCCESS;
|
---|
65 | }
|
---|
66 |
|
---|
67 | /**
|
---|
68 | * Synchronise the contents of the host clipboard with the guest, called by the HGCM layer
|
---|
69 | * after a save and restore of the guest.
|
---|
70 | */
|
---|
71 | int VBoxClipboardSvcImplSync(PVBOXCLIPBOARDCLIENTDATA /* pClientData */)
|
---|
72 | {
|
---|
73 | LogFlowFunc(("called, returning VINF_SUCCESS\n"));
|
---|
74 | return VINF_SUCCESS;
|
---|
75 | }
|
---|
76 |
|
---|
77 | /**
|
---|
78 | * Shut down the shared clipboard subsystem and "disconnect" the guest.
|
---|
79 | *
|
---|
80 | * @param pClientData Structure containing context information about the guest system
|
---|
81 | */
|
---|
82 | int VBoxClipboardSvcImplDisconnect(PVBOXCLIPBOARDCLIENTDATA pClientData)
|
---|
83 | {
|
---|
84 | RT_NOREF(pClientData);
|
---|
85 | return VINF_SUCCESS;
|
---|
86 | }
|
---|
87 |
|
---|
88 | /**
|
---|
89 | * The guest is taking possession of the shared clipboard. Called by the HGCM clipboard
|
---|
90 | * subsystem.
|
---|
91 | *
|
---|
92 | * @param pClientData Context data for the guest system
|
---|
93 | * @param u32Formats Clipboard formats the guest is offering
|
---|
94 | */
|
---|
95 | int VBoxClipboardSvcImplFormatAnnounce(PVBOXCLIPBOARDCLIENTDATA pClientData, uint32_t u32Formats)
|
---|
96 | {
|
---|
97 | RT_NOREF(pClientData, u32Formats);
|
---|
98 | return VINF_SUCCESS;
|
---|
99 | }
|
---|
100 |
|
---|
101 | /**
|
---|
102 | * Called by the HGCM clipboard subsystem when the guest wants to read the host clipboard.
|
---|
103 | *
|
---|
104 | * @param pClientData Context information about the guest VM
|
---|
105 | * @param u32Format The format that the guest would like to receive the data in
|
---|
106 | * @param pv Where to write the data to
|
---|
107 | * @param cb The size of the buffer to write the data to
|
---|
108 | * @param pcbActual Where to write the actual size of the written data
|
---|
109 | */
|
---|
110 | int VBoxClipboardSvcImplReadData(PVBOXCLIPBOARDCLIENTDATA pClientData, uint32_t u32Format,
|
---|
111 | void *pv, uint32_t cb, uint32_t *pcbActual)
|
---|
112 | {
|
---|
113 | RT_NOREF(pClientData, u32Format, pv, cb);
|
---|
114 | LogFlowFunc(("called, returning VINF_SUCCESS\n"));
|
---|
115 | /* No data available. */
|
---|
116 | *pcbActual = 0;
|
---|
117 | return VINF_SUCCESS;
|
---|
118 | }
|
---|
119 |
|
---|
120 | int VBoxClipboardSvcImplWriteData(PVBOXCLIPBOARDCLIENTDATA pClientData, void *pv, uint32_t cb,
|
---|
121 | uint32_t u32Format)
|
---|
122 | {
|
---|
123 | RT_NOREF(pClientData, pv, cb, u32Format);
|
---|
124 | return VERR_NOT_IMPLEMENTED;
|
---|
125 | }
|
---|
126 |
|
---|
127 | #ifdef VBOX_WITH_SHARED_CLIPBOARD_URI_LIST
|
---|
128 | int VBoxClipboardSvcImplURIReadDir(PVBOXCLIPBOARDCLIENTDATA pClientData, PVBOXCLIPBOARDDIRDATA pDirData)
|
---|
129 | {
|
---|
130 | RT_NOREF(pClientData, pDirData);
|
---|
131 | return VERR_NOT_IMPLEMENTED;
|
---|
132 | }
|
---|
133 |
|
---|
134 | int VBoxClipboardSvcImplURIWriteDir(PVBOXCLIPBOARDCLIENTDATA pClientData, PVBOXCLIPBOARDDIRDATA pDirData)
|
---|
135 | {
|
---|
136 | RT_NOREF(pClientData, pDirData);
|
---|
137 | return VERR_NOT_IMPLEMENTED;
|
---|
138 | }
|
---|
139 |
|
---|
140 | int VBoxClipboardSvcImplURIReadFileHdr(PVBOXCLIPBOARDCLIENTDATA pClientData, PVBOXCLIPBOARDFILEHDR pFileHdr)
|
---|
141 | {
|
---|
142 | RT_NOREF(pClientData, pFileHdr);
|
---|
143 | return VERR_NOT_IMPLEMENTED;
|
---|
144 | }
|
---|
145 |
|
---|
146 | int VBoxClipboardSvcImplURIWriteFileHdr(PVBOXCLIPBOARDCLIENTDATA pClientData, PVBOXCLIPBOARDFILEHDR pFileHdr)
|
---|
147 | {
|
---|
148 | RT_NOREF(pClientData, pFileHdr);
|
---|
149 | return VERR_NOT_IMPLEMENTED;
|
---|
150 | }
|
---|
151 |
|
---|
152 | int VBoxClipboardSvcImplURIReadFileData(PVBOXCLIPBOARDCLIENTDATA pClientData, PVBOXCLIPBOARDFILEDATA pFileData)
|
---|
153 | {
|
---|
154 | RT_NOREF(pClientData, pFileData);
|
---|
155 | return VERR_NOT_IMPLEMENTED;
|
---|
156 | }
|
---|
157 |
|
---|
158 | int VBoxClipboardSvcImplURIWriteFileData(PVBOXCLIPBOARDCLIENTDATA pClientData, PVBOXCLIPBOARDFILEDATA pFileData)
|
---|
159 | {
|
---|
160 | RT_NOREF(pClientData, pFileData);
|
---|
161 | return VERR_NOT_IMPLEMENTED;
|
---|
162 | }
|
---|
163 | #endif /* VBOX_WITH_SHARED_CLIPBOARD_URI_LIST */
|
---|
164 |
|
---|