use core::ffi::*;
#[cfg(feature = "objc2")]
use objc2::__framework_prelude::*;
use crate::*;
pub const kAEAND: c_uint = 0x414e4420;
pub const kAEOR: c_uint = 0x4f522020;
pub const kAENOT: c_uint = 0x4e4f5420;
pub const kAEFirst: c_uint = 0x66697273;
pub const kAELast: c_uint = 0x6c617374;
pub const kAEMiddle: c_uint = 0x6d696464;
pub const kAEAny: c_uint = 0x616e7920;
pub const kAEAll: c_uint = 0x616c6c20;
pub const kAENext: c_uint = 0x6e657874;
pub const kAEPrevious: c_uint = 0x70726576;
pub const keyAECompOperator: c_uint = 0x72656c6f;
pub const keyAELogicalTerms: c_uint = 0x7465726d;
pub const keyAELogicalOperator: c_uint = 0x6c6f6763;
pub const keyAEObject1: c_uint = 0x6f626a31;
pub const keyAEObject2: c_uint = 0x6f626a32;
pub const keyAEDesiredClass: c_uint = 0x77616e74;
pub const keyAEContainer: c_uint = 0x66726f6d;
pub const keyAEKeyForm: c_uint = 0x666f726d;
pub const keyAEKeyData: c_uint = 0x73656c64;
#[cfg(feature = "AEDataModel")]
pub const keyAERangeStart: AEKeyword = 0x73746172;
#[cfg(feature = "AEDataModel")]
pub const keyAERangeStop: AEKeyword = 0x73746f70;
#[cfg(feature = "AEDataModel")]
pub const keyDisposeTokenProc: AEKeyword = 0x78746f6b;
#[cfg(feature = "AEDataModel")]
pub const keyAECompareProc: AEKeyword = 0x636d7072;
#[cfg(feature = "AEDataModel")]
pub const keyAECountProc: AEKeyword = 0x636f6e74;
#[cfg(feature = "AEDataModel")]
pub const keyAEMarkTokenProc: AEKeyword = 0x6d6b6964;
#[cfg(feature = "AEDataModel")]
pub const keyAEMarkProc: AEKeyword = 0x6d61726b;
#[cfg(feature = "AEDataModel")]
pub const keyAEAdjustMarksProc: AEKeyword = 0x61646a6d;
#[cfg(feature = "AEDataModel")]
pub const keyAEGetErrDescProc: AEKeyword = 0x696e6463;
pub const formAbsolutePosition: c_uint = 0x696e6478;
pub const formRelativePosition: c_uint = 0x72656c65;
pub const formTest: c_uint = 0x74657374;
pub const formRange: c_uint = 0x72616e67;
pub const formPropertyID: c_uint = 0x70726f70;
pub const formName: c_uint = 0x6e616d65;
pub const formUniqueID: c_uint = 0x49442020;
#[cfg(feature = "AEDataModel")]
pub const typeObjectSpecifier: DescType = 0x6f626a20;
#[cfg(feature = "AEDataModel")]
pub const typeObjectBeingExamined: DescType = 0x65786d6e;
#[cfg(feature = "AEDataModel")]
pub const typeCurrentContainer: DescType = 0x63636e74;
#[cfg(feature = "AEDataModel")]
pub const typeToken: DescType = 0x746f6b65;
#[cfg(feature = "AEDataModel")]
pub const typeRelativeDescriptor: DescType = 0x72656c20;
#[cfg(feature = "AEDataModel")]
pub const typeAbsoluteOrdinal: DescType = 0x6162736f;
#[cfg(feature = "AEDataModel")]
pub const typeIndexDescriptor: DescType = 0x696e6465;
#[cfg(feature = "AEDataModel")]
pub const typeRangeDescriptor: DescType = 0x72616e67;
#[cfg(feature = "AEDataModel")]
pub const typeLogicalDescriptor: DescType = 0x6c6f6769;
#[cfg(feature = "AEDataModel")]
pub const typeCompDescriptor: DescType = 0x636d7064;
#[cfg(feature = "AEDataModel")]
pub const typeOSLTokenList: DescType = 0x6f73746c;
pub const kAEIDoMinimum: c_uint = 0x0000;
pub const kAEIDoWhose: c_uint = 0x0001;
pub const kAEIDoMarking: c_uint = 0x0004;
pub const kAEPassSubDescs: c_uint = 0x0008;
pub const kAEResolveNestedLists: c_uint = 0x0010;
pub const kAEHandleSimpleRanges: c_uint = 0x0020;
pub const kAEUseRelativeIterators: c_uint = 0x0040;
pub const typeWhoseDescriptor: c_uint = 0x77686f73;
pub const formWhose: c_uint = 0x77686f73;
pub const typeWhoseRange: c_uint = 0x77726e67;
pub const keyAEWhoseRangeStart: c_uint = 0x77737472;
pub const keyAEWhoseRangeStop: c_uint = 0x77737470;
pub const keyAEIndex: c_uint = 0x6b696478;
pub const keyAETest: c_uint = 0x6b747374;
#[cfg(feature = "AEDataModel")]
#[repr(C, packed(2))]
#[derive(Clone, Copy, Debug, PartialEq)]
pub struct ccntTokenRecord {
pub tokenClass: DescType,
pub token: AEDesc,
}
#[cfg(all(feature = "AEDataModel", feature = "objc2"))]
unsafe impl Encode for ccntTokenRecord {
const ENCODING: Encoding = Encoding::Struct(
"ccntTokenRecord",
&[<DescType>::ENCODING, <AEDesc>::ENCODING],
);
}
#[cfg(all(feature = "AEDataModel", feature = "objc2"))]
unsafe impl RefEncode for ccntTokenRecord {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
#[cfg(feature = "AEDataModel")]
pub type ccntTokenRecPtr = *mut ccntTokenRecord;
#[cfg(feature = "AEDataModel")]
pub type ccntTokenRecHandle = *mut ccntTokenRecPtr;
#[cfg(feature = "AEDataModel")]
pub type OSLAccessorProcPtr = Option<
unsafe extern "C-unwind" fn(
DescType,
*const AEDesc,
DescType,
DescType,
*const AEDesc,
*mut AEDesc,
SRefCon,
) -> OSErr,
>;
#[cfg(feature = "AEDataModel")]
pub type OSLCompareProcPtr = Option<
unsafe extern "C-unwind" fn(DescType, *const AEDesc, *const AEDesc, *mut Boolean) -> OSErr,
>;
#[cfg(feature = "AEDataModel")]
pub type OSLCountProcPtr =
Option<unsafe extern "C-unwind" fn(DescType, DescType, *const AEDesc, *mut c_long) -> OSErr>;
#[cfg(feature = "AEDataModel")]
pub type OSLDisposeTokenProcPtr = Option<unsafe extern "C-unwind" fn(*mut AEDesc) -> OSErr>;
#[cfg(feature = "AEDataModel")]
pub type OSLGetMarkTokenProcPtr =
Option<unsafe extern "C-unwind" fn(*const AEDesc, DescType, *mut AEDesc) -> OSErr>;
#[cfg(feature = "AEDataModel")]
pub type OSLGetErrDescProcPtr = Option<unsafe extern "C-unwind" fn(*mut *mut AEDesc) -> OSErr>;
#[cfg(feature = "AEDataModel")]
pub type OSLMarkProcPtr =
Option<unsafe extern "C-unwind" fn(*const AEDesc, *const AEDesc, c_long) -> OSErr>;
#[cfg(feature = "AEDataModel")]
pub type OSLAdjustMarksProcPtr =
Option<unsafe extern "C-unwind" fn(c_long, c_long, *const AEDesc) -> OSErr>;
#[cfg(feature = "AEDataModel")]
pub type OSLAccessorUPP = OSLAccessorProcPtr;
#[cfg(feature = "AEDataModel")]
pub type OSLCompareUPP = OSLCompareProcPtr;
#[cfg(feature = "AEDataModel")]
pub type OSLCountUPP = OSLCountProcPtr;
#[cfg(feature = "AEDataModel")]
pub type OSLDisposeTokenUPP = OSLDisposeTokenProcPtr;
#[cfg(feature = "AEDataModel")]
pub type OSLGetMarkTokenUPP = OSLGetMarkTokenProcPtr;
#[cfg(feature = "AEDataModel")]
pub type OSLGetErrDescUPP = OSLGetErrDescProcPtr;
#[cfg(feature = "AEDataModel")]
pub type OSLMarkUPP = OSLMarkProcPtr;
#[cfg(feature = "AEDataModel")]
pub type OSLAdjustMarksUPP = OSLAdjustMarksProcPtr;
extern "C-unwind" {
#[cfg(feature = "AEDataModel")]
pub fn NewOSLAccessorUPP(user_routine: OSLAccessorProcPtr) -> OSLAccessorUPP;
}
extern "C-unwind" {
#[cfg(feature = "AEDataModel")]
pub fn NewOSLCompareUPP(user_routine: OSLCompareProcPtr) -> OSLCompareUPP;
}
extern "C-unwind" {
#[cfg(feature = "AEDataModel")]
pub fn NewOSLCountUPP(user_routine: OSLCountProcPtr) -> OSLCountUPP;
}
extern "C-unwind" {
#[cfg(feature = "AEDataModel")]
pub fn NewOSLDisposeTokenUPP(user_routine: OSLDisposeTokenProcPtr) -> OSLDisposeTokenUPP;
}
extern "C-unwind" {
#[cfg(feature = "AEDataModel")]
pub fn NewOSLGetMarkTokenUPP(user_routine: OSLGetMarkTokenProcPtr) -> OSLGetMarkTokenUPP;
}
extern "C-unwind" {
#[cfg(feature = "AEDataModel")]
pub fn NewOSLGetErrDescUPP(user_routine: OSLGetErrDescProcPtr) -> OSLGetErrDescUPP;
}
extern "C-unwind" {
#[cfg(feature = "AEDataModel")]
pub fn NewOSLMarkUPP(user_routine: OSLMarkProcPtr) -> OSLMarkUPP;
}
extern "C-unwind" {
#[cfg(feature = "AEDataModel")]
pub fn NewOSLAdjustMarksUPP(user_routine: OSLAdjustMarksProcPtr) -> OSLAdjustMarksUPP;
}
extern "C-unwind" {
#[cfg(feature = "AEDataModel")]
pub fn DisposeOSLAccessorUPP(user_upp: OSLAccessorUPP);
}
extern "C-unwind" {
#[cfg(feature = "AEDataModel")]
pub fn DisposeOSLCompareUPP(user_upp: OSLCompareUPP);
}
extern "C-unwind" {
#[cfg(feature = "AEDataModel")]
pub fn DisposeOSLCountUPP(user_upp: OSLCountUPP);
}
extern "C-unwind" {
#[cfg(feature = "AEDataModel")]
pub fn DisposeOSLDisposeTokenUPP(user_upp: OSLDisposeTokenUPP);
}
extern "C-unwind" {
#[cfg(feature = "AEDataModel")]
pub fn DisposeOSLGetMarkTokenUPP(user_upp: OSLGetMarkTokenUPP);
}
extern "C-unwind" {
#[cfg(feature = "AEDataModel")]
pub fn DisposeOSLGetErrDescUPP(user_upp: OSLGetErrDescUPP);
}
extern "C-unwind" {
#[cfg(feature = "AEDataModel")]
pub fn DisposeOSLMarkUPP(user_upp: OSLMarkUPP);
}
extern "C-unwind" {
#[cfg(feature = "AEDataModel")]
pub fn DisposeOSLAdjustMarksUPP(user_upp: OSLAdjustMarksUPP);
}
extern "C-unwind" {
#[cfg(feature = "AEDataModel")]
pub fn InvokeOSLAccessorUPP(
desired_class: DescType,
container: *const AEDesc,
container_class: DescType,
form: DescType,
selection_data: *const AEDesc,
value: *mut AEDesc,
accessor_refcon: SRefCon,
user_upp: OSLAccessorUPP,
) -> OSErr;
}
extern "C-unwind" {
#[cfg(feature = "AEDataModel")]
pub fn InvokeOSLCompareUPP(
oper: DescType,
obj1: *const AEDesc,
obj2: *const AEDesc,
result: *mut Boolean,
user_upp: OSLCompareUPP,
) -> OSErr;
}
extern "C-unwind" {
#[cfg(feature = "AEDataModel")]
pub fn InvokeOSLCountUPP(
desired_type: DescType,
container_class: DescType,
container: *const AEDesc,
result: *mut c_long,
user_upp: OSLCountUPP,
) -> OSErr;
}
extern "C-unwind" {
#[cfg(feature = "AEDataModel")]
pub fn InvokeOSLDisposeTokenUPP(
unneeded_token: *mut AEDesc,
user_upp: OSLDisposeTokenUPP,
) -> OSErr;
}
extern "C-unwind" {
#[cfg(feature = "AEDataModel")]
pub fn InvokeOSLGetMarkTokenUPP(
d_container_token: *const AEDesc,
container_class: DescType,
result: *mut AEDesc,
user_upp: OSLGetMarkTokenUPP,
) -> OSErr;
}
extern "C-unwind" {
#[cfg(feature = "AEDataModel")]
pub fn InvokeOSLGetErrDescUPP(
app_desc_ptr: *mut *mut AEDesc,
user_upp: OSLGetErrDescUPP,
) -> OSErr;
}
extern "C-unwind" {
#[cfg(feature = "AEDataModel")]
pub fn InvokeOSLMarkUPP(
d_token: *const AEDesc,
mark_token: *const AEDesc,
index: c_long,
user_upp: OSLMarkUPP,
) -> OSErr;
}
extern "C-unwind" {
#[cfg(feature = "AEDataModel")]
pub fn InvokeOSLAdjustMarksUPP(
new_start: c_long,
new_stop: c_long,
mark_token: *const AEDesc,
user_upp: OSLAdjustMarksUPP,
) -> OSErr;
}
extern "C-unwind" {
pub fn AEObjectInit() -> OSErr;
}
extern "C-unwind" {
#[cfg(feature = "AEDataModel")]
pub fn AESetObjectCallbacks(
my_compare_proc: OSLCompareUPP,
my_count_proc: OSLCountUPP,
my_dispose_token_proc: OSLDisposeTokenUPP,
my_get_mark_token_proc: OSLGetMarkTokenUPP,
my_mark_proc: OSLMarkUPP,
my_adjust_marks_proc: OSLAdjustMarksUPP,
my_get_err_desc_proc_ptr: OSLGetErrDescUPP,
) -> OSErr;
}
extern "C-unwind" {
#[cfg(feature = "AEDataModel")]
pub fn AEResolve(
object_specifier: *const AEDesc,
callback_flags: c_short,
the_token: *mut AEDesc,
) -> OSErr;
}
#[cfg(feature = "AEDataModel")]
#[inline]
pub unsafe extern "C-unwind" fn AEInstallObjectAccessor(
desired_class: DescType,
container_type: DescType,
the_accessor: OSLAccessorUPP,
accessor_refcon: SRefCon,
is_sys_handler: bool,
) -> OSErr {
extern "C-unwind" {
fn AEInstallObjectAccessor(
desired_class: DescType,
container_type: DescType,
the_accessor: OSLAccessorUPP,
accessor_refcon: SRefCon,
is_sys_handler: Boolean,
) -> OSErr;
}
unsafe {
AEInstallObjectAccessor(
desired_class,
container_type,
the_accessor,
accessor_refcon,
is_sys_handler as _,
)
}
}
#[cfg(feature = "AEDataModel")]
#[inline]
pub unsafe extern "C-unwind" fn AERemoveObjectAccessor(
desired_class: DescType,
container_type: DescType,
the_accessor: OSLAccessorUPP,
is_sys_handler: bool,
) -> OSErr {
extern "C-unwind" {
fn AERemoveObjectAccessor(
desired_class: DescType,
container_type: DescType,
the_accessor: OSLAccessorUPP,
is_sys_handler: Boolean,
) -> OSErr;
}
unsafe {
AERemoveObjectAccessor(
desired_class,
container_type,
the_accessor,
is_sys_handler as _,
)
}
}
#[cfg(feature = "AEDataModel")]
#[inline]
pub unsafe extern "C-unwind" fn AEGetObjectAccessor(
desired_class: DescType,
container_type: DescType,
accessor: *mut OSLAccessorUPP,
accessor_refcon: *mut SRefCon,
is_sys_handler: bool,
) -> OSErr {
extern "C-unwind" {
fn AEGetObjectAccessor(
desired_class: DescType,
container_type: DescType,
accessor: *mut OSLAccessorUPP,
accessor_refcon: *mut SRefCon,
is_sys_handler: Boolean,
) -> OSErr;
}
unsafe {
AEGetObjectAccessor(
desired_class,
container_type,
accessor,
accessor_refcon,
is_sys_handler as _,
)
}
}
extern "C-unwind" {
#[cfg(feature = "AEDataModel")]
pub fn AEDisposeToken(the_token: *mut AEDesc) -> OSErr;
}
extern "C-unwind" {
#[cfg(feature = "AEDataModel")]
pub fn AECallObjectAccessor(
desired_class: DescType,
container_token: *const AEDesc,
container_class: DescType,
key_form: DescType,
key_data: *const AEDesc,
token: *mut AEDesc,
) -> OSErr;
}