Rename internal structs for consistency (#2149)

Proxy -> EventLoopProxy
Id -> WindowId or DeviceId
WindowTarget -> EventLoopWindowTarget
Handle -> MonitorHandle
Mode -> VideoMode
PlatformSpecificBuilderAttributes -> PlatformSpecificWindowBuilderAttributes
SuperWindowId -> RootWindowId
This commit is contained in:
Mads Marquart 2022-03-18 14:09:39 +01:00 committed by GitHub
parent 85baf79d17
commit a438091266
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 134 additions and 135 deletions

View file

@ -3,17 +3,17 @@ mod runner;
mod state;
mod window_target;
pub use self::proxy::Proxy;
pub use self::window_target::WindowTarget;
pub use self::proxy::EventLoopProxy;
pub use self::window_target::EventLoopWindowTarget;
use super::{backend, device, window};
use crate::event::Event;
use crate::event_loop as root;
use crate::event_loop::{ControlFlow, EventLoopWindowTarget as RootEventLoopWindowTarget};
use std::marker::PhantomData;
pub struct EventLoop<T: 'static> {
elw: root::EventLoopWindowTarget<T>,
elw: RootEventLoopWindowTarget<T>,
}
#[derive(Default, Debug, Copy, Clone, PartialEq, Hash)]
@ -22,8 +22,8 @@ pub(crate) struct PlatformSpecificEventLoopAttributes {}
impl<T> EventLoop<T> {
pub(crate) fn new(_: &PlatformSpecificEventLoopAttributes) -> Self {
EventLoop {
elw: root::EventLoopWindowTarget {
p: WindowTarget::new(),
elw: RootEventLoopWindowTarget {
p: EventLoopWindowTarget::new(),
_marker: PhantomData,
},
}
@ -31,9 +31,9 @@ impl<T> EventLoop<T> {
pub fn run<F>(self, mut event_handler: F) -> !
where
F: 'static + FnMut(Event<'_, T>, &root::EventLoopWindowTarget<T>, &mut root::ControlFlow),
F: 'static + FnMut(Event<'_, T>, &RootEventLoopWindowTarget<T>, &mut ControlFlow),
{
let target = root::EventLoopWindowTarget {
let target = RootEventLoopWindowTarget {
p: self.elw.p.clone(),
_marker: PhantomData,
};
@ -51,11 +51,11 @@ impl<T> EventLoop<T> {
unreachable!();
}
pub fn create_proxy(&self) -> Proxy<T> {
pub fn create_proxy(&self) -> EventLoopProxy<T> {
self.elw.p.proxy()
}
pub fn window_target(&self) -> &root::EventLoopWindowTarget<T> {
pub fn window_target(&self) -> &RootEventLoopWindowTarget<T> {
&self.elw
}
}