Remove generic parameter T from EventLoopWindowTarget (#3298)

This commit is contained in:
Mads Marquart 2024-01-13 21:36:53 +01:00 committed by GitHub
parent 169cd39f93
commit 22311802b5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
37 changed files with 174 additions and 210 deletions

View file

@ -30,7 +30,7 @@ impl WindowExtAndroid for Window {
}
}
impl<T> EventLoopWindowTargetExtAndroid for EventLoopWindowTarget<T> {}
impl EventLoopWindowTargetExtAndroid for EventLoopWindowTarget {}
/// Additional methods on [`WindowBuilder`] that are specific to Android.
pub trait WindowBuilderExtAndroid {}

View file

@ -388,7 +388,7 @@ pub trait EventLoopWindowTargetExtMacOS {
fn allows_automatic_window_tabbing(&self) -> bool;
}
impl<T> EventLoopWindowTargetExtMacOS for EventLoopWindowTarget<T> {
impl EventLoopWindowTargetExtMacOS for EventLoopWindowTarget {
fn hide_application(&self) {
self.p.hide_application()
}

View file

@ -174,7 +174,7 @@ pub trait EventLoopExtPumpEvents {
/// callback.
fn pump_events<F>(&mut self, timeout: Option<Duration>, event_handler: F) -> PumpStatus
where
F: FnMut(Event<Self::UserEvent>, &EventLoopWindowTarget<Self::UserEvent>);
F: FnMut(Event<Self::UserEvent>, &EventLoopWindowTarget);
}
impl<T> EventLoopExtPumpEvents for EventLoop<T> {
@ -182,7 +182,7 @@ impl<T> EventLoopExtPumpEvents for EventLoop<T> {
fn pump_events<F>(&mut self, timeout: Option<Duration>, event_handler: F) -> PumpStatus
where
F: FnMut(Event<Self::UserEvent>, &EventLoopWindowTarget<Self::UserEvent>),
F: FnMut(Event<Self::UserEvent>, &EventLoopWindowTarget),
{
self.event_loop.pump_events(timeout, event_handler)
}

View file

@ -66,7 +66,7 @@ pub trait EventLoopExtRunOnDemand {
/// [`set_control_flow()`]: EventLoopWindowTarget::set_control_flow()
fn run_on_demand<F>(&mut self, event_handler: F) -> Result<(), EventLoopError>
where
F: FnMut(Event<Self::UserEvent>, &EventLoopWindowTarget<Self::UserEvent>);
F: FnMut(Event<Self::UserEvent>, &EventLoopWindowTarget);
}
impl<T> EventLoopExtRunOnDemand for EventLoop<T> {
@ -74,14 +74,14 @@ impl<T> EventLoopExtRunOnDemand for EventLoop<T> {
fn run_on_demand<F>(&mut self, event_handler: F) -> Result<(), EventLoopError>
where
F: FnMut(Event<Self::UserEvent>, &EventLoopWindowTarget<Self::UserEvent>),
F: FnMut(Event<Self::UserEvent>, &EventLoopWindowTarget),
{
self.event_loop.window_target().clear_exit();
self.event_loop.run_on_demand(event_handler)
}
}
impl<T> EventLoopWindowTarget<T> {
impl EventLoopWindowTarget {
/// Clear exit status.
pub(crate) fn clear_exit(&self) {
self.p.clear_exit()

View file

@ -55,7 +55,7 @@ pub trait WindowBuilderExtStartupNotify {
fn with_activation_token(self, token: ActivationToken) -> Self;
}
impl<T> EventLoopExtStartupNotify for EventLoopWindowTarget<T> {
impl EventLoopExtStartupNotify for EventLoopWindowTarget {
fn read_token_from_env(&self) -> Option<ActivationToken> {
match self.p {
#[cfg(wayland_platform)]

View file

@ -12,7 +12,7 @@ pub trait EventLoopWindowTargetExtWayland {
fn is_wayland(&self) -> bool;
}
impl<T> EventLoopWindowTargetExtWayland for EventLoopWindowTarget<T> {
impl EventLoopWindowTargetExtWayland for EventLoopWindowTarget {
#[inline]
fn is_wayland(&self) -> bool {
self.p.is_wayland()

View file

@ -172,7 +172,7 @@ pub trait EventLoopExtWebSys {
/// [^1]: `run()` is _not_ available on WASM when the target supports `exception-handling`.
fn spawn<F>(self, event_handler: F)
where
F: 'static + FnMut(Event<Self::UserEvent>, &EventLoopWindowTarget<Self::UserEvent>);
F: 'static + FnMut(Event<Self::UserEvent>, &EventLoopWindowTarget);
}
impl<T> EventLoopExtWebSys for EventLoop<T> {
@ -180,7 +180,7 @@ impl<T> EventLoopExtWebSys for EventLoop<T> {
fn spawn<F>(self, event_handler: F)
where
F: 'static + FnMut(Event<Self::UserEvent>, &EventLoopWindowTarget<Self::UserEvent>),
F: 'static + FnMut(Event<Self::UserEvent>, &EventLoopWindowTarget),
{
self.event_loop.spawn(event_handler)
}
@ -202,7 +202,7 @@ pub trait EventLoopWindowTargetExtWebSys {
fn poll_strategy(&self) -> PollStrategy;
}
impl<T> EventLoopWindowTargetExtWebSys for EventLoopWindowTarget<T> {
impl EventLoopWindowTargetExtWebSys for EventLoopWindowTarget {
#[inline]
fn set_poll_strategy(&self, strategy: PollStrategy) {
self.p.set_poll_strategy(strategy);
@ -315,11 +315,11 @@ impl Error for BadAnimation {}
pub trait CustomCursorBuilderExtWebSys {
/// Async version of [`CustomCursorBuilder::build()`] which waits until the
/// cursor has completely finished loading.
fn build_async<T>(self, window_target: &EventLoopWindowTarget<T>) -> CustomCursorFuture;
fn build_async(self, window_target: &EventLoopWindowTarget) -> CustomCursorFuture;
}
impl CustomCursorBuilderExtWebSys for CustomCursorBuilder {
fn build_async<T>(self, window_target: &EventLoopWindowTarget<T>) -> CustomCursorFuture {
fn build_async(self, window_target: &EventLoopWindowTarget) -> CustomCursorFuture {
CustomCursorFuture(PlatformCustomCursor::build_async(
self.inner,
&window_target.p,

View file

@ -95,7 +95,7 @@ pub trait EventLoopWindowTargetExtX11 {
fn is_x11(&self) -> bool;
}
impl<T> EventLoopWindowTargetExtX11 for EventLoopWindowTarget<T> {
impl EventLoopWindowTargetExtX11 for EventLoopWindowTarget {
#[inline]
fn is_x11(&self) -> bool {
!self.p.is_wayland()