VirtualBox

source: vbox/trunk/src/VBox/Additions/x11/VBoxClient/display-helper.h@ 96407

Last change on this file since 96407 was 96407, checked in by vboxsync, 22 months ago

scm copyright and license note update

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 4.0 KB
Line 
1/* $Id: display-helper.h 96407 2022-08-22 17:43:14Z vboxsync $ */
2/** @file
3 * Guest Additions - Definitions for Desktop Environment helpers.
4 */
5
6/*
7 * Copyright (C) 2006-2022 Oracle and/or its affiliates.
8 *
9 * This file is part of VirtualBox base platform packages, as
10 * available from https://www.virtualbox.org.
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation, in version 3 of the
15 * License.
16 *
17 * This program is distributed in the hope that it will be useful, but
18 * WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 * General Public License for more details.
21 *
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, see <https://www.gnu.org/licenses>.
24 *
25 * SPDX-License-Identifier: GPL-3.0-only
26 */
27
28#ifndef GA_INCLUDED_SRC_x11_VBoxClient_display_helper_h
29#define GA_INCLUDED_SRC_x11_VBoxClient_display_helper_h
30#ifndef RT_WITHOUT_PRAGMA_ONCE
31# pragma once
32#endif
33
34#include "display-ipc.h"
35
36/** Environment variable which contains information about currently running Desktop Environment. */
37#define VBCL_HLP_ENV_XDG_CURRENT_DESKTOP "XDG_CURRENT_DESKTOP"
38
39/**
40 * Display offsets change notification callback.
41 *
42 * @returns IPRT status code.
43 * @param cDisplays Number of displays which have changed their offset.
44 * @param aDisplays Displays offset data.
45 */
46typedef DECLCALLBACKTYPE(int, FNDISPLAYOFFSETCHANGE, (uint32_t cDisplays, struct VBOX_DRMIPC_VMWRECT *aDisplays));
47
48/**
49 * Desktop Environment helper definition structure.
50 */
51typedef struct
52{
53 /** A short helper name. 16 chars maximum (RTTHREAD_NAME_LEN). */
54 const char *pszName;
55
56 /**
57 * Probing callback.
58 *
59 * Called in attempt to detect if user is currently running Desktop Environment
60 * which is compatible with the helper.
61 *
62 * @returns IPRT status code.
63 */
64 DECLCALLBACKMEMBER(int, pfnProbe, (void));
65
66 /**
67 * Initialization callback.
68 *
69 * @returns IPRT status code.
70 */
71 DECLCALLBACKMEMBER(int, pfnInit, (void));
72
73 /**
74 * Termination callback.
75 *
76 * @returns IPRT status code.
77 */
78 DECLCALLBACKMEMBER(int, pfnTerm, (void));
79
80 /**
81 * Set primary display in Desktop Environment specific way.
82 *
83 * @returns IPRT status code.
84 * @param idDisplay Display ID which should be set as primary.
85 */
86 DECLCALLBACKMEMBER(int, pfnSetPrimaryDisplay, (uint32_t idDisplay));
87
88 /**
89 * Register notification callback for display offsets change event.
90 *
91 * @param pfnCb Notification callback.
92 */
93 DECLCALLBACKMEMBER(void, pfnSubscribeDisplayOffsetChangeNotification, (FNDISPLAYOFFSETCHANGE *pfnCb));
94
95 /**
96 * Unregister notification callback for display offsets change event.
97 */
98 DECLCALLBACKMEMBER(void, pfnUnsubscribeDisplayOffsetChangeNotification, (void));
99
100} VBCLDISPLAYHELPER;
101
102/**
103 * Initialization callback for generic Desktop Environment helper.
104 *
105 * @returns IPRT status code.
106 */
107RTDECL(int) vbcl_hlp_generic_init(void);
108
109/**
110 * Termination callback for generic Desktop Environment helper.
111 *
112 * @returns IPRT status code.
113 */
114RTDECL(int) vbcl_hlp_generic_term(void);
115
116/**
117 * Subscribe to display offset change notifications emitted by Generic Desktop Environment helper.
118 *
119 * @param pfnCb A pointer to callback function which will be triggered when event arrives.
120 */
121RTDECL(void) vbcl_hlp_generic_subscribe_display_offset_changed(FNDISPLAYOFFSETCHANGE *pfnCb);
122
123/**
124 * Unsubscribe from display offset change notifications emitted by Generic Desktop Environment helper.
125 */
126RTDECL(void) vbcl_hlp_generic_unsubscribe_display_offset_changed(void);
127
128/** GNOME3 helper private data. */
129extern const VBCLDISPLAYHELPER g_DisplayHelperGnome3;
130/** Generic helper private data. */
131extern const VBCLDISPLAYHELPER g_DisplayHelperGeneric;
132
133#endif /* !GA_INCLUDED_SRC_x11_VBoxClient_display_helper_h */
Note: See TracBrowser for help on using the repository browser.

© 2023 Oracle
ContactPrivacy policyTerms of Use