25 lines
468 B
Rust
25 lines
468 B
Rust
use std::ops::Deref;
|
|
|
|
use windows::Win32::UI::WindowsAndMessaging::HCURSOR;
|
|
|
|
#[derive(Debug, Clone, Copy)]
|
|
pub(crate) struct SafeCursor {
|
|
raw: HCURSOR,
|
|
}
|
|
|
|
unsafe impl Send for SafeCursor {}
|
|
unsafe impl Sync for SafeCursor {}
|
|
|
|
impl From<HCURSOR> for SafeCursor {
|
|
fn from(value: HCURSOR) -> Self {
|
|
SafeCursor { raw: value }
|
|
}
|
|
}
|
|
|
|
impl Deref for SafeCursor {
|
|
type Target = HCURSOR;
|
|
|
|
fn deref(&self) -> &Self::Target {
|
|
&self.raw
|
|
}
|
|
}
|