1 | /** @file
|
---|
2 | * Stubs for dynamically loading libXrandr and the symbols which are needed by
|
---|
3 | * VirtualBox.
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2008-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 | * The contents of this file may alternatively be used under the terms
|
---|
18 | * of the Common Development and Distribution License Version 1.0
|
---|
19 | * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
|
---|
20 | * VirtualBox OSE distribution, in which case the provisions of the
|
---|
21 | * CDDL are applicable instead of those of the GPL.
|
---|
22 | *
|
---|
23 | * You may elect to license modified versions of this file under the
|
---|
24 | * terms and conditions of either the GPL or the CDDL or both.
|
---|
25 | */
|
---|
26 |
|
---|
27 | /** The file name of the DBus library */
|
---|
28 | #define RT_RUNTIME_LOADER_LIB_NAME "libXrandr.so.2"
|
---|
29 |
|
---|
30 | /** The name of the loader function */
|
---|
31 | #define RT_RUNTIME_LOADER_FUNCTION RTXrandrLoadLib
|
---|
32 |
|
---|
33 | /** The following are the symbols which we need from the Xrandr library. */
|
---|
34 | #define RT_RUNTIME_LOADER_INSERT_SYMBOLS \
|
---|
35 | RT_PROXY_STUB(XRRQueryExtension, Bool, (Display *dpy, int *event_base_return, int *error_base_return), \
|
---|
36 | (dpy, event_base_return, error_base_return)) \
|
---|
37 | RT_PROXY_STUB(XRRQueryVersion, Bool, (Display *dpy, int *major_version_return, int *minor_version_return), \
|
---|
38 | (dpy, major_version_return, minor_version_return)) \
|
---|
39 | RT_PROXY_STUB(XRRSelectInput, void, (Display *dpy, Window window, int mask), \
|
---|
40 | (dpy, window, mask)) \
|
---|
41 | RT_PROXY_STUB(XRRGetMonitors, XRRMonitorInfo *, (Display *dpy, Window window, Bool get_active, int *nmonitors), \
|
---|
42 | (dpy, window, get_active, nmonitors)) \
|
---|
43 | RT_PROXY_STUB(XRRFreeMonitors, void, (XRRMonitorInfo *monitors), \
|
---|
44 | (monitors))
|
---|
45 |
|
---|
46 | #ifdef VBOX_XRANDR_GENERATE_HEADER
|
---|
47 | # define RT_RUNTIME_LOADER_GENERATE_HEADER
|
---|
48 | # define RT_RUNTIME_LOADER_GENERATE_DECLS
|
---|
49 | # include <iprt/runtime-loader.h>
|
---|
50 | # undef RT_RUNTIME_LOADER_GENERATE_HEADER
|
---|
51 | # undef RT_RUNTIME_LOADER_GENERATE_DECLS
|
---|
52 |
|
---|
53 | #elif defined(VBOX_XRANDR_GENERATE_BODY)
|
---|
54 | # define RT_RUNTIME_LOADER_GENERATE_BODY_STUBS
|
---|
55 | # include <iprt/runtime-loader.h>
|
---|
56 | # undef RT_RUNTIME_LOADER_GENERATE_BODY_STUBS
|
---|
57 |
|
---|
58 | #else
|
---|
59 | # error This file should only be included to generate stubs for loading the Xrandr library at runtime
|
---|
60 | #endif
|
---|
61 |
|
---|
62 | #undef RT_RUNTIME_LOADER_LIB_NAME
|
---|
63 | #undef RT_RUNTIME_LOADER_INSERT_SYMBOLS
|
---|
64 |
|
---|