Rename MonitorID -> MonitorId
This commit is contained in:
parent
aa5f5de109
commit
86fa1b58e5
19 changed files with 106 additions and 106 deletions
|
|
@ -5,25 +5,25 @@ use super::XConnection;
|
|||
use native_monitor::NativeMonitorId;
|
||||
|
||||
#[derive(Clone)]
|
||||
pub struct MonitorID(pub Arc<XConnection>, pub u32);
|
||||
pub struct MonitorId(pub Arc<XConnection>, pub u32);
|
||||
|
||||
pub fn get_available_monitors(x: &Arc<XConnection>) -> VecDeque<MonitorID> {
|
||||
pub fn get_available_monitors(x: &Arc<XConnection>) -> VecDeque<MonitorId> {
|
||||
let nb_monitors = unsafe { (x.xlib.XScreenCount)(x.display) };
|
||||
|
||||
let mut monitors = VecDeque::new();
|
||||
monitors.extend((0 .. nb_monitors).map(|i| MonitorID(x.clone(), i as u32)));
|
||||
monitors.extend((0 .. nb_monitors).map(|i| MonitorId(x.clone(), i as u32)));
|
||||
monitors
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn get_primary_monitor(x: &Arc<XConnection>) -> MonitorID {
|
||||
pub fn get_primary_monitor(x: &Arc<XConnection>) -> MonitorId {
|
||||
let primary_monitor = unsafe { (x.xlib.XDefaultScreen)(x.display) };
|
||||
MonitorID(x.clone(), primary_monitor as u32)
|
||||
MonitorId(x.clone(), primary_monitor as u32)
|
||||
}
|
||||
|
||||
impl MonitorID {
|
||||
impl MonitorId {
|
||||
pub fn get_name(&self) -> Option<String> {
|
||||
let MonitorID(_, screen_num) = *self;
|
||||
let MonitorId(_, screen_num) = *self;
|
||||
Some(format!("Monitor #{}", screen_num))
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue