From 4acf43722121b69fdaf17e8d46e2966a0ff57451 Mon Sep 17 00:00:00 2001 From: Victor Berger Date: Fri, 3 Mar 2017 20:56:27 +0100 Subject: [PATCH] Move api module into platform::linux --- src/api/mod.rs | 5 ----- src/lib.rs | 1 - src/os/unix.rs | 6 ++---- src/{api => platform/linux}/dlopen.rs | 0 src/platform/linux/mod.rs | 15 +++++++++------ src/{api => platform/linux}/wayland/context.rs | 0 src/{api => platform/linux}/wayland/keyboard.rs | 0 src/{api => platform/linux}/wayland/mod.rs | 0 src/{api => platform/linux}/wayland/window.rs | 0 src/{api => platform/linux}/x11/events.rs | 0 src/{api => platform/linux}/x11/ffi.rs | 0 src/{api => platform/linux}/x11/input.rs | 0 src/{api => platform/linux}/x11/mod.rs | 0 src/{api => platform/linux}/x11/monitor.rs | 0 src/{api => platform/linux}/x11/window.rs | 0 src/{api => platform/linux}/x11/xdisplay.rs | 2 +- 16 files changed, 12 insertions(+), 17 deletions(-) delete mode 100644 src/api/mod.rs rename src/{api => platform/linux}/dlopen.rs (100%) rename src/{api => platform/linux}/wayland/context.rs (100%) rename src/{api => platform/linux}/wayland/keyboard.rs (100%) rename src/{api => platform/linux}/wayland/mod.rs (100%) rename src/{api => platform/linux}/wayland/window.rs (100%) rename src/{api => platform/linux}/x11/events.rs (100%) rename src/{api => platform/linux}/x11/ffi.rs (100%) rename src/{api => platform/linux}/x11/input.rs (100%) rename src/{api => platform/linux}/x11/mod.rs (100%) rename src/{api => platform/linux}/x11/monitor.rs (100%) rename src/{api => platform/linux}/x11/window.rs (100%) rename src/{api => platform/linux}/x11/xdisplay.rs (99%) diff --git a/src/api/mod.rs b/src/api/mod.rs deleted file mode 100644 index 108ab1ad..00000000 --- a/src/api/mod.rs +++ /dev/null @@ -1,5 +0,0 @@ -// TODO: remove this module altogether and move all implementations to `platform` - -pub mod dlopen; -pub mod wayland; -pub mod x11; diff --git a/src/lib.rs b/src/lib.rs index d0ba5911..00dba8bd 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -128,7 +128,6 @@ pub use native_monitor::NativeMonitorId; #[macro_use] mod api_transition; -mod api; mod platform; mod events; mod window; diff --git a/src/os/unix.rs b/src/os/unix.rs index 63735515..06f57a6b 100644 --- a/src/os/unix.rs +++ b/src/os/unix.rs @@ -7,14 +7,12 @@ use Window; use platform::Window as LinuxWindow; use platform::{UnixBackend, UNIX_BACKEND}; use WindowBuilder; -use api::x11::XConnection; -use api::x11::ffi::XVisualInfo; +use platform::x11::XConnection; +use platform::x11::ffi::XVisualInfo; use wayland_client::protocol::wl_display::WlDisplay; use wayland_client::protocol::wl_surface::WlSurface; -pub use api::x11; - // TODO: do not expose XConnection pub fn get_x11_xconnection() -> Option> { match *UNIX_BACKEND { diff --git a/src/api/dlopen.rs b/src/platform/linux/dlopen.rs similarity index 100% rename from src/api/dlopen.rs rename to src/platform/linux/dlopen.rs diff --git a/src/platform/linux/mod.rs b/src/platform/linux/mod.rs index 029ba7d7..e55462d4 100644 --- a/src/platform/linux/mod.rs +++ b/src/platform/linux/mod.rs @@ -10,12 +10,15 @@ use MouseCursor; use WindowAttributes; use libc; -use api::wayland; -use api::x11; -use api::x11::XConnection; -use api::x11::XError; -use api::x11::XNotSupported; -use api::x11::ffi::XVisualInfo; +use self::x11::XConnection; +use self::x11::XError; +use self::x11::XNotSupported; +use self::x11::ffi::XVisualInfo; + +mod dlopen; +pub mod wayland; +pub mod x11; + gen_api_transition!(); diff --git a/src/api/wayland/context.rs b/src/platform/linux/wayland/context.rs similarity index 100% rename from src/api/wayland/context.rs rename to src/platform/linux/wayland/context.rs diff --git a/src/api/wayland/keyboard.rs b/src/platform/linux/wayland/keyboard.rs similarity index 100% rename from src/api/wayland/keyboard.rs rename to src/platform/linux/wayland/keyboard.rs diff --git a/src/api/wayland/mod.rs b/src/platform/linux/wayland/mod.rs similarity index 100% rename from src/api/wayland/mod.rs rename to src/platform/linux/wayland/mod.rs diff --git a/src/api/wayland/window.rs b/src/platform/linux/wayland/window.rs similarity index 100% rename from src/api/wayland/window.rs rename to src/platform/linux/wayland/window.rs diff --git a/src/api/x11/events.rs b/src/platform/linux/x11/events.rs similarity index 100% rename from src/api/x11/events.rs rename to src/platform/linux/x11/events.rs diff --git a/src/api/x11/ffi.rs b/src/platform/linux/x11/ffi.rs similarity index 100% rename from src/api/x11/ffi.rs rename to src/platform/linux/x11/ffi.rs diff --git a/src/api/x11/input.rs b/src/platform/linux/x11/input.rs similarity index 100% rename from src/api/x11/input.rs rename to src/platform/linux/x11/input.rs diff --git a/src/api/x11/mod.rs b/src/platform/linux/x11/mod.rs similarity index 100% rename from src/api/x11/mod.rs rename to src/platform/linux/x11/mod.rs diff --git a/src/api/x11/monitor.rs b/src/platform/linux/x11/monitor.rs similarity index 100% rename from src/api/x11/monitor.rs rename to src/platform/linux/x11/monitor.rs diff --git a/src/api/x11/window.rs b/src/platform/linux/x11/window.rs similarity index 100% rename from src/api/x11/window.rs rename to src/platform/linux/x11/window.rs diff --git a/src/api/x11/xdisplay.rs b/src/platform/linux/x11/xdisplay.rs similarity index 99% rename from src/api/x11/xdisplay.rs rename to src/platform/linux/x11/xdisplay.rs index 95cc187a..4024adb8 100644 --- a/src/api/x11/xdisplay.rs +++ b/src/platform/linux/x11/xdisplay.rs @@ -7,7 +7,7 @@ use std::sync::Mutex; use libc; use super::ffi; -use api::dlopen; +use super::super::dlopen; /// A connection to an X server. pub struct XConnection {