1 | /** @file
|
---|
2 | * Stubs for dynamically loading libXrandr and the symbols which are needed by
|
---|
3 | * VirtualBox.
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2008-2023 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 | * The contents of this file may alternatively be used under the terms
|
---|
26 | * of the Common Development and Distribution License Version 1.0
|
---|
27 | * (CDDL), a copy of it is provided in the "COPYING.CDDL" file included
|
---|
28 | * in the VirtualBox distribution, in which case the provisions of the
|
---|
29 | * CDDL are applicable instead of those of the GPL.
|
---|
30 | *
|
---|
31 | * You may elect to license modified versions of this file under the
|
---|
32 | * terms and conditions of either the GPL or the CDDL or both.
|
---|
33 | *
|
---|
34 | * SPDX-License-Identifier: GPL-3.0-only OR CDDL-1.0
|
---|
35 | */
|
---|
36 |
|
---|
37 | /** The file name of the libXrandr library. */
|
---|
38 | #define RT_RUNTIME_LOADER_LIB_NAME "libXrandr.so.2"
|
---|
39 |
|
---|
40 | /** The name of the loader function. */
|
---|
41 | #define RT_RUNTIME_LOADER_FUNCTION RTXrandrLoadLib
|
---|
42 |
|
---|
43 | /** The following are the symbols which we need from the Xrandr library. */
|
---|
44 | #define RT_RUNTIME_LOADER_INSERT_SYMBOLS \
|
---|
45 | RT_PROXY_STUB(XRRQueryExtension, Bool, (Display *dpy, int *event_base_return, int *error_base_return), \
|
---|
46 | (dpy, event_base_return, error_base_return)) \
|
---|
47 | RT_PROXY_STUB(XRRQueryVersion, Bool, (Display *dpy, int *major_version_return, int *minor_version_return), \
|
---|
48 | (dpy, major_version_return, minor_version_return)) \
|
---|
49 | RT_PROXY_STUB(XRRSelectInput, void, (Display *dpy, Window window, int mask), \
|
---|
50 | (dpy, window, mask)) \
|
---|
51 | RT_PROXY_STUB(XRRGetMonitors, XRRMonitorInfo *, (Display *dpy, Window window, Bool get_active, int *nmonitors), \
|
---|
52 | (dpy, window, get_active, nmonitors)) \
|
---|
53 | RT_PROXY_STUB(XRRFreeMonitors, void, (XRRMonitorInfo *monitors), \
|
---|
54 | (monitors)) \
|
---|
55 | RT_PROXY_STUB(XRRGetScreenResources, XRRScreenResources *, (Display *dpy, Window window), \
|
---|
56 | (dpy, window)) \
|
---|
57 | RT_PROXY_STUB(XRRFreeScreenResources, void, (XRRScreenResources *resources), \
|
---|
58 | (resources)) \
|
---|
59 | RT_PROXY_STUB(XRRSetOutputPrimary, void, (Display *dpy, Window window, RROutput output), \
|
---|
60 | (dpy, window, output))
|
---|
61 |
|
---|
62 | #ifdef VBOX_XRANDR_GENERATE_HEADER
|
---|
63 | # define RT_RUNTIME_LOADER_GENERATE_HEADER
|
---|
64 | # define RT_RUNTIME_LOADER_GENERATE_DECLS
|
---|
65 | # include <iprt/runtime-loader.h>
|
---|
66 | # undef RT_RUNTIME_LOADER_GENERATE_HEADER
|
---|
67 | # undef RT_RUNTIME_LOADER_GENERATE_DECLS
|
---|
68 |
|
---|
69 | #elif defined(VBOX_XRANDR_GENERATE_BODY)
|
---|
70 | # define RT_RUNTIME_LOADER_GENERATE_BODY_STUBS
|
---|
71 | # include <iprt/runtime-loader.h>
|
---|
72 | # undef RT_RUNTIME_LOADER_GENERATE_BODY_STUBS
|
---|
73 |
|
---|
74 | #else
|
---|
75 | # error This file should only be included to generate stubs for loading the Xrandr library at runtime
|
---|
76 | #endif
|
---|
77 |
|
---|
78 | #undef RT_RUNTIME_LOADER_LIB_NAME
|
---|
79 | #undef RT_RUNTIME_LOADER_INSERT_SYMBOLS
|
---|
80 |
|
---|