add: ActiveEventLoop::create_proxy()

Co-authored-by: Kirill Chibisov <contact@kchibisov.com>
This commit is contained in:
daxpedda 2024-06-29 17:19:09 +02:00 committed by GitHub
parent 2e93e48a3b
commit a0d69c782a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 78 additions and 71 deletions

View file

@ -58,10 +58,6 @@ impl EventLoop {
self.elw.p.run(Box::new(move |event| handle_event(&mut app, &target, event)), true);
}
pub fn create_proxy(&self) -> EventLoopProxy {
EventLoopProxy::new(self.elw.p.waker())
}
pub fn window_target(&self) -> &RootActiveEventLoop {
&self.elw
}

View file

@ -12,7 +12,7 @@ use super::super::KeyEventExtra;
use super::device::DeviceId;
use super::runner::{EventWrapper, Execution};
use super::window::WindowId;
use super::{backend, runner};
use super::{backend, runner, EventLoopProxy};
use crate::event::{
DeviceId as RootDeviceId, ElementState, Event, KeyEvent, Touch, TouchPhase, WindowEvent,
};
@ -68,6 +68,10 @@ impl ActiveEventLoop {
WindowId(self.runner.generate_id())
}
pub fn create_proxy(&self) -> EventLoopProxy {
EventLoopProxy::new(self.waker())
}
pub fn create_custom_cursor(&self, source: CustomCursorSource) -> RootCustomCursor {
RootCustomCursor { inner: CustomCursor::new(self, source.inner) }
}