Skip to content

Commit

Permalink
some doc aliases
Browse files Browse the repository at this point in the history
  • Loading branch information
yury committed Feb 25, 2025
1 parent 79f9ed3 commit 88bda5c
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 5 deletions.
5 changes: 3 additions & 2 deletions cidre/src/cf/data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,17 @@ use crate::{arc, cf, define_cf_type};
use crate::ns;

define_cf_type!(
#[doc(alias = "CFData")]
#[doc(alias = "CFDataRef")]
Data(cf::Type)
);

define_cf_type!(
#[doc(alias = "CFMutableData")]
#[doc(alias = "CFMutableDataRef")]
DataMut(Data)
);

impl Data {
#[doc(alias = "CFDataGetTypeID")]
#[inline]
pub fn type_id() -> cf::TypeId {
unsafe { CFDataGetTypeID() }
Expand Down
3 changes: 3 additions & 0 deletions cidre/src/cf/date.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ use std::ffi::c_void;
pub type TimeInterval = std::ffi::c_double;
pub type AbsTime = TimeInterval;

#[doc(alias = "kCFAbsoluteTimeIntervalSince1970")]
pub const ABS_TIME_INTERVAL_SINCE_1970: TimeInterval = 978307200.0;

#[doc(alias = "kCFAbsoluteTimeIntervalSince1904")]
pub const ABS_TIME_INTERVAL_SINCE_1904: TimeInterval = 3061152000.0;

#[cfg(feature = "ns")]
Expand Down
17 changes: 15 additions & 2 deletions cidre/src/cf/notification_center.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ use crate::{cf, define_cf_type};
#[cfg(feature = "ns")]
use crate::ns;

define_cf_type!(NotificationName(cf::String));
define_cf_type!(
#[doc(alias = "CFNotificationName")]
NotificationName(cf::String)
);

impl NotificationName {
pub fn with_raw(string: &cf::String) -> &Self {
Expand All @@ -27,9 +30,13 @@ pub type NotificationCallback = extern "C" fn(
user_info: Option<&cf::Dictionary>,
);

define_cf_type!(NotificationCenter(cf::Type));
define_cf_type!(
#[doc(alias = "CFNotificationCenterRef")]
NotificationCenter(cf::Type)
);

impl NotificationCenter {
#[doc(alias = "CFNotificationCenterGetTypeID")]
#[inline]
pub fn type_id() -> cf::TypeId {
unsafe { CFNotificationCenterGetTypeID() }
Expand Down Expand Up @@ -101,11 +108,17 @@ impl NotificationCenter {
}
}

#[derive(Debug, Clone, Copy, PartialEq, Eq)]
#[doc(alias = "CFNotificationSuspensionBehavior")]
#[repr(isize)]
pub enum NotificationSuspensionBehavior {
#[doc(alias = "kCFNotificationSuspensionBehaviorDrop")]
Drop = 1,
#[doc(alias = "kCFNotificationSuspensionBehaviorCoalesce")]
Coalesce = 2,
#[doc(alias = "kCFNotificationSuspensionBehaviorHold")]
Hold = 3,
#[doc(alias = "kCFNotificationSuspensionBehaviorDeliverImmediately")]
DeliverImmediately = 4,
}

Expand Down
5 changes: 4 additions & 1 deletion cidre/src/cf/number.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@ use crate::cf::{Allocator, ComparisonResult, Index, Type, TypeId};

use std::{ffi::c_void, time::Duration};

define_cf_type!(Boolean(Type));
define_cf_type!(
#[doc(alias = "CFBooleanRef")]
Boolean(Type)
);

impl Boolean {
/// ```
Expand Down

0 comments on commit 88bda5c

Please # to comment.