use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
#[cfg(feature = "objc2-core-foundation")]
use objc2_core_foundation::*;
#[cfg(feature = "objc2-core-graphics")]
use objc2_core_graphics::*;
#[cfg(feature = "objc2-core-media")]
use objc2_core_media::*;
use objc2_foundation::*;
use crate::*;
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct AVCaptionUnitsType(pub NSInteger);
impl AVCaptionUnitsType {
#[doc(alias = "AVCaptionUnitsTypeUnspecified")]
pub const Unspecified: Self = Self(0);
#[doc(alias = "AVCaptionUnitsTypeCells")]
pub const Cells: Self = Self(1);
#[doc(alias = "AVCaptionUnitsTypePercent")]
pub const Percent: Self = Self(2);
}
unsafe impl Encode for AVCaptionUnitsType {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for AVCaptionUnitsType {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
#[cfg(feature = "objc2-core-foundation")]
#[repr(C)]
#[derive(Clone, Copy, Debug, PartialEq)]
pub struct AVCaptionDimension {
pub value: CGFloat,
pub units: AVCaptionUnitsType,
}
#[cfg(feature = "objc2-core-foundation")]
unsafe impl Encode for AVCaptionDimension {
const ENCODING: Encoding = Encoding::Struct(
"AVCaptionDimension",
&[<CGFloat>::ENCODING, <AVCaptionUnitsType>::ENCODING],
);
}
#[cfg(feature = "objc2-core-foundation")]
unsafe impl RefEncode for AVCaptionDimension {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
#[cfg(feature = "objc2-core-foundation")]
#[repr(C)]
#[derive(Clone, Copy, Debug, PartialEq)]
pub struct AVCaptionPoint {
pub x: AVCaptionDimension,
pub y: AVCaptionDimension,
}
#[cfg(feature = "objc2-core-foundation")]
unsafe impl Encode for AVCaptionPoint {
const ENCODING: Encoding = Encoding::Struct(
"AVCaptionPoint",
&[
<AVCaptionDimension>::ENCODING,
<AVCaptionDimension>::ENCODING,
],
);
}
#[cfg(feature = "objc2-core-foundation")]
unsafe impl RefEncode for AVCaptionPoint {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
#[cfg(feature = "objc2-core-foundation")]
#[repr(C)]
#[derive(Clone, Copy, Debug, PartialEq)]
pub struct AVCaptionSize {
pub width: AVCaptionDimension,
pub height: AVCaptionDimension,
}
#[cfg(feature = "objc2-core-foundation")]
unsafe impl Encode for AVCaptionSize {
const ENCODING: Encoding = Encoding::Struct(
"AVCaptionSize",
&[
<AVCaptionDimension>::ENCODING,
<AVCaptionDimension>::ENCODING,
],
);
}
#[cfg(feature = "objc2-core-foundation")]
unsafe impl RefEncode for AVCaptionSize {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
#[cfg(feature = "objc2-core-foundation")]
impl AVCaptionDimension {
#[doc(alias = "AVCaptionDimensionMake")]
#[cfg(feature = "objc2-core-foundation")]
#[inline]
pub unsafe fn new(value: CGFloat, units: AVCaptionUnitsType) -> AVCaptionDimension {
extern "C-unwind" {
fn AVCaptionDimensionMake(
value: CGFloat,
units: AVCaptionUnitsType,
) -> AVCaptionDimension;
}
unsafe { AVCaptionDimensionMake(value, units) }
}
}
#[cfg(feature = "objc2-core-foundation")]
impl AVCaptionPoint {
#[doc(alias = "AVCaptionPointMake")]
#[cfg(feature = "objc2-core-foundation")]
#[inline]
pub unsafe fn new(x: AVCaptionDimension, y: AVCaptionDimension) -> AVCaptionPoint {
extern "C-unwind" {
fn AVCaptionPointMake(x: AVCaptionDimension, y: AVCaptionDimension) -> AVCaptionPoint;
}
unsafe { AVCaptionPointMake(x, y) }
}
}
#[cfg(feature = "objc2-core-foundation")]
impl AVCaptionSize {
#[doc(alias = "AVCaptionSizeMake")]
#[cfg(feature = "objc2-core-foundation")]
#[inline]
pub unsafe fn new(width: AVCaptionDimension, height: AVCaptionDimension) -> AVCaptionSize {
extern "C-unwind" {
fn AVCaptionSizeMake(
width: AVCaptionDimension,
height: AVCaptionDimension,
) -> AVCaptionSize;
}
unsafe { AVCaptionSizeMake(width, height) }
}
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct AVCaptionRegionDisplayAlignment(pub NSInteger);
impl AVCaptionRegionDisplayAlignment {
#[doc(alias = "AVCaptionRegionDisplayAlignmentBefore")]
pub const Before: Self = Self(0);
#[doc(alias = "AVCaptionRegionDisplayAlignmentCenter")]
pub const Center: Self = Self(1);
#[doc(alias = "AVCaptionRegionDisplayAlignmentAfter")]
pub const After: Self = Self(2);
}
unsafe impl Encode for AVCaptionRegionDisplayAlignment {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for AVCaptionRegionDisplayAlignment {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct AVCaptionRegionWritingMode(pub NSInteger);
impl AVCaptionRegionWritingMode {
#[doc(alias = "AVCaptionRegionWritingModeLeftToRightAndTopToBottom")]
pub const LeftToRightAndTopToBottom: Self = Self(0);
#[doc(alias = "AVCaptionRegionWritingModeTopToBottomAndRightToLeft")]
pub const TopToBottomAndRightToLeft: Self = Self(2);
}
unsafe impl Encode for AVCaptionRegionWritingMode {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for AVCaptionRegionWritingMode {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct AVCaptionRegionScroll(pub NSInteger);
impl AVCaptionRegionScroll {
#[doc(alias = "AVCaptionRegionScrollNone")]
pub const None: Self = Self(0);
#[doc(alias = "AVCaptionRegionScrollRollUp")]
pub const RollUp: Self = Self(1);
}
unsafe impl Encode for AVCaptionRegionScroll {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for AVCaptionRegionScroll {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
extern_class!(
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct AVCaptionRegion;
);
extern_conformance!(
unsafe impl NSCoding for AVCaptionRegion {}
);
extern_conformance!(
unsafe impl NSCopying for AVCaptionRegion {}
);
unsafe impl CopyingHelper for AVCaptionRegion {
type Result = Self;
}
extern_conformance!(
unsafe impl NSMutableCopying for AVCaptionRegion {}
);
unsafe impl MutableCopyingHelper for AVCaptionRegion {
type Result = AVMutableCaptionRegion;
}
extern_conformance!(
unsafe impl NSObjectProtocol for AVCaptionRegion {}
);
extern_conformance!(
unsafe impl NSSecureCoding for AVCaptionRegion {}
);
impl AVCaptionRegion {
extern_methods!(
#[unsafe(method(appleITTTopRegion))]
#[unsafe(method_family = none)]
pub unsafe fn appleITTTopRegion() -> Retained<AVCaptionRegion>;
#[unsafe(method(appleITTBottomRegion))]
#[unsafe(method_family = none)]
pub unsafe fn appleITTBottomRegion() -> Retained<AVCaptionRegion>;
#[unsafe(method(appleITTLeftRegion))]
#[unsafe(method_family = none)]
pub unsafe fn appleITTLeftRegion() -> Retained<AVCaptionRegion>;
#[unsafe(method(appleITTRightRegion))]
#[unsafe(method_family = none)]
pub unsafe fn appleITTRightRegion() -> Retained<AVCaptionRegion>;
#[unsafe(method(subRipTextBottomRegion))]
#[unsafe(method_family = none)]
pub unsafe fn subRipTextBottomRegion() -> Retained<AVCaptionRegion>;
#[unsafe(method(identifier))]
#[unsafe(method_family = none)]
pub unsafe fn identifier(&self) -> Option<Retained<NSString>>;
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(origin))]
#[unsafe(method_family = none)]
pub unsafe fn origin(&self) -> AVCaptionPoint;
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(size))]
#[unsafe(method_family = none)]
pub unsafe fn size(&self) -> AVCaptionSize;
#[unsafe(method(scroll))]
#[unsafe(method_family = none)]
pub unsafe fn scroll(&self) -> AVCaptionRegionScroll;
#[unsafe(method(displayAlignment))]
#[unsafe(method_family = none)]
pub unsafe fn displayAlignment(&self) -> AVCaptionRegionDisplayAlignment;
#[unsafe(method(writingMode))]
#[unsafe(method_family = none)]
pub unsafe fn writingMode(&self) -> AVCaptionRegionWritingMode;
#[unsafe(method(encodeWithCoder:))]
#[unsafe(method_family = none)]
pub unsafe fn encodeWithCoder(&self, encoder: &NSCoder);
#[unsafe(method(isEqual:))]
#[unsafe(method_family = none)]
pub unsafe fn isEqual(&self, object: &AnyObject) -> bool;
#[unsafe(method(mutableCopyWithZone:))]
#[unsafe(method_family = mutableCopy)]
pub unsafe fn mutableCopyWithZone(&self, zone: *mut NSZone) -> Retained<AnyObject>;
);
}
impl AVCaptionRegion {
extern_methods!(
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new() -> Retained<Self>;
);
}
extern_class!(
#[unsafe(super(AVCaptionRegion, NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct AVMutableCaptionRegion;
);
extern_conformance!(
unsafe impl NSCoding for AVMutableCaptionRegion {}
);
extern_conformance!(
unsafe impl NSCopying for AVMutableCaptionRegion {}
);
unsafe impl CopyingHelper for AVMutableCaptionRegion {
type Result = AVCaptionRegion;
}
extern_conformance!(
unsafe impl NSMutableCopying for AVMutableCaptionRegion {}
);
unsafe impl MutableCopyingHelper for AVMutableCaptionRegion {
type Result = Self;
}
extern_conformance!(
unsafe impl NSObjectProtocol for AVMutableCaptionRegion {}
);
extern_conformance!(
unsafe impl NSSecureCoding for AVMutableCaptionRegion {}
);
impl AVMutableCaptionRegion {
extern_methods!(
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[unsafe(method(initWithIdentifier:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithIdentifier(
this: Allocated<Self>,
identifier: &NSString,
) -> Retained<Self>;
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(origin))]
#[unsafe(method_family = none)]
pub unsafe fn origin(&self) -> AVCaptionPoint;
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(setOrigin:))]
#[unsafe(method_family = none)]
pub unsafe fn setOrigin(&self, origin: AVCaptionPoint);
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(size))]
#[unsafe(method_family = none)]
pub unsafe fn size(&self) -> AVCaptionSize;
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(setSize:))]
#[unsafe(method_family = none)]
pub unsafe fn setSize(&self, size: AVCaptionSize);
#[unsafe(method(scroll))]
#[unsafe(method_family = none)]
pub unsafe fn scroll(&self) -> AVCaptionRegionScroll;
#[unsafe(method(setScroll:))]
#[unsafe(method_family = none)]
pub unsafe fn setScroll(&self, scroll: AVCaptionRegionScroll);
#[unsafe(method(displayAlignment))]
#[unsafe(method_family = none)]
pub unsafe fn displayAlignment(&self) -> AVCaptionRegionDisplayAlignment;
#[unsafe(method(setDisplayAlignment:))]
#[unsafe(method_family = none)]
pub unsafe fn setDisplayAlignment(
&self,
display_alignment: AVCaptionRegionDisplayAlignment,
);
#[unsafe(method(writingMode))]
#[unsafe(method_family = none)]
pub unsafe fn writingMode(&self) -> AVCaptionRegionWritingMode;
#[unsafe(method(setWritingMode:))]
#[unsafe(method_family = none)]
pub unsafe fn setWritingMode(&self, writing_mode: AVCaptionRegionWritingMode);
);
}
impl AVMutableCaptionRegion {
extern_methods!(
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new() -> Retained<Self>;
);
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct AVCaptionAnimation(pub NSInteger);
impl AVCaptionAnimation {
#[doc(alias = "AVCaptionAnimationNone")]
pub const None: Self = Self(0);
#[doc(alias = "AVCaptionAnimationCharacterReveal")]
pub const CharacterReveal: Self = Self(1);
}
unsafe impl Encode for AVCaptionAnimation {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for AVCaptionAnimation {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
extern_class!(
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct AVCaption;
);
extern_conformance!(
unsafe impl NSCoding for AVCaption {}
);
extern_conformance!(
unsafe impl NSCopying for AVCaption {}
);
unsafe impl CopyingHelper for AVCaption {
type Result = Self;
}
extern_conformance!(
unsafe impl NSMutableCopying for AVCaption {}
);
unsafe impl MutableCopyingHelper for AVCaption {
type Result = AVMutableCaption;
}
extern_conformance!(
unsafe impl NSObjectProtocol for AVCaption {}
);
extern_conformance!(
unsafe impl NSSecureCoding for AVCaption {}
);
impl AVCaption {
extern_methods!(
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new() -> Retained<Self>;
#[cfg(feature = "objc2-core-media")]
#[unsafe(method(initWithText:timeRange:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithText_timeRange(
this: Allocated<Self>,
text: &NSString,
time_range: CMTimeRange,
) -> Retained<Self>;
#[unsafe(method(text))]
#[unsafe(method_family = none)]
pub unsafe fn text(&self) -> Retained<NSString>;
#[cfg(feature = "objc2-core-media")]
#[unsafe(method(timeRange))]
#[unsafe(method_family = none)]
pub unsafe fn timeRange(&self) -> CMTimeRange;
);
}
extern_class!(
#[unsafe(super(AVCaption, NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct AVMutableCaption;
);
extern_conformance!(
unsafe impl NSCoding for AVMutableCaption {}
);
extern_conformance!(
unsafe impl NSCopying for AVMutableCaption {}
);
unsafe impl CopyingHelper for AVMutableCaption {
type Result = AVCaption;
}
extern_conformance!(
unsafe impl NSMutableCopying for AVMutableCaption {}
);
unsafe impl MutableCopyingHelper for AVMutableCaption {
type Result = Self;
}
extern_conformance!(
unsafe impl NSObjectProtocol for AVMutableCaption {}
);
extern_conformance!(
unsafe impl NSSecureCoding for AVMutableCaption {}
);
impl AVMutableCaption {
extern_methods!(
#[unsafe(method(text))]
#[unsafe(method_family = none)]
pub unsafe fn text(&self) -> Retained<NSString>;
#[unsafe(method(setText:))]
#[unsafe(method_family = none)]
pub unsafe fn setText(&self, text: &NSString);
#[cfg(feature = "objc2-core-media")]
#[unsafe(method(timeRange))]
#[unsafe(method_family = none)]
pub unsafe fn timeRange(&self) -> CMTimeRange;
#[cfg(feature = "objc2-core-media")]
#[unsafe(method(setTimeRange:))]
#[unsafe(method_family = none)]
pub unsafe fn setTimeRange(&self, time_range: CMTimeRange);
);
}
impl AVMutableCaption {
extern_methods!(
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new() -> Retained<Self>;
#[cfg(feature = "objc2-core-media")]
#[unsafe(method(initWithText:timeRange:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithText_timeRange(
this: Allocated<Self>,
text: &NSString,
time_range: CMTimeRange,
) -> Retained<Self>;
);
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct AVCaptionFontWeight(pub NSInteger);
impl AVCaptionFontWeight {
#[doc(alias = "AVCaptionFontWeightUnknown")]
pub const Unknown: Self = Self(0);
#[doc(alias = "AVCaptionFontWeightNormal")]
pub const Normal: Self = Self(1);
#[doc(alias = "AVCaptionFontWeightBold")]
pub const Bold: Self = Self(2);
}
unsafe impl Encode for AVCaptionFontWeight {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for AVCaptionFontWeight {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct AVCaptionFontStyle(pub NSInteger);
impl AVCaptionFontStyle {
#[doc(alias = "AVCaptionFontStyleUnknown")]
pub const Unknown: Self = Self(0);
#[doc(alias = "AVCaptionFontStyleNormal")]
pub const Normal: Self = Self(1);
#[doc(alias = "AVCaptionFontStyleItalic")]
pub const Italic: Self = Self(2);
}
unsafe impl Encode for AVCaptionFontStyle {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for AVCaptionFontStyle {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct AVCaptionDecoration(pub NSUInteger);
bitflags::bitflags! {
impl AVCaptionDecoration: NSUInteger {
#[doc(alias = "AVCaptionDecorationNone")]
const None = 0;
#[doc(alias = "AVCaptionDecorationUnderline")]
const Underline = 1<<0;
#[doc(alias = "AVCaptionDecorationLineThrough")]
const LineThrough = 1<<1;
#[doc(alias = "AVCaptionDecorationOverline")]
const Overline = 1<<2;
}
}
unsafe impl Encode for AVCaptionDecoration {
const ENCODING: Encoding = NSUInteger::ENCODING;
}
unsafe impl RefEncode for AVCaptionDecoration {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct AVCaptionTextCombine(pub NSInteger);
impl AVCaptionTextCombine {
#[doc(alias = "AVCaptionTextCombineAll")]
pub const All: Self = Self(-1);
#[doc(alias = "AVCaptionTextCombineNone")]
pub const None: Self = Self(0);
#[doc(alias = "AVCaptionTextCombineOneDigit")]
pub const OneDigit: Self = Self(1);
#[doc(alias = "AVCaptionTextCombineTwoDigits")]
pub const TwoDigits: Self = Self(2);
#[doc(alias = "AVCaptionTextCombineThreeDigits")]
pub const ThreeDigits: Self = Self(3);
#[doc(alias = "AVCaptionTextCombineFourDigits")]
pub const FourDigits: Self = Self(4);
}
unsafe impl Encode for AVCaptionTextCombine {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for AVCaptionTextCombine {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct AVCaptionTextAlignment(pub NSInteger);
impl AVCaptionTextAlignment {
#[doc(alias = "AVCaptionTextAlignmentStart")]
pub const Start: Self = Self(0);
#[doc(alias = "AVCaptionTextAlignmentEnd")]
pub const End: Self = Self(1);
#[doc(alias = "AVCaptionTextAlignmentCenter")]
pub const Center: Self = Self(2);
#[doc(alias = "AVCaptionTextAlignmentLeft")]
pub const Left: Self = Self(3);
#[doc(alias = "AVCaptionTextAlignmentRight")]
pub const Right: Self = Self(4);
}
unsafe impl Encode for AVCaptionTextAlignment {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for AVCaptionTextAlignment {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
impl AVCaption {
extern_methods!(
#[cfg(feature = "objc2-core-graphics")]
#[unsafe(method(textColorAtIndex:range:))]
#[unsafe(method_family = copy)]
pub unsafe fn textColorAtIndex_range(
&self,
index: NSInteger,
out_range: *mut NSRange,
) -> Option<Retained<CGColor>>;
#[cfg(feature = "objc2-core-graphics")]
#[unsafe(method(backgroundColorAtIndex:range:))]
#[unsafe(method_family = copy)]
pub unsafe fn backgroundColorAtIndex_range(
&self,
index: NSInteger,
out_range: *mut NSRange,
) -> Option<Retained<CGColor>>;
#[unsafe(method(fontWeightAtIndex:range:))]
#[unsafe(method_family = none)]
pub unsafe fn fontWeightAtIndex_range(
&self,
index: NSInteger,
out_range: *mut NSRange,
) -> AVCaptionFontWeight;
#[unsafe(method(fontStyleAtIndex:range:))]
#[unsafe(method_family = none)]
pub unsafe fn fontStyleAtIndex_range(
&self,
index: NSInteger,
out_range: *mut NSRange,
) -> AVCaptionFontStyle;
#[unsafe(method(decorationAtIndex:range:))]
#[unsafe(method_family = none)]
pub unsafe fn decorationAtIndex_range(
&self,
index: NSInteger,
out_range: *mut NSRange,
) -> AVCaptionDecoration;
#[unsafe(method(textCombineAtIndex:range:))]
#[unsafe(method_family = none)]
pub unsafe fn textCombineAtIndex_range(
&self,
index: NSInteger,
out_range: *mut NSRange,
) -> AVCaptionTextCombine;
#[unsafe(method(rubyAtIndex:range:))]
#[unsafe(method_family = none)]
pub unsafe fn rubyAtIndex_range(
&self,
index: NSInteger,
out_range: *mut NSRange,
) -> Option<Retained<AVCaptionRuby>>;
);
}
impl AVCaption {
extern_methods!(
#[unsafe(method(region))]
#[unsafe(method_family = none)]
pub unsafe fn region(&self) -> Option<Retained<AVCaptionRegion>>;
#[unsafe(method(textAlignment))]
#[unsafe(method_family = none)]
pub unsafe fn textAlignment(&self) -> AVCaptionTextAlignment;
);
}
impl AVCaption {
extern_methods!(
#[unsafe(method(animation))]
#[unsafe(method_family = none)]
pub unsafe fn animation(&self) -> AVCaptionAnimation;
);
}
impl AVMutableCaption {
extern_methods!(
#[cfg(feature = "objc2-core-graphics")]
#[unsafe(method(setTextColor:inRange:))]
#[unsafe(method_family = none)]
pub unsafe fn setTextColor_inRange(&self, color: &CGColor, range: NSRange);
#[cfg(feature = "objc2-core-graphics")]
#[unsafe(method(setBackgroundColor:inRange:))]
#[unsafe(method_family = none)]
pub unsafe fn setBackgroundColor_inRange(&self, color: &CGColor, range: NSRange);
#[unsafe(method(setFontWeight:inRange:))]
#[unsafe(method_family = none)]
pub unsafe fn setFontWeight_inRange(
&self,
font_weight: AVCaptionFontWeight,
range: NSRange,
);
#[unsafe(method(setFontStyle:inRange:))]
#[unsafe(method_family = none)]
pub unsafe fn setFontStyle_inRange(&self, font_style: AVCaptionFontStyle, range: NSRange);
#[unsafe(method(setDecoration:inRange:))]
#[unsafe(method_family = none)]
pub unsafe fn setDecoration_inRange(&self, decoration: AVCaptionDecoration, range: NSRange);
#[unsafe(method(setTextCombine:inRange:))]
#[unsafe(method_family = none)]
pub unsafe fn setTextCombine_inRange(
&self,
text_combine: AVCaptionTextCombine,
range: NSRange,
);
#[unsafe(method(setRuby:inRange:))]
#[unsafe(method_family = none)]
pub unsafe fn setRuby_inRange(&self, ruby: &AVCaptionRuby, range: NSRange);
#[unsafe(method(removeTextColorInRange:))]
#[unsafe(method_family = none)]
pub unsafe fn removeTextColorInRange(&self, range: NSRange);
#[unsafe(method(removeBackgroundColorInRange:))]
#[unsafe(method_family = none)]
pub unsafe fn removeBackgroundColorInRange(&self, range: NSRange);
#[unsafe(method(removeFontWeightInRange:))]
#[unsafe(method_family = none)]
pub unsafe fn removeFontWeightInRange(&self, range: NSRange);
#[unsafe(method(removeFontStyleInRange:))]
#[unsafe(method_family = none)]
pub unsafe fn removeFontStyleInRange(&self, range: NSRange);
#[unsafe(method(removeDecorationInRange:))]
#[unsafe(method_family = none)]
pub unsafe fn removeDecorationInRange(&self, range: NSRange);
#[unsafe(method(removeTextCombineInRange:))]
#[unsafe(method_family = none)]
pub unsafe fn removeTextCombineInRange(&self, range: NSRange);
#[unsafe(method(removeRubyInRange:))]
#[unsafe(method_family = none)]
pub unsafe fn removeRubyInRange(&self, range: NSRange);
);
}
impl AVMutableCaption {
extern_methods!(
#[unsafe(method(region))]
#[unsafe(method_family = none)]
pub unsafe fn region(&self) -> Retained<AVCaptionRegion>;
#[unsafe(method(setRegion:))]
#[unsafe(method_family = none)]
pub unsafe fn setRegion(&self, region: &AVCaptionRegion);
#[unsafe(method(textAlignment))]
#[unsafe(method_family = none)]
pub unsafe fn textAlignment(&self) -> AVCaptionTextAlignment;
#[unsafe(method(setTextAlignment:))]
#[unsafe(method_family = none)]
pub unsafe fn setTextAlignment(&self, text_alignment: AVCaptionTextAlignment);
);
}
impl AVMutableCaption {
extern_methods!(
#[unsafe(method(animation))]
#[unsafe(method_family = none)]
pub unsafe fn animation(&self) -> AVCaptionAnimation;
#[unsafe(method(setAnimation:))]
#[unsafe(method_family = none)]
pub unsafe fn setAnimation(&self, animation: AVCaptionAnimation);
);
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct AVCaptionRubyPosition(pub NSInteger);
impl AVCaptionRubyPosition {
#[doc(alias = "AVCaptionRubyPositionBefore")]
pub const Before: Self = Self(0);
#[doc(alias = "AVCaptionRubyPositionAfter")]
pub const After: Self = Self(1);
}
unsafe impl Encode for AVCaptionRubyPosition {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for AVCaptionRubyPosition {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct AVCaptionRubyAlignment(pub NSInteger);
impl AVCaptionRubyAlignment {
#[doc(alias = "AVCaptionRubyAlignmentStart")]
pub const Start: Self = Self(0);
#[doc(alias = "AVCaptionRubyAlignmentCenter")]
pub const Center: Self = Self(1);
#[doc(alias = "AVCaptionRubyAlignmentDistributeSpaceBetween")]
pub const DistributeSpaceBetween: Self = Self(2);
#[doc(alias = "AVCaptionRubyAlignmentDistributeSpaceAround")]
pub const DistributeSpaceAround: Self = Self(3);
}
unsafe impl Encode for AVCaptionRubyAlignment {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for AVCaptionRubyAlignment {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
extern_class!(
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct AVCaptionRuby;
);
unsafe impl Send for AVCaptionRuby {}
unsafe impl Sync for AVCaptionRuby {}
extern_conformance!(
unsafe impl NSCoding for AVCaptionRuby {}
);
extern_conformance!(
unsafe impl NSCopying for AVCaptionRuby {}
);
unsafe impl CopyingHelper for AVCaptionRuby {
type Result = Self;
}
extern_conformance!(
unsafe impl NSObjectProtocol for AVCaptionRuby {}
);
extern_conformance!(
unsafe impl NSSecureCoding for AVCaptionRuby {}
);
impl AVCaptionRuby {
extern_methods!(
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new() -> Retained<Self>;
#[unsafe(method(initWithText:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithText(this: Allocated<Self>, text: &NSString) -> Retained<Self>;
#[unsafe(method(initWithText:position:alignment:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithText_position_alignment(
this: Allocated<Self>,
text: &NSString,
position: AVCaptionRubyPosition,
alignment: AVCaptionRubyAlignment,
) -> Retained<Self>;
#[unsafe(method(text))]
#[unsafe(method_family = none)]
pub unsafe fn text(&self) -> Retained<NSString>;
#[unsafe(method(position))]
#[unsafe(method_family = none)]
pub unsafe fn position(&self) -> AVCaptionRubyPosition;
#[unsafe(method(alignment))]
#[unsafe(method_family = none)]
pub unsafe fn alignment(&self) -> AVCaptionRubyAlignment;
);
}
extern "C-unwind" {
#[cfg(feature = "objc2-core-foundation")]
#[deprecated = "renamed to `AVCaptionDimension::new`"]
pub fn AVCaptionDimensionMake(value: CGFloat, units: AVCaptionUnitsType) -> AVCaptionDimension;
}
extern "C-unwind" {
#[cfg(feature = "objc2-core-foundation")]
#[deprecated = "renamed to `AVCaptionPoint::new`"]
pub fn AVCaptionPointMake(x: AVCaptionDimension, y: AVCaptionDimension) -> AVCaptionPoint;
}
extern "C-unwind" {
#[cfg(feature = "objc2-core-foundation")]
#[deprecated = "renamed to `AVCaptionSize::new`"]
pub fn AVCaptionSizeMake(
width: AVCaptionDimension,
height: AVCaptionDimension,
) -> AVCaptionSize;
}