VirtualBox

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

Last change on this file since 93560 was 93551, checked in by vboxsync, 3 years ago

Additions: X11: VBoxClient: move Wayland detection function into common place, bugref:10134.

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