[93370] | 1 | /* $Id: display-helper.h 98103 2023-01-17 14:15:46Z vboxsync $ */
|
---|
| 2 | /** @file
|
---|
[93423] | 3 | * Guest Additions - Definitions for Desktop Environment helpers.
|
---|
[93370] | 4 | */
|
---|
| 5 |
|
---|
| 6 | /*
|
---|
[98103] | 7 | * Copyright (C) 2006-2023 Oracle and/or its affiliates.
|
---|
[93370] | 8 | *
|
---|
[96407] | 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
|
---|
[93370] | 26 | */
|
---|
| 27 |
|
---|
[93375] | 28 | #ifndef GA_INCLUDED_SRC_x11_VBoxClient_display_helper_h
|
---|
| 29 | #define GA_INCLUDED_SRC_x11_VBoxClient_display_helper_h
|
---|
[93370] | 30 | #ifndef RT_WITHOUT_PRAGMA_ONCE
|
---|
| 31 | # pragma once
|
---|
| 32 | #endif
|
---|
| 33 |
|
---|
| 34 | #include "display-ipc.h"
|
---|
| 35 |
|
---|
| 36 | /**
|
---|
| 37 | * Display offsets change notification callback.
|
---|
| 38 | *
|
---|
| 39 | * @returns IPRT status code.
|
---|
[94076] | 40 | * @param cDisplays Number of displays which have changed their offset.
|
---|
| 41 | * @param aDisplays Displays offset data.
|
---|
[93370] | 42 | */
|
---|
[94076] | 43 | typedef DECLCALLBACKTYPE(int, FNDISPLAYOFFSETCHANGE, (uint32_t cDisplays, struct VBOX_DRMIPC_VMWRECT *aDisplays));
|
---|
[93370] | 44 |
|
---|
| 45 | /**
|
---|
| 46 | * Desktop Environment helper definition structure.
|
---|
| 47 | */
|
---|
| 48 | typedef struct
|
---|
| 49 | {
|
---|
| 50 | /** A short helper name. 16 chars maximum (RTTHREAD_NAME_LEN). */
|
---|
| 51 | const char *pszName;
|
---|
| 52 |
|
---|
| 53 | /**
|
---|
| 54 | * Probing callback.
|
---|
| 55 | *
|
---|
| 56 | * Called in attempt to detect if user is currently running Desktop Environment
|
---|
| 57 | * which is compatible with the helper.
|
---|
| 58 | *
|
---|
| 59 | * @returns IPRT status code.
|
---|
| 60 | */
|
---|
| 61 | DECLCALLBACKMEMBER(int, pfnProbe, (void));
|
---|
| 62 |
|
---|
| 63 | /**
|
---|
| 64 | * Initialization callback.
|
---|
| 65 | *
|
---|
| 66 | * @returns IPRT status code.
|
---|
| 67 | */
|
---|
| 68 | DECLCALLBACKMEMBER(int, pfnInit, (void));
|
---|
| 69 |
|
---|
| 70 | /**
|
---|
| 71 | * Termination callback.
|
---|
| 72 | *
|
---|
| 73 | * @returns IPRT status code.
|
---|
| 74 | */
|
---|
| 75 | DECLCALLBACKMEMBER(int, pfnTerm, (void));
|
---|
| 76 |
|
---|
| 77 | /**
|
---|
| 78 | * Set primary display in Desktop Environment specific way.
|
---|
| 79 | *
|
---|
| 80 | * @returns IPRT status code.
|
---|
| 81 | * @param idDisplay Display ID which should be set as primary.
|
---|
| 82 | */
|
---|
| 83 | DECLCALLBACKMEMBER(int, pfnSetPrimaryDisplay, (uint32_t idDisplay));
|
---|
| 84 |
|
---|
| 85 | /**
|
---|
| 86 | * Register notification callback for display offsets change event.
|
---|
| 87 | *
|
---|
[93384] | 88 | * @param pfnCb Notification callback.
|
---|
[93370] | 89 | */
|
---|
[93384] | 90 | DECLCALLBACKMEMBER(void, pfnSubscribeDisplayOffsetChangeNotification, (FNDISPLAYOFFSETCHANGE *pfnCb));
|
---|
[93370] | 91 |
|
---|
| 92 | /**
|
---|
| 93 | * Unregister notification callback for display offsets change event.
|
---|
| 94 | */
|
---|
| 95 | DECLCALLBACKMEMBER(void, pfnUnsubscribeDisplayOffsetChangeNotification, (void));
|
---|
| 96 |
|
---|
| 97 | } VBCLDISPLAYHELPER;
|
---|
| 98 |
|
---|
| 99 | /**
|
---|
| 100 | * Initialization callback for generic Desktop Environment helper.
|
---|
| 101 | *
|
---|
| 102 | * @returns IPRT status code.
|
---|
| 103 | */
|
---|
| 104 | RTDECL(int) vbcl_hlp_generic_init(void);
|
---|
| 105 |
|
---|
| 106 | /**
|
---|
| 107 | * Termination callback for generic Desktop Environment helper.
|
---|
| 108 | *
|
---|
| 109 | * @returns IPRT status code.
|
---|
| 110 | */
|
---|
| 111 | RTDECL(int) vbcl_hlp_generic_term(void);
|
---|
| 112 |
|
---|
| 113 | /**
|
---|
| 114 | * Subscribe to display offset change notifications emitted by Generic Desktop Environment helper.
|
---|
| 115 | *
|
---|
| 116 | * @param pfnCb A pointer to callback function which will be triggered when event arrives.
|
---|
| 117 | */
|
---|
| 118 | RTDECL(void) vbcl_hlp_generic_subscribe_display_offset_changed(FNDISPLAYOFFSETCHANGE *pfnCb);
|
---|
| 119 |
|
---|
| 120 | /**
|
---|
| 121 | * Unsubscribe from display offset change notifications emitted by Generic Desktop Environment helper.
|
---|
| 122 | */
|
---|
| 123 | RTDECL(void) vbcl_hlp_generic_unsubscribe_display_offset_changed(void);
|
---|
| 124 |
|
---|
| 125 | /** GNOME3 helper private data. */
|
---|
| 126 | extern const VBCLDISPLAYHELPER g_DisplayHelperGnome3;
|
---|
| 127 | /** Generic helper private data. */
|
---|
| 128 | extern const VBCLDISPLAYHELPER g_DisplayHelperGeneric;
|
---|
| 129 |
|
---|
[93375] | 130 | #endif /* !GA_INCLUDED_SRC_x11_VBoxClient_display_helper_h */
|
---|