#![allow(non_camel_case_types, non_snake_case)]
use crate::co;
use crate::decl::*;
use crate::guard::*;
use crate::kernel::privs::*;
use crate::macros::*;
use crate::user::ffi;
handle! { HCURSOR;
}
impl HCURSOR {
#[must_use]
pub fn CopyCursor(&self) -> SysResult<DestroyCursorGuard> {
unsafe {
PtrRet(ffi::CopyIcon(self.ptr()))
.to_sysresult_handle()
.map(|h| DestroyCursorGuard::new(h))
}
}
#[must_use]
pub fn GetCursor() -> Option<HCURSOR> {
PtrRet(unsafe { ffi::GetCursor() }).to_opt_handle()
}
pub fn SetSystemCursor(&self, id: co::OCR) -> SysResult<()> {
BoolRet(unsafe { ffi::SetSystemCursor(self.ptr(), id.raw()) }).to_sysresult()
}
}