use core::cell::UnsafeCell;
use core::ffi::*;
use core::marker::{PhantomData, PhantomPinned};
use core::ptr::NonNull;
#[cfg(feature = "dispatch2")]
use dispatch2::*;
#[cfg(feature = "objc2")]
use objc2::__framework_prelude::*;
use objc2_core_foundation::*;
use crate::*;
#[doc(alias = "CMClockRef")]
#[repr(C)]
pub struct CMClock {
inner: [u8; 0],
_p: UnsafeCell<PhantomData<(*const UnsafeCell<()>, PhantomPinned)>>,
}
cf_type!(
unsafe impl CMClock {}
);
#[cfg(feature = "objc2")]
cf_objc2_type!(
unsafe impl RefEncode<"OpaqueCMClock"> for CMClock {}
);
unsafe impl Send for CMClock {}
unsafe impl Sync for CMClock {}
#[doc(alias = "CMTimebaseRef")]
#[repr(C)]
pub struct CMTimebase {
inner: [u8; 0],
_p: UnsafeCell<PhantomData<(*const UnsafeCell<()>, PhantomPinned)>>,
}
cf_type!(
unsafe impl CMTimebase {}
);
#[cfg(feature = "objc2")]
cf_objc2_type!(
unsafe impl RefEncode<"OpaqueCMTimebase"> for CMTimebase {}
);
unsafe impl Send for CMTimebase {}
unsafe impl Sync for CMTimebase {}
#[doc(alias = "CMClockOrTimebaseRef")]
pub type CMClockOrTimebase = CFType;
pub const kCMClockError_MissingRequiredParameter: OSStatus = -12745;
pub const kCMClockError_InvalidParameter: OSStatus = -12746;
pub const kCMClockError_AllocationFailed: OSStatus = -12747;
pub const kCMClockError_UnsupportedOperation: OSStatus = -12756;
pub const kCMTimebaseError_MissingRequiredParameter: OSStatus = -12748;
pub const kCMTimebaseError_InvalidParameter: OSStatus = -12749;
pub const kCMTimebaseError_AllocationFailed: OSStatus = -12750;
pub const kCMTimebaseError_TimerIntervalTooShort: OSStatus = -12751;
pub const kCMTimebaseError_ReadOnly: OSStatus = -12757;
pub const kCMSyncError_MissingRequiredParameter: OSStatus = -12752;
pub const kCMSyncError_InvalidParameter: OSStatus = -12753;
pub const kCMSyncError_AllocationFailed: OSStatus = -12754;
pub const kCMSyncError_RateMustBeNonZero: OSStatus = -12755;
unsafe impl ConcreteType for CMClock {
#[doc(alias = "CMClockGetTypeID")]
#[inline]
fn type_id() -> CFTypeID {
extern "C-unwind" {
fn CMClockGetTypeID() -> CFTypeID;
}
unsafe { CMClockGetTypeID() }
}
}
impl CMClock {
#[doc(alias = "CMClockGetHostTimeClock")]
#[inline]
pub unsafe fn host_time_clock() -> CFRetained<CMClock> {
extern "C-unwind" {
fn CMClockGetHostTimeClock() -> Option<NonNull<CMClock>>;
}
let ret = unsafe { CMClockGetHostTimeClock() };
let ret =
ret.expect("function was marked as returning non-null, but actually returned NULL");
unsafe { CFRetained::retain(ret) }
}
#[doc(alias = "CMClockConvertHostTimeToSystemUnits")]
#[cfg(feature = "CMTime")]
#[inline]
pub unsafe fn convert_host_time_to_system_units(host_time: CMTime) -> u64 {
extern "C-unwind" {
fn CMClockConvertHostTimeToSystemUnits(host_time: CMTime) -> u64;
}
unsafe { CMClockConvertHostTimeToSystemUnits(host_time) }
}
#[doc(alias = "CMClockMakeHostTimeFromSystemUnits")]
#[cfg(feature = "CMTime")]
#[inline]
pub unsafe fn make_host_time_from_system_units(host_time: u64) -> CMTime {
extern "C-unwind" {
fn CMClockMakeHostTimeFromSystemUnits(host_time: u64) -> CMTime;
}
unsafe { CMClockMakeHostTimeFromSystemUnits(host_time) }
}
#[doc(alias = "CMClockGetTime")]
#[cfg(feature = "CMTime")]
#[inline]
pub unsafe fn time(&self) -> CMTime {
extern "C-unwind" {
fn CMClockGetTime(clock: &CMClock) -> CMTime;
}
unsafe { CMClockGetTime(self) }
}
#[doc(alias = "CMClockGetAnchorTime")]
#[cfg(feature = "CMTime")]
#[inline]
pub unsafe fn anchor_time(
&self,
clock_time_out: NonNull<CMTime>,
reference_clock_time_out: NonNull<CMTime>,
) -> OSStatus {
extern "C-unwind" {
fn CMClockGetAnchorTime(
clock: &CMClock,
clock_time_out: NonNull<CMTime>,
reference_clock_time_out: NonNull<CMTime>,
) -> OSStatus;
}
unsafe { CMClockGetAnchorTime(self, clock_time_out, reference_clock_time_out) }
}
#[doc(alias = "CMClockMightDrift")]
#[inline]
pub unsafe fn might_drift(&self, other_clock: &CMClock) -> bool {
extern "C-unwind" {
fn CMClockMightDrift(clock: &CMClock, other_clock: &CMClock) -> Boolean;
}
let ret = unsafe { CMClockMightDrift(self, other_clock) };
ret != 0
}
#[doc(alias = "CMClockInvalidate")]
#[inline]
pub unsafe fn invalidate(&self) {
extern "C-unwind" {
fn CMClockInvalidate(clock: &CMClock);
}
unsafe { CMClockInvalidate(self) }
}
}
unsafe impl ConcreteType for CMTimebase {
#[doc(alias = "CMTimebaseGetTypeID")]
#[inline]
fn type_id() -> CFTypeID {
extern "C-unwind" {
fn CMTimebaseGetTypeID() -> CFTypeID;
}
unsafe { CMTimebaseGetTypeID() }
}
}
impl CMTimebase {
#[doc(alias = "CMTimebaseCreateWithMasterClock")]
#[deprecated]
#[inline]
pub unsafe fn create_with_master_clock(
allocator: Option<&CFAllocator>,
master_clock: &CMClock,
timebase_out: NonNull<*mut CMTimebase>,
) -> OSStatus {
extern "C-unwind" {
fn CMTimebaseCreateWithMasterClock(
allocator: Option<&CFAllocator>,
master_clock: &CMClock,
timebase_out: NonNull<*mut CMTimebase>,
) -> OSStatus;
}
unsafe { CMTimebaseCreateWithMasterClock(allocator, master_clock, timebase_out) }
}
#[doc(alias = "CMTimebaseCreateWithMasterTimebase")]
#[deprecated]
#[inline]
pub unsafe fn create_with_master_timebase(
allocator: Option<&CFAllocator>,
master_timebase: &CMTimebase,
timebase_out: NonNull<*mut CMTimebase>,
) -> OSStatus {
extern "C-unwind" {
fn CMTimebaseCreateWithMasterTimebase(
allocator: Option<&CFAllocator>,
master_timebase: &CMTimebase,
timebase_out: NonNull<*mut CMTimebase>,
) -> OSStatus;
}
unsafe { CMTimebaseCreateWithMasterTimebase(allocator, master_timebase, timebase_out) }
}
#[doc(alias = "CMTimebaseCopyMasterTimebase")]
#[deprecated]
#[inline]
pub unsafe fn master_timebase(&self) -> Option<CFRetained<CMTimebase>> {
extern "C-unwind" {
fn CMTimebaseCopyMasterTimebase(timebase: &CMTimebase) -> Option<NonNull<CMTimebase>>;
}
let ret = unsafe { CMTimebaseCopyMasterTimebase(self) };
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}
#[doc(alias = "CMTimebaseCopyMasterClock")]
#[deprecated]
#[inline]
pub unsafe fn master_clock(&self) -> Option<CFRetained<CMClock>> {
extern "C-unwind" {
fn CMTimebaseCopyMasterClock(timebase: &CMTimebase) -> Option<NonNull<CMClock>>;
}
let ret = unsafe { CMTimebaseCopyMasterClock(self) };
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}
#[doc(alias = "CMTimebaseCopyMaster")]
#[deprecated]
#[inline]
pub unsafe fn master(&self) -> CFRetained<CMClockOrTimebase> {
extern "C-unwind" {
fn CMTimebaseCopyMaster(timebase: &CMTimebase) -> Option<NonNull<CMClockOrTimebase>>;
}
let ret = unsafe { CMTimebaseCopyMaster(self) };
let ret =
ret.expect("function was marked as returning non-null, but actually returned NULL");
unsafe { CFRetained::from_raw(ret) }
}
#[doc(alias = "CMTimebaseCopyUltimateMasterClock")]
#[deprecated]
#[inline]
pub unsafe fn ultimate_master_clock(&self) -> CFRetained<CMClock> {
extern "C-unwind" {
fn CMTimebaseCopyUltimateMasterClock(timebase: &CMTimebase)
-> Option<NonNull<CMClock>>;
}
let ret = unsafe { CMTimebaseCopyUltimateMasterClock(self) };
let ret =
ret.expect("function was marked as returning non-null, but actually returned NULL");
unsafe { CFRetained::from_raw(ret) }
}
#[doc(alias = "CMTimebaseGetMasterTimebase")]
#[deprecated]
#[inline]
pub unsafe fn get_master_timebase(&self) -> Option<CFRetained<CMTimebase>> {
extern "C-unwind" {
fn CMTimebaseGetMasterTimebase(timebase: &CMTimebase) -> Option<NonNull<CMTimebase>>;
}
let ret = unsafe { CMTimebaseGetMasterTimebase(self) };
ret.map(|ret| unsafe { CFRetained::retain(ret) })
}
#[doc(alias = "CMTimebaseGetMasterClock")]
#[deprecated]
#[inline]
pub unsafe fn get_master_clock(&self) -> Option<CFRetained<CMClock>> {
extern "C-unwind" {
fn CMTimebaseGetMasterClock(timebase: &CMTimebase) -> Option<NonNull<CMClock>>;
}
let ret = unsafe { CMTimebaseGetMasterClock(self) };
ret.map(|ret| unsafe { CFRetained::retain(ret) })
}
#[doc(alias = "CMTimebaseGetMaster")]
#[deprecated]
#[inline]
pub unsafe fn get_master(&self) -> Option<CFRetained<CMClockOrTimebase>> {
extern "C-unwind" {
fn CMTimebaseGetMaster(timebase: &CMTimebase) -> Option<NonNull<CMClockOrTimebase>>;
}
let ret = unsafe { CMTimebaseGetMaster(self) };
ret.map(|ret| unsafe { CFRetained::retain(ret) })
}
#[doc(alias = "CMTimebaseGetUltimateMasterClock")]
#[deprecated]
#[inline]
pub unsafe fn get_ultimate_master_clock(&self) -> Option<CFRetained<CMClock>> {
extern "C-unwind" {
fn CMTimebaseGetUltimateMasterClock(timebase: &CMTimebase) -> Option<NonNull<CMClock>>;
}
let ret = unsafe { CMTimebaseGetUltimateMasterClock(self) };
ret.map(|ret| unsafe { CFRetained::retain(ret) })
}
#[doc(alias = "CMTimebaseSetMasterClock")]
#[deprecated]
#[inline]
pub unsafe fn set_master_clock(&self, new_master_clock: &CMClock) -> OSStatus {
extern "C-unwind" {
fn CMTimebaseSetMasterClock(
timebase: &CMTimebase,
new_master_clock: &CMClock,
) -> OSStatus;
}
unsafe { CMTimebaseSetMasterClock(self, new_master_clock) }
}
#[doc(alias = "CMTimebaseSetMasterTimebase")]
#[deprecated]
#[inline]
pub unsafe fn set_master_timebase(&self, new_master_timebase: &CMTimebase) -> OSStatus {
extern "C-unwind" {
fn CMTimebaseSetMasterTimebase(
timebase: &CMTimebase,
new_master_timebase: &CMTimebase,
) -> OSStatus;
}
unsafe { CMTimebaseSetMasterTimebase(self, new_master_timebase) }
}
#[doc(alias = "CMTimebaseGetTime")]
#[cfg(feature = "CMTime")]
#[inline]
pub unsafe fn time(&self) -> CMTime {
extern "C-unwind" {
fn CMTimebaseGetTime(timebase: &CMTimebase) -> CMTime;
}
unsafe { CMTimebaseGetTime(self) }
}
#[doc(alias = "CMTimebaseGetTimeWithTimeScale")]
#[cfg(feature = "CMTime")]
#[inline]
pub unsafe fn time_with_time_scale(
&self,
timescale: CMTimeScale,
method: CMTimeRoundingMethod,
) -> CMTime {
extern "C-unwind" {
fn CMTimebaseGetTimeWithTimeScale(
timebase: &CMTimebase,
timescale: CMTimeScale,
method: CMTimeRoundingMethod,
) -> CMTime;
}
unsafe { CMTimebaseGetTimeWithTimeScale(self, timescale, method) }
}
#[doc(alias = "CMTimebaseSetTime")]
#[cfg(feature = "CMTime")]
#[inline]
pub unsafe fn set_time(&self, time: CMTime) -> OSStatus {
extern "C-unwind" {
fn CMTimebaseSetTime(timebase: &CMTimebase, time: CMTime) -> OSStatus;
}
unsafe { CMTimebaseSetTime(self, time) }
}
#[doc(alias = "CMTimebaseSetAnchorTime")]
#[cfg(feature = "CMTime")]
#[inline]
pub unsafe fn set_anchor_time(
&self,
timebase_time: CMTime,
immediate_source_time: CMTime,
) -> OSStatus {
extern "C-unwind" {
fn CMTimebaseSetAnchorTime(
timebase: &CMTimebase,
timebase_time: CMTime,
immediate_source_time: CMTime,
) -> OSStatus;
}
unsafe { CMTimebaseSetAnchorTime(self, timebase_time, immediate_source_time) }
}
#[doc(alias = "CMTimebaseGetRate")]
#[inline]
pub unsafe fn rate(&self) -> f64 {
extern "C-unwind" {
fn CMTimebaseGetRate(timebase: &CMTimebase) -> f64;
}
unsafe { CMTimebaseGetRate(self) }
}
#[doc(alias = "CMTimebaseGetTimeAndRate")]
#[cfg(feature = "CMTime")]
#[inline]
pub unsafe fn time_and_rate(&self, time_out: *mut CMTime, rate_out: *mut f64) -> OSStatus {
extern "C-unwind" {
fn CMTimebaseGetTimeAndRate(
timebase: &CMTimebase,
time_out: *mut CMTime,
rate_out: *mut f64,
) -> OSStatus;
}
unsafe { CMTimebaseGetTimeAndRate(self, time_out, rate_out) }
}
#[doc(alias = "CMTimebaseSetRate")]
#[inline]
pub unsafe fn set_rate(&self, rate: f64) -> OSStatus {
extern "C-unwind" {
fn CMTimebaseSetRate(timebase: &CMTimebase, rate: f64) -> OSStatus;
}
unsafe { CMTimebaseSetRate(self, rate) }
}
#[doc(alias = "CMTimebaseSetRateAndAnchorTime")]
#[cfg(feature = "CMTime")]
#[inline]
pub unsafe fn set_rate_and_anchor_time(
&self,
rate: f64,
timebase_time: CMTime,
immediate_source_time: CMTime,
) -> OSStatus {
extern "C-unwind" {
fn CMTimebaseSetRateAndAnchorTime(
timebase: &CMTimebase,
rate: f64,
timebase_time: CMTime,
immediate_source_time: CMTime,
) -> OSStatus;
}
unsafe { CMTimebaseSetRateAndAnchorTime(self, rate, timebase_time, immediate_source_time) }
}
#[doc(alias = "CMTimebaseGetEffectiveRate")]
#[inline]
pub unsafe fn effective_rate(&self) -> f64 {
extern "C-unwind" {
fn CMTimebaseGetEffectiveRate(timebase: &CMTimebase) -> f64;
}
unsafe { CMTimebaseGetEffectiveRate(self) }
}
#[doc(alias = "CMTimebaseAddTimer")]
#[inline]
pub unsafe fn add_timer(&self, timer: &CFRunLoopTimer, runloop: &CFRunLoop) -> OSStatus {
extern "C-unwind" {
fn CMTimebaseAddTimer(
timebase: &CMTimebase,
timer: &CFRunLoopTimer,
runloop: &CFRunLoop,
) -> OSStatus;
}
unsafe { CMTimebaseAddTimer(self, timer, runloop) }
}
#[doc(alias = "CMTimebaseRemoveTimer")]
#[inline]
pub unsafe fn remove_timer(&self, timer: &CFRunLoopTimer) -> OSStatus {
extern "C-unwind" {
fn CMTimebaseRemoveTimer(timebase: &CMTimebase, timer: &CFRunLoopTimer) -> OSStatus;
}
unsafe { CMTimebaseRemoveTimer(self, timer) }
}
#[doc(alias = "CMTimebaseSetTimerNextFireTime")]
#[cfg(feature = "CMTime")]
#[inline]
pub unsafe fn set_timer_next_fire_time(
&self,
timer: &CFRunLoopTimer,
fire_time: CMTime,
flags: u32,
) -> OSStatus {
extern "C-unwind" {
fn CMTimebaseSetTimerNextFireTime(
timebase: &CMTimebase,
timer: &CFRunLoopTimer,
fire_time: CMTime,
flags: u32,
) -> OSStatus;
}
unsafe { CMTimebaseSetTimerNextFireTime(self, timer, fire_time, flags) }
}
#[doc(alias = "CMTimebaseSetTimerToFireImmediately")]
#[inline]
pub unsafe fn set_timer_to_fire_immediately(&self, timer: &CFRunLoopTimer) -> OSStatus {
extern "C-unwind" {
fn CMTimebaseSetTimerToFireImmediately(
timebase: &CMTimebase,
timer: &CFRunLoopTimer,
) -> OSStatus;
}
unsafe { CMTimebaseSetTimerToFireImmediately(self, timer) }
}
#[doc(alias = "CMTimebaseAddTimerDispatchSource")]
#[cfg(feature = "dispatch2")]
#[inline]
pub unsafe fn add_timer_dispatch_source(&self, timer_source: &DispatchSource) -> OSStatus {
extern "C-unwind" {
fn CMTimebaseAddTimerDispatchSource(
timebase: &CMTimebase,
timer_source: &DispatchSource,
) -> OSStatus;
}
unsafe { CMTimebaseAddTimerDispatchSource(self, timer_source) }
}
#[doc(alias = "CMTimebaseRemoveTimerDispatchSource")]
#[cfg(feature = "dispatch2")]
#[inline]
pub unsafe fn remove_timer_dispatch_source(&self, timer_source: &DispatchSource) -> OSStatus {
extern "C-unwind" {
fn CMTimebaseRemoveTimerDispatchSource(
timebase: &CMTimebase,
timer_source: &DispatchSource,
) -> OSStatus;
}
unsafe { CMTimebaseRemoveTimerDispatchSource(self, timer_source) }
}
#[doc(alias = "CMTimebaseSetTimerDispatchSourceNextFireTime")]
#[cfg(all(feature = "CMTime", feature = "dispatch2"))]
#[inline]
pub unsafe fn set_timer_dispatch_source_next_fire_time(
&self,
timer_source: &DispatchSource,
fire_time: CMTime,
flags: u32,
) -> OSStatus {
extern "C-unwind" {
fn CMTimebaseSetTimerDispatchSourceNextFireTime(
timebase: &CMTimebase,
timer_source: &DispatchSource,
fire_time: CMTime,
flags: u32,
) -> OSStatus;
}
unsafe {
CMTimebaseSetTimerDispatchSourceNextFireTime(self, timer_source, fire_time, flags)
}
}
#[doc(alias = "CMTimebaseSetTimerDispatchSourceToFireImmediately")]
#[cfg(feature = "dispatch2")]
#[inline]
pub unsafe fn set_timer_dispatch_source_to_fire_immediately(
&self,
timer_source: &DispatchSource,
) -> OSStatus {
extern "C-unwind" {
fn CMTimebaseSetTimerDispatchSourceToFireImmediately(
timebase: &CMTimebase,
timer_source: &DispatchSource,
) -> OSStatus;
}
unsafe { CMTimebaseSetTimerDispatchSourceToFireImmediately(self, timer_source) }
}
}
extern "C-unwind" {
pub fn CMSyncGetRelativeRate(
of_clock_or_timebase: &CMClockOrTimebase,
relative_to_clock_or_timebase: &CMClockOrTimebase,
) -> f64;
}
extern "C-unwind" {
#[cfg(feature = "CMTime")]
pub fn CMSyncGetRelativeRateAndAnchorTime(
of_clock_or_timebase: &CMClockOrTimebase,
relative_to_clock_or_timebase: &CMClockOrTimebase,
out_relative_rate: *mut f64,
out_of_clock_or_timebase_anchor_time: *mut CMTime,
out_relative_to_clock_or_timebase_anchor_time: *mut CMTime,
) -> OSStatus;
}
extern "C-unwind" {
#[cfg(feature = "CMTime")]
pub fn CMSyncConvertTime(
time: CMTime,
from_clock_or_timebase: &CMClockOrTimebase,
to_clock_or_timebase: &CMClockOrTimebase,
) -> CMTime;
}
#[inline]
pub unsafe extern "C-unwind" fn CMSyncMightDrift(
clock_or_timebase1: &CMClockOrTimebase,
clock_or_timebase2: &CMClockOrTimebase,
) -> bool {
extern "C-unwind" {
fn CMSyncMightDrift(
clock_or_timebase1: &CMClockOrTimebase,
clock_or_timebase2: &CMClockOrTimebase,
) -> Boolean;
}
let ret = unsafe { CMSyncMightDrift(clock_or_timebase1, clock_or_timebase2) };
ret != 0
}
extern "C-unwind" {
#[cfg(feature = "CMTime")]
pub fn CMSyncGetTime(clock_or_timebase: &CMClockOrTimebase) -> CMTime;
}
impl CMTimebase {
#[doc(alias = "CMTimebaseNotificationBarrier")]
#[inline]
pub unsafe fn notification_barrier(&self) -> OSStatus {
extern "C-unwind" {
fn CMTimebaseNotificationBarrier(timebase: &CMTimebase) -> OSStatus;
}
unsafe { CMTimebaseNotificationBarrier(self) }
}
}
extern "C" {
pub static kCMTimebaseNotification_EffectiveRateChanged: &'static CFString;
}
extern "C" {
pub static kCMTimebaseNotification_TimeJumped: &'static CFString;
}
extern "C" {
pub static kCMTimebaseNotificationKey_EventTime: &'static CFString;
}
#[deprecated = "renamed to `CMClock::host_time_clock`"]
#[inline]
pub unsafe extern "C-unwind" fn CMClockGetHostTimeClock() -> CFRetained<CMClock> {
extern "C-unwind" {
fn CMClockGetHostTimeClock() -> Option<NonNull<CMClock>>;
}
let ret = unsafe { CMClockGetHostTimeClock() };
let ret = ret.expect("function was marked as returning non-null, but actually returned NULL");
unsafe { CFRetained::retain(ret) }
}
extern "C-unwind" {
#[cfg(feature = "CMTime")]
#[deprecated = "renamed to `CMClock::convert_host_time_to_system_units`"]
pub fn CMClockConvertHostTimeToSystemUnits(host_time: CMTime) -> u64;
}
extern "C-unwind" {
#[cfg(feature = "CMTime")]
#[deprecated = "renamed to `CMClock::make_host_time_from_system_units`"]
pub fn CMClockMakeHostTimeFromSystemUnits(host_time: u64) -> CMTime;
}
extern "C-unwind" {
#[cfg(feature = "CMTime")]
#[deprecated = "renamed to `CMClock::time`"]
pub fn CMClockGetTime(clock: &CMClock) -> CMTime;
}
extern "C-unwind" {
#[cfg(feature = "CMTime")]
#[deprecated = "renamed to `CMClock::anchor_time`"]
pub fn CMClockGetAnchorTime(
clock: &CMClock,
clock_time_out: NonNull<CMTime>,
reference_clock_time_out: NonNull<CMTime>,
) -> OSStatus;
}
#[deprecated = "renamed to `CMClock::might_drift`"]
#[inline]
pub unsafe extern "C-unwind" fn CMClockMightDrift(clock: &CMClock, other_clock: &CMClock) -> bool {
extern "C-unwind" {
fn CMClockMightDrift(clock: &CMClock, other_clock: &CMClock) -> Boolean;
}
let ret = unsafe { CMClockMightDrift(clock, other_clock) };
ret != 0
}
extern "C-unwind" {
#[deprecated = "renamed to `CMClock::invalidate`"]
pub fn CMClockInvalidate(clock: &CMClock);
}
extern "C-unwind" {
#[deprecated = "renamed to `CMTimebase::create_with_master_clock`"]
pub fn CMTimebaseCreateWithMasterClock(
allocator: Option<&CFAllocator>,
master_clock: &CMClock,
timebase_out: NonNull<*mut CMTimebase>,
) -> OSStatus;
}
extern "C-unwind" {
#[deprecated = "renamed to `CMTimebase::create_with_master_timebase`"]
pub fn CMTimebaseCreateWithMasterTimebase(
allocator: Option<&CFAllocator>,
master_timebase: &CMTimebase,
timebase_out: NonNull<*mut CMTimebase>,
) -> OSStatus;
}
#[deprecated = "renamed to `CMTimebase::master_timebase`"]
#[inline]
pub unsafe extern "C-unwind" fn CMTimebaseCopyMasterTimebase(
timebase: &CMTimebase,
) -> Option<CFRetained<CMTimebase>> {
extern "C-unwind" {
fn CMTimebaseCopyMasterTimebase(timebase: &CMTimebase) -> Option<NonNull<CMTimebase>>;
}
let ret = unsafe { CMTimebaseCopyMasterTimebase(timebase) };
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}
#[deprecated = "renamed to `CMTimebase::master_clock`"]
#[inline]
pub unsafe extern "C-unwind" fn CMTimebaseCopyMasterClock(
timebase: &CMTimebase,
) -> Option<CFRetained<CMClock>> {
extern "C-unwind" {
fn CMTimebaseCopyMasterClock(timebase: &CMTimebase) -> Option<NonNull<CMClock>>;
}
let ret = unsafe { CMTimebaseCopyMasterClock(timebase) };
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}
#[deprecated = "renamed to `CMTimebase::master`"]
#[inline]
pub unsafe extern "C-unwind" fn CMTimebaseCopyMaster(
timebase: &CMTimebase,
) -> CFRetained<CMClockOrTimebase> {
extern "C-unwind" {
fn CMTimebaseCopyMaster(timebase: &CMTimebase) -> Option<NonNull<CMClockOrTimebase>>;
}
let ret = unsafe { CMTimebaseCopyMaster(timebase) };
let ret = ret.expect("function was marked as returning non-null, but actually returned NULL");
unsafe { CFRetained::from_raw(ret) }
}
#[deprecated = "renamed to `CMTimebase::ultimate_master_clock`"]
#[inline]
pub unsafe extern "C-unwind" fn CMTimebaseCopyUltimateMasterClock(
timebase: &CMTimebase,
) -> CFRetained<CMClock> {
extern "C-unwind" {
fn CMTimebaseCopyUltimateMasterClock(timebase: &CMTimebase) -> Option<NonNull<CMClock>>;
}
let ret = unsafe { CMTimebaseCopyUltimateMasterClock(timebase) };
let ret = ret.expect("function was marked as returning non-null, but actually returned NULL");
unsafe { CFRetained::from_raw(ret) }
}
#[deprecated = "renamed to `CMTimebase::get_master_timebase`"]
#[inline]
pub unsafe extern "C-unwind" fn CMTimebaseGetMasterTimebase(
timebase: &CMTimebase,
) -> Option<CFRetained<CMTimebase>> {
extern "C-unwind" {
fn CMTimebaseGetMasterTimebase(timebase: &CMTimebase) -> Option<NonNull<CMTimebase>>;
}
let ret = unsafe { CMTimebaseGetMasterTimebase(timebase) };
ret.map(|ret| unsafe { CFRetained::retain(ret) })
}
#[deprecated = "renamed to `CMTimebase::get_master_clock`"]
#[inline]
pub unsafe extern "C-unwind" fn CMTimebaseGetMasterClock(
timebase: &CMTimebase,
) -> Option<CFRetained<CMClock>> {
extern "C-unwind" {
fn CMTimebaseGetMasterClock(timebase: &CMTimebase) -> Option<NonNull<CMClock>>;
}
let ret = unsafe { CMTimebaseGetMasterClock(timebase) };
ret.map(|ret| unsafe { CFRetained::retain(ret) })
}
#[deprecated = "renamed to `CMTimebase::get_master`"]
#[inline]
pub unsafe extern "C-unwind" fn CMTimebaseGetMaster(
timebase: &CMTimebase,
) -> Option<CFRetained<CMClockOrTimebase>> {
extern "C-unwind" {
fn CMTimebaseGetMaster(timebase: &CMTimebase) -> Option<NonNull<CMClockOrTimebase>>;
}
let ret = unsafe { CMTimebaseGetMaster(timebase) };
ret.map(|ret| unsafe { CFRetained::retain(ret) })
}
#[deprecated = "renamed to `CMTimebase::get_ultimate_master_clock`"]
#[inline]
pub unsafe extern "C-unwind" fn CMTimebaseGetUltimateMasterClock(
timebase: &CMTimebase,
) -> Option<CFRetained<CMClock>> {
extern "C-unwind" {
fn CMTimebaseGetUltimateMasterClock(timebase: &CMTimebase) -> Option<NonNull<CMClock>>;
}
let ret = unsafe { CMTimebaseGetUltimateMasterClock(timebase) };
ret.map(|ret| unsafe { CFRetained::retain(ret) })
}
extern "C-unwind" {
#[deprecated = "renamed to `CMTimebase::set_master_clock`"]
pub fn CMTimebaseSetMasterClock(timebase: &CMTimebase, new_master_clock: &CMClock) -> OSStatus;
}
extern "C-unwind" {
#[deprecated = "renamed to `CMTimebase::set_master_timebase`"]
pub fn CMTimebaseSetMasterTimebase(
timebase: &CMTimebase,
new_master_timebase: &CMTimebase,
) -> OSStatus;
}
extern "C-unwind" {
#[cfg(feature = "CMTime")]
#[deprecated = "renamed to `CMTimebase::time`"]
pub fn CMTimebaseGetTime(timebase: &CMTimebase) -> CMTime;
}
extern "C-unwind" {
#[cfg(feature = "CMTime")]
#[deprecated = "renamed to `CMTimebase::time_with_time_scale`"]
pub fn CMTimebaseGetTimeWithTimeScale(
timebase: &CMTimebase,
timescale: CMTimeScale,
method: CMTimeRoundingMethod,
) -> CMTime;
}
extern "C-unwind" {
#[cfg(feature = "CMTime")]
#[deprecated = "renamed to `CMTimebase::set_time`"]
pub fn CMTimebaseSetTime(timebase: &CMTimebase, time: CMTime) -> OSStatus;
}
extern "C-unwind" {
#[cfg(feature = "CMTime")]
#[deprecated = "renamed to `CMTimebase::set_anchor_time`"]
pub fn CMTimebaseSetAnchorTime(
timebase: &CMTimebase,
timebase_time: CMTime,
immediate_source_time: CMTime,
) -> OSStatus;
}
extern "C-unwind" {
#[deprecated = "renamed to `CMTimebase::rate`"]
pub fn CMTimebaseGetRate(timebase: &CMTimebase) -> f64;
}
extern "C-unwind" {
#[cfg(feature = "CMTime")]
#[deprecated = "renamed to `CMTimebase::time_and_rate`"]
pub fn CMTimebaseGetTimeAndRate(
timebase: &CMTimebase,
time_out: *mut CMTime,
rate_out: *mut f64,
) -> OSStatus;
}
extern "C-unwind" {
#[deprecated = "renamed to `CMTimebase::set_rate`"]
pub fn CMTimebaseSetRate(timebase: &CMTimebase, rate: f64) -> OSStatus;
}
extern "C-unwind" {
#[cfg(feature = "CMTime")]
#[deprecated = "renamed to `CMTimebase::set_rate_and_anchor_time`"]
pub fn CMTimebaseSetRateAndAnchorTime(
timebase: &CMTimebase,
rate: f64,
timebase_time: CMTime,
immediate_source_time: CMTime,
) -> OSStatus;
}
extern "C-unwind" {
#[deprecated = "renamed to `CMTimebase::effective_rate`"]
pub fn CMTimebaseGetEffectiveRate(timebase: &CMTimebase) -> f64;
}
extern "C-unwind" {
#[deprecated = "renamed to `CMTimebase::add_timer`"]
pub fn CMTimebaseAddTimer(
timebase: &CMTimebase,
timer: &CFRunLoopTimer,
runloop: &CFRunLoop,
) -> OSStatus;
}
extern "C-unwind" {
#[deprecated = "renamed to `CMTimebase::remove_timer`"]
pub fn CMTimebaseRemoveTimer(timebase: &CMTimebase, timer: &CFRunLoopTimer) -> OSStatus;
}
extern "C-unwind" {
#[cfg(feature = "CMTime")]
#[deprecated = "renamed to `CMTimebase::set_timer_next_fire_time`"]
pub fn CMTimebaseSetTimerNextFireTime(
timebase: &CMTimebase,
timer: &CFRunLoopTimer,
fire_time: CMTime,
flags: u32,
) -> OSStatus;
}
extern "C-unwind" {
#[deprecated = "renamed to `CMTimebase::set_timer_to_fire_immediately`"]
pub fn CMTimebaseSetTimerToFireImmediately(
timebase: &CMTimebase,
timer: &CFRunLoopTimer,
) -> OSStatus;
}
extern "C-unwind" {
#[cfg(feature = "dispatch2")]
#[deprecated = "renamed to `CMTimebase::add_timer_dispatch_source`"]
pub fn CMTimebaseAddTimerDispatchSource(
timebase: &CMTimebase,
timer_source: &DispatchSource,
) -> OSStatus;
}
extern "C-unwind" {
#[cfg(feature = "dispatch2")]
#[deprecated = "renamed to `CMTimebase::remove_timer_dispatch_source`"]
pub fn CMTimebaseRemoveTimerDispatchSource(
timebase: &CMTimebase,
timer_source: &DispatchSource,
) -> OSStatus;
}
extern "C-unwind" {
#[cfg(all(feature = "CMTime", feature = "dispatch2"))]
#[deprecated = "renamed to `CMTimebase::set_timer_dispatch_source_next_fire_time`"]
pub fn CMTimebaseSetTimerDispatchSourceNextFireTime(
timebase: &CMTimebase,
timer_source: &DispatchSource,
fire_time: CMTime,
flags: u32,
) -> OSStatus;
}
extern "C-unwind" {
#[cfg(feature = "dispatch2")]
#[deprecated = "renamed to `CMTimebase::set_timer_dispatch_source_to_fire_immediately`"]
pub fn CMTimebaseSetTimerDispatchSourceToFireImmediately(
timebase: &CMTimebase,
timer_source: &DispatchSource,
) -> OSStatus;
}
extern "C-unwind" {
#[deprecated = "renamed to `CMTimebase::notification_barrier`"]
pub fn CMTimebaseNotificationBarrier(timebase: &CMTimebase) -> OSStatus;
}