objc2-browser-engine-kit 0.3.2

Bindings to the BrowserEngineKit framework
Documentation
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;
#[cfg(feature = "objc2-quartz-core")]
use objc2_quartz_core::*;

use crate::*;

extern_class!(
    /// [Apple's documentation](https://developer.apple.com/documentation/browserenginekit/belayerhierarchy?language=objc)
    #[unsafe(super(NSObject))]
    #[thread_kind = MainThreadOnly]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct BELayerHierarchy;
);

extern_conformance!(
    unsafe impl NSObjectProtocol for BELayerHierarchy {}
);

impl BELayerHierarchy {
    extern_methods!(
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;

        /// may fail if a connection to the render server cannot be established
        #[unsafe(method(layerHierarchyWithError:_))]
        #[unsafe(method_family = none)]
        pub unsafe fn layerHierarchyWithError(
            mtm: MainThreadMarker,
        ) -> Result<Retained<BELayerHierarchy>, Retained<NSError>>;

        #[cfg(feature = "BELayerHierarchyHandle")]
        /// a reference to this `BELayerHierarchy` for use with `BELayerHierarchyHostingView`
        #[unsafe(method(handle))]
        #[unsafe(method_family = none)]
        pub unsafe fn handle(&self) -> Retained<BELayerHierarchyHandle>;

        #[cfg(feature = "objc2-quartz-core")]
        /// the root layer of this hierarchy
        #[unsafe(method(layer))]
        #[unsafe(method_family = none)]
        pub unsafe fn layer(&self) -> Option<Retained<CALayer>>;

        #[cfg(feature = "objc2-quartz-core")]
        /// Setter for [`layer`][Self::layer].
        #[unsafe(method(setLayer:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setLayer(&self, layer: Option<&CALayer>);

        /// invalidate must be called before this layer hierarchy is disposed of
        #[unsafe(method(invalidate))]
        #[unsafe(method_family = none)]
        pub unsafe fn invalidate(&self);
    );
}