use core::cell::UnsafeCell;
use core::ffi::*;
use core::marker::{PhantomData, PhantomPinned};
#[cfg(feature = "objc2")]
use objc2::__framework_prelude::*;
use crate::*;
#[repr(C)]
#[derive(Debug)]
pub struct CGPDFOperatorTable {
inner: [u8; 0],
_p: UnsafeCell<PhantomData<(*const UnsafeCell<()>, PhantomPinned)>>,
}
#[cfg(feature = "objc2")]
unsafe impl RefEncode for CGPDFOperatorTable {
const ENCODING_REF: Encoding = Encoding::Pointer(&Encoding::Struct("CGPDFOperatorTable", &[]));
}
pub type CGPDFOperatorTableRef = *mut CGPDFOperatorTable;
#[cfg(feature = "CGPDFScanner")]
pub type CGPDFOperatorCallback = Option<unsafe extern "C-unwind" fn(CGPDFScannerRef, *mut c_void)>;
impl CGPDFOperatorTable {
#[doc(alias = "CGPDFOperatorTableCreate")]
#[inline]
pub fn create() -> CGPDFOperatorTableRef {
extern "C-unwind" {
fn CGPDFOperatorTableCreate() -> CGPDFOperatorTableRef;
}
unsafe { CGPDFOperatorTableCreate() }
}
#[doc(alias = "CGPDFOperatorTableRetain")]
#[inline]
pub unsafe fn retain(table: CGPDFOperatorTableRef) -> CGPDFOperatorTableRef {
extern "C-unwind" {
fn CGPDFOperatorTableRetain(table: CGPDFOperatorTableRef) -> CGPDFOperatorTableRef;
}
unsafe { CGPDFOperatorTableRetain(table) }
}
#[doc(alias = "CGPDFOperatorTableRelease")]
#[inline]
pub unsafe fn release(table: CGPDFOperatorTableRef) {
extern "C-unwind" {
fn CGPDFOperatorTableRelease(table: CGPDFOperatorTableRef);
}
unsafe { CGPDFOperatorTableRelease(table) }
}
#[doc(alias = "CGPDFOperatorTableSetCallback")]
#[cfg(feature = "CGPDFScanner")]
#[inline]
pub unsafe fn set_callback(
table: CGPDFOperatorTableRef,
name: *const c_char,
callback: CGPDFOperatorCallback,
) {
extern "C-unwind" {
fn CGPDFOperatorTableSetCallback(
table: CGPDFOperatorTableRef,
name: *const c_char,
callback: CGPDFOperatorCallback,
);
}
unsafe { CGPDFOperatorTableSetCallback(table, name, callback) }
}
}
#[deprecated = "renamed to `CGPDFOperatorTable::create`"]
#[inline]
pub extern "C-unwind" fn CGPDFOperatorTableCreate() -> CGPDFOperatorTableRef {
extern "C-unwind" {
fn CGPDFOperatorTableCreate() -> CGPDFOperatorTableRef;
}
unsafe { CGPDFOperatorTableCreate() }
}
extern "C-unwind" {
#[deprecated = "renamed to `CGPDFOperatorTable::retain`"]
pub fn CGPDFOperatorTableRetain(table: CGPDFOperatorTableRef) -> CGPDFOperatorTableRef;
}
extern "C-unwind" {
#[deprecated = "renamed to `CGPDFOperatorTable::release`"]
pub fn CGPDFOperatorTableRelease(table: CGPDFOperatorTableRef);
}
extern "C-unwind" {
#[cfg(feature = "CGPDFScanner")]
#[deprecated = "renamed to `CGPDFOperatorTable::set_callback`"]
pub fn CGPDFOperatorTableSetCallback(
table: CGPDFOperatorTableRef,
name: *const c_char,
callback: CGPDFOperatorCallback,
);
}