diff options
Diffstat (limited to 'src/x11')
-rw-r--r-- | src/x11/window/mod.rs | 26 | ||||
-rw-r--r-- | src/x11/window/monitor.rs | 10 |
2 files changed, 18 insertions, 18 deletions
diff --git a/src/x11/window/mod.rs b/src/x11/window/mod.rs index e902c88..904bef9 100644 --- a/src/x11/window/mod.rs +++ b/src/x11/window/mod.rs @@ -160,7 +160,7 @@ impl Window { } for i in range(0, mode_num) { - let mode: ffi::XF86VidModeModeInfo = ptr::read(*modes.offset(i as int) as *const _); + let mode: ffi::XF86VidModeModeInfo = ptr::read(*modes.offset(i as isize) as *const _); if mode.hdisplay == dimensions.0 as u16 && mode.vdisplay == dimensions.1 as u16 { best_mode = i; } @@ -215,7 +215,7 @@ impl Window { if builder.monitor.is_some() { window_attributes |= ffi::CWOverrideRedirect; unsafe { - ffi::XF86VidModeSwitchToMode(display, screen_id, *modes.offset(best_mode as int)); + ffi::XF86VidModeSwitchToMode(display, screen_id, *modes.offset(best_mode as isize)); ffi::XF86VidModeSetViewPort(display, screen_id, 0, 0); set_win_attr.override_redirect = 1; } @@ -383,7 +383,7 @@ impl Window { } } - fn get_geometry(&self) -> Option<(int, int, uint, uint)> { + fn get_geometry(&self) -> Option<(isize, isize, usize, usize)> { unsafe { use std::mem; @@ -402,27 +402,27 @@ impl Window { return None; } - Some((x as int, y as int, width as uint, height as uint)) + Some((x as isize, y as isize, width as usize, height as usize)) } } - pub fn get_position(&self) -> Option<(int, int)> { + pub fn get_position(&self) -> Option<(isize, isize)> { self.get_geometry().map(|(x, y, _, _)| (x, y)) } - pub fn set_position(&self, x: int, y: int) { + pub fn set_position(&self, x: isize, y: isize) { unsafe { ffi::XMoveWindow(self.x.display, self.x.window, x as libc::c_int, y as libc::c_int) } } - pub fn get_inner_size(&self) -> Option<(uint, uint)> { + pub fn get_inner_size(&self) -> Option<(usize, usize)> { self.get_geometry().map(|(_, _, w, h)| (w, h)) } - pub fn get_outer_size(&self) -> Option<(uint, uint)> { + pub fn get_outer_size(&self) -> Option<(usize, usize)> { unimplemented!() } - pub fn set_inner_size(&self, _x: uint, _y: uint) { + pub fn set_inner_size(&self, _x: usize, _y: usize) { unimplemented!() } @@ -476,14 +476,14 @@ impl Window { let (current_width, current_height) = self.current_size.get(); if current_width != cfg_event.width || current_height != cfg_event.height { self.current_size.set((cfg_event.width, cfg_event.height)); - events.push_back(Resized(cfg_event.width as uint, cfg_event.height as uint)); + events.push_back(Resized(cfg_event.width as usize, cfg_event.height as usize)); } }, ffi::MotionNotify => { use events::Event::MouseMoved; let event: &ffi::XMotionEvent = unsafe { mem::transmute(&xev) }; - events.push_back(MouseMoved((event.x as int, event.y as int))); + events.push_back(MouseMoved((event.x as isize, event.y as isize))); }, ffi::KeyPress | ffi::KeyRelease => { @@ -507,7 +507,7 @@ impl Window { mem::transmute(buffer.as_mut_ptr()), buffer.len() as libc::c_int, ptr::null_mut(), ptr::null_mut()); - str::from_utf8(buffer.as_slice().slice_to(count as uint)) + str::from_utf8(buffer.as_slice().slice_to(count as usize)) .unwrap_or("").to_string() }; @@ -609,7 +609,7 @@ impl Window { ::Api::OpenGl } - pub fn set_window_resize_callback(&mut self, _: Option<fn(uint, uint)>) { + pub fn set_window_resize_callback(&mut self, _: Option<fn(usize, usize)>) { } pub fn set_cursor(&self, cursor: MouseCursor) { diff --git a/src/x11/window/monitor.rs b/src/x11/window/monitor.rs index 596dca7..29c23c9 100644 --- a/src/x11/window/monitor.rs +++ b/src/x11/window/monitor.rs @@ -3,7 +3,7 @@ use std::collections::RingBuf; use super::super::ffi; use super::ensure_thread_init; -pub struct MonitorID(pub uint); +pub struct MonitorID(pub usize); pub fn get_available_monitors() -> RingBuf<MonitorID> { ensure_thread_init(); @@ -18,7 +18,7 @@ pub fn get_available_monitors() -> RingBuf<MonitorID> { }; let mut monitors = RingBuf::new(); - monitors.extend(range(0, nb_monitors).map(|i| MonitorID(i as uint))); + monitors.extend(range(0, nb_monitors).map(|i| MonitorID(i as usize))); monitors } @@ -34,7 +34,7 @@ pub fn get_primary_monitor() -> MonitorID { primary_monitor }; - MonitorID(primary_monitor as uint) + MonitorID(primary_monitor as usize) } impl MonitorID { @@ -43,7 +43,7 @@ impl MonitorID { Some(format!("Monitor #{}", screen_num)) } - pub fn get_dimensions(&self) -> (uint, uint) { + pub fn get_dimensions(&self) -> (usize, usize) { let dimensions = unsafe { let display = ffi::XOpenDisplay(ptr::null()); let MonitorID(screen_num) = *self; @@ -51,7 +51,7 @@ impl MonitorID { let width = ffi::XWidthOfScreen(screen); let height = ffi::XHeightOfScreen(screen); ffi::XCloseDisplay(display); - (width as uint, height as uint) + (width as usize, height as usize) }; dimensions |