| 1 |
/* |
| 2 |
* Copyright 2026 Zhiyi Zhang for CodeWeavers |
| 3 |
* |
| 4 |
* This library is free software; you can redistribute it and/or |
| 5 |
* modify it under the terms of the GNU Lesser General Public |
| 6 |
* License as published by the Free Software Foundation; either |
| 7 |
* version 2.1 of the License, or (at your option) any later version. |
| 8 |
* |
| 9 |
* This library is distributed in the hope that it will be useful, |
| 10 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 12 |
* Lesser General Public License for more details. |
| 13 |
* |
| 14 |
* You should have received a copy of the GNU Lesser General Public |
| 15 |
* License along with this library; if not, write to the Free Software |
| 16 |
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA |
| 17 |
*/ |
| 18 |
|
| 19 |
#ifdef __WIDL__ |
| 20 |
#pragma winrt ns_prefix |
| 21 |
#endif |
| 22 |
|
| 23 |
import "inspectable.idl"; |
| 24 |
import "asyncinfo.idl"; |
| 25 |
import "eventtoken.idl"; |
| 26 |
import "windowscontracts.idl"; |
| 27 |
import "windows.foundation.idl"; |
| 28 |
import "windows.graphics.idl"; |
| 29 |
import "windows.storage.streams.idl"; |
| 30 |
|
| 31 |
namespace Windows.Graphics.Display { |
| 32 |
typedef enum AdvancedColorKind AdvancedColorKind; |
| 33 |
typedef enum DisplayOrientations DisplayOrientations; |
| 34 |
typedef enum HdrMetadataFormat HdrMetadataFormat; |
| 35 |
typedef enum ResolutionScale ResolutionScale; |
| 36 |
|
| 37 |
interface IAdvancedColorInfo; |
| 38 |
interface IDisplayInformationStatics; |
| 39 |
|
| 40 |
runtimeclass AdvancedColorInfo; |
| 41 |
runtimeclass DisplayInformation; |
| 42 |
|
| 43 |
declare { |
| 44 |
interface Windows.Foundation.TypedEventHandler<Windows.Graphics.Display.DisplayInformation *, IInspectable *>; |
| 45 |
} |
| 46 |
|
| 47 |
[ |
| 48 |
contract(Windows.Foundation.UniversalApiContract, 6.0) |
| 49 |
] |
| 50 |
enum AdvancedColorKind |
| 51 |
{ |
| 52 |
StandardDynamicRange = 0, |
| 53 |
WideColorGamut = 1, |
| 54 |
HighDynamicRange = 2 |
| 55 |
}; |
| 56 |
|
| 57 |
[ |
| 58 |
contract(Windows.Foundation.UniversalApiContract, 1.0), |
| 59 |
flags |
| 60 |
] |
| 61 |
enum DisplayOrientations |
| 62 |
{ |
| 63 |
None = 0x0, |
| 64 |
Landscape = 0x1, |
| 65 |
Portrait = 0x2, |
| 66 |
LandscapeFlipped = 0x4, |
| 67 |
PortraitFlipped = 0x8 |
| 68 |
}; |
| 69 |
|
| 70 |
[ |
| 71 |
contract(Windows.Foundation.UniversalApiContract, 6.0) |
| 72 |
] |
| 73 |
enum HdrMetadataFormat |
| 74 |
{ |
| 75 |
Hdr10 = 0, |
| 76 |
Hdr10Plus = 1 |
| 77 |
}; |
| 78 |
|
| 79 |
[ |
| 80 |
contract(Windows.Foundation.UniversalApiContract, 1.0) |
| 81 |
] |
| 82 |
enum ResolutionScale |
| 83 |
{ |
| 84 |
Invalid = 0, |
| 85 |
Scale100Percent = 100, |
| 86 |
[contract(Windows.Foundation.UniversalApiContract, 1.0)] Scale120Percent = 120, |
| 87 |
[contract(Windows.Foundation.UniversalApiContract, 1.0)] Scale125Percent = 125, |
| 88 |
Scale140Percent = 140, |
| 89 |
[contract(Windows.Foundation.UniversalApiContract, 1.0)] Scale150Percent = 150, |
| 90 |
[contract(Windows.Foundation.UniversalApiContract, 1.0)] Scale160Percent = 160, |
| 91 |
[contract(Windows.Foundation.UniversalApiContract, 1.0)] Scale175Percent = 175, |
| 92 |
Scale180Percent = 180, |
| 93 |
[contract(Windows.Foundation.UniversalApiContract, 1.0)] Scale200Percent = 200, |
| 94 |
[contract(Windows.Foundation.UniversalApiContract, 1.0)] Scale225Percent = 225, |
| 95 |
[contract(Windows.Foundation.UniversalApiContract, 1.0)] Scale250Percent = 250, |
| 96 |
[contract(Windows.Foundation.UniversalApiContract, 1.0)] Scale300Percent = 300, |
| 97 |
[contract(Windows.Foundation.UniversalApiContract, 1.0)] Scale350Percent = 350, |
| 98 |
[contract(Windows.Foundation.UniversalApiContract, 1.0)] Scale400Percent = 400, |
| 99 |
[contract(Windows.Foundation.UniversalApiContract, 1.0)] Scale450Percent = 450, |
| 100 |
[contract(Windows.Foundation.UniversalApiContract, 1.0)] Scale500Percent = 500 |
| 101 |
}; |
| 102 |
|
| 103 |
[ |
| 104 |
contract(Windows.Foundation.UniversalApiContract, 6.0), |
| 105 |
exclusiveto(Windows.Graphics.Display.AdvancedColorInfo), |
| 106 |
uuid(8797dcfb-b229-4081-ae9a-2cc85e34ad6a) |
| 107 |
] |
| 108 |
interface IAdvancedColorInfo : IInspectable |
| 109 |
{ |
| 110 |
[propget] HRESULT CurrentAdvancedColorKind([out, retval] Windows.Graphics.Display.AdvancedColorKind *value); |
| 111 |
[propget] HRESULT RedPrimary([out, retval] Windows.Foundation.Point *value); |
| 112 |
[propget] HRESULT GreenPrimary([out, retval] Windows.Foundation.Point *value); |
| 113 |
[propget] HRESULT BluePrimary([out, retval] Windows.Foundation.Point *value); |
| 114 |
[propget] HRESULT WhitePoint([out, retval] Windows.Foundation.Point *value); |
| 115 |
[propget] HRESULT MaxLuminanceInNits([out, retval] FLOAT *value); |
| 116 |
[propget] HRESULT MinLuminanceInNits([out, retval] FLOAT *value); |
| 117 |
[propget] HRESULT MaxAverageFullFrameLuminanceInNits([out, retval] FLOAT *value); |
| 118 |
[propget] HRESULT SdrWhiteLevelInNits([out, retval] FLOAT *value); |
| 119 |
HRESULT IsHdrMetadataFormatCurrentlySupported([in] Windows.Graphics.Display.HdrMetadataFormat format, [out, retval] boolean *result); |
| 120 |
HRESULT IsAdvancedColorKindAvailable([in] Windows.Graphics.Display.AdvancedColorKind kind, [out, retval] boolean *result); |
| 121 |
} |
| 122 |
|
| 123 |
[ |
| 124 |
contract(Windows.Foundation.UniversalApiContract, 1.0), |
| 125 |
exclusiveto(Windows.Graphics.Display.DisplayInformation), |
| 126 |
uuid(bed112ae-adc3-4dc9-ae65-851f4d7d4799) |
| 127 |
] |
| 128 |
interface IDisplayInformation : IInspectable |
| 129 |
{ |
| 130 |
[propget] HRESULT CurrentOrientation([out, retval] Windows.Graphics.Display.DisplayOrientations *value); |
| 131 |
[propget] HRESULT NativeOrientation([out, retval] Windows.Graphics.Display.DisplayOrientations *value); |
| 132 |
[eventadd] HRESULT OrientationChanged([in] Windows.Foundation.TypedEventHandler<Windows.Graphics.Display.DisplayInformation *, IInspectable *> *handler, [out, retval] EventRegistrationToken *token); |
| 133 |
[eventremove] HRESULT OrientationChanged([in] EventRegistrationToken token); |
| 134 |
[propget] HRESULT ResolutionScale([out, retval] Windows.Graphics.Display.ResolutionScale *value); |
| 135 |
[propget] HRESULT LogicalDpi([out, retval] FLOAT *value); |
| 136 |
[propget] HRESULT RawDpiX([out, retval] FLOAT *value); |
| 137 |
[propget] HRESULT RawDpiY([out, retval] FLOAT *value); |
| 138 |
[eventadd] HRESULT DpiChanged([in] Windows.Foundation.TypedEventHandler<Windows.Graphics.Display.DisplayInformation *, IInspectable *> *handler, [out, retval] EventRegistrationToken *token); |
| 139 |
[eventremove] HRESULT DpiChanged([in] EventRegistrationToken token); |
| 140 |
[propget] HRESULT StereoEnabled([out, retval] boolean *value); |
| 141 |
[eventadd] HRESULT StereoEnabledChanged([in] Windows.Foundation.TypedEventHandler<Windows.Graphics.Display.DisplayInformation *, IInspectable *> *handler, [out, retval] EventRegistrationToken *token); |
| 142 |
[eventremove] HRESULT StereoEnabledChanged([in] EventRegistrationToken token); |
| 143 |
HRESULT GetColorProfileAsync([out, retval] Windows.Foundation.IAsyncOperation<Windows.Storage.Streams.IRandomAccessStream *> **async_info); |
| 144 |
[eventadd] HRESULT ColorProfileChanged([in] Windows.Foundation.TypedEventHandler<Windows.Graphics.Display.DisplayInformation *, IInspectable *> *handler, [out, retval] EventRegistrationToken *token); |
| 145 |
[eventremove] HRESULT ColorProfileChanged([in] EventRegistrationToken token); |
| 146 |
} |
| 147 |
|
| 148 |
[ |
| 149 |
contract(Windows.Foundation.UniversalApiContract, 1.0), |
| 150 |
exclusiveto(Windows.Graphics.Display.DisplayInformation), |
| 151 |
uuid(4dcd0021-fad1-4b8e-8edf-775887b8bf19) |
| 152 |
] |
| 153 |
interface IDisplayInformation2 : IInspectable |
| 154 |
requires Windows.Graphics.Display.IDisplayInformation |
| 155 |
{ |
| 156 |
[propget] HRESULT RawPixelsPerViewPixel([out, retval] DOUBLE *value); |
| 157 |
} |
| 158 |
|
| 159 |
[ |
| 160 |
contract(Windows.Foundation.UniversalApiContract, 2.0), |
| 161 |
exclusiveto(Windows.Graphics.Display.DisplayInformation), |
| 162 |
uuid(db15011d-0f09-4466-8ff3-11de9a3c929a) |
| 163 |
] |
| 164 |
interface IDisplayInformation3 : IInspectable |
| 165 |
{ |
| 166 |
[propget] HRESULT DiagonalSizeInInches([out, retval] Windows.Foundation.IReference<DOUBLE> **value); |
| 167 |
} |
| 168 |
|
| 169 |
[ |
| 170 |
contract(Windows.Foundation.UniversalApiContract, 3.0), |
| 171 |
exclusiveto(Windows.Graphics.Display.DisplayInformation), |
| 172 |
uuid(c972ce2f-1242-46be-b536-e1aafe9e7acf) |
| 173 |
] |
| 174 |
interface IDisplayInformation4 : IInspectable |
| 175 |
{ |
| 176 |
[propget] HRESULT ScreenWidthInRawPixels([out, retval] UINT32 *value); |
| 177 |
[propget] HRESULT ScreenHeightInRawPixels([out, retval] UINT32 *value); |
| 178 |
} |
| 179 |
|
| 180 |
[ |
| 181 |
contract(Windows.Foundation.UniversalApiContract, 6.0), |
| 182 |
exclusiveto(Windows.Graphics.Display.DisplayInformation), |
| 183 |
uuid(3a5442dc-2cde-4a8d-80d1-21dc5adcc1aa) |
| 184 |
] |
| 185 |
interface IDisplayInformation5 : IInspectable |
| 186 |
{ |
| 187 |
HRESULT GetAdvancedColorInfo([out, retval] Windows.Graphics.Display.AdvancedColorInfo **value); |
| 188 |
[eventadd] HRESULT AdvancedColorInfoChanged([in] Windows.Foundation.TypedEventHandler<Windows.Graphics.Display.DisplayInformation *, IInspectable *> *handler, [out, retval] EventRegistrationToken *token); |
| 189 |
[eventremove] HRESULT AdvancedColorInfoChanged([in] EventRegistrationToken token); |
| 190 |
} |
| 191 |
|
| 192 |
[ |
| 193 |
contract(Windows.Foundation.UniversalApiContract, 1.0), |
| 194 |
exclusiveto(Windows.Graphics.Display.DisplayInformation), |
| 195 |
uuid(c6a02a6c-d452-44dc-ba07-96f3c6adf9d1) |
| 196 |
] |
| 197 |
interface IDisplayInformationStatics : IInspectable |
| 198 |
{ |
| 199 |
HRESULT GetForCurrentView([out, retval] Windows.Graphics.Display.DisplayInformation **current); |
| 200 |
[propget] HRESULT AutoRotationPreferences([out, retval] Windows.Graphics.Display.DisplayOrientations *value); |
| 201 |
[propput] HRESULT AutoRotationPreferences([in] Windows.Graphics.Display.DisplayOrientations value); |
| 202 |
[eventadd] HRESULT DisplayContentsInvalidated([in] Windows.Foundation.TypedEventHandler<Windows.Graphics.Display.DisplayInformation *, IInspectable *> *handler, [out, retval] EventRegistrationToken *token); |
| 203 |
[eventremove] HRESULT DisplayContentsInvalidated([in] EventRegistrationToken token); |
| 204 |
} |
| 205 |
|
| 206 |
[ |
| 207 |
contract(Windows.Foundation.UniversalApiContract, 6.0), |
| 208 |
marshaling_behavior(agile), |
| 209 |
threading(both) |
| 210 |
] |
| 211 |
runtimeclass AdvancedColorInfo |
| 212 |
{ |
| 213 |
[default] interface Windows.Graphics.Display.IAdvancedColorInfo; |
| 214 |
} |
| 215 |
|
| 216 |
[ |
| 217 |
contract(Windows.Foundation.UniversalApiContract, 1.0), |
| 218 |
marshaling_behavior(agile), |
| 219 |
static(Windows.Graphics.Display.IDisplayInformationStatics, Windows.Foundation.UniversalApiContract, 1.0) |
| 220 |
] |
| 221 |
runtimeclass DisplayInformation |
| 222 |
{ |
| 223 |
[default] interface Windows.Graphics.Display.IDisplayInformation; |
| 224 |
[contract(Windows.Foundation.UniversalApiContract, 1.0)] interface Windows.Graphics.Display.IDisplayInformation2; |
| 225 |
[contract(Windows.Foundation.UniversalApiContract, 2.0)] interface Windows.Graphics.Display.IDisplayInformation3; |
| 226 |
[contract(Windows.Foundation.UniversalApiContract, 3.0)] interface Windows.Graphics.Display.IDisplayInformation4; |
| 227 |
[contract(Windows.Foundation.UniversalApiContract, 6.0)] interface Windows.Graphics.Display.IDisplayInformation5; |
| 228 |
} |
| 229 |
} |