mirror of
https://github.com/storytold/winit.git
synced 2026-11-25 05:40:45 +01:00
Draft web platform structure
This commit is contained in:
1 parent
eea9530f38
commit
c5703eb00a
26 files changed
+1171
-153
No files matched your search
@@ -0,0 +1,19 @@
|
||||
use super::runner;
|
||||
use crate::event::Event;
|
||||
use crate::event_loop::EventLoopClosed;
|
||||
|
||||
#[derive(Clone)]
|
||||
pub struct Proxy<T: 'static> {
|
||||
runner: runner::Shared<T>,
|
||||
}
|
||||
|
||||
impl<T: 'static> Proxy<T> {
|
||||
pub fn new(runner: runner::Shared<T>) -> Self {
|
||||
Proxy { runner }
|
||||
}
|
||||
|
||||
pub fn send_event(&self, event: T) -> Result<(), EventLoopClosed> {
|
||||
self.runner.send_event(Event::UserEvent(event));
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user