mirror of
https://github.com/rust-windowing/winit.git
synced 2026-06-27 23:23:14 -04:00
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:
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user