VirtualBox

source: vbox/trunk/src/VBox/Additions/x11/VBoxClient/VBoxClient.h@ 102092

Last change on this file since 102092 was 101878, checked in by vboxsync, 13 months ago

Additions: X11/Wayland: Add initial support for clipboard sharing with Gnome and Plasma Wayland guests (not yet enabled), bugref:10194.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 4.8 KB
Line 
1/* $Id: VBoxClient.h 101878 2023-11-06 15:36:24Z vboxsync $ */
2/** @file
3 *
4 * VirtualBox additions user session daemon.
5 */
6
7/*
8 * Copyright (C) 2006-2023 Oracle and/or its affiliates.
9 *
10 * This file is part of VirtualBox base platform packages, as
11 * available from https://www.virtualbox.org.
12 *
13 * This program is free software; you can redistribute it and/or
14 * modify it under the terms of the GNU General Public License
15 * as published by the Free Software Foundation, in version 3 of the
16 * License.
17 *
18 * This program is distributed in the hope that it will be useful, but
19 * WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21 * General Public License for more details.
22 *
23 * You should have received a copy of the GNU General Public License
24 * along with this program; if not, see <https://www.gnu.org/licenses>.
25 *
26 * SPDX-License-Identifier: GPL-3.0-only
27 */
28
29#ifndef GA_INCLUDED_SRC_x11_VBoxClient_VBoxClient_h
30#define GA_INCLUDED_SRC_x11_VBoxClient_VBoxClient_h
31#ifndef RT_WITHOUT_PRAGMA_ONCE
32# pragma once
33#endif
34
35#include <VBox/log.h>
36#include <iprt/cpp/utils.h>
37#include <iprt/string.h>
38
39#include <VBox/GuestHost/DisplayServerType.h>
40
41/** A shortcut to log callback entering. */
42#define VBCL_LOG_CALLBACK VBClLogVerbose(3, "%s\n", __func__)
43
44int VBClShowNotify(const char *pszHeader, const char *pszBody);
45
46void VBClLogInfo(const char *pszFormat, ...);
47void VBClLogError(const char *pszFormat, ...);
48void VBClLogFatalError(const char *pszFormat, ...);
49void VBClLogVerbose(unsigned iLevel, const char *pszFormat, ...);
50
51int VBClLogCreate(const char *pszLogFile);
52int VBClLogCreateEx(const char *pszLogFile, bool fPrintHeader);
53int VBClLogModify(const char *pszDest, unsigned uVerbosity);
54void VBClLogSetLogPrefix(const char *pszPrefix);
55void VBClLogDestroy(void);
56
57/** Call clean-up for the current service and exit. */
58extern void VBClShutdown(bool fExit = true);
59
60extern VBGHDISPLAYSERVERTYPE VBClGetDisplayServerType(void);
61
62/**
63 * A service descriptor.
64 */
65typedef struct
66{
67 /** The short service name. 16 chars maximum (RTTHREAD_NAME_LEN). */
68 const char *pszName;
69 /** The longer service name. */
70 const char *pszDesc;
71 /** Get the services default path to pidfile, relative to $HOME */
72 /** @todo Should this also have a component relative to the X server number?
73 */
74 const char *pszPidFilePathTemplate;
75 /** The usage options stuff for the --help screen. */
76 const char *pszUsage;
77 /** The option descriptions for the --help screen. */
78 const char *pszOptions;
79
80 /**
81 * Tries to parse the given command line option.
82 *
83 * @returns 0 if we parsed, -1 if it didn't and anything else means exit.
84 * @param ppszShort If not NULL it points to the short option iterator. a short argument.
85 * If NULL examine argv[*pi].
86 * @param argc The argument count.
87 * @param argv The argument vector.
88 * @param pi The argument vector index. Update if any value(s) are eaten.
89 */
90 DECLCALLBACKMEMBER(int, pfnOption,(const char **ppszShort, int argc, char **argv, int *pi));
91
92 /**
93 * Called before parsing arguments.
94 * @returns VBox status code, or
95 * VERR_NOT_AVAILABLE if service is supported on this platform in general but not available at the moment.
96 * VERR_NOT_SUPPORTED if service is not supported on this platform. */
97 DECLCALLBACKMEMBER(int, pfnInit,(void));
98
99 /** Called from the worker thread.
100 *
101 * @returns VBox status code.
102 * @retval VINF_SUCCESS if exitting because *pfShutdown was set.
103 * @param pfShutdown Pointer to a per service termination flag to check
104 * before and after blocking.
105 */
106 DECLCALLBACKMEMBER(int, pfnWorker,(bool volatile *pfShutdown));
107
108 /**
109 * Asks the service to stop.
110 *
111 * @remarks Will be called from the signal handler.
112 */
113 DECLCALLBACKMEMBER(void, pfnStop,(void));
114
115 /**
116 * Does termination cleanups.
117 *
118 * @remarks This will be called even if pfnInit hasn't been called or pfnStop failed!
119 */
120 DECLCALLBACKMEMBER(int, pfnTerm,(void));
121} VBCLSERVICE;
122/** Pointer to a VBCLSERVICE. */
123typedef VBCLSERVICE *PVBCLSERVICE;
124/** Pointer to a const VBCLSERVICE. */
125typedef VBCLSERVICE const *PCVBCLSERVICE;
126
127RT_C_DECLS_BEGIN
128extern VBCLSERVICE g_SvcClipboard;
129extern VBCLSERVICE g_SvcDisplayDRM;
130extern VBCLSERVICE g_SvcDisplaySVGA;
131extern VBCLSERVICE g_SvcDisplayLegacy;
132# ifdef RT_OS_LINUX
133extern VBCLSERVICE g_SvcDisplaySVGASession;
134# endif
135extern VBCLSERVICE g_SvcDragAndDrop;
136extern VBCLSERVICE g_SvcHostVersion;
137extern VBCLSERVICE g_SvcSeamless;
138# ifdef VBOX_WITH_WAYLAND_ADDITIONS
139extern VBCLSERVICE g_SvcWayland;
140# endif
141
142extern unsigned g_cVerbosity;
143extern bool g_fDaemonized;
144RT_C_DECLS_END
145
146#endif /* !GA_INCLUDED_SRC_x11_VBoxClient_VBoxClient_h */
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