use core::ffi::*;
use core::ptr::NonNull;
#[cfg(feature = "objc2")]
use objc2::__framework_prelude::*;
use objc2_core_foundation::*;
#[cfg(feature = "objc2-core-graphics")]
use objc2_core_graphics::*;
#[cfg(feature = "objc2-core-text")]
use objc2_core_text::*;
use crate::*;
extern "C" {
pub static kMACaptionAppearanceSettingsChangedNotification: &'static CFString;
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct MACaptionAppearanceDomain(pub CFIndex);
impl MACaptionAppearanceDomain {
#[doc(alias = "kMACaptionAppearanceDomainDefault")]
pub const Default: Self = Self(0);
#[doc(alias = "kMACaptionAppearanceDomainUser")]
pub const User: Self = Self(1);
}
#[cfg(feature = "objc2")]
unsafe impl Encode for MACaptionAppearanceDomain {
const ENCODING: Encoding = CFIndex::ENCODING;
}
#[cfg(feature = "objc2")]
unsafe impl RefEncode for MACaptionAppearanceDomain {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct MACaptionAppearanceDisplayType(pub CFIndex);
impl MACaptionAppearanceDisplayType {
#[doc(alias = "kMACaptionAppearanceDisplayTypeForcedOnly")]
pub const ForcedOnly: Self = Self(0);
#[doc(alias = "kMACaptionAppearanceDisplayTypeAutomatic")]
pub const Automatic: Self = Self(1);
#[doc(alias = "kMACaptionAppearanceDisplayTypeAlwaysOn")]
pub const AlwaysOn: Self = Self(2);
}
#[cfg(feature = "objc2")]
unsafe impl Encode for MACaptionAppearanceDisplayType {
const ENCODING: Encoding = CFIndex::ENCODING;
}
#[cfg(feature = "objc2")]
unsafe impl RefEncode for MACaptionAppearanceDisplayType {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct MACaptionAppearanceBehavior(pub CFIndex);
impl MACaptionAppearanceBehavior {
#[doc(alias = "kMACaptionAppearanceBehaviorUseValue")]
pub const UseValue: Self = Self(0);
#[doc(alias = "kMACaptionAppearanceBehaviorUseContentIfAvailable")]
pub const UseContentIfAvailable: Self = Self(1);
}
#[cfg(feature = "objc2")]
unsafe impl Encode for MACaptionAppearanceBehavior {
const ENCODING: Encoding = CFIndex::ENCODING;
}
#[cfg(feature = "objc2")]
unsafe impl RefEncode for MACaptionAppearanceBehavior {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct MACaptionAppearanceFontStyle(pub CFIndex);
impl MACaptionAppearanceFontStyle {
#[doc(alias = "kMACaptionAppearanceFontStyleDefault")]
pub const Default: Self = Self(0);
#[doc(alias = "kMACaptionAppearanceFontStyleMonospacedWithSerif")]
pub const MonospacedWithSerif: Self = Self(1);
#[doc(alias = "kMACaptionAppearanceFontStyleProportionalWithSerif")]
pub const ProportionalWithSerif: Self = Self(2);
#[doc(alias = "kMACaptionAppearanceFontStyleMonospacedWithoutSerif")]
pub const MonospacedWithoutSerif: Self = Self(3);
#[doc(alias = "kMACaptionAppearanceFontStyleProportionalWithoutSerif")]
pub const ProportionalWithoutSerif: Self = Self(4);
#[doc(alias = "kMACaptionAppearanceFontStyleCasual")]
pub const Casual: Self = Self(5);
#[doc(alias = "kMACaptionAppearanceFontStyleCursive")]
pub const Cursive: Self = Self(6);
#[doc(alias = "kMACaptionAppearanceFontStyleSmallCapital")]
pub const SmallCapital: Self = Self(7);
}
#[cfg(feature = "objc2")]
unsafe impl Encode for MACaptionAppearanceFontStyle {
const ENCODING: Encoding = CFIndex::ENCODING;
}
#[cfg(feature = "objc2")]
unsafe impl RefEncode for MACaptionAppearanceFontStyle {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct MACaptionAppearanceTextEdgeStyle(pub CFIndex);
impl MACaptionAppearanceTextEdgeStyle {
#[doc(alias = "kMACaptionAppearanceTextEdgeStyleUndefined")]
pub const Undefined: Self = Self(0);
#[doc(alias = "kMACaptionAppearanceTextEdgeStyleNone")]
pub const None: Self = Self(1);
#[doc(alias = "kMACaptionAppearanceTextEdgeStyleRaised")]
pub const Raised: Self = Self(2);
#[doc(alias = "kMACaptionAppearanceTextEdgeStyleDepressed")]
pub const Depressed: Self = Self(3);
#[doc(alias = "kMACaptionAppearanceTextEdgeStyleUniform")]
pub const Uniform: Self = Self(4);
#[doc(alias = "kMACaptionAppearanceTextEdgeStyleDropShadow")]
pub const DropShadow: Self = Self(5);
}
#[cfg(feature = "objc2")]
unsafe impl Encode for MACaptionAppearanceTextEdgeStyle {
const ENCODING: Encoding = CFIndex::ENCODING;
}
#[cfg(feature = "objc2")]
unsafe impl RefEncode for MACaptionAppearanceTextEdgeStyle {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
extern "C" {
pub static MAMediaCharacteristicDescribesMusicAndSoundForAccessibility: &'static CFString;
}
extern "C" {
pub static MAMediaCharacteristicTranscribesSpokenDialogForAccessibility: &'static CFString;
}
extern "C-unwind" {
pub fn MACaptionAppearanceDidDisplayCaptions(strings: &CFArray);
}
extern "C-unwind" {
pub fn MACaptionAppearanceAddSelectedLanguage(
domain: MACaptionAppearanceDomain,
language: &CFString,
) -> bool;
}
#[inline]
pub unsafe extern "C-unwind" fn MACaptionAppearanceCopySelectedLanguages(
domain: MACaptionAppearanceDomain,
) -> CFRetained<CFArray> {
extern "C-unwind" {
fn MACaptionAppearanceCopySelectedLanguages(
domain: MACaptionAppearanceDomain,
) -> Option<NonNull<CFArray>>;
}
let ret = unsafe { MACaptionAppearanceCopySelectedLanguages(domain) };
let ret = ret.expect("function was marked as returning non-null, but actually returned NULL");
unsafe { CFRetained::from_raw(ret) }
}
extern "C-unwind" {
pub fn MACaptionAppearanceGetDisplayType(
domain: MACaptionAppearanceDomain,
) -> MACaptionAppearanceDisplayType;
}
extern "C-unwind" {
pub fn MACaptionAppearanceSetDisplayType(
domain: MACaptionAppearanceDomain,
display_type: MACaptionAppearanceDisplayType,
);
}
#[inline]
pub unsafe extern "C-unwind" fn MACaptionAppearanceCopyPreferredCaptioningMediaCharacteristics(
domain: MACaptionAppearanceDomain,
) -> CFRetained<CFArray> {
extern "C-unwind" {
fn MACaptionAppearanceCopyPreferredCaptioningMediaCharacteristics(
domain: MACaptionAppearanceDomain,
) -> Option<NonNull<CFArray>>;
}
let ret = unsafe { MACaptionAppearanceCopyPreferredCaptioningMediaCharacteristics(domain) };
let ret = ret.expect("function was marked as returning non-null, but actually returned NULL");
unsafe { CFRetained::from_raw(ret) }
}
extern "C-unwind" {
pub fn MACaptionAppearanceIsCustomized(domain: MACaptionAppearanceDomain) -> bool;
}
#[cfg(feature = "objc2-core-graphics")]
#[inline]
pub unsafe extern "C-unwind" fn MACaptionAppearanceCopyForegroundColor(
domain: MACaptionAppearanceDomain,
behavior: *mut MACaptionAppearanceBehavior,
) -> CFRetained<CGColor> {
extern "C-unwind" {
fn MACaptionAppearanceCopyForegroundColor(
domain: MACaptionAppearanceDomain,
behavior: *mut MACaptionAppearanceBehavior,
) -> Option<NonNull<CGColor>>;
}
let ret = unsafe { MACaptionAppearanceCopyForegroundColor(domain, behavior) };
let ret = ret.expect("function was marked as returning non-null, but actually returned NULL");
unsafe { CFRetained::from_raw(ret) }
}
#[cfg(feature = "objc2-core-graphics")]
#[inline]
pub unsafe extern "C-unwind" fn MACaptionAppearanceCopyBackgroundColor(
domain: MACaptionAppearanceDomain,
behavior: *mut MACaptionAppearanceBehavior,
) -> CFRetained<CGColor> {
extern "C-unwind" {
fn MACaptionAppearanceCopyBackgroundColor(
domain: MACaptionAppearanceDomain,
behavior: *mut MACaptionAppearanceBehavior,
) -> Option<NonNull<CGColor>>;
}
let ret = unsafe { MACaptionAppearanceCopyBackgroundColor(domain, behavior) };
let ret = ret.expect("function was marked as returning non-null, but actually returned NULL");
unsafe { CFRetained::from_raw(ret) }
}
#[cfg(feature = "objc2-core-graphics")]
#[inline]
pub unsafe extern "C-unwind" fn MACaptionAppearanceCopyWindowColor(
domain: MACaptionAppearanceDomain,
behavior: *mut MACaptionAppearanceBehavior,
) -> CFRetained<CGColor> {
extern "C-unwind" {
fn MACaptionAppearanceCopyWindowColor(
domain: MACaptionAppearanceDomain,
behavior: *mut MACaptionAppearanceBehavior,
) -> Option<NonNull<CGColor>>;
}
let ret = unsafe { MACaptionAppearanceCopyWindowColor(domain, behavior) };
let ret = ret.expect("function was marked as returning non-null, but actually returned NULL");
unsafe { CFRetained::from_raw(ret) }
}
extern "C-unwind" {
pub fn MACaptionAppearanceGetForegroundOpacity(
domain: MACaptionAppearanceDomain,
behavior: *mut MACaptionAppearanceBehavior,
) -> CGFloat;
}
extern "C-unwind" {
pub fn MACaptionAppearanceGetBackgroundOpacity(
domain: MACaptionAppearanceDomain,
behavior: *mut MACaptionAppearanceBehavior,
) -> CGFloat;
}
extern "C-unwind" {
pub fn MACaptionAppearanceGetWindowOpacity(
domain: MACaptionAppearanceDomain,
behavior: *mut MACaptionAppearanceBehavior,
) -> CGFloat;
}
extern "C-unwind" {
pub fn MACaptionAppearanceGetWindowRoundedCornerRadius(
domain: MACaptionAppearanceDomain,
behavior: *mut MACaptionAppearanceBehavior,
) -> CGFloat;
}
#[cfg(feature = "objc2-core-text")]
#[inline]
pub unsafe extern "C-unwind" fn MACaptionAppearanceCopyFontDescriptorForStyle(
domain: MACaptionAppearanceDomain,
behavior: *mut MACaptionAppearanceBehavior,
font_style: MACaptionAppearanceFontStyle,
) -> CFRetained<CTFontDescriptor> {
extern "C-unwind" {
fn MACaptionAppearanceCopyFontDescriptorForStyle(
domain: MACaptionAppearanceDomain,
behavior: *mut MACaptionAppearanceBehavior,
font_style: MACaptionAppearanceFontStyle,
) -> Option<NonNull<CTFontDescriptor>>;
}
let ret =
unsafe { MACaptionAppearanceCopyFontDescriptorForStyle(domain, behavior, font_style) };
let ret = ret.expect("function was marked as returning non-null, but actually returned NULL");
unsafe { CFRetained::from_raw(ret) }
}
extern "C-unwind" {
pub fn MACaptionAppearanceGetRelativeCharacterSize(
domain: MACaptionAppearanceDomain,
behavior: *mut MACaptionAppearanceBehavior,
) -> CGFloat;
}
extern "C-unwind" {
pub fn MACaptionAppearanceGetTextEdgeStyle(
domain: MACaptionAppearanceDomain,
behavior: *mut MACaptionAppearanceBehavior,
) -> MACaptionAppearanceTextEdgeStyle;
}
#[inline]
pub unsafe extern "C-unwind" fn MACaptionAppearanceCopyProfileIDs() -> CFRetained<CFArray> {
extern "C-unwind" {
fn MACaptionAppearanceCopyProfileIDs() -> Option<NonNull<CFArray>>;
}
let ret = unsafe { MACaptionAppearanceCopyProfileIDs() };
let ret = ret.expect("function was marked as returning non-null, but actually returned NULL");
unsafe { CFRetained::from_raw(ret) }
}
extern "C-unwind" {
pub fn MACaptionAppearanceSetActiveProfileID(profile_id: &CFString);
}
#[inline]
pub unsafe extern "C-unwind" fn MACaptionAppearanceCopyActiveProfileID() -> CFRetained<CFString> {
extern "C-unwind" {
fn MACaptionAppearanceCopyActiveProfileID() -> Option<NonNull<CFString>>;
}
let ret = unsafe { MACaptionAppearanceCopyActiveProfileID() };
let ret = ret.expect("function was marked as returning non-null, but actually returned NULL");
unsafe { CFRetained::from_raw(ret) }
}
#[inline]
pub unsafe extern "C-unwind" fn MACaptionAppearanceCopyProfileName(
profile_id: &CFString,
) -> CFRetained<CFString> {
extern "C-unwind" {
fn MACaptionAppearanceCopyProfileName(profile_id: &CFString) -> Option<NonNull<CFString>>;
}
let ret = unsafe { MACaptionAppearanceCopyProfileName(profile_id) };
let ret = ret.expect("function was marked as returning non-null, but actually returned NULL");
unsafe { CFRetained::from_raw(ret) }
}
extern "C-unwind" {
#[cfg(feature = "block2")]
pub fn MACaptionAppearanceExecuteBlockForProfileID(
profile_id: &CFString,
a_block: &block2::DynBlock<dyn Fn()>,
);
}