linux: move api transition boilerplate to x11/wayland submodules
This commit is contained in:
parent
4acf437221
commit
624a422f20
5 changed files with 330 additions and 137 deletions
|
|
@ -4,7 +4,7 @@ use std::sync::Arc;
|
|||
use std::ptr;
|
||||
use libc;
|
||||
use Window;
|
||||
use platform::Window as LinuxWindow;
|
||||
use platform::Window2 as LinuxWindow;
|
||||
use platform::{UnixBackend, UNIX_BACKEND};
|
||||
use WindowBuilder;
|
||||
use platform::x11::XConnection;
|
||||
|
|
@ -84,7 +84,7 @@ pub trait WindowExt {
|
|||
impl WindowExt for Window {
|
||||
#[inline]
|
||||
fn get_xlib_window(&self) -> Option<*mut libc::c_void> {
|
||||
match *self.window.window {
|
||||
match self.window {
|
||||
LinuxWindow::X(ref w) => Some(w.get_xlib_window()),
|
||||
_ => None
|
||||
}
|
||||
|
|
@ -92,28 +92,28 @@ impl WindowExt for Window {
|
|||
|
||||
#[inline]
|
||||
fn get_xlib_display(&self) -> Option<*mut libc::c_void> {
|
||||
match *self.window.window {
|
||||
match self.window {
|
||||
LinuxWindow::X(ref w) => Some(w.get_xlib_display()),
|
||||
_ => None
|
||||
}
|
||||
}
|
||||
|
||||
fn get_xlib_screen_id(&self) -> Option<*mut libc::c_void> {
|
||||
match *self.window.window {
|
||||
match self.window {
|
||||
LinuxWindow::X(ref w) => Some(w.get_xlib_screen_id()),
|
||||
_ => None
|
||||
}
|
||||
}
|
||||
|
||||
fn get_xlib_xconnection(&self) -> Option<Arc<XConnection>> {
|
||||
match *self.window.window {
|
||||
match self.window {
|
||||
LinuxWindow::X(ref w) => Some(w.get_xlib_xconnection()),
|
||||
_ => None
|
||||
}
|
||||
}
|
||||
|
||||
fn get_xcb_connection(&self) -> Option<*mut libc::c_void> {
|
||||
match *self.window.window {
|
||||
match self.window {
|
||||
LinuxWindow::X(ref w) => Some(w.get_xcb_connection()),
|
||||
_ => None
|
||||
}
|
||||
|
|
@ -134,7 +134,7 @@ impl WindowExt for Window {
|
|||
|
||||
#[inline]
|
||||
fn get_wayland_client_surface(&self) -> Option<&WlSurface> {
|
||||
match *self.window.window {
|
||||
match self.window {
|
||||
LinuxWindow::Wayland(ref w) => Some(w.get_surface()),
|
||||
_ => None
|
||||
}
|
||||
|
|
@ -142,7 +142,7 @@ impl WindowExt for Window {
|
|||
|
||||
#[inline]
|
||||
fn get_wayland_client_display(&self) -> Option<&WlDisplay> {
|
||||
match *self.window.window {
|
||||
match self.window {
|
||||
LinuxWindow::Wayland(ref w) => Some(w.get_display()),
|
||||
_ => None
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue