objc2_media_accessibility/generated/MACaptionAppearance.rs
1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5#[cfg(feature = "objc2")]
6use objc2::__framework_prelude::*;
7use objc2_core_foundation::*;
8#[cfg(feature = "objc2-core-graphics")]
9use objc2_core_graphics::*;
10#[cfg(feature = "objc2-core-text")]
11use objc2_core_text::*;
12
13use crate::*;
14
15extern "C" {
16 /// CFNotification sent when any user-defined captioning settings are changed.
17 ///
18 /// See also [Apple's documentation](https://developer.apple.com/documentation/mediaaccessibility/kmacaptionappearancesettingschangednotification?language=objc)
19 pub static kMACaptionAppearanceSettingsChangedNotification: &'static CFString;
20}
21
22/// MACaptionAppearanceDomain is used to specify which domain of preferences to access.
23///
24///
25/// The user-defined preferences. This domain should be passed to retrieve settings that should be used to render captions.
26///
27/// The system defaults which will not change during a user session. These settings should be used for comparison, not to render captions. For example, when rendering a glyph some caption render engines need to get the user-defined font and the system-defined font to determeine the final pixel size to render a glyph. Most render engines will never need to use this domain.
28///
29/// See also [Apple's documentation](https://developer.apple.com/documentation/mediaaccessibility/macaptionappearancedomain?language=objc)
30// NS_ENUM
31#[repr(transparent)]
32#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
33pub struct MACaptionAppearanceDomain(pub CFIndex);
34impl MACaptionAppearanceDomain {
35 #[doc(alias = "kMACaptionAppearanceDomainDefault")]
36 pub const Default: Self = Self(0);
37 #[doc(alias = "kMACaptionAppearanceDomainUser")]
38 pub const User: Self = Self(1);
39}
40
41#[cfg(feature = "objc2")]
42unsafe impl Encode for MACaptionAppearanceDomain {
43 const ENCODING: Encoding = CFIndex::ENCODING;
44}
45
46#[cfg(feature = "objc2")]
47unsafe impl RefEncode for MACaptionAppearanceDomain {
48 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
49}
50
51/// MACaptionAppearanceDisplayType is used to specify the the type of captions that should be displayed
52///
53///
54/// Only forced captions for translation should be displayed.
55///
56/// If the language of the audio track differs from the system locale then captions matching the system locale should be displayed (if available).
57///
58/// The best available captioning track should always be displayed, whether it be CC, SDH, or subtitles.
59///
60/// See also [Apple's documentation](https://developer.apple.com/documentation/mediaaccessibility/macaptionappearancedisplaytype?language=objc)
61// NS_ENUM
62#[repr(transparent)]
63#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
64pub struct MACaptionAppearanceDisplayType(pub CFIndex);
65impl MACaptionAppearanceDisplayType {
66 #[doc(alias = "kMACaptionAppearanceDisplayTypeForcedOnly")]
67 pub const ForcedOnly: Self = Self(0);
68 #[doc(alias = "kMACaptionAppearanceDisplayTypeAutomatic")]
69 pub const Automatic: Self = Self(1);
70 #[doc(alias = "kMACaptionAppearanceDisplayTypeAlwaysOn")]
71 pub const AlwaysOn: Self = Self(2);
72}
73
74#[cfg(feature = "objc2")]
75unsafe impl Encode for MACaptionAppearanceDisplayType {
76 const ENCODING: Encoding = CFIndex::ENCODING;
77}
78
79#[cfg(feature = "objc2")]
80unsafe impl RefEncode for MACaptionAppearanceDisplayType {
81 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
82}
83
84/// MACaptionAppearanceBehavior is used to determine how a preference value should be used.
85///
86///
87/// The value should override any content, application, or otherwise-defined values.
88///
89/// Content, application, or otherwise-defined values should override the returned value. If no other value is defined, then the return value should be used.
90///
91/// See also [Apple's documentation](https://developer.apple.com/documentation/mediaaccessibility/macaptionappearancebehavior?language=objc)
92// NS_ENUM
93#[repr(transparent)]
94#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
95pub struct MACaptionAppearanceBehavior(pub CFIndex);
96impl MACaptionAppearanceBehavior {
97 #[doc(alias = "kMACaptionAppearanceBehaviorUseValue")]
98 pub const UseValue: Self = Self(0);
99 #[doc(alias = "kMACaptionAppearanceBehaviorUseContentIfAvailable")]
100 pub const UseContentIfAvailable: Self = Self(1);
101}
102
103#[cfg(feature = "objc2")]
104unsafe impl Encode for MACaptionAppearanceBehavior {
105 const ENCODING: Encoding = CFIndex::ENCODING;
106}
107
108#[cfg(feature = "objc2")]
109unsafe impl RefEncode for MACaptionAppearanceBehavior {
110 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
111}
112
113/// MACaptionAppearanceFontStyle is used to specify a font style
114///
115///
116/// Default font style.
117///
118/// Font style for fonts similar to Courier.
119///
120/// Font style for fonts similar to Times New Roman.
121///
122/// Font style for fonts similar to Helvetica Monospaced.
123///
124/// Font style for fonts similar to Arial.
125///
126/// Font style for fonts similar to Dom and Impress.
127///
128/// Font style for fonts similar to Coronet and Marigold.
129///
130/// Font style for fonts similar to Engravers Gothic.
131///
132/// See also [Apple's documentation](https://developer.apple.com/documentation/mediaaccessibility/macaptionappearancefontstyle?language=objc)
133// NS_ENUM
134#[repr(transparent)]
135#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
136pub struct MACaptionAppearanceFontStyle(pub CFIndex);
137impl MACaptionAppearanceFontStyle {
138 #[doc(alias = "kMACaptionAppearanceFontStyleDefault")]
139 pub const Default: Self = Self(0);
140 #[doc(alias = "kMACaptionAppearanceFontStyleMonospacedWithSerif")]
141 pub const MonospacedWithSerif: Self = Self(1);
142 #[doc(alias = "kMACaptionAppearanceFontStyleProportionalWithSerif")]
143 pub const ProportionalWithSerif: Self = Self(2);
144 #[doc(alias = "kMACaptionAppearanceFontStyleMonospacedWithoutSerif")]
145 pub const MonospacedWithoutSerif: Self = Self(3);
146 #[doc(alias = "kMACaptionAppearanceFontStyleProportionalWithoutSerif")]
147 pub const ProportionalWithoutSerif: Self = Self(4);
148 #[doc(alias = "kMACaptionAppearanceFontStyleCasual")]
149 pub const Casual: Self = Self(5);
150 #[doc(alias = "kMACaptionAppearanceFontStyleCursive")]
151 pub const Cursive: Self = Self(6);
152 #[doc(alias = "kMACaptionAppearanceFontStyleSmallCapital")]
153 pub const SmallCapital: Self = Self(7);
154}
155
156#[cfg(feature = "objc2")]
157unsafe impl Encode for MACaptionAppearanceFontStyle {
158 const ENCODING: Encoding = CFIndex::ENCODING;
159}
160
161#[cfg(feature = "objc2")]
162unsafe impl RefEncode for MACaptionAppearanceFontStyle {
163 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
164}
165
166/// MACaptionAppearanceTextEdgeStyle is used to specify a text-edge style.
167///
168///
169/// Undefined edge style.
170///
171/// No edge style.
172///
173/// Raised edge style.
174///
175/// Depressed edge style.
176///
177/// Uniform edge style.
178///
179/// Shadow edge style.
180///
181/// See also [Apple's documentation](https://developer.apple.com/documentation/mediaaccessibility/macaptionappearancetextedgestyle?language=objc)
182// NS_ENUM
183#[repr(transparent)]
184#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
185pub struct MACaptionAppearanceTextEdgeStyle(pub CFIndex);
186impl MACaptionAppearanceTextEdgeStyle {
187 #[doc(alias = "kMACaptionAppearanceTextEdgeStyleUndefined")]
188 pub const Undefined: Self = Self(0);
189 #[doc(alias = "kMACaptionAppearanceTextEdgeStyleNone")]
190 pub const None: Self = Self(1);
191 #[doc(alias = "kMACaptionAppearanceTextEdgeStyleRaised")]
192 pub const Raised: Self = Self(2);
193 #[doc(alias = "kMACaptionAppearanceTextEdgeStyleDepressed")]
194 pub const Depressed: Self = Self(3);
195 #[doc(alias = "kMACaptionAppearanceTextEdgeStyleUniform")]
196 pub const Uniform: Self = Self(4);
197 #[doc(alias = "kMACaptionAppearanceTextEdgeStyleDropShadow")]
198 pub const DropShadow: Self = Self(5);
199}
200
201#[cfg(feature = "objc2")]
202unsafe impl Encode for MACaptionAppearanceTextEdgeStyle {
203 const ENCODING: Encoding = CFIndex::ENCODING;
204}
205
206#[cfg(feature = "objc2")]
207unsafe impl RefEncode for MACaptionAppearanceTextEdgeStyle {
208 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
209}
210
211extern "C" {
212 /// A media characteristic that indicates that a track or media selection option includes legible content in the language of its specified locale that:
213 /// - describes music and
214 /// - describes sound other than spoken dialog, such as sound effects and significant silences, occurring in program audio.
215 ///
216 /// Legible tracks provided for accessibility purposes are typically tagged both with this characteristic as well as with MAMediaCharacteristicTranscribesSpokenDialogForAccessibility.
217 /// A legible track provided for accessibility purposes that's associated with an audio track without music and without sound other than spoken dialog -- lacking even significant silences -- can be tagged with this characteristic, because it trivially meets these requirements.
218 ///
219 /// See also [Apple's documentation](https://developer.apple.com/documentation/mediaaccessibility/mamediacharacteristicdescribesmusicandsoundforaccessibility?language=objc)
220 pub static MAMediaCharacteristicDescribesMusicAndSoundForAccessibility: &'static CFString;
221}
222
223extern "C" {
224 /// A media characteristic that indicates that a track or media selection option includes legible content in the language of its specified locale that:
225 /// - transcribes spoken dialog and
226 /// - identifies speakers whenever other visual cues are insufficient for a viewer to determine who is speaking.
227 ///
228 /// Legible tracks provided for accessibility purposes are typically tagged both with this characteristic as well as with MAMediaCharacteristicDescribesMusicAndSoundForAccessibility.
229 /// A legible track provided for accessibility purposes that's associated with an audio track that has no spoken dialog can be tagged with this characteristic, because it trivially meets these requirements.
230 ///
231 /// See also [Apple's documentation](https://developer.apple.com/documentation/mediaaccessibility/mamediacharacteristictranscribesspokendialogforaccessibility?language=objc)
232 pub static MAMediaCharacteristicTranscribesSpokenDialogForAccessibility: &'static CFString;
233}
234
235extern "C-unwind" {
236 /// Called by clients to inform accessibility products that captions have been displayed onscreen.
237 ///
238 /// Parameter `strings`: An array of CFStringRef or CFAttributedStringRef objects that represent the text that is being displayed. An empty array is used to indicate that no captions are being displayed.
239 pub fn MACaptionAppearanceDidDisplayCaptions(strings: &CFArray);
240}
241
242extern "C-unwind" {
243 /// Adds a user's selected caption language to stack of languages.
244 ///
245 /// Parameter `domain`: Preference domain, see
246 ///
247 /// ```text
248 /// MACaptionAppearanceDomain
249 /// ```
250 ///
251 ///
252 /// Parameter `language`: Canonical language identifier (see
253 ///
254 /// ```text
255 /// CFLocale
256 /// ```
257 ///
258 /// ) of the user's preferred caption language.
259 ///
260 /// Returns: <code>
261 /// true
262 /// </code>
263 /// if addition was successful. Unsuccessful additions are most liketly the result of invalid language codes.
264 ///
265 /// After a language is added it will appear first in the array returned by MACaptionAppearanceCopySelectedLanguages. Applications should call this anytime a user selects a specific languages for captioning tracks.
266 ///
267 /// For example, an AVFoundation clients may execute the following code in response to a user selecting a captioning track:
268 /// <code>
269 /// // in response to a user selection (from a pop-up menu or any other UI affordance), make the selection effective
270 /// -[AVPlayerItem selectMediaOption:legibleOption inMediaSelectionGroup:legibleGroup];
271 ///
272 /// // now update system-wide captioning preferences by registering the language of the option selected by the user
273 /// MACaptionAppearanceAddSelectedLanguage(kMACaptionAppearanceDomainUser, (CFStringRef)[[legibleOption locale] localeIdentifier]);
274 /// </code>
275 pub fn MACaptionAppearanceAddSelectedLanguage(
276 domain: MACaptionAppearanceDomain,
277 language: &CFString,
278 ) -> bool;
279}
280
281/// Copies the user's preferred caption languages.
282///
283///
284/// Parameter `domain`: Preference domain, see
285///
286/// ```text
287/// MACaptionAppearanceDomain
288/// ```
289///
290/// .
291///
292///
293/// Returns: Ordered array of preferred canonical language identifiers.
294///
295///
296/// Languages added using MACaptionAppearanceAddSelectedLanguage are normalized, and thus the contents of this array may have slightly different strings than those passed into MACaptionAppearanceAddSelectedLanguage.
297#[inline]
298pub unsafe extern "C-unwind" fn MACaptionAppearanceCopySelectedLanguages(
299 domain: MACaptionAppearanceDomain,
300) -> CFRetained<CFArray> {
301 extern "C-unwind" {
302 fn MACaptionAppearanceCopySelectedLanguages(
303 domain: MACaptionAppearanceDomain,
304 ) -> Option<NonNull<CFArray>>;
305 }
306 let ret = unsafe { MACaptionAppearanceCopySelectedLanguages(domain) };
307 let ret = ret.expect("function was marked as returning non-null, but actually returned NULL");
308 unsafe { CFRetained::from_raw(ret) }
309}
310
311extern "C-unwind" {
312 /// User preference representing what type of captions should be displayed
313 ///
314 /// Parameter `domain`: Preference domain, see
315 ///
316 /// ```text
317 /// MACaptionAppearanceDomain
318 /// ```
319 ///
320 /// .
321 ///
322 /// Returns: User preference representing what type of captions should be displayed. See
323 ///
324 /// ```text
325 /// MACaptionAppearanceDisplayType
326 /// ```
327 ///
328 /// .
329 pub fn MACaptionAppearanceGetDisplayType(
330 domain: MACaptionAppearanceDomain,
331 ) -> MACaptionAppearanceDisplayType;
332}
333
334extern "C-unwind" {
335 /// User preference representing what type of captions should be displayed
336 ///
337 /// Parameter `domain`: Preference domain, see
338 ///
339 /// ```text
340 /// MACaptionAppearanceDomain
341 /// ```
342 ///
343 /// .
344 ///
345 /// Parameter `displayType`: Captions display type, see
346 ///
347 /// ```text
348 /// MACaptionAppearanceDisplayType
349 /// ```
350 ///
351 /// .
352 pub fn MACaptionAppearanceSetDisplayType(
353 domain: MACaptionAppearanceDomain,
354 display_type: MACaptionAppearanceDisplayType,
355 );
356}
357
358/// User preference for captioning media characteristic
359///
360/// Parameter `domain`: Preference domain, see
361///
362/// ```text
363/// MACaptionAppearanceDomain
364/// ```
365///
366/// .
367///
368/// Returns: An array containing the preferred order of media characteristics for captions.
369#[inline]
370pub unsafe extern "C-unwind" fn MACaptionAppearanceCopyPreferredCaptioningMediaCharacteristics(
371 domain: MACaptionAppearanceDomain,
372) -> CFRetained<CFArray> {
373 extern "C-unwind" {
374 fn MACaptionAppearanceCopyPreferredCaptioningMediaCharacteristics(
375 domain: MACaptionAppearanceDomain,
376 ) -> Option<NonNull<CFArray>>;
377 }
378 let ret = unsafe { MACaptionAppearanceCopyPreferredCaptioningMediaCharacteristics(domain) };
379 let ret = ret.expect("function was marked as returning non-null, but actually returned NULL");
380 unsafe { CFRetained::from_raw(ret) }
381}
382
383extern "C-unwind" {
384 /// Provides a boolean indicating if the currently-active style has been customized by the user. This is useful for some clients who may need different fallback strategies for customized styles vs system-default styles.
385 ///
386 /// Parameter `domain`: Preference domain, see
387 ///
388 /// ```text
389 /// MACaptionAppearanceDomain
390 /// ```
391 ///
392 /// .
393 ///
394 /// Returns: A boolean indicating if the currently-active style has been customized by the user
395 pub fn MACaptionAppearanceIsCustomized(domain: MACaptionAppearanceDomain) -> bool;
396}
397
398/// User preference for foreground/text color.
399///
400/// Parameter `domain`: Preference domain, see
401///
402/// ```text
403/// MACaptionAppearanceDomain
404/// ```
405///
406/// .
407///
408/// Parameter `behavior`: (see
409///
410/// ```text
411/// MACaptionAppearanceBehavior
412/// ```
413///
414/// )
415///
416/// Returns: User preference for foreground/text color.
417#[cfg(feature = "objc2-core-graphics")]
418#[inline]
419pub unsafe extern "C-unwind" fn MACaptionAppearanceCopyForegroundColor(
420 domain: MACaptionAppearanceDomain,
421 behavior: *mut MACaptionAppearanceBehavior,
422) -> CFRetained<CGColor> {
423 extern "C-unwind" {
424 fn MACaptionAppearanceCopyForegroundColor(
425 domain: MACaptionAppearanceDomain,
426 behavior: *mut MACaptionAppearanceBehavior,
427 ) -> Option<NonNull<CGColor>>;
428 }
429 let ret = unsafe { MACaptionAppearanceCopyForegroundColor(domain, behavior) };
430 let ret = ret.expect("function was marked as returning non-null, but actually returned NULL");
431 unsafe { CFRetained::from_raw(ret) }
432}
433
434/// User preference for background color.
435///
436/// The background color is the color behind each caption glyph.
437///
438/// Parameter `domain`: Preference domain, see
439///
440/// ```text
441/// MACaptionAppearanceDomain
442/// ```
443///
444/// .
445///
446/// Parameter `behavior`: (see
447///
448/// ```text
449/// MACaptionAppearanceBehavior
450/// ```
451///
452/// )
453///
454/// Returns: User preference for background color.
455#[cfg(feature = "objc2-core-graphics")]
456#[inline]
457pub unsafe extern "C-unwind" fn MACaptionAppearanceCopyBackgroundColor(
458 domain: MACaptionAppearanceDomain,
459 behavior: *mut MACaptionAppearanceBehavior,
460) -> CFRetained<CGColor> {
461 extern "C-unwind" {
462 fn MACaptionAppearanceCopyBackgroundColor(
463 domain: MACaptionAppearanceDomain,
464 behavior: *mut MACaptionAppearanceBehavior,
465 ) -> Option<NonNull<CGColor>>;
466 }
467 let ret = unsafe { MACaptionAppearanceCopyBackgroundColor(domain, behavior) };
468 let ret = ret.expect("function was marked as returning non-null, but actually returned NULL");
469 unsafe { CFRetained::from_raw(ret) }
470}
471
472/// User preference for window color.
473///
474/// The window color is the color of a box behind all of the caption glyphs.
475///
476/// Parameter `domain`: Preference domain, see
477///
478/// ```text
479/// MACaptionAppearanceDomain
480/// ```
481///
482/// .
483///
484/// Parameter `behavior`: (see
485///
486/// ```text
487/// MACaptionAppearanceBehavior
488/// ```
489///
490/// )
491///
492/// Returns: User preference for window color.
493#[cfg(feature = "objc2-core-graphics")]
494#[inline]
495pub unsafe extern "C-unwind" fn MACaptionAppearanceCopyWindowColor(
496 domain: MACaptionAppearanceDomain,
497 behavior: *mut MACaptionAppearanceBehavior,
498) -> CFRetained<CGColor> {
499 extern "C-unwind" {
500 fn MACaptionAppearanceCopyWindowColor(
501 domain: MACaptionAppearanceDomain,
502 behavior: *mut MACaptionAppearanceBehavior,
503 ) -> Option<NonNull<CGColor>>;
504 }
505 let ret = unsafe { MACaptionAppearanceCopyWindowColor(domain, behavior) };
506 let ret = ret.expect("function was marked as returning non-null, but actually returned NULL");
507 unsafe { CFRetained::from_raw(ret) }
508}
509
510extern "C-unwind" {
511 /// User preference for foreground opacity.
512 ///
513 /// Parameter `domain`: Preference domain, see
514 ///
515 /// ```text
516 /// MACaptionAppearanceDomain
517 /// ```
518 ///
519 /// .
520 ///
521 /// Parameter `behavior`: (see
522 ///
523 /// ```text
524 /// MACaptionAppearanceBehavior
525 /// ```
526 ///
527 /// )
528 ///
529 /// Returns: User preference for foreground opacity.
530 pub fn MACaptionAppearanceGetForegroundOpacity(
531 domain: MACaptionAppearanceDomain,
532 behavior: *mut MACaptionAppearanceBehavior,
533 ) -> CGFloat;
534}
535
536extern "C-unwind" {
537 /// User preference for background opacity.
538 ///
539 /// Parameter `domain`: Preference domain, see
540 ///
541 /// ```text
542 /// MACaptionAppearanceDomain
543 /// ```
544 ///
545 /// .
546 ///
547 /// Parameter `behavior`: (see
548 ///
549 /// ```text
550 /// MACaptionAppearanceBehavior
551 /// ```
552 ///
553 /// )
554 ///
555 /// Returns: User preference for background opacity.
556 pub fn MACaptionAppearanceGetBackgroundOpacity(
557 domain: MACaptionAppearanceDomain,
558 behavior: *mut MACaptionAppearanceBehavior,
559 ) -> CGFloat;
560}
561
562extern "C-unwind" {
563 /// User preference for window opacity.
564 ///
565 /// Parameter `domain`: Preference domain, see
566 ///
567 /// ```text
568 /// MACaptionAppearanceDomain
569 /// ```
570 ///
571 /// .
572 ///
573 /// Parameter `behavior`: (see
574 ///
575 /// ```text
576 /// MACaptionAppearanceBehavior
577 /// ```
578 ///
579 /// )
580 ///
581 /// Returns: User preference for window opacity.
582 pub fn MACaptionAppearanceGetWindowOpacity(
583 domain: MACaptionAppearanceDomain,
584 behavior: *mut MACaptionAppearanceBehavior,
585 ) -> CGFloat;
586}
587
588extern "C-unwind" {
589 /// User preference for caption-window corner radius.
590 ///
591 /// Parameter `domain`: Preference domain, see
592 ///
593 /// ```text
594 /// MACaptionAppearanceDomain
595 /// ```
596 ///
597 /// .
598 ///
599 /// Parameter `behavior`: (see
600 ///
601 /// ```text
602 /// MACaptionAppearanceBehavior
603 /// ```
604 ///
605 /// )
606 ///
607 /// Returns: User preference for caption-window corner radius.
608 pub fn MACaptionAppearanceGetWindowRoundedCornerRadius(
609 domain: MACaptionAppearanceDomain,
610 behavior: *mut MACaptionAppearanceBehavior,
611 ) -> CGFloat;
612}
613
614/// User font preference for the specified style.
615///
616/// Parameter `domain`: Preference domain, see
617///
618/// ```text
619/// MACaptionAppearanceDomain
620/// ```
621///
622/// .
623///
624/// Parameter `behavior`: (see
625///
626/// ```text
627/// MACaptionAppearanceBehavior
628/// ```
629///
630/// )
631///
632/// Parameter `fontStyle`: Font style, see
633///
634/// ```text
635/// MACaptionAppearanceFontStyle
636/// ```
637///
638/// .
639///
640/// Returns: User font preference for the specified style.
641#[cfg(feature = "objc2-core-text")]
642#[inline]
643pub unsafe extern "C-unwind" fn MACaptionAppearanceCopyFontDescriptorForStyle(
644 domain: MACaptionAppearanceDomain,
645 behavior: *mut MACaptionAppearanceBehavior,
646 font_style: MACaptionAppearanceFontStyle,
647) -> CFRetained<CTFontDescriptor> {
648 extern "C-unwind" {
649 fn MACaptionAppearanceCopyFontDescriptorForStyle(
650 domain: MACaptionAppearanceDomain,
651 behavior: *mut MACaptionAppearanceBehavior,
652 font_style: MACaptionAppearanceFontStyle,
653 ) -> Option<NonNull<CTFontDescriptor>>;
654 }
655 let ret =
656 unsafe { MACaptionAppearanceCopyFontDescriptorForStyle(domain, behavior, font_style) };
657 let ret = ret.expect("function was marked as returning non-null, but actually returned NULL");
658 unsafe { CFRetained::from_raw(ret) }
659}
660
661extern "C-unwind" {
662 /// User preference for font scaling.
663 ///
664 /// Parameter `domain`: Preference domain, see
665 ///
666 /// ```text
667 /// MACaptionAppearanceDomain
668 /// ```
669 ///
670 /// .
671 ///
672 /// Parameter `behavior`: (see
673 ///
674 /// ```text
675 /// MACaptionAppearanceBehavior
676 /// ```
677 ///
678 /// )
679 ///
680 /// Returns: User font scaling preference for the specified style.
681 pub fn MACaptionAppearanceGetRelativeCharacterSize(
682 domain: MACaptionAppearanceDomain,
683 behavior: *mut MACaptionAppearanceBehavior,
684 ) -> CGFloat;
685}
686
687extern "C-unwind" {
688 /// User preference for text edge style.
689 ///
690 /// Parameter `domain`: Preference domain, see
691 ///
692 /// ```text
693 /// MACaptionAppearanceDomain
694 /// ```
695 ///
696 /// .
697 ///
698 /// Parameter `behavior`: (see
699 ///
700 /// ```text
701 /// MACaptionAppearanceBehavior
702 /// ```
703 ///
704 /// )
705 ///
706 /// Returns: User preference for text edge style.
707 pub fn MACaptionAppearanceGetTextEdgeStyle(
708 domain: MACaptionAppearanceDomain,
709 behavior: *mut MACaptionAppearanceBehavior,
710 ) -> MACaptionAppearanceTextEdgeStyle;
711}