diff options
author | tomaka <pierre.krieger1708@gmail.com> | 2015-09-24 09:34:35 +0200 |
---|---|---|
committer | tomaka <pierre.krieger1708@gmail.com> | 2015-09-24 09:34:35 +0200 |
commit | 3e11e5ef69cc714c067dff49834f0e782c8f7fc6 (patch) | |
tree | c60477887a81d310e11f37c1e25ec3d5862ead7b /src/platform/linux | |
parent | aa5f5de1099fab89f173fb02bae16324946de147 (diff) | |
parent | 86fa1b58e5a44a1711e812ed1e56c0e2c6946eed (diff) | |
download | glutin-3e11e5ef69cc714c067dff49834f0e782c8f7fc6.tar.gz glutin-3e11e5ef69cc714c067dff49834f0e782c8f7fc6.zip |
Merge pull request #612 from tomaka/monitorid-to-monitorid
Rename MonitorID -> MonitorId
Diffstat (limited to 'src/platform/linux')
-rw-r--r-- | src/platform/linux/api_dispatch.rs | 44 | ||||
-rw-r--r-- | src/platform/linux/mod.rs | 4 |
2 files changed, 24 insertions, 24 deletions
diff --git a/src/platform/linux/api_dispatch.rs b/src/platform/linux/api_dispatch.rs index 5ab4ae2..cb35b26 100644 --- a/src/platform/linux/api_dispatch.rs +++ b/src/platform/linux/api_dispatch.rs @@ -1,5 +1,5 @@ /*#[cfg(feature = "window")] -pub use api::x11::{Window, WindowProxy, MonitorID, get_available_monitors, get_primary_monitor}; +pub use api::x11::{Window, WindowProxy, MonitorId, get_available_monitors, get_primary_monitor}; #[cfg(feature = "window")] pub use api::x11::{WaitEventsIterator, PollEventsIterator};*/ @@ -69,64 +69,64 @@ impl WindowProxy { } #[derive(Clone)] -pub enum MonitorID { +pub enum MonitorId { #[doc(hidden)] - X(x11::MonitorID), + X(x11::MonitorId), #[doc(hidden)] - Wayland(wayland::MonitorID), + Wayland(wayland::MonitorId), #[doc(hidden)] None, } #[inline] -pub fn get_available_monitors() -> VecDeque<MonitorID> { +pub fn get_available_monitors() -> VecDeque<MonitorId> { match *BACKEND { Backend::Wayland => wayland::get_available_monitors() .into_iter() - .map(MonitorID::Wayland) + .map(MonitorId::Wayland) .collect(), Backend::X(ref connec) => x11::get_available_monitors(connec) .into_iter() - .map(MonitorID::X) + .map(MonitorId::X) .collect(), - Backend::Error(_) => { let mut d = VecDeque::new(); d.push_back(MonitorID::None); d}, + Backend::Error(_) => { let mut d = VecDeque::new(); d.push_back(MonitorId::None); d}, } } #[inline] -pub fn get_primary_monitor() -> MonitorID { +pub fn get_primary_monitor() -> MonitorId { match *BACKEND { - Backend::Wayland => MonitorID::Wayland(wayland::get_primary_monitor()), - Backend::X(ref connec) => MonitorID::X(x11::get_primary_monitor(connec)), - Backend::Error(_) => MonitorID::None, + Backend::Wayland => MonitorId::Wayland(wayland::get_primary_monitor()), + Backend::X(ref connec) => MonitorId::X(x11::get_primary_monitor(connec)), + Backend::Error(_) => MonitorId::None, } } -impl MonitorID { +impl MonitorId { #[inline] pub fn get_name(&self) -> Option<String> { match self { - &MonitorID::X(ref m) => m.get_name(), - &MonitorID::Wayland(ref m) => m.get_name(), - &MonitorID::None => None, + &MonitorId::X(ref m) => m.get_name(), + &MonitorId::Wayland(ref m) => m.get_name(), + &MonitorId::None => None, } } #[inline] pub fn get_native_identifier(&self) -> ::native_monitor::NativeMonitorId { match self { - &MonitorID::X(ref m) => m.get_native_identifier(), - &MonitorID::Wayland(ref m) => m.get_native_identifier(), - &MonitorID::None => unimplemented!() // FIXME: + &MonitorId::X(ref m) => m.get_native_identifier(), + &MonitorId::Wayland(ref m) => m.get_native_identifier(), + &MonitorId::None => unimplemented!() // FIXME: } } #[inline] pub fn get_dimensions(&self) -> (u32, u32) { match self { - &MonitorID::X(ref m) => m.get_dimensions(), - &MonitorID::Wayland(ref m) => m.get_dimensions(), - &MonitorID::None => (800, 600), // FIXME: + &MonitorId::X(ref m) => m.get_dimensions(), + &MonitorId::Wayland(ref m) => m.get_dimensions(), + &MonitorId::None => (800, 600), // FIXME: } } } diff --git a/src/platform/linux/mod.rs b/src/platform/linux/mod.rs index f5d663b..4f97d5c 100644 --- a/src/platform/linux/mod.rs +++ b/src/platform/linux/mod.rs @@ -12,7 +12,7 @@ use libc; use api::osmesa::{self, OsMesaContext}; #[cfg(feature = "window")] -pub use self::api_dispatch::{Window, WindowProxy, MonitorID, get_available_monitors, get_primary_monitor}; +pub use self::api_dispatch::{Window, WindowProxy, MonitorId, get_available_monitors, get_primary_monitor}; #[cfg(feature = "window")] pub use self::api_dispatch::{WaitEventsIterator, PollEventsIterator}; #[cfg(feature = "window")] @@ -21,7 +21,7 @@ mod api_dispatch; #[cfg(not(feature = "window"))] pub type Window = (); // TODO: hack to make things work #[cfg(not(feature = "window"))] -pub type MonitorID = (); // TODO: hack to make things work +pub type MonitorId = (); // TODO: hack to make things work pub struct HeadlessContext(OsMesaContext); |