mirror of
https://github.com/Devolutions/IronRDP.git
synced 2025-08-04 07:08:17 +00:00
refactor(web): iron_remote_desktop::export -> make_bridge (#765)
This commit is contained in:
parent
e0eea449b8
commit
8961b40012
3 changed files with 285 additions and 287 deletions
|
@ -32,9 +32,8 @@ pub trait RemoteDesktopApi {
|
|||
}
|
||||
|
||||
#[macro_export]
|
||||
macro_rules! export {
|
||||
macro_rules! make_bridge {
|
||||
($api:ty) => {
|
||||
mod __wasm_ffi {
|
||||
use wasm_bindgen::prelude::*;
|
||||
use web_sys::{js_sys, HtmlCanvasElement};
|
||||
use $crate::{
|
||||
|
@ -355,7 +354,6 @@ macro_rules! export {
|
|||
self.0.value().into()
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -432,7 +432,7 @@ impl WasmClipboard {
|
|||
.on_remote_clipboard_changed
|
||||
.call1(
|
||||
&JsValue::NULL,
|
||||
&JsValue::from(crate::__wasm_ffi::ClipboardData::from(clipboard_data)),
|
||||
&JsValue::from(crate::wasm_bridge::ClipboardData::from(clipboard_data)),
|
||||
)
|
||||
.expect("failed to call JS callback");
|
||||
}
|
||||
|
|
|
@ -12,8 +12,6 @@ extern crate time as _;
|
|||
#[macro_use]
|
||||
extern crate tracing;
|
||||
|
||||
use iron_remote_desktop::RemoteDesktopApi;
|
||||
|
||||
mod canvas;
|
||||
mod clipboard;
|
||||
mod error;
|
||||
|
@ -24,7 +22,7 @@ mod session;
|
|||
|
||||
struct Api;
|
||||
|
||||
impl RemoteDesktopApi for Api {
|
||||
impl iron_remote_desktop::RemoteDesktopApi for Api {
|
||||
type Session = session::Session;
|
||||
type SessionBuilder = session::SessionBuilder;
|
||||
type SessionTerminationInfo = session::SessionTerminationInfo;
|
||||
|
@ -39,4 +37,6 @@ impl RemoteDesktopApi for Api {
|
|||
}
|
||||
}
|
||||
|
||||
iron_remote_desktop::export!(crate::Api);
|
||||
mod wasm_bridge {
|
||||
iron_remote_desktop::make_bridge!(crate::Api);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue