You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

28 lines
967 B

//! Strongly typed safe opaque pointers to GHOST handles.
//!
//! We define opaque ZST structures for each handle type, these then implement the [`GhostHandle`] trait, which allows them to be used for type arguments to [`Handle<T>`](Handle).
use super::*;
pub use types::{Handle,GhostHandle};
#[cfg(not(nightly))] enum HandleInner{}
macro_rules! handle {
($name:ident, $inner_name:ident) => {
#[cfg(nightly)] pub struct $inner_name(!);
#[cfg(not(nightly))] pub struct $inner_name(HandleInner);
impl private::Sealed for $inner_name{}
impl GhostHandle for $inner_name{}
pub type $name = *mut Handle<$inner_name>;
};
}
handle!(GHOST_SystemHandle, System);
handle!(GHOST_TimerTaskHandle, TimerTask);
handle!(GHOST_WindowHandle, Window);
handle!(GHOST_EventHandle, Event);
handle!(GHOST_RectangleHandle, Rectangle);
handle!(GHOST_EventConsumerHandle, EventConsumer);
handle!(GHOST_ContextHandle, Context);
handle!(GHOST_XrContextHandle, XrContextHandle);