VirtualBox

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

Last change on this file since 93386 was 93384, checked in by vboxsync, 3 years ago

Additions: Linux: scm fix, bugref:10185.

  • 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 93384 2022-01-20 19:48:25Z vboxsync $ */
2/** @file
3 *
4 * Definitions for Desktop Environment helpers.
5 */
6
7/*
8 * Copyright (C) 2006-2022 Oracle Corporation
9 *
10 * This file is part of VirtualBox Open Source Edition (OSE), as
11 * available from http://www.virtualbox.org. This file is free software;
12 * you can redistribute it and/or modify it under the terms of the GNU
13 * General Public License (GPL) as published by the Free Software
14 * Foundation, in version 2 as it comes in the "COPYING" file of the
15 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
16 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
17 */
18
19#ifndef GA_INCLUDED_SRC_x11_VBoxClient_display_helper_h
20#define GA_INCLUDED_SRC_x11_VBoxClient_display_helper_h
21#ifndef RT_WITHOUT_PRAGMA_ONCE
22# pragma once
23#endif
24
25#include "display-ipc.h"
26
27/** Environment variable which contains information about currently running Desktop Environment. */
28#define VBCL_HLP_ENV_XDG_CURRENT_DESKTOP "XDG_CURRENT_DESKTOP"
29/** Environment variable which is exported when in Wayland Desktop Environment. */
30#define VBCL_HLP_ENV_WAYLAND_DISPLAY "WAYLAND_DISPLAY"
31
32/**
33 * Display offsets change notification callback.
34 *
35 * @returns IPRT status code.
36 * @param cOffsets Number of displays which have changed their offset.
37 * @param paOffsets Displays offset data.
38 */
39typedef DECLCALLBACKTYPE(int, FNDISPLAYOFFSETCHANGE, (uint32_t cOffsets, struct RTPOINT *paOffsets));
40
41/**
42 * Desktop Environment helper definition structure.
43 */
44typedef struct
45{
46 /** A short helper name. 16 chars maximum (RTTHREAD_NAME_LEN). */
47 const char *pszName;
48
49 /**
50 * Probing callback.
51 *
52 * Called in attempt to detect if user is currently running Desktop Environment
53 * which is compatible with the helper.
54 *
55 * @returns IPRT status code.
56 */
57 DECLCALLBACKMEMBER(int, pfnProbe, (void));
58
59 /**
60 * Initialization callback.
61 *
62 * @returns IPRT status code.
63 */
64 DECLCALLBACKMEMBER(int, pfnInit, (void));
65
66 /**
67 * Termination callback.
68 *
69 * @returns IPRT status code.
70 */
71 DECLCALLBACKMEMBER(int, pfnTerm, (void));
72
73 /**
74 * Set primary display in Desktop Environment specific way.
75 *
76 * @returns IPRT status code.
77 * @param idDisplay Display ID which should be set as primary.
78 */
79 DECLCALLBACKMEMBER(int, pfnSetPrimaryDisplay, (uint32_t idDisplay));
80
81 /**
82 * Register notification callback for display offsets change event.
83 *
84 * @param pfnCb Notification callback.
85 */
86 DECLCALLBACKMEMBER(void, pfnSubscribeDisplayOffsetChangeNotification, (FNDISPLAYOFFSETCHANGE *pfnCb));
87
88 /**
89 * Unregister notification callback for display offsets change event.
90 */
91 DECLCALLBACKMEMBER(void, pfnUnsubscribeDisplayOffsetChangeNotification, (void));
92
93} VBCLDISPLAYHELPER;
94
95/**
96 * Initialization callback for generic Desktop Environment helper.
97 *
98 * @returns IPRT status code.
99 */
100RTDECL(int) vbcl_hlp_generic_init(void);
101
102/**
103 * Termination callback for generic Desktop Environment helper.
104 *
105 * @returns IPRT status code.
106 */
107RTDECL(int) vbcl_hlp_generic_term(void);
108
109/**
110 * Subscribe to display offset change notifications emitted by Generic Desktop Environment helper.
111 *
112 * @param pfnCb A pointer to callback function which will be triggered when event arrives.
113 */
114RTDECL(void) vbcl_hlp_generic_subscribe_display_offset_changed(FNDISPLAYOFFSETCHANGE *pfnCb);
115
116/**
117 * Unsubscribe from display offset change notifications emitted by Generic Desktop Environment helper.
118 */
119RTDECL(void) vbcl_hlp_generic_unsubscribe_display_offset_changed(void);
120
121/** GNOME3 helper private data. */
122extern const VBCLDISPLAYHELPER g_DisplayHelperGnome3;
123/** Generic helper private data. */
124extern const VBCLDISPLAYHELPER g_DisplayHelperGeneric;
125
126#endif /* !GA_INCLUDED_SRC_x11_VBoxClient_display_helper_h */
Note: See TracBrowser for help on using the repository browser.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette