diff options
Diffstat (limited to 'third_party/rust/raw-window-handle/src/windows.rs')
-rw-r--r-- | third_party/rust/raw-window-handle/src/windows.rs | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/third_party/rust/raw-window-handle/src/windows.rs b/third_party/rust/raw-window-handle/src/windows.rs new file mode 100644 index 0000000000..365886eed2 --- /dev/null +++ b/third_party/rust/raw-window-handle/src/windows.rs @@ -0,0 +1,34 @@ +use core::ptr; +use libc::c_void; + +/// Raw window handle for Windows. +/// +/// ## Construction +/// ``` +/// # use raw_window_handle::windows::WindowsHandle; +/// let handle = WindowsHandle { +/// /* fields */ +/// ..WindowsHandle::empty() +/// }; +/// ``` +#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] +pub struct WindowsHandle { + /// A Win32 HWND handle. + pub hwnd: *mut c_void, + /// The HINSTANCE associated with this type's HWND. + pub hinstance: *mut c_void, + #[doc(hidden)] + #[deprecated = "This field is used to ensure that this struct is non-exhaustive, so that it may be extended in the future. Do not refer to this field."] + pub _non_exhaustive_do_not_use: crate::seal::Seal, +} + +impl WindowsHandle { + pub fn empty() -> WindowsHandle { + #[allow(deprecated)] + WindowsHandle { + hwnd: ptr::null_mut(), + hinstance: ptr::null_mut(), + _non_exhaustive_do_not_use: crate::seal::Seal, + } + } +} |