diff options
author | Ryan Stewart <ryan@binsoftware.com> | 2015-03-18 14:16:35 -0700 |
---|---|---|
committer | Ryan Stewart <ryan@binsoftware.com> | 2015-03-18 14:16:35 -0700 |
commit | 1b2fd6e6d01788922a90cd4e58adf371007f50a8 (patch) | |
tree | 5266e1e7a4c1141faeb71a51e01047daa32e712a /src/lib.rs | |
parent | 779f3ce888e0009bdbd14bc28a1e475b46df83ee (diff) | |
download | glutin-1b2fd6e6d01788922a90cd4e58adf371007f50a8.tar.gz glutin-1b2fd6e6d01788922a90cd4e58adf371007f50a8.zip |
fix headless build by ensuring NativeMonitorId enum is available internally even without the window feature; add Eq/PartialEq to NativeMonitorId
Diffstat (limited to 'src/lib.rs')
-rw-r--r-- | src/lib.rs | 21 |
1 files changed, 20 insertions, 1 deletions
@@ -50,7 +50,9 @@ pub use headless::{HeadlessRendererBuilder, HeadlessContext}; #[cfg(feature = "window")] pub use window::{WindowBuilder, Window, WindowProxy, PollEventsIterator, WaitEventsIterator}; #[cfg(feature = "window")] -pub use window::{AvailableMonitorsIter, NativeMonitorID, MonitorID, get_available_monitors, get_primary_monitor}; +pub use window::{AvailableMonitorsIter, MonitorID, get_available_monitors, get_primary_monitor}; +#[cfg(feature = "window")] +pub use native_monitor::NativeMonitorId; #[cfg(all(not(target_os = "windows"), not(target_os = "linux"), not(target_os = "macos"), not(target_os = "android")))] use this_platform_is_not_supported; @@ -322,3 +324,20 @@ impl<'a> BuilderAttribs<'a> { .expect("Could not find compliant pixel format") } } + +mod native_monitor { + /// Native platform identifier for a monitor. Different platforms use fundamentally different types + /// to represent a monitor ID. + #[derive(PartialEq, Eq)] + pub enum NativeMonitorId { + /// Cocoa and X11 use a numeric identifier to represent a monitor. + Numeric(u32), + + /// Win32 uses a Unicode string to represent a monitor. + Name(String), + + /// Other platforms (Android) don't support monitor identification. + Unavailable + } +} + |