Properly implement Debug for Window and EventLoop types (#3297)
For EventLoop, EventLoopBuilder, EventLoopProxy and by requiring it as a supertrait of Window and ActiveEventLoop. It is especially useful for user to be able to know that Window is Debug.
This commit is contained in:
parent
39c0862198
commit
be1baf164c
43 changed files with 152 additions and 42 deletions
|
|
@ -1,5 +1,5 @@
|
|||
use std::sync::MutexGuard;
|
||||
use std::{io, ptr};
|
||||
use std::{fmt, io, ptr};
|
||||
|
||||
use bitflags::bitflags;
|
||||
use windows_sys::Win32::Foundation::{HWND, RECT};
|
||||
|
|
@ -23,6 +23,7 @@ use crate::platform_impl::platform::{event_loop, util, Fullscreen, SelectedCurso
|
|||
use crate::window::{Theme, WindowAttributes};
|
||||
|
||||
/// Contains information about states and the window that the callback is going to use.
|
||||
#[derive(Debug)]
|
||||
pub(crate) struct WindowState {
|
||||
pub mouse: MouseProperties,
|
||||
|
||||
|
|
@ -65,7 +66,13 @@ pub struct SavedWindow {
|
|||
pub placement: WINDOWPLACEMENT,
|
||||
}
|
||||
|
||||
#[derive(Clone)]
|
||||
impl fmt::Debug for SavedWindow {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
f.debug_struct("SavedWindow").finish_non_exhaustive()
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug)]
|
||||
pub struct MouseProperties {
|
||||
pub(crate) selected_cursor: SelectedCursor,
|
||||
pub capture_count: u32,
|
||||
|
|
@ -129,7 +136,7 @@ bitflags! {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Eq, PartialEq)]
|
||||
#[derive(Debug, Eq, PartialEq, Hash)]
|
||||
pub enum ImeState {
|
||||
Disabled,
|
||||
Enabled,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue