VirtualBox

source: vbox/trunk/src/VBox/HostServices/SharedClipboard/VBoxSharedClipboardSvc-x11-stubs.cpp@ 85416

Last change on this file since 85416 was 84142, checked in by vboxsync, 5 years ago

Shared Clipboard/HostService: Renaming to match terminology (*SvcImpl* -> *Backend*).

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 4.2 KB
Line 
1/* $Id: VBoxSharedClipboardSvc-x11-stubs.cpp 84142 2020-05-05 07:13:00Z 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-2020 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. */
41int ShClBackendInit(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. */
48void ShClBackendDestroy(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 */
60int ShClBackendConnect(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 */
71int ShClBackendSync(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 */
83int ShClBackendDisconnect(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 fFormats Clipboard formats the guest is offering.
95 */
96int ShClBackendFormatAnnounce(PSHCLCLIENT pClient, SHCLFORMATS fFormats)
97{
98 RT_NOREF(pClient, fFormats);
99 return VINF_SUCCESS;
100}
101
102/**
103 * Called by the HGCM clipboard subsystem when the guest wants to read the host clipboard.
104 *
105 * @param pClient Context information about the guest VM
106 * @param pCmdCtx Command context to use.
107 * @param uFormat Clipboard format to read.
108 * @param pvData Where to return the read clipboard data.
109 * @param cbData Size (in bytes) of buffer where to return the clipboard data.
110 * @param pcbActual Where to store the actual amount of data available.
111 */
112int ShClBackendReadData(PSHCLCLIENT pClient, PSHCLCLIENTCMDCTX pCmdCtx,
113 SHCLFORMAT uFormat, void *pvData, uint32_t cbData, uint32_t *pcbActual)
114{
115 RT_NOREF(pClient, pCmdCtx, uFormat, pvData, cbData);
116
117 /* No data available. */
118 *pcbActual = 0;
119
120 return VINF_SUCCESS;
121}
122
123int ShClBackendWriteData(PSHCLCLIENT pClient, PSHCLCLIENTCMDCTX pCmdCtx,
124 SHCLFORMAT uFormat, void *pvData, uint32_t cbData)
125{
126 RT_NOREF(pClient, pCmdCtx, uFormat, pvData, cbData);
127 return VERR_NOT_IMPLEMENTED;
128}
129
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette