b3_display_handler/
appkit.rs

1//! Implementations for AppKit
2
3use std::{ffi::c_void, ptr::NonNull};
4
5/// Window hanlder implementation for AppKit.
6#[non_exhaustive]
7#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
8pub struct AppKitWindowHandler {
9    /// A pointer to an `NSView` instance.
10    pub view_ptr: NonNull<c_void>,
11}
12
13impl AppKitWindowHandler {
14    /// Creates a new instance of [AppKitWindowHandler].
15    ///
16    /// # Parameters:
17    /// * `view_ptr` - A pointer to an `NSView` instance.
18    pub fn new(view_ptr: NonNull<c_void>) -> Self {
19        Self {
20            view_ptr,
21        }
22    }
23}