use core::cell::UnsafeCell;
use core::ffi::*;
use core::marker::{PhantomData, PhantomPinned};
use core::ptr::NonNull;
#[cfg(feature = "objc2")]
use objc2::__framework_prelude::*;
use objc2_core_foundation::*;
use crate::*;
#[doc(alias = "ColorSyncCMMRef")]
#[repr(C)]
pub struct ColorSyncCMM {
inner: [u8; 0],
_p: UnsafeCell<PhantomData<(*const UnsafeCell<()>, PhantomPinned)>>,
}
cf_type!(
unsafe impl ColorSyncCMM {}
);
#[cfg(feature = "objc2")]
cf_objc2_type!(
unsafe impl RefEncode<"ColorSyncCMM"> for ColorSyncCMM {}
);
unsafe impl ConcreteType for ColorSyncCMM {
#[doc(alias = "ColorSyncCMMGetTypeID")]
#[inline]
fn type_id() -> CFTypeID {
extern "C-unwind" {
fn ColorSyncCMMGetTypeID() -> CFTypeID;
}
unsafe { ColorSyncCMMGetTypeID() }
}
}
impl ColorSyncCMM {
#[doc(alias = "ColorSyncCMMCreate")]
#[inline]
pub unsafe fn new(cmm_bundle: &CFBundle) -> Option<CFRetained<ColorSyncCMM>> {
extern "C-unwind" {
fn ColorSyncCMMCreate(cmm_bundle: &CFBundle) -> Option<NonNull<ColorSyncCMM>>;
}
let ret = unsafe { ColorSyncCMMCreate(cmm_bundle) };
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}
#[doc(alias = "ColorSyncCMMGetBundle")]
#[inline]
pub unsafe fn bundle(&self) -> Option<CFRetained<CFBundle>> {
extern "C-unwind" {
fn ColorSyncCMMGetBundle(param1: &ColorSyncCMM) -> Option<NonNull<CFBundle>>;
}
let ret = unsafe { ColorSyncCMMGetBundle(self) };
ret.map(|ret| unsafe { CFRetained::retain(ret) })
}
#[doc(alias = "ColorSyncCMMCopyLocalizedName")]
#[inline]
pub unsafe fn localized_name(&self) -> Option<CFRetained<CFString>> {
extern "C-unwind" {
fn ColorSyncCMMCopyLocalizedName(param1: &ColorSyncCMM) -> Option<NonNull<CFString>>;
}
let ret = unsafe { ColorSyncCMMCopyLocalizedName(self) };
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}
#[doc(alias = "ColorSyncCMMCopyCMMIdentifier")]
#[inline]
pub unsafe fn cmm_identifier(&self) -> Option<CFRetained<CFString>> {
extern "C-unwind" {
fn ColorSyncCMMCopyCMMIdentifier(param1: &ColorSyncCMM) -> Option<NonNull<CFString>>;
}
let ret = unsafe { ColorSyncCMMCopyCMMIdentifier(self) };
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}
}
pub type ColorSyncCMMIterateCallback =
Option<unsafe extern "C-unwind" fn(NonNull<ColorSyncCMM>, NonNull<c_void>) -> bool>;
extern "C-unwind" {
pub fn ColorSyncIterateInstalledCMMs(
call_back: ColorSyncCMMIterateCallback,
user_info: *mut c_void,
);
}
#[cfg(feature = "ColorSyncProfile")]
pub type CMMInitializeLinkProfileProc = Option<
unsafe extern "C-unwind" fn(
NonNull<ColorSyncMutableProfile>,
NonNull<CFArray>,
*const CFDictionary,
) -> bool,
>;
#[cfg(feature = "ColorSyncTransform")]
pub type CMMInitializeTransformProc = Option<
unsafe extern "C-unwind" fn(
NonNull<ColorSyncTransform>,
NonNull<CFArray>,
*const CFDictionary,
) -> bool,
>;
#[cfg(feature = "ColorSyncTransform")]
pub type CMMApplyTransformProc = Option<
unsafe extern "C-unwind" fn(
NonNull<ColorSyncTransform>,
usize,
usize,
usize,
NonNull<NonNull<c_void>>,
ColorSyncDataDepth,
ColorSyncDataLayout,
usize,
usize,
NonNull<NonNull<c_void>>,
ColorSyncDataDepth,
ColorSyncDataLayout,
usize,
*const CFDictionary,
) -> bool,
>;
#[cfg(feature = "ColorSyncTransform")]
pub type CMMCreateTransformPropertyProc = Option<
unsafe extern "C-unwind" fn(
*mut ColorSyncTransform,
NonNull<CFType>,
*const CFDictionary,
) -> *const CFType,
>;
extern "C" {
pub static kCMMInitializeLinkProfileProcName: &'static CFString;
}
extern "C" {
pub static kCMMInitializeTransformProcName: &'static CFString;
}
extern "C" {
pub static kCMMApplyTransformProcName: &'static CFString;
}
extern "C" {
pub static kCMMCreateTransformPropertyProcName: &'static CFString;
}
#[deprecated = "renamed to `ColorSyncCMM::new`"]
#[inline]
pub unsafe extern "C-unwind" fn ColorSyncCMMCreate(
cmm_bundle: &CFBundle,
) -> Option<CFRetained<ColorSyncCMM>> {
extern "C-unwind" {
fn ColorSyncCMMCreate(cmm_bundle: &CFBundle) -> Option<NonNull<ColorSyncCMM>>;
}
let ret = unsafe { ColorSyncCMMCreate(cmm_bundle) };
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}
#[deprecated = "renamed to `ColorSyncCMM::bundle`"]
#[inline]
pub unsafe extern "C-unwind" fn ColorSyncCMMGetBundle(
param1: &ColorSyncCMM,
) -> Option<CFRetained<CFBundle>> {
extern "C-unwind" {
fn ColorSyncCMMGetBundle(param1: &ColorSyncCMM) -> Option<NonNull<CFBundle>>;
}
let ret = unsafe { ColorSyncCMMGetBundle(param1) };
ret.map(|ret| unsafe { CFRetained::retain(ret) })
}
#[deprecated = "renamed to `ColorSyncCMM::localized_name`"]
#[inline]
pub unsafe extern "C-unwind" fn ColorSyncCMMCopyLocalizedName(
param1: &ColorSyncCMM,
) -> Option<CFRetained<CFString>> {
extern "C-unwind" {
fn ColorSyncCMMCopyLocalizedName(param1: &ColorSyncCMM) -> Option<NonNull<CFString>>;
}
let ret = unsafe { ColorSyncCMMCopyLocalizedName(param1) };
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}
#[deprecated = "renamed to `ColorSyncCMM::cmm_identifier`"]
#[inline]
pub unsafe extern "C-unwind" fn ColorSyncCMMCopyCMMIdentifier(
param1: &ColorSyncCMM,
) -> Option<CFRetained<CFString>> {
extern "C-unwind" {
fn ColorSyncCMMCopyCMMIdentifier(param1: &ColorSyncCMM) -> Option<NonNull<CFString>>;
}
let ret = unsafe { ColorSyncCMMCopyCMMIdentifier(param1) };
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}