diff --git a/src/lib.rs b/src/lib.rs index 49b0fca..85ac5fb 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -189,6 +189,10 @@ pub enum RawWindowHandle { #[cfg_attr(not(feature = "nightly-docs"), cfg(target_os = "windows"))] Windows(windows::WindowsHandle), + #[cfg_attr(feature = "nightly-docs", doc(cfg(target_os = "windows")))] + #[cfg_attr(not(feature = "nightly-docs"), cfg(target_os = "windows"))] + WinRT(windows::WinRTHandle), + #[cfg_attr(feature = "nightly-docs", doc(cfg(target_arch = "wasm32")))] #[cfg_attr(not(feature = "nightly-docs"), cfg(target_arch = "wasm32"))] Web(web::WebHandle), diff --git a/src/windows.rs b/src/windows.rs index f297872..20c9af6 100644 --- a/src/windows.rs +++ b/src/windows.rs @@ -26,3 +26,24 @@ impl WindowsHandle { } } } + +/// Raw window handle for WinRT. +/// +/// ## Construction +/// ``` +/// # use raw_window_handle::windows::WinRTHandle; +/// let mut handle = WinRTHandle::empty(); +/// /* set fields */ +/// ``` +#[non_exhaustive] +#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] +pub struct WinRTHandle { + /// A WinRT CoreWindow handle. + pub core_window: Option>, +} + +impl WinRTHandle { + pub fn empty() -> WinRTHandle { + WinRTHandle { core_window: None } + } +}