objc2_app_kit/generated/
NSGlyphGenerator.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsshowcontrolglyphs?language=objc)
11pub const NSShowControlGlyphs: c_uint = 1 << 0;
12/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsshowinvisibleglyphs?language=objc)
13pub const NSShowInvisibleGlyphs: c_uint = 1 << 1;
14/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nswantsbidilevels?language=objc)
15pub const NSWantsBidiLevels: c_uint = 1 << 2;
16
17extern_protocol!(
18    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsglyphstorage?language=objc)
19    pub unsafe trait NSGlyphStorage {
20        #[cfg(feature = "NSFont")]
21        /// # Safety
22        ///
23        /// `glyphs` must be a valid pointer.
24        #[unsafe(method(insertGlyphs:length:forStartingGlyphAtIndex:characterIndex:))]
25        #[unsafe(method_family = none)]
26        unsafe fn insertGlyphs_length_forStartingGlyphAtIndex_characterIndex(
27            &self,
28            glyphs: NonNull<NSGlyph>,
29            length: NSUInteger,
30            glyph_index: NSUInteger,
31            char_index: NSUInteger,
32        );
33
34        #[unsafe(method(setIntAttribute:value:forGlyphAtIndex:))]
35        #[unsafe(method_family = none)]
36        fn setIntAttribute_value_forGlyphAtIndex(
37            &self,
38            attribute_tag: NSInteger,
39            val: NSInteger,
40            glyph_index: NSUInteger,
41        );
42
43        #[unsafe(method(attributedString))]
44        #[unsafe(method_family = none)]
45        fn attributedString(&self) -> Retained<NSAttributedString>;
46
47        #[unsafe(method(layoutOptions))]
48        #[unsafe(method_family = none)]
49        fn layoutOptions(&self) -> NSUInteger;
50    }
51);
52
53extern_class!(
54    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsglyphgenerator?language=objc)
55    #[unsafe(super(NSObject))]
56    #[derive(Debug, PartialEq, Eq, Hash)]
57    pub struct NSGlyphGenerator;
58);
59
60extern_conformance!(
61    unsafe impl NSObjectProtocol for NSGlyphGenerator {}
62);
63
64impl NSGlyphGenerator {
65    extern_methods!(
66        /// # Safety
67        ///
68        /// - `glyph_index` must be a valid pointer or null.
69        /// - `char_index` must be a valid pointer or null.
70        #[unsafe(method(generateGlyphsForGlyphStorage:desiredNumberOfCharacters:glyphIndex:characterIndex:))]
71        #[unsafe(method_family = none)]
72        pub unsafe fn generateGlyphsForGlyphStorage_desiredNumberOfCharacters_glyphIndex_characterIndex(
73            &self,
74            glyph_storage: &ProtocolObject<dyn NSGlyphStorage>,
75            n_chars: NSUInteger,
76            glyph_index: *mut NSUInteger,
77            char_index: *mut NSUInteger,
78        );
79
80        #[unsafe(method(sharedGlyphGenerator))]
81        #[unsafe(method_family = none)]
82        pub fn sharedGlyphGenerator() -> Retained<NSGlyphGenerator>;
83    );
84}
85
86/// Methods declared on superclass `NSObject`.
87impl NSGlyphGenerator {
88    extern_methods!(
89        #[unsafe(method(init))]
90        #[unsafe(method_family = init)]
91        pub fn init(this: Allocated<Self>) -> Retained<Self>;
92
93        #[unsafe(method(new))]
94        #[unsafe(method_family = new)]
95        pub fn new() -> Retained<Self>;
96    );
97}
98
99impl DefaultRetained for NSGlyphGenerator {
100    #[inline]
101    fn default_retained() -> Retained<Self> {
102        Self::new()
103    }
104}