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:))]
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 #[unsafe(super(NSObject))]
53 #[derive(Debug, PartialEq, Eq, Hash)]
54 pub struct NSGlyphGenerator;
55);
56
57unsafe impl NSObjectProtocol for NSGlyphGenerator {}
58
59impl NSGlyphGenerator {
60 extern_methods!(
61 #[unsafe(method(generateGlyphsForGlyphStorage:desiredNumberOfCharacters:glyphIndex:characterIndex:))]
62 #[unsafe(method_family = none)]
63 pub unsafe fn generateGlyphsForGlyphStorage_desiredNumberOfCharacters_glyphIndex_characterIndex(
64 &self,
65 glyph_storage: &ProtocolObject<dyn NSGlyphStorage>,
66 n_chars: NSUInteger,
67 glyph_index: *mut NSUInteger,
68 char_index: *mut NSUInteger,
69 );
70
71 #[unsafe(method(sharedGlyphGenerator))]
72 #[unsafe(method_family = none)]
73 pub unsafe fn sharedGlyphGenerator() -> Retained<NSGlyphGenerator>;
74 );
75}
76
77impl NSGlyphGenerator {
79 extern_methods!(
80 #[unsafe(method(init))]
81 #[unsafe(method_family = init)]
82 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
83
84 #[unsafe(method(new))]
85 #[unsafe(method_family = new)]
86 pub unsafe fn new() -> Retained<Self>;
87 );
88}