1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use objc2::__framework_prelude::*;
use objc2_foundation::*;

use crate::*;

// NS_TYPED_ENUM
pub type CATextLayerTruncationMode = NSString;

// NS_TYPED_ENUM
pub type CATextLayerAlignmentMode = NSString;

extern_class!(
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[cfg(feature = "CALayer")]
    pub struct CATextLayer;

    #[cfg(feature = "CALayer")]
    unsafe impl ClassType for CATextLayer {
        #[inherits(NSObject)]
        type Super = CALayer;
        type Mutability = InteriorMutable;
    }
);

#[cfg(all(feature = "CALayer", feature = "CAMediaTiming"))]
unsafe impl CAMediaTiming for CATextLayer {}

#[cfg(feature = "CALayer")]
unsafe impl NSCoding for CATextLayer {}

#[cfg(feature = "CALayer")]
unsafe impl NSObjectProtocol for CATextLayer {}

#[cfg(feature = "CALayer")]
unsafe impl NSSecureCoding for CATextLayer {}

extern_methods!(
    #[cfg(feature = "CALayer")]
    unsafe impl CATextLayer {
        #[method_id(@__retain_semantics Other string)]
        pub unsafe fn string(&self) -> Option<Retained<AnyObject>>;

        #[method(setString:)]
        pub unsafe fn setString(&self, string: Option<&AnyObject>);

        #[method(fontSize)]
        pub unsafe fn fontSize(&self) -> CGFloat;

        #[method(setFontSize:)]
        pub unsafe fn setFontSize(&self, font_size: CGFloat);

        #[method(isWrapped)]
        pub unsafe fn isWrapped(&self) -> bool;

        #[method(setWrapped:)]
        pub unsafe fn setWrapped(&self, wrapped: bool);

        #[method_id(@__retain_semantics Other truncationMode)]
        pub unsafe fn truncationMode(&self) -> Retained<CATextLayerTruncationMode>;

        #[method(setTruncationMode:)]
        pub unsafe fn setTruncationMode(&self, truncation_mode: &CATextLayerTruncationMode);

        #[method_id(@__retain_semantics Other alignmentMode)]
        pub unsafe fn alignmentMode(&self) -> Retained<CATextLayerAlignmentMode>;

        #[method(setAlignmentMode:)]
        pub unsafe fn setAlignmentMode(&self, alignment_mode: &CATextLayerAlignmentMode);

        #[method(allowsFontSubpixelQuantization)]
        pub unsafe fn allowsFontSubpixelQuantization(&self) -> bool;

        #[method(setAllowsFontSubpixelQuantization:)]
        pub unsafe fn setAllowsFontSubpixelQuantization(
            &self,
            allows_font_subpixel_quantization: bool,
        );
    }
);

extern_methods!(
    /// Methods declared on superclass `CALayer`
    #[cfg(feature = "CALayer")]
    unsafe impl CATextLayer {
        #[method_id(@__retain_semantics Other layer)]
        pub unsafe fn layer() -> Retained<Self>;

        #[method_id(@__retain_semantics Init init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[method_id(@__retain_semantics Init initWithLayer:)]
        pub unsafe fn initWithLayer(this: Allocated<Self>, layer: &AnyObject) -> Retained<Self>;
    }
);

extern_methods!(
    /// Methods declared on superclass `NSObject`
    #[cfg(feature = "CALayer")]
    unsafe impl CATextLayer {
        #[method_id(@__retain_semantics New new)]
        pub unsafe fn new() -> Retained<Self>;
    }
);

extern "C" {
    pub static kCATruncationNone: &'static CATextLayerTruncationMode;
}

extern "C" {
    pub static kCATruncationStart: &'static CATextLayerTruncationMode;
}

extern "C" {
    pub static kCATruncationEnd: &'static CATextLayerTruncationMode;
}

extern "C" {
    pub static kCATruncationMiddle: &'static CATextLayerTruncationMode;
}

extern "C" {
    pub static kCAAlignmentNatural: &'static CATextLayerAlignmentMode;
}

extern "C" {
    pub static kCAAlignmentLeft: &'static CATextLayerAlignmentMode;
}

extern "C" {
    pub static kCAAlignmentRight: &'static CATextLayerAlignmentMode;
}

extern "C" {
    pub static kCAAlignmentCenter: &'static CATextLayerAlignmentMode;
}

extern "C" {
    pub static kCAAlignmentJustified: &'static CATextLayerAlignmentMode;
}