1 // Licensed under the Apache License, Version 2.0
2 // <LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
3 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your option.
4 // All files in the project carrying such notice may not be copied, modified, or distributed
5 // except according to those terms.
6 use shared::minwindef::{DWORD, LPDWORD};
7 use um::physicalmonitorenumerationapi::_BOOL;
8 use um::winnt::HANDLE;
9 pub const MC_CAPS_NONE: DWORD = 0x00000000;
10 pub const MC_CAPS_MONITOR_TECHNOLOGY_TYPE: DWORD = 0x00000001;
11 pub const MC_CAPS_BRIGHTNESS: DWORD = 0x00000002;
12 pub const MC_CAPS_CONTRAST: DWORD = 0x00000004;
13 pub const MC_CAPS_COLOR_TEMPERATURE: DWORD = 0x00000008;
14 pub const MC_CAPS_RED_GREEN_BLUE_GAIN: DWORD = 0x00000010;
15 pub const MC_CAPS_RED_GREEN_BLUE_DRIVE: DWORD = 0x00000020;
16 pub const MC_CAPS_DEGAUSS: DWORD = 0x00000040;
17 pub const MC_CAPS_DISPLAY_AREA_POSITION: DWORD = 0x00000080;
18 pub const MC_CAPS_DISPLAY_AREA_SIZE: DWORD = 0x00000100;
19 pub const MC_CAPS_RESTORE_FACTORY_DEFAULTS: DWORD = 0x00000400;
20 pub const MC_CAPS_RESTORE_FACTORY_COLOR_DEFAULTS: DWORD = 0x00000800;
21 pub const MC_RESTORE_FACTORY_DEFAULTS_ENABLES_MONITOR_SETTINGS: DWORD = 0x00001000;
22 pub const MC_SUPPORTED_COLOR_TEMPERATURE_NONE: DWORD = 0x00000000;
23 pub const MC_SUPPORTED_COLOR_TEMPERATURE_4000K: DWORD = 0x00000001;
24 pub const MC_SUPPORTED_COLOR_TEMPERATURE_5000K: DWORD = 0x00000002;
25 pub const MC_SUPPORTED_COLOR_TEMPERATURE_6500K: DWORD = 0x00000004;
26 pub const MC_SUPPORTED_COLOR_TEMPERATURE_7500K: DWORD = 0x00000008;
27 pub const MC_SUPPORTED_COLOR_TEMPERATURE_8200K: DWORD = 0x00000010;
28 pub const MC_SUPPORTED_COLOR_TEMPERATURE_9300K: DWORD = 0x00000020;
29 pub const MC_SUPPORTED_COLOR_TEMPERATURE_10000K: DWORD = 0x00000040;
30 pub const MC_SUPPORTED_COLOR_TEMPERATURE_11500K: DWORD = 0x00000080;
31 ENUM!{enum MC_DISPLAY_TECHNOLOGY_TYPE {
32     MC_SHADOW_MASK_CATHODE_RAY_TUBE,
33     MC_APERTURE_GRILL_CATHODE_RAY_TUBE,
34     MC_THIN_FILM_TRANSISTOR,
35     MC_LIQUID_CRYSTAL_ON_SILICON,
36     MC_PLASMA,
37     MC_ORGANIC_LIGHT_EMITTING_DIODE,
38     MC_ELECTROLUMINESCENT,
39     MC_MICROELECTROMECHANICAL,
40     MC_FIELD_EMISSION_DEVICE,
41 }}
42 pub type LPMC_DISPLAY_TECHNOLOGY_TYPE = *mut MC_DISPLAY_TECHNOLOGY_TYPE;
43 ENUM!{enum MC_DRIVE_TYPE {
44     MC_RED_DRIVE,
45     MC_GREEN_DRIVE,
46     MC_BLUE_DRIVE,
47 }}
48 ENUM!{enum MC_GAIN_TYPE {
49     MC_RED_GAIN,
50     MC_GREEN_GAIN,
51     MC_BLUE_GAIN,
52 }}
53 ENUM!{enum MC_POSITION_TYPE {
54     MC_HORIZONTAL_POSITION,
55     MC_VERTICAL_POSITION,
56 }}
57 ENUM!{enum MC_SIZE_TYPE {
58     MC_WIDTH,
59     MC_HEIGHT,
60 }}
61 ENUM!{enum MC_COLOR_TEMPERATURE {
62     MC_COLOR_TEMPERATURE_UNKNOWN,
63     MC_COLOR_TEMPERATURE_4000K,
64     MC_COLOR_TEMPERATURE_5000K,
65     MC_COLOR_TEMPERATURE_6500K,
66     MC_COLOR_TEMPERATURE_7500K,
67     MC_COLOR_TEMPERATURE_8200K,
68     MC_COLOR_TEMPERATURE_9300K,
69     MC_COLOR_TEMPERATURE_10000K,
70     MC_COLOR_TEMPERATURE_11500K,
71 }}
72 pub type LPMC_COLOR_TEMPERATURE = *mut MC_COLOR_TEMPERATURE;
73 extern "system" {
GetMonitorCapabilities( hMonitor: HANDLE, pdwMonitorCapabilities: LPDWORD, pdwSupportedColorTemperature: LPDWORD, ) -> _BOOL74     pub fn GetMonitorCapabilities(
75         hMonitor: HANDLE,
76         pdwMonitorCapabilities: LPDWORD,
77         pdwSupportedColorTemperature: LPDWORD,
78     ) -> _BOOL;
SaveCurrentMonitorSettings( hMonitor: HANDLE, ) -> _BOOL79     pub fn SaveCurrentMonitorSettings(
80         hMonitor: HANDLE,
81     ) -> _BOOL;
GetMonitorTechnologyType( hMonitor: HANDLE, pdtyDisplayTechnologyType: LPMC_DISPLAY_TECHNOLOGY_TYPE, ) -> _BOOL82     pub fn GetMonitorTechnologyType(
83         hMonitor: HANDLE,
84         pdtyDisplayTechnologyType: LPMC_DISPLAY_TECHNOLOGY_TYPE,
85     ) -> _BOOL;
GetMonitorBrightness( hMonitor: HANDLE, pdwMinimumBrightness: LPDWORD, pdwCurrentBrightness: LPDWORD, pdwMaximumBrightness: LPDWORD, ) -> _BOOL86     pub fn GetMonitorBrightness(
87         hMonitor: HANDLE,
88         pdwMinimumBrightness: LPDWORD,
89         pdwCurrentBrightness: LPDWORD,
90         pdwMaximumBrightness: LPDWORD,
91     ) -> _BOOL;
GetMonitorContrast( hMonitor: HANDLE, pdwMinimumContrast: LPDWORD, pdwCurrentContrast: LPDWORD, pdwMaximumContrast: LPDWORD, ) -> _BOOL92     pub fn GetMonitorContrast(
93         hMonitor: HANDLE,
94         pdwMinimumContrast: LPDWORD,
95         pdwCurrentContrast: LPDWORD,
96         pdwMaximumContrast: LPDWORD,
97     ) -> _BOOL;
GetMonitorColorTemperature( hMonitor: HANDLE, pctCurrentColorTemperature: LPMC_COLOR_TEMPERATURE, ) -> _BOOL98     pub fn GetMonitorColorTemperature(
99         hMonitor: HANDLE,
100         pctCurrentColorTemperature: LPMC_COLOR_TEMPERATURE,
101     ) -> _BOOL;
GetMonitorRedGreenOrBlueDrive( hMonitor: HANDLE, dtDriveType: MC_DRIVE_TYPE, pdwMinimumDrive: LPDWORD, pdwCurrentDrive: LPDWORD, pdwMaximumDrive: LPDWORD, ) -> _BOOL102     pub fn GetMonitorRedGreenOrBlueDrive(
103         hMonitor: HANDLE,
104         dtDriveType: MC_DRIVE_TYPE,
105         pdwMinimumDrive: LPDWORD,
106         pdwCurrentDrive: LPDWORD,
107         pdwMaximumDrive: LPDWORD,
108     ) -> _BOOL;
GetMonitorRedGreenOrBlueGain( hMonitor: HANDLE, gtGainType: MC_GAIN_TYPE, pdwMinimumGain: LPDWORD, pdwCurrentGain: LPDWORD, pdwMaximumGain: LPDWORD, ) -> _BOOL109     pub fn GetMonitorRedGreenOrBlueGain(
110         hMonitor: HANDLE,
111         gtGainType: MC_GAIN_TYPE,
112         pdwMinimumGain: LPDWORD,
113         pdwCurrentGain: LPDWORD,
114         pdwMaximumGain: LPDWORD,
115     ) -> _BOOL;
SetMonitorBrightness( hMonitor: HANDLE, dwNewBrightness: DWORD, ) -> _BOOL116     pub fn SetMonitorBrightness(
117         hMonitor: HANDLE,
118         dwNewBrightness: DWORD,
119     ) -> _BOOL;
SetMonitorContrast( hMonitor: HANDLE, dwNewContrast: DWORD, ) -> _BOOL120     pub fn SetMonitorContrast(
121         hMonitor: HANDLE,
122         dwNewContrast: DWORD,
123     ) -> _BOOL;
SetMonitorColorTemperature( hMonitor: HANDLE, ctCurrentColorTemperature: MC_COLOR_TEMPERATURE, ) -> _BOOL124     pub fn SetMonitorColorTemperature(
125         hMonitor: HANDLE,
126         ctCurrentColorTemperature: MC_COLOR_TEMPERATURE,
127     ) -> _BOOL;
SetMonitorRedGreenOrBlueDrive( hMonitor: HANDLE, dtDriveType: MC_DRIVE_TYPE, dwNewDrive: DWORD, ) -> _BOOL128     pub fn SetMonitorRedGreenOrBlueDrive(
129         hMonitor: HANDLE,
130         dtDriveType: MC_DRIVE_TYPE,
131         dwNewDrive: DWORD,
132     ) -> _BOOL;
SetMonitorRedGreenOrBlueGain( hMonitor: HANDLE, gtGainType: MC_GAIN_TYPE, dwNewGain: DWORD, ) -> _BOOL133     pub fn SetMonitorRedGreenOrBlueGain(
134         hMonitor: HANDLE,
135         gtGainType: MC_GAIN_TYPE,
136         dwNewGain: DWORD,
137     ) -> _BOOL;
DegaussMonitor( hMonitor: HANDLE, ) -> _BOOL138     pub fn DegaussMonitor(
139         hMonitor: HANDLE,
140     ) -> _BOOL;
GetMonitorDisplayAreaSize( hMonitor: HANDLE, stSizeType: MC_SIZE_TYPE, pdwMinimumWidthOrHeight: LPDWORD, pdwCurrentWidthOrHeight: LPDWORD, pdwMaximumWidthOrHeight: LPDWORD, ) -> _BOOL141     pub fn GetMonitorDisplayAreaSize(
142         hMonitor: HANDLE,
143         stSizeType: MC_SIZE_TYPE,
144         pdwMinimumWidthOrHeight: LPDWORD,
145         pdwCurrentWidthOrHeight: LPDWORD,
146         pdwMaximumWidthOrHeight: LPDWORD,
147     ) -> _BOOL;
GetMonitorDisplayAreaPosition( hMonitor: HANDLE, ptPositionType: MC_POSITION_TYPE, pdwMinimumPosition: LPDWORD, pdwCurrentPosition: LPDWORD, pdwMaximumPosition: LPDWORD, ) -> _BOOL148     pub fn GetMonitorDisplayAreaPosition(
149         hMonitor: HANDLE,
150         ptPositionType: MC_POSITION_TYPE,
151         pdwMinimumPosition: LPDWORD,
152         pdwCurrentPosition: LPDWORD,
153         pdwMaximumPosition: LPDWORD,
154     ) -> _BOOL;
SetMonitorDisplayAreaSize( hMonitor: HANDLE, stSizeType: MC_SIZE_TYPE, dwNewDisplayAreaWidthOrHeight: DWORD, ) -> _BOOL155     pub fn SetMonitorDisplayAreaSize(
156         hMonitor: HANDLE,
157         stSizeType: MC_SIZE_TYPE,
158         dwNewDisplayAreaWidthOrHeight: DWORD,
159     ) -> _BOOL;
SetMonitorDisplayAreaPosition( hMonitor: HANDLE, ptPositionType: MC_POSITION_TYPE, dwNewPosition: DWORD, ) -> _BOOL160     pub fn SetMonitorDisplayAreaPosition(
161         hMonitor: HANDLE,
162         ptPositionType: MC_POSITION_TYPE,
163         dwNewPosition: DWORD,
164     ) -> _BOOL;
RestoreMonitorFactoryColorDefaults( hMonitor: HANDLE, ) -> _BOOL165     pub fn RestoreMonitorFactoryColorDefaults(
166         hMonitor: HANDLE,
167     ) -> _BOOL;
RestoreMonitorFactoryDefaults( hMonitor: HANDLE, ) -> _BOOL168     pub fn RestoreMonitorFactoryDefaults(
169         hMonitor: HANDLE,
170     ) -> _BOOL;
171 }
172