Draft web platform structure

This commit is contained in:
Héctor Ramón Jiménez 2019-06-25 03:15:34 +02:00
parent eea9530f38
commit c5703eb00a
26 changed files with 1171 additions and 153 deletions

View file

@ -20,7 +20,5 @@ pub mod macos;
pub mod unix;
pub mod windows;
pub mod stdweb;
pub mod web_sys;
pub mod desktop;
pub mod web;

View file

@ -1,8 +0,0 @@
#![cfg(feature = "stdweb")]
use stdweb::web::html_element::CanvasElement;
pub trait WindowExtStdweb {
fn canvas(&self) -> CanvasElement;
}

15
src/platform/web.rs Normal file
View file

@ -0,0 +1,15 @@
#[cfg(feature = "stdweb")]
use stdweb::web::html_element::CanvasElement;
#[cfg(feature = "stdweb")]
pub trait WindowExtStdweb {
fn canvas(&self) -> CanvasElement;
}
#[cfg(feature = "web-sys")]
use web_sys::HtmlCanvasElement;
#[cfg(feature = "web-sys")]
pub trait WindowExtWebSys {
fn canvas(&self) -> HtmlCanvasElement;
}

View file

@ -1,7 +0,0 @@
#![cfg(feature = "web-sys")]
use web_sys::HtmlCanvasElement;
pub trait WindowExtWebSys {
fn canvas(&self) -> HtmlCanvasElement;
}