objc2_app_kit/generated/
NSGlyphGenerator.rs1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10pub const NSShowControlGlyphs: c_uint = 1 << 0;
12pub const NSShowInvisibleGlyphs: c_uint = 1 << 1;
14pub const NSWantsBidiLevels: c_uint = 1 << 2;
16
17extern_protocol!(
18 pub unsafe trait NSGlyphStorage {
20 #[cfg(feature = "NSFont")]
21 #[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 #[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 #[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
86impl 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}