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
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
79impl 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}