use std::marker::PhantomData;
use wlroots_sys::wlr_output_mode;
use output::Output;
#[derive(Debug, Eq, PartialEq)]
pub struct Mode<'output> {
output_mode: *mut wlr_output_mode,
phantom: PhantomData<&'output Output>
}
impl<'output> Mode<'output> {
pub(crate) unsafe fn new<'unbound>(output_mode: *mut wlr_output_mode) -> Mode<'unbound> {
Mode { output_mode,
phantom: PhantomData }
}
pub(crate) unsafe fn as_ptr(&self) -> *mut wlr_output_mode {
self.output_mode
}
pub fn flags(&self) -> u32 {
unsafe { (*self.output_mode).flags }
}
pub fn dimensions(&self) -> (i32, i32) {
unsafe { ((*self.output_mode).width, (*self.output_mode).height) }
}
pub fn refresh(&self) -> i32 {
unsafe { (*self.output_mode).refresh }
}
}