1 | /* $Id: VBoxSharedClipboardSvc-x11-stubs.cpp 93919 2022-02-24 13:59:11Z 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-2022 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 | /*
|
---|
41 | * Initialise the host side of the shared clipboard - called by the hgcm layer.
|
---|
42 | */
|
---|
43 | int ShClBackendInit(PSHCLBACKEND pBackend, VBOXHGCMSVCFNTABLE *pTable)
|
---|
44 | {
|
---|
45 | RT_NOREF(pTable);
|
---|
46 | LogFlowFunc(("called, returning VINF_SUCCESS\n"));
|
---|
47 | return VINF_SUCCESS;
|
---|
48 | }
|
---|
49 |
|
---|
50 | /*
|
---|
51 | * Terminate the host side of the shared clipboard - called by the hgcm layer.
|
---|
52 | */
|
---|
53 | void ShClBackendDestroy(PSHCLBACKEND pBackend)
|
---|
54 | {
|
---|
55 | RT_NOREF(pBackend);
|
---|
56 | LogFlowFunc(("called, returning\n"));
|
---|
57 | }
|
---|
58 |
|
---|
59 | int ShClBackendConnect(PSHCLBACKEND pBackend, PSHCLCLIENT pClient, bool fHeadless)
|
---|
60 | {
|
---|
61 | RT_NOREF(pBackend, pClient, fHeadless);
|
---|
62 | LogFlowFunc(("called, returning VINF_SUCCESS\n"));
|
---|
63 | return VINF_SUCCESS;
|
---|
64 | }
|
---|
65 |
|
---|
66 | /*
|
---|
67 | * Synchronise the contents of the host clipboard with the guest, called by the HGCM layer
|
---|
68 | * after a save and restore of the guest.
|
---|
69 | */
|
---|
70 | int ShClBackendSync(PSHCLBACKEND pBackend, PSHCLCLIENT pClient)
|
---|
71 | {
|
---|
72 | RT_NOREF(pBackend, pClient);
|
---|
73 | LogFlowFunc(("called, returning VINF_SUCCESS\n"));
|
---|
74 | return VINF_SUCCESS;
|
---|
75 | }
|
---|
76 |
|
---|
77 | int ShClBackendDisconnect(PSHCLBACKEND pBackend, PSHCLCLIENT pClient)
|
---|
78 | {
|
---|
79 | RT_NOREF(pBackend, pClient);
|
---|
80 | return VINF_SUCCESS;
|
---|
81 | }
|
---|
82 |
|
---|
83 | /*
|
---|
84 | * The guest is taking possession of the shared clipboard.
|
---|
85 | * Called by the HGCM clipboard subsystem.
|
---|
86 | */
|
---|
87 | int ShClBackendReportFormats(PSHCLBACKEND pBackend, PSHCLCLIENT pClient, SHCLFORMATS fFormats)
|
---|
88 | {
|
---|
89 | RT_NOREF(pBackend, pClient, fFormats);
|
---|
90 | return VINF_SUCCESS;
|
---|
91 | }
|
---|
92 |
|
---|
93 | /*
|
---|
94 | * Called by the HGCM clipboard subsystem when the guest wants to read the host clipboard.
|
---|
95 | */
|
---|
96 | int ShClBackendReadData(PSHCLBACKEND pBackend, PSHCLCLIENT pClient, PSHCLCLIENTCMDCTX pCmdCtx,
|
---|
97 | SHCLFORMAT uFormat, void *pvData, uint32_t cbData, uint32_t *pcbActual)
|
---|
98 | {
|
---|
99 | RT_NOREF(pBackend, pClient, pCmdCtx, uFormat, pvData, cbData);
|
---|
100 |
|
---|
101 | /* No data available. */
|
---|
102 | *pcbActual = 0;
|
---|
103 |
|
---|
104 | return VINF_SUCCESS;
|
---|
105 | }
|
---|
106 |
|
---|
107 | int ShClBackendWriteData(PSHCLBACKEND pBackend, PSHCLCLIENT pClient, PSHCLCLIENTCMDCTX pCmdCtx,
|
---|
108 | SHCLFORMAT uFormat, void *pvData, uint32_t cbData)
|
---|
109 | {
|
---|
110 | RT_NOREF(pBackend, pClient, pCmdCtx, uFormat, pvData, cbData);
|
---|
111 | return VERR_NOT_IMPLEMENTED;
|
---|
112 | }
|
---|
113 |
|
---|