[92989] | 1 | /** @file
|
---|
| 2 | * Module to dynamically load libXrandr and load all symbols which are needed by
|
---|
| 3 | * VirtualBox.
|
---|
| 4 | */
|
---|
| 5 |
|
---|
| 6 | /*
|
---|
[98103] | 7 | * Copyright (C) 2008-2023 Oracle and/or its affiliates.
|
---|
[92989] | 8 | *
|
---|
[96407] | 9 | * This file is part of VirtualBox base platform packages, as
|
---|
| 10 | * available from https://www.virtualbox.org.
|
---|
[92989] | 11 | *
|
---|
[96407] | 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 | *
|
---|
[92989] | 25 | * The contents of this file may alternatively be used under the terms
|
---|
| 26 | * of the Common Development and Distribution License Version 1.0
|
---|
[96407] | 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
|
---|
[92989] | 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.
|
---|
[96407] | 33 | *
|
---|
| 34 | * SPDX-License-Identifier: GPL-3.0-only OR CDDL-1.0
|
---|
[92989] | 35 | */
|
---|
| 36 |
|
---|
| 37 | #ifndef VBOX_INCLUDED_xrandr_h
|
---|
| 38 | #define VBOX_INCLUDED_xrandr_h
|
---|
| 39 | #ifndef RT_WITHOUT_PRAGMA_ONCE
|
---|
| 40 | # pragma once
|
---|
| 41 | #endif
|
---|
| 42 |
|
---|
| 43 | #include <iprt/types.h>
|
---|
| 44 | #include <iprt/stdarg.h>
|
---|
| 45 |
|
---|
| 46 | #ifndef __cplusplus
|
---|
| 47 | # error "This header requires C++ to avoid name clashes."
|
---|
| 48 | #endif
|
---|
| 49 |
|
---|
[92992] | 50 | /* Define missing X11/XRandr structures, types and macros. */
|
---|
| 51 |
|
---|
| 52 | #define Bool int
|
---|
| 53 | #define RRScreenChangeNotifyMask (1L << 0)
|
---|
| 54 | #define RRScreenChangeNotify 0
|
---|
| 55 |
|
---|
| 56 | struct _XDisplay;
|
---|
| 57 | typedef struct _XDisplay Display;
|
---|
| 58 |
|
---|
| 59 | typedef unsigned long Atom;
|
---|
| 60 | typedef unsigned long XID;
|
---|
| 61 | typedef XID RROutput;
|
---|
| 62 | typedef XID Window;
|
---|
[93221] | 63 | typedef XID RROutput;
|
---|
| 64 | typedef XID RRCrtc;
|
---|
| 65 | typedef XID RRMode;
|
---|
| 66 | typedef unsigned long XRRModeFlags;
|
---|
| 67 | typedef unsigned long int Time;
|
---|
[92992] | 68 |
|
---|
| 69 | struct XRRMonitorInfo
|
---|
| 70 | {
|
---|
| 71 | Atom name;
|
---|
| 72 | Bool primary;
|
---|
| 73 | Bool automatic;
|
---|
| 74 | int noutput;
|
---|
| 75 | int x;
|
---|
| 76 | int y;
|
---|
| 77 | int width;
|
---|
| 78 | int height;
|
---|
| 79 | int mwidth;
|
---|
| 80 | int mheight;
|
---|
| 81 | RROutput *outputs;
|
---|
| 82 | };
|
---|
| 83 | typedef struct XRRMonitorInfo XRRMonitorInfo;
|
---|
| 84 |
|
---|
[93221] | 85 | struct XRRModeInfo
|
---|
| 86 | {
|
---|
| 87 | RRMode id;
|
---|
| 88 | unsigned int width;
|
---|
| 89 | unsigned int height;
|
---|
| 90 | unsigned long dotClock;
|
---|
| 91 | unsigned int hSyncStart;
|
---|
| 92 | unsigned int hSyncEnd;
|
---|
| 93 | unsigned int hTotal;
|
---|
| 94 | unsigned int hSkew;
|
---|
| 95 | unsigned int vSyncStart;
|
---|
| 96 | unsigned int vSyncEnd;
|
---|
| 97 | unsigned int vTotal;
|
---|
| 98 | char *name;
|
---|
| 99 | unsigned int nameLength;
|
---|
| 100 | XRRModeFlags modeFlags;
|
---|
| 101 | };
|
---|
| 102 | typedef struct XRRModeInfo XRRModeInfo;
|
---|
[92992] | 103 |
|
---|
[93221] | 104 | struct XRRScreenResources
|
---|
| 105 | {
|
---|
| 106 | Time timestamp;
|
---|
| 107 | Time configTimestamp;
|
---|
| 108 | int ncrtc;
|
---|
| 109 | RRCrtc *crtcs;
|
---|
| 110 | int noutput;
|
---|
| 111 | RROutput *outputs;
|
---|
| 112 | int nmode;
|
---|
| 113 | XRRModeInfo *modes;
|
---|
| 114 | };
|
---|
| 115 | typedef struct XRRScreenResources XRRScreenResources;
|
---|
| 116 |
|
---|
[94188] | 117 | /* Declarations of the functions that we need from libXrandr. */
|
---|
[92989] | 118 | #define VBOX_XRANDR_GENERATE_HEADER
|
---|
| 119 |
|
---|
| 120 | #include <VBox/xrandr-calls.h>
|
---|
| 121 |
|
---|
| 122 | #undef VBOX_XRANDR_GENERATE_HEADER
|
---|
| 123 |
|
---|
| 124 | #endif /* !VBOX_INCLUDED_xrandr_h */
|
---|
| 125 |
|
---|