@@ -101,7 +101,17 @@ pub type CFNumberRef = *const c_void; |
| 101 | 101 | pub type CFMachPortRef = *const c_void; |
| 102 | 102 | pub type CFRunLoopSourceRef = *const c_void; |
| 103 | 103 | pub type CFRunLoopRef = *const c_void; |
| 104 | +pub type CFRunLoopTimerRef = *const c_void; |
| 104 | 105 | pub type CFAllocatorRef = *const c_void; |
| 106 | + |
| 107 | +#[repr(C)] |
| 108 | +pub struct CFRunLoopTimerContext { |
| 109 | + pub version: i64, |
| 110 | + pub info: *mut c_void, |
| 111 | + pub retain: Option<extern "C" fn(*const c_void) -> *const c_void>, |
| 112 | + pub release: Option<extern "C" fn(*const c_void)>, |
| 113 | + pub copy_description: Option<extern "C" fn(*const c_void) -> CFStringRef>, |
| 114 | +} |
| 105 | 115 | pub type CGContextRef = *mut c_void; |
| 106 | 116 | pub type CGPathRef = *const c_void; |
| 107 | 117 | pub type CGMutablePathRef = *mut c_void; |
@@ -467,6 +477,18 @@ unsafe extern "C" { |
| 467 | 477 | pub fn CFRunLoopStop(rl: CFRunLoopRef); |
| 468 | 478 | pub fn CFRunLoopWakeUp(rl: CFRunLoopRef); |
| 469 | 479 | |
| 480 | + pub fn CFRunLoopTimerCreate( |
| 481 | + allocator: CFAllocatorRef, |
| 482 | + fire_date: f64, |
| 483 | + interval: f64, |
| 484 | + flags: u32, |
| 485 | + order: i64, |
| 486 | + callout: extern "C" fn(*mut c_void, *mut c_void), |
| 487 | + context: *mut CFRunLoopTimerContext, |
| 488 | + ) -> CFRunLoopTimerRef; |
| 489 | + pub fn CFRunLoopAddTimer(rl: CFRunLoopRef, timer: CFRunLoopTimerRef, mode: CFStringRef); |
| 490 | + pub fn CFAbsoluteTimeGetCurrent() -> f64; |
| 491 | + |
| 470 | 492 | pub static kCFAllocatorDefault: CFAllocatorRef; |
| 471 | 493 | pub static kCFTypeDictionaryKeyCallBacks: c_void; |
| 472 | 494 | pub static kCFTypeDictionaryValueCallBacks: c_void; |