1 | /* $Id: VBoxSharedClipboardSvc-x11-stubs.cpp 80662 2019-09-09 08:43:14Z 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 | * @returns RT status code
|
---|
57 | * @param pClient Structure containing context information about the guest system
|
---|
58 | * @param fHeadless Whether headless.
|
---|
59 | */
|
---|
60 | int VBoxClipboardSvcImplConnect(PSHCLCLIENT pClient, bool fHeadless)
|
---|
61 | {
|
---|
62 | RT_NOREF(pClient, 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(PSHCLCLIENT pClient)
|
---|
72 | {
|
---|
73 | RT_NOREF(pClient);
|
---|
74 | LogFlowFunc(("called, returning VINF_SUCCESS\n"));
|
---|
75 | return VINF_SUCCESS;
|
---|
76 | }
|
---|
77 |
|
---|
78 | /**
|
---|
79 | * Shut down the shared clipboard subsystem and "disconnect" the guest.
|
---|
80 | *
|
---|
81 | * @param pClient Structure containing context information about the guest system
|
---|
82 | */
|
---|
83 | int VBoxClipboardSvcImplDisconnect(PSHCLCLIENT pClient)
|
---|
84 | {
|
---|
85 | RT_NOREF(pClient);
|
---|
86 | return VINF_SUCCESS;
|
---|
87 | }
|
---|
88 |
|
---|
89 | /**
|
---|
90 | * The guest is taking possession of the shared clipboard. Called by the HGCM clipboard
|
---|
91 | * subsystem.
|
---|
92 | *
|
---|
93 | * @param pClient Context data for the guest system.
|
---|
94 | * @param pCmdCtx Command context to use.
|
---|
95 | * @param pFormats Clipboard formats the guest is offering.
|
---|
96 | */
|
---|
97 | int VBoxClipboardSvcImplFormatAnnounce(PSHCLCLIENT pClient, PSHCLCLIENTCMDCTX pCmdCtx,
|
---|
98 | PSHCLFORMATDATA pFormats)
|
---|
99 | {
|
---|
100 | RT_NOREF(pClient, pCmdCtx, pFormats);
|
---|
101 | return VINF_SUCCESS;
|
---|
102 | }
|
---|
103 |
|
---|
104 | /**
|
---|
105 | * Called by the HGCM clipboard subsystem when the guest wants to read the host clipboard.
|
---|
106 | *
|
---|
107 | * @param pClient Context information about the guest VM
|
---|
108 | * @param pCmdCtx Command context to use.
|
---|
109 | * @param pData Data block to put read data into.
|
---|
110 | * @param pcbActual Where to store the actual amount of data available.
|
---|
111 | */
|
---|
112 | int VBoxClipboardSvcImplReadData(PSHCLCLIENT pClient, PSHCLCLIENTCMDCTX pCmdCtx,
|
---|
113 | PSHCLDATABLOCK pData, uint32_t *pcbActual)
|
---|
114 | {
|
---|
115 | RT_NOREF(pClient, pCmdCtx, pData);
|
---|
116 |
|
---|
117 | /* No data available. */
|
---|
118 | *pcbActual = 0;
|
---|
119 |
|
---|
120 | return VINF_SUCCESS;
|
---|
121 | }
|
---|
122 |
|
---|
123 | int VBoxClipboardSvcImplWriteData(PSHCLCLIENT pClient, PSHCLCLIENTCMDCTX pCmdCtx,
|
---|
124 | PSHCLDATABLOCK pData)
|
---|
125 | {
|
---|
126 | RT_NOREF(pClient, pCmdCtx, pData);
|
---|
127 | return VERR_NOT_IMPLEMENTED;
|
---|
128 | }
|
---|
129 |
|
---|