Skip to content

Commit

Permalink
Remove api_transition macro (#279)
Browse files Browse the repository at this point in the history
* Remove api_transition macro

* Rename Window2 to Window

* Try fix X11 code
  • Loading branch information
tomaka authored Sep 6, 2017
1 parent 0ada6c1 commit 342d5d8
Show file tree
Hide file tree
Showing 13 changed files with 97 additions and 247 deletions.
144 changes: 0 additions & 144 deletions src/api_transition.rs

This file was deleted.

5 changes: 1 addition & 4 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,6 @@ extern crate wayland_client;
pub use events::*;
pub use window::{AvailableMonitorsIter, MonitorId};

#[macro_use]
mod api_transition;

mod platform;
mod events;
mod window;
Expand All @@ -144,7 +141,7 @@ pub mod os;
/// });
/// ```
pub struct Window {
window: platform::Window2,
window: platform::Window,
}

/// Identifier of a window. Unique for each window.
Expand Down
2 changes: 1 addition & 1 deletion src/os/unix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use EventsLoop;
use MonitorId;
use Window;
use platform::EventsLoop as LinuxEventsLoop;
use platform::Window2 as LinuxWindow;
use platform::Window as LinuxWindow;
use WindowBuilder;
use platform::x11::XConnection;
use platform::x11::ffi::XVisualInfo;
Expand Down
12 changes: 6 additions & 6 deletions src/platform/android/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ pub struct WindowId;
#[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct DeviceId;

pub struct Window2 {
pub struct Window {
native_window: *const c_void,
}

Expand All @@ -159,10 +159,10 @@ pub struct PlatformSpecificWindowBuilderAttributes;
#[derive(Clone, Default)]
pub struct PlatformSpecificHeadlessBuilderAttributes;

impl Window2 {
impl Window {
pub fn new(_: &EventsLoop, win_attribs: &WindowAttributes,
_: &PlatformSpecificWindowBuilderAttributes)
-> Result<Window2, CreationError>
-> Result<Window, CreationError>
{
// not implemented
assert!(win_attribs.min_dimensions.is_none());
Expand All @@ -175,7 +175,7 @@ impl Window2 {

android_glue::set_multitouch(win_attribs.multitouch);

Ok(Window2 {
Ok(Window {
native_window: native_window as *const _,
})
}
Expand Down Expand Up @@ -269,8 +269,8 @@ impl Window2 {
}
}

unsafe impl Send for Window2 {}
unsafe impl Sync for Window2 {}
unsafe impl Send for Window {}
unsafe impl Sync for Window {}

// Constant device ID, to be removed when this backend is updated to report real device IDs.
const DEVICE_ID: ::DeviceId = ::DeviceId(DeviceId);
8 changes: 4 additions & 4 deletions src/platform/ios/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ static mut jmpbuf: [c_int;27] = [0;27];
#[derive(Clone)]
pub struct MonitorId;

pub struct Window2 {
pub struct Window {
delegate_state: *mut DelegateState
}

Expand Down Expand Up @@ -258,11 +258,11 @@ pub struct DeviceId;
#[derive(Clone, Default)]
pub struct PlatformSpecificWindowBuilderAttributes;

impl Window2 {
impl Window {
pub fn new(ev: &EventsLoop, _: &WindowAttributes, _: &PlatformSpecificWindowBuilderAttributes)
-> Result<Window2, CreationError>
-> Result<Window, CreationError>
{
Ok(Window2 {
Ok(Window {
delegate_state: ev.delegate_state,
})
}
Expand Down
Loading

0 comments on commit 342d5d8

Please sign in to comment.