1 | /* $Id: x11-stub.cpp 75498 2018-11-16 00:03:41Z 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-2017 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 "VBoxClipboard.h"
|
---|
38 |
|
---|
39 |
|
---|
40 |
|
---|
41 | /** Initialise the host side of the shared clipboard - called by the hgcm layer. */
|
---|
42 | int vboxClipboardInit (void)
|
---|
43 | {
|
---|
44 | LogFlowFunc(("called, returning VINF_SUCCESS.\n"));
|
---|
45 | return VINF_SUCCESS;
|
---|
46 | }
|
---|
47 |
|
---|
48 | /** Terminate the host side of the shared clipboard - called by the hgcm layer. */
|
---|
49 | void vboxClipboardDestroy (void)
|
---|
50 | {
|
---|
51 | LogFlowFunc(("called, returning.\n"));
|
---|
52 | }
|
---|
53 |
|
---|
54 | /**
|
---|
55 | * Enable the shared clipboard - called by the hgcm clipboard subsystem.
|
---|
56 | *
|
---|
57 | * @param pClient Structure containing context information about the guest system
|
---|
58 | * @param fHeadless Whether headless.
|
---|
59 | * @returns RT status code
|
---|
60 | */
|
---|
61 | int vboxClipboardConnect (VBOXCLIPBOARDCLIENTDATA *pClient,
|
---|
62 | bool fHeadless)
|
---|
63 | {
|
---|
64 | RT_NOREF(pClient, fHeadless);
|
---|
65 | LogFlowFunc(("called, returning VINF_SUCCESS.\n"));
|
---|
66 | return VINF_SUCCESS;
|
---|
67 | }
|
---|
68 |
|
---|
69 | /**
|
---|
70 | * Synchronise the contents of the host clipboard with the guest, called by the HGCM layer
|
---|
71 | * after a save and restore of the guest.
|
---|
72 | */
|
---|
73 | int vboxClipboardSync (VBOXCLIPBOARDCLIENTDATA * /* pClient */)
|
---|
74 | {
|
---|
75 | LogFlowFunc(("called, returning VINF_SUCCESS.\n"));
|
---|
76 | return VINF_SUCCESS;
|
---|
77 | }
|
---|
78 |
|
---|
79 | /**
|
---|
80 | * Shut down the shared clipboard subsystem and "disconnect" the guest.
|
---|
81 | *
|
---|
82 | * @param pClient Structure containing context information about the guest system
|
---|
83 | */
|
---|
84 | void vboxClipboardDisconnect (VBOXCLIPBOARDCLIENTDATA *pClient)
|
---|
85 | {
|
---|
86 | RT_NOREF(pClient);
|
---|
87 | LogFlowFunc(("called, returning.\n"));
|
---|
88 | }
|
---|
89 |
|
---|
90 | /**
|
---|
91 | * The guest is taking possession of the shared clipboard. Called by the HGCM clipboard
|
---|
92 | * subsystem.
|
---|
93 | *
|
---|
94 | * @param pClient Context data for the guest system
|
---|
95 | * @param u32Formats Clipboard formats the guest is offering
|
---|
96 | */
|
---|
97 | void vboxClipboardFormatAnnounce (VBOXCLIPBOARDCLIENTDATA *pClient,
|
---|
98 | uint32_t u32Formats)
|
---|
99 | {
|
---|
100 | RT_NOREF(pClient, u32Formats);
|
---|
101 | LogFlowFunc(("called, returning.\n"));
|
---|
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 u32Format The format that the guest would like to receive the data in
|
---|
109 | * @param pv Where to write the data to
|
---|
110 | * @param cb The size of the buffer to write the data to
|
---|
111 | * @param pcbActual Where to write the actual size of the written data
|
---|
112 | */
|
---|
113 | int vboxClipboardReadData (VBOXCLIPBOARDCLIENTDATA *pClient, uint32_t u32Format,
|
---|
114 | void *pv, uint32_t cb, uint32_t *pcbActual)
|
---|
115 | {
|
---|
116 | RT_NOREF(pClient, u32Format, pv, cb);
|
---|
117 | LogFlowFunc(("called, returning VINF_SUCCESS.\n"));
|
---|
118 | /* No data available. */
|
---|
119 | *pcbActual = 0;
|
---|
120 | return VINF_SUCCESS;
|
---|
121 | }
|
---|
122 |
|
---|
123 | /**
|
---|
124 | * Called by the HGCM clipboard subsystem when we have requested data and that data arrives.
|
---|
125 | *
|
---|
126 | * @param pClient Context information about the guest VM
|
---|
127 | * @param pv Buffer to which the data was written
|
---|
128 | * @param cb The size of the data written
|
---|
129 | * @param u32Format The format of the data written
|
---|
130 | */
|
---|
131 | void vboxClipboardWriteData (VBOXCLIPBOARDCLIENTDATA *pClient, void *pv,
|
---|
132 | uint32_t cb, uint32_t u32Format)
|
---|
133 | {
|
---|
134 | RT_NOREF(pClient, pv, cb, u32Format);
|
---|
135 | LogFlowFunc(("called, returning.\n"));
|
---|
136 | }
|
---|
137 |
|
---|