Skip to content

Commit

Permalink
Rename platform to platform_impl
Browse files Browse the repository at this point in the history
  • Loading branch information
Osspial committed Nov 9, 2018
1 parent 99c0f84 commit 7df59c6
Show file tree
Hide file tree
Showing 60 changed files with 55 additions and 55 deletions.
16 changes: 8 additions & 8 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ pub use icon::*;
pub mod dpi;
mod events;
mod icon;
mod platform;
mod platform_impl;
mod window;

pub mod os;
Expand All @@ -127,7 +127,7 @@ pub mod os;
/// });
/// ```
pub struct Window {
window: platform::Window,
window: platform_impl::Window,
}

impl std::fmt::Debug for Window {
Expand All @@ -143,15 +143,15 @@ impl std::fmt::Debug for Window {
/// Whenever you receive an event specific to a window, this event contains a `WindowId` which you
/// can then compare to the ids of your windows.
#[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct WindowId(platform::WindowId);
pub struct WindowId(platform_impl::WindowId);

/// Identifier of an input device.
///
/// Whenever you receive an event arising from a particular input device, this event contains a `DeviceId` which
/// identifies its origin. Note that devices may be virtual (representing an on-screen cursor and keyboard focus) or
/// physical. Virtual devices typically aggregate inputs from multiple physical devices.
#[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct DeviceId(platform::DeviceId);
pub struct DeviceId(platform_impl::DeviceId);

/// Provides a way to retrieve events from the system and from the windows that were registered to
/// the events loop.
Expand All @@ -167,7 +167,7 @@ pub struct DeviceId(platform::DeviceId);
/// `Window` created from this `EventLoop` _can_ be sent to an other thread, and the
/// `EventLoopProxy` allows you to wakeup an `EventLoop` from an other thread.
pub struct EventLoop<T> {
events_loop: platform::EventLoop<T>,
events_loop: platform_impl::EventLoop<T>,
_marker: ::std::marker::PhantomData<*mut ()> // Not Send nor Sync
}

Expand Down Expand Up @@ -217,7 +217,7 @@ impl<T> EventLoop<T> {
/// fallback on x11. If this variable is set with any other value, winit will panic.
pub fn new_user_event() -> EventLoop<T> {
EventLoop {
events_loop: platform::EventLoop::new(),
events_loop: platform_impl::EventLoop::new(),
_marker: ::std::marker::PhantomData,
}
}
Expand Down Expand Up @@ -260,7 +260,7 @@ impl<T> EventLoop<T> {
/// Used to wake up the `EventLoop` from another thread.
#[derive(Clone)]
pub struct EventLoopProxy<T> {
events_loop_proxy: platform::EventLoopProxy<T>,
events_loop_proxy: platform_impl::EventLoopProxy<T>,
}

impl<T> std::fmt::Debug for EventLoopProxy<T> {
Expand Down Expand Up @@ -304,7 +304,7 @@ pub struct WindowBuilder {
pub window: WindowAttributes,

// Platform-specific configuration. Private.
platform_specific: platform::PlatformSpecificWindowBuilderAttributes,
platform_specific: platform_impl::PlatformSpecificWindowBuilderAttributes,
}

impl std::fmt::Debug for WindowBuilder {
Expand Down
12 changes: 6 additions & 6 deletions src/os/unix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,19 @@ use {
Window,
WindowBuilder,
};
use platform::{
use platform_impl::{
EventLoop as LinuxEventLoop,
Window as LinuxWindow,
};
use platform::x11::XConnection;
use platform::x11::ffi::XVisualInfo;
use platform_impl::x11::XConnection;
use platform_impl::x11::ffi::XVisualInfo;

// TODO: stupid hack so that glutin can do its work
#[doc(hidden)]
pub use platform::x11;
pub use platform_impl::x11;

pub use platform::XNotSupported;
pub use platform::x11::util::WindowType as XWindowType;
pub use platform_impl::XNotSupported;
pub use platform_impl::x11::util::WindowType as XWindowType;

/// Additional methods on `EventLoop` that are specific to Linux.
pub trait EventLoopExt {
Expand Down
2 changes: 1 addition & 1 deletion src/os/windows.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use libc;
use winapi::shared::windef::HWND;

use {DeviceId, EventLoop, Icon, MonitorId, Window, WindowBuilder};
use platform::EventLoop as WindowsEventLoop;
use platform_impl::EventLoop as WindowsEventLoop;

/// Additional methods on `EventLoop` that are specific to Windows.
pub trait EventLoopExt {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use std::sync::{Arc, Mutex, Weak};

use {CreationError, MouseCursor, WindowAttributes};
use dpi::{LogicalPosition, LogicalSize};
use platform::MonitorId as PlatformMonitorId;
use platform_impl::MonitorId as PlatformMonitorId;
use window::MonitorId as RootMonitorId;

use sctk::window::{ConceptFrame, Event as WEvent, Window as SWindow};
Expand All @@ -14,7 +14,7 @@ use sctk::reexports::client::protocol::wl_surface::RequestsTrait as SurfaceReque
use sctk::output::OutputMgr;

use super::{make_wid, EventLoop, MonitorId, WindowId};
use platform::platform::wayland::event_loop::{get_available_monitors, get_primary_monitor};
use platform_impl::platform::wayland::event_loop::{get_available_monitors, get_primary_monitor};

pub struct Window {
surface: Proxy<wl_surface::WlSurface>,
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ use {
WindowEvent,
};
use events::ModifiersState;
use platform::PlatformSpecificWindowBuilderAttributes;
use platform_impl::PlatformSpecificWindowBuilderAttributes;
use self::dnd::{Dnd, DndState};
use self::ime::{ImeReceiver, ImeSender, ImeCreationError, Ime};

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ use parking_lot::Mutex;
use {Icon, MouseCursor, WindowAttributes};
use CreationError::{self, OsError};
use dpi::{LogicalPosition, LogicalSize};
use platform::MonitorId as PlatformMonitorId;
use platform::PlatformSpecificWindowBuilderAttributes;
use platform::x11::MonitorId as X11MonitorId;
use platform_impl::MonitorId as PlatformMonitorId;
use platform_impl::PlatformSpecificWindowBuilderAttributes;
use platform_impl::x11::MonitorId as X11MonitorId;
use window::MonitorId as RootMonitorId;

use super::{ffi, util, ImeSender, XConnection, XError, WindowId, EventLoop};
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ use cocoa::base::{id, nil};
use cocoa::foundation::{NSRect, NSUInteger};
use core_graphics::display::CGDisplay;

use platform::platform::ffi;
use platform::platform::window::IdRef;
use platform_impl::platform::ffi;
use platform_impl::platform::window::IdRef;

pub const EMPTY_RANGE: ffi::NSRange = ffi::NSRange {
location: ffi::NSNotFound as NSUInteger,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ use objc::declare::ClassDecl;
use objc::runtime::{Class, Object, Protocol, Sel, BOOL, YES};

use {ElementState, Event, KeyboardInput, MouseButton, WindowEvent, WindowId};
use platform::platform::events_loop::{DEVICE_ID, event_mods, Shared, to_virtual_key_code, check_additional_virtual_key_codes};
use platform::platform::util;
use platform::platform::ffi::*;
use platform::platform::window::{get_window_id, IdRef};
use platform_impl::platform::events_loop::{DEVICE_ID, event_mods, Shared, to_virtual_key_code, check_additional_virtual_key_codes};
use platform_impl::platform::util;
use platform_impl::platform::ffi::*;
use platform_impl::platform::window::{get_window_id, IdRef};

struct ViewState {
window: id,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ use {
};
use CreationError::OsError;
use os::macos::{ActivationPolicy, WindowExt};
use platform::platform::{ffi, util};
use platform::platform::events_loop::{EventLoop, Shared};
use platform::platform::view::{new_view, set_ime_spot};
use platform_impl::platform::{ffi, util};
use platform_impl::platform::events_loop::{EventLoop, Shared};
use platform_impl::platform::view::{new_view, set_ime_spot};
use window::MonitorId as RootMonitorId;

#[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use winapi::um::oleidl::{IDropTarget, IDropTargetVtbl};
use winapi::um::winnt::HRESULT;
use winapi::um::{shellapi, unknwnbase};

use platform::platform::WindowId;
use platform_impl::platform::WindowId;

use {Event, WindowId as SuperWindowId};

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -52,18 +52,18 @@ use {
WindowId as SuperWindowId,
};
use events::{DeviceEvent, Touch, TouchPhase, StartCause};
use platform::platform::{event, Cursor, WindowId, DEVICE_ID, wrap_device_id, util};
use platform::platform::dpi::{
use platform_impl::platform::{event, Cursor, WindowId, DEVICE_ID, wrap_device_id, util};
use platform_impl::platform::dpi::{
become_dpi_aware,
dpi_to_scale_factor,
enable_non_client_dpi_scaling,
get_hwnd_scale_factor,
};
use platform::platform::drop_handler::FileDropHandler;
use platform::platform::event::{handle_extended_keys, process_key_params, vkey_to_winit_vkey};
use platform::platform::icon::WinIcon;
use platform::platform::raw_input::{get_raw_input_data, get_raw_mouse_button_state};
use platform::platform::window::adjust_size;
use platform_impl::platform::drop_handler::FileDropHandler;
use platform_impl::platform::event::{handle_extended_keys, process_key_params, vkey_to_winit_vkey};
use platform_impl::platform::icon::WinIcon;
use platform_impl::platform::raw_input::{get_raw_input_data, get_raw_mouse_button_state};
use platform_impl::platform::window::adjust_size;

/// Contains saved window info for switching between fullscreen
#[derive(Clone)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use winapi::shared::windef::{HICON, HWND};
use winapi::um::winuser;

use {Pixel, PIXEL_SIZE, Icon};
use platform::platform::util;
use platform_impl::platform::util;

impl Pixel {
fn to_bgra(&mut self) {
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ use std::collections::VecDeque;

use super::{EventLoop, util};
use dpi::{PhysicalPosition, PhysicalSize};
use platform::platform::dpi::{dpi_to_scale_factor, get_monitor_dpi};
use platform::platform::window::Window;
use platform_impl::platform::dpi::{dpi_to_scale_factor, get_monitor_dpi};
use platform_impl::platform::window::Window;

/// Win32 implementation of the main `MonitorId` object.
#[derive(Debug, Clone)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ use winapi::um::winuser::{
RID_INPUT,
};

use platform::platform::util;
use platform_impl::platform::util;
use events::ElementState;

#[allow(dead_code)]
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@ use {
PhysicalSize,
WindowAttributes,
};
use platform::platform::{Cursor, PlatformSpecificWindowBuilderAttributes, WindowId};
use platform::platform::dpi::{dpi_to_scale_factor, get_hwnd_dpi};
use platform::platform::events_loop::{self, EventLoop, DESTROY_MSG_ID, INITIAL_DPI_MSG_ID, REQUEST_REDRAW_NO_NEWEVENTS_MSG_ID};
use platform::platform::events_loop::WindowState;
use platform::platform::icon::{self, IconType, WinIcon};
use platform::platform::monitor;
use platform::platform::raw_input::register_all_mice_and_keyboards_for_raw_input;
use platform::platform::drop_handler::FileDropHandler;
use platform::platform::util;
use platform_impl::platform::{Cursor, PlatformSpecificWindowBuilderAttributes, WindowId};
use platform_impl::platform::dpi::{dpi_to_scale_factor, get_hwnd_dpi};
use platform_impl::platform::events_loop::{self, EventLoop, DESTROY_MSG_ID, INITIAL_DPI_MSG_ID, REQUEST_REDRAW_NO_NEWEVENTS_MSG_ID};
use platform_impl::platform::events_loop::WindowState;
use platform_impl::platform::icon::{self, IconType, WinIcon};
use platform_impl::platform::monitor;
use platform_impl::platform::raw_input::register_all_mice_and_keyboards_for_raw_input;
use platform_impl::platform::drop_handler::FileDropHandler;
use platform_impl::platform::util;

const WS_RESIZABLE: DWORD = winuser::WS_SIZEBOX | winuser::WS_MAXIMIZEBOX;

Expand Down
8 changes: 4 additions & 4 deletions src/window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use {
MouseCursor,
PhysicalPosition,
PhysicalSize,
platform,
platform_impl,
Window,
WindowBuilder,
WindowId,
Expand Down Expand Up @@ -154,7 +154,7 @@ impl WindowBuilder {
}));

// building
platform::Window::new(
platform_impl::Window::new(
&events_loop.events_loop,
self.window,
self.platform_specific,
Expand Down Expand Up @@ -449,7 +449,7 @@ impl Window {
// This may change in the future.
#[derive(Debug)]
pub struct AvailableMonitorsIter {
pub(crate) data: VecDequeIter<platform::MonitorId>,
pub(crate) data: VecDequeIter<platform_impl::MonitorId>,
}

impl Iterator for AvailableMonitorsIter {
Expand All @@ -469,7 +469,7 @@ impl Iterator for AvailableMonitorsIter {
/// Identifier for a monitor.
#[derive(Debug, Clone)]
pub struct MonitorId {
pub(crate) inner: platform::MonitorId
pub(crate) inner: platform_impl::MonitorId
}

impl MonitorId {
Expand Down

0 comments on commit 7df59c6

Please sign in to comment.