VirtualBox

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

Last change on this file since 93469 was 93423, checked in by vboxsync, 3 years ago

Additions: Linux: update description for guest screen resizing code, bugref:10134.

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