Closed madsmtm closed 3 months ago
This required two large rewrites of header-translator's internals, as emitting the correct Rust for a given enum constant was tricky, but now we're here!
header-translator
This should help a lot with uncluttering the top-level namespace for each framework.
// Generated before pub type AXHearingDeviceEar = NSInteger; pub const AXHearingDeviceEarNone: AXHearingDeviceEar = 0; pub const AXHearingDeviceEarLeft: AXHearingDeviceEar = 1 << 1; pub const AXHearingDeviceEarRight: AXHearingDeviceEar = 1 << 2; pub const AXHearingDeviceEarBoth: AXHearingDeviceEar = AXHearingDeviceEarLeft | AXHearingDeviceEarRight; // Generated now pub struct AXHearingDeviceEar(pub NSInteger); impl AXHearingDeviceEar { #[doc(alias = "AXHearingDeviceEarNone")] pub const None: Self = Self(0); #[doc(alias = "AXHearingDeviceEarLeft")] pub const Left: Self = Self(1 << 1); #[doc(alias = "AXHearingDeviceEarRight")] pub const Right: Self = Self(1 << 2); #[doc(alias = "AXHearingDeviceEarBoth")] pub const Both: Self = Self(AXHearingDeviceEar::Left.0 | AXHearingDeviceEar::Right.0); }
Part of https://github.com/madsmtm/objc2/issues/310, though more work here is definitely needed.
This required two large rewrites of
header-translator
's internals, as emitting the correct Rust for a given enum constant was tricky, but now we're here!This should help a lot with uncluttering the top-level namespace for each framework.
Part of https://github.com/madsmtm/objc2/issues/310, though more work here is definitely needed.