use core::cell::UnsafeCell;
use core::marker::{PhantomData, PhantomPinned};
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
#[cfg(feature = "objc2-core-foundation")]
use objc2_core_foundation::*;
#[cfg(feature = "objc2-metal")]
use objc2_metal::*;
use crate::*;
#[repr(C)]
#[derive(Debug)]
pub struct cp_texture_topology {
inner: [u8; 0],
_p: UnsafeCell<PhantomData<(*const UnsafeCell<()>, PhantomPinned)>>,
}
unsafe impl RefEncode for cp_texture_topology {
const ENCODING_REF: Encoding = Encoding::Pointer(&Encoding::Struct("cp_texture_topology", &[]));
}
pub type cp_texture_topology_t = *mut cp_texture_topology;
impl cp_texture_topology {
#[doc(alias = "cp_texture_topology_get_array_length")]
#[inline]
pub unsafe fn array_length(texture_topology: cp_texture_topology_t) -> u64 {
extern "C-unwind" {
fn cp_texture_topology_get_array_length(texture_topology: cp_texture_topology_t)
-> u64;
}
unsafe { cp_texture_topology_get_array_length(texture_topology) }
}
#[doc(alias = "cp_texture_topology_get_texture_type")]
#[cfg(feature = "objc2-metal")]
#[inline]
pub unsafe fn texture_type(texture_topology: cp_texture_topology_t) -> MTLTextureType {
extern "C-unwind" {
fn cp_texture_topology_get_texture_type(
texture_topology: cp_texture_topology_t,
) -> MTLTextureType;
}
unsafe { cp_texture_topology_get_texture_type(texture_topology) }
}
}
extern_class!(
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct CP_OBJECT_cp_layer_renderer_properties;
);
extern_conformance!(
unsafe impl NSObjectProtocol for CP_OBJECT_cp_layer_renderer_properties {}
);
impl CP_OBJECT_cp_layer_renderer_properties {
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() -> Retained<Self>;
);
}
pub type cp_layer_renderer_properties_t = CP_OBJECT_cp_layer_renderer_properties;
#[cfg(all(
feature = "layer_renderer_configuration",
feature = "objc2-core-foundation"
))]
#[inline]
pub unsafe extern "C-unwind" fn cp_layer_renderer_properties_create_using_configuration(
configuration: &cp_layer_renderer_configuration_t,
error: *mut *mut CFError,
) -> Option<Retained<cp_layer_renderer_properties_t>> {
extern "C-unwind" {
fn cp_layer_renderer_properties_create_using_configuration(
configuration: &cp_layer_renderer_configuration_t,
error: *mut *mut CFError,
) -> *mut cp_layer_renderer_properties_t;
}
let ret =
unsafe { cp_layer_renderer_properties_create_using_configuration(configuration, error) };
unsafe { Retained::from_raw(ret) }
}
extern "C-unwind" {
pub fn cp_layer_renderer_properties_get_texture_topology_count(
layer_properties: &cp_layer_renderer_properties_t,
) -> usize;
}
extern "C-unwind" {
pub fn cp_layer_renderer_properties_get_texture_topology(
layer_properties: &cp_layer_renderer_properties_t,
index: usize,
) -> cp_texture_topology_t;
}
extern "C-unwind" {
pub fn cp_layer_renderer_properties_get_view_count(
layer_properties: &cp_layer_renderer_properties_t,
) -> usize;
}
extern "C-unwind" {
#[cfg(feature = "tracking_area")]
pub fn cp_layer_renderer_properties_get_tracking_areas_max_value(
properties: &cp_layer_renderer_properties_t,
) -> cp_tracking_area_render_value;
}
extern "C-unwind" {
#[deprecated = "renamed to `cp_texture_topology::array_length`"]
pub fn cp_texture_topology_get_array_length(texture_topology: cp_texture_topology_t) -> u64;
}
extern "C-unwind" {
#[cfg(feature = "objc2-metal")]
#[deprecated = "renamed to `cp_texture_topology::texture_type`"]
pub fn cp_texture_topology_get_texture_type(
texture_topology: cp_texture_topology_t,
) -> MTLTextureType;
}