gdk4_win32/
win32_hcursor.rs
1use std::ptr::NonNull;
4
5use glib::{translate::*, types::Pointee};
6
7use crate::{ffi, prelude::*, Win32HCursor, HCURSOR};
8
9impl Win32HCursor {
10 #[doc(alias = "gdk_win32_hcursor_new")]
11 pub fn new(
12 display: &impl IsA<crate::Win32Display>,
13 handle: HCURSOR,
14 destroyable: bool,
15 ) -> Self {
16 assert_initialized_main_thread!();
17 unsafe {
18 from_glib_full(ffi::gdk_win32_hcursor_new(
19 display.as_ref().to_glib_none().0,
20 handle.0,
21 destroyable.into_glib(),
22 ))
23 }
24 }
25
26 pub fn handle(&self) -> HCURSOR {
27 let ptr: NonNull<Pointee> = ObjectExt::property(self, "handle");
28 HCURSOR(ptr.as_ptr() as _)
29 }
30}