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        #[unsafe(method(insertGlyphs:length:forStartingGlyphAtIndex:characterIndex:))]
22        #[unsafe(method_family = none)]
23        unsafe fn insertGlyphs_length_forStartingGlyphAtIndex_characterIndex(
24            &self,
25            glyphs: NonNull<NSGlyph>,
26            length: NSUInteger,
27            glyph_index: NSUInteger,
28            char_index: NSUInteger,
29        );
30
31        #[unsafe(method(setIntAttribute:value:forGlyphAtIndex:))]
32        #[unsafe(method_family = none)]
33        unsafe fn setIntAttribute_value_forGlyphAtIndex(
34            &self,
35            attribute_tag: NSInteger,
36            val: NSInteger,
37            glyph_index: NSUInteger,
38        );
39
40        #[unsafe(method(attributedString))]
41        #[unsafe(method_family = none)]
42        unsafe fn attributedString(&self) -> Retained<NSAttributedString>;
43
44        #[unsafe(method(layoutOptions))]
45        #[unsafe(method_family = none)]
46        unsafe fn layoutOptions(&self) -> NSUInteger;
47    }
48);
49
50extern_class!(
51    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsglyphgenerator?language=objc)
52    #[unsafe(super(NSObject))]
53    #[derive(Debug, PartialEq, Eq, Hash)]
54    pub struct NSGlyphGenerator;
55);
56
57extern_conformance!(
58    unsafe impl NSObjectProtocol for NSGlyphGenerator {}
59);
60
61impl NSGlyphGenerator {
62    extern_methods!(
63        #[unsafe(method(generateGlyphsForGlyphStorage:desiredNumberOfCharacters:glyphIndex:characterIndex:))]
64        #[unsafe(method_family = none)]
65        pub unsafe fn generateGlyphsForGlyphStorage_desiredNumberOfCharacters_glyphIndex_characterIndex(
66            &self,
67            glyph_storage: &ProtocolObject<dyn NSGlyphStorage>,
68            n_chars: NSUInteger,
69            glyph_index: *mut NSUInteger,
70            char_index: *mut NSUInteger,
71        );
72
73        #[unsafe(method(sharedGlyphGenerator))]
74        #[unsafe(method_family = none)]
75        pub unsafe fn sharedGlyphGenerator() -> Retained<NSGlyphGenerator>;
76    );
77}
78
79/// Methods declared on superclass `NSObject`.
80impl NSGlyphGenerator {
81    extern_methods!(
82        #[unsafe(method(init))]
83        #[unsafe(method_family = init)]
84        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
85
86        #[unsafe(method(new))]
87        #[unsafe(method_family = new)]
88        pub unsafe fn new() -> Retained<Self>;
89    );
90}