Skip to content

Commit

Permalink
Add WinRT CoreWindow handle (rust-windowing#68)
Browse files Browse the repository at this point in the history
* Add WinRT core window handle

* cargo fmt
  • Loading branch information
nathanvoglsam authored and Friz64 committed Jun 2, 2021
1 parent d8cefbb commit 4d26179
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/lib.rs
Expand Up @@ -58,6 +58,8 @@ pub enum RawWindowHandle {

Windows(windows::WindowsHandle),

WinRT(windows::WinRTHandle),

Web(web::WebHandle),

Android(android::AndroidHandle),
Expand Down
21 changes: 21 additions & 0 deletions src/windows.rs
Expand Up @@ -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<NonNull<c_void>>,
}

impl WinRTHandle {
pub fn empty() -> WinRTHandle {
WinRTHandle { core_window: None }
}
}

0 comments on commit 4d26179

Please sign in to comment.