From 86fa1b58e5a44a1711e812ed1e56c0e2c6946eed Mon Sep 17 00:00:00 2001 From: Pierre Krieger Date: Thu, 24 Sep 2015 09:11:59 +0200 Subject: Rename MonitorID -> MonitorId --- src/api/win32/init.rs | 4 ++-- src/api/win32/mod.rs | 2 +- src/api/win32/monitor.rs | 16 ++++++++-------- 3 files changed, 11 insertions(+), 11 deletions(-) (limited to 'src/api/win32') diff --git a/src/api/win32/init.rs b/src/api/win32/init.rs index 7c7eb83..67e4e4e 100644 --- a/src/api/win32/init.rs +++ b/src/api/win32/init.rs @@ -6,7 +6,7 @@ use std::thread; use super::callback; use super::Window; -use super::MonitorID; +use super::MonitorId; use super::WindowWrapper; use super::Context; @@ -269,7 +269,7 @@ unsafe fn register_window_class() -> Vec { class_name } -unsafe fn switch_to_fullscreen(rect: &mut winapi::RECT, monitor: &MonitorID) +unsafe fn switch_to_fullscreen(rect: &mut winapi::RECT, monitor: &MonitorId) -> Result<(), CreationError> { // adjusting the rect diff --git a/src/api/win32/mod.rs b/src/api/win32/mod.rs index cb2cc6a..4fb3635 100644 --- a/src/api/win32/mod.rs +++ b/src/api/win32/mod.rs @@ -21,7 +21,7 @@ use PixelFormat; use PixelFormatRequirements; use WindowAttributes; -pub use self::monitor::{MonitorID, get_available_monitors, get_primary_monitor}; +pub use self::monitor::{MonitorId, get_available_monitors, get_primary_monitor}; use winapi; use user32; diff --git a/src/api/win32/monitor.rs b/src/api/win32/monitor.rs index 2f2e2c1..297e826 100644 --- a/src/api/win32/monitor.rs +++ b/src/api/win32/monitor.rs @@ -6,9 +6,9 @@ use std::mem; use native_monitor::NativeMonitorId; -/// Win32 implementation of the main `MonitorID` object. +/// Win32 implementation of the main `MonitorId` object. #[derive(Clone)] -pub struct MonitorID { +pub struct MonitorId { /// The system name of the adapter. adapter_name: [winapi::WCHAR; 32], @@ -93,7 +93,7 @@ fn wchar_as_string(wchar: &[winapi::WCHAR]) -> String { } /// Win32 implementation of the main `get_available_monitors` function. -pub fn get_available_monitors() -> VecDeque { +pub fn get_available_monitors() -> VecDeque { // return value let mut result = VecDeque::new(); @@ -120,7 +120,7 @@ pub fn get_available_monitors() -> VecDeque { for (num, monitor) in DeviceEnumerator::monitors(adapter.DeviceName.as_ptr()).enumerate() { // adding to the resulting list - result.push_back(MonitorID { + result.push_back(MonitorId { adapter_name: adapter.DeviceName, monitor_name: wchar_as_string(&monitor.DeviceName), readable_name: wchar_as_string(&monitor.DeviceString), @@ -136,7 +136,7 @@ pub fn get_available_monitors() -> VecDeque { } /// Win32 implementation of the main `get_primary_monitor` function. -pub fn get_primary_monitor() -> MonitorID { +pub fn get_primary_monitor() -> MonitorId { // we simply get all available monitors and return the one with the `PRIMARY_DEVICE` flag // TODO: it is possible to query the win32 API for the primary monitor, this should be done // instead @@ -149,7 +149,7 @@ pub fn get_primary_monitor() -> MonitorID { panic!("Failed to find the primary monitor") } -impl MonitorID { +impl MonitorId { /// See the docs if the crate root file. #[inline] pub fn get_name(&self) -> Option { @@ -169,14 +169,14 @@ impl MonitorID { self.dimensions } - /// This is a Win32-only function for `MonitorID` that returns the system name of the adapter + /// This is a Win32-only function for `MonitorId` that returns the system name of the adapter /// device. #[inline] pub fn get_adapter_name(&self) -> &[winapi::WCHAR] { &self.adapter_name } - /// This is a Win32-only function for `MonitorID` that returns the position of the + /// This is a Win32-only function for `MonitorId` that returns the position of the /// monitor on the desktop. /// A window that is positionned at these coordinates will overlap the monitor. #[inline] -- cgit v1.2.3