objc2_foundation/generated/
NSAffineTransform.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::*;
6#[cfg(feature = "objc2-core-foundation")]
7use objc2_core_foundation::*;
8
9use crate::*;
10
11/// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsaffinetransformstruct?language=objc)
12#[cfg(feature = "objc2-core-foundation")]
13#[repr(C)]
14#[derive(Clone, Copy, Debug, PartialEq)]
15pub struct NSAffineTransformStruct {
16    pub m11: CGFloat,
17    pub m12: CGFloat,
18    pub m21: CGFloat,
19    pub m22: CGFloat,
20    pub tX: CGFloat,
21    pub tY: CGFloat,
22}
23
24#[cfg(feature = "objc2-core-foundation")]
25unsafe impl Encode for NSAffineTransformStruct {
26    const ENCODING: Encoding = Encoding::Struct(
27        "?",
28        &[
29            <CGFloat>::ENCODING,
30            <CGFloat>::ENCODING,
31            <CGFloat>::ENCODING,
32            <CGFloat>::ENCODING,
33            <CGFloat>::ENCODING,
34            <CGFloat>::ENCODING,
35        ],
36    );
37}
38
39#[cfg(feature = "objc2-core-foundation")]
40unsafe impl RefEncode for NSAffineTransformStruct {
41    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
42}
43
44#[cfg(feature = "objc2-core-foundation")]
45unsafe impl Send for NSAffineTransformStruct {}
46
47#[cfg(feature = "objc2-core-foundation")]
48unsafe impl Sync for NSAffineTransformStruct {}
49
50extern_class!(
51    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsaffinetransform?language=objc)
52    #[unsafe(super(NSObject))]
53    #[derive(Debug, PartialEq, Eq, Hash)]
54    pub struct NSAffineTransform;
55);
56
57#[cfg(feature = "NSObject")]
58unsafe impl NSCoding for NSAffineTransform {}
59
60#[cfg(feature = "NSObject")]
61unsafe impl NSCopying for NSAffineTransform {}
62
63#[cfg(feature = "NSObject")]
64unsafe impl CopyingHelper for NSAffineTransform {
65    type Result = Self;
66}
67
68unsafe impl NSObjectProtocol for NSAffineTransform {}
69
70#[cfg(feature = "NSObject")]
71unsafe impl NSSecureCoding for NSAffineTransform {}
72
73impl NSAffineTransform {
74    extern_methods!(
75        #[unsafe(method(transform))]
76        #[unsafe(method_family = none)]
77        pub unsafe fn transform() -> Retained<NSAffineTransform>;
78
79        #[unsafe(method(initWithTransform:))]
80        #[unsafe(method_family = init)]
81        pub unsafe fn initWithTransform(
82            this: Allocated<Self>,
83            transform: &NSAffineTransform,
84        ) -> Retained<Self>;
85
86        #[unsafe(method(init))]
87        #[unsafe(method_family = init)]
88        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
89
90        #[cfg(feature = "objc2-core-foundation")]
91        #[unsafe(method(translateXBy:yBy:))]
92        #[unsafe(method_family = none)]
93        pub unsafe fn translateXBy_yBy(&self, delta_x: CGFloat, delta_y: CGFloat);
94
95        #[cfg(feature = "objc2-core-foundation")]
96        #[unsafe(method(rotateByDegrees:))]
97        #[unsafe(method_family = none)]
98        pub unsafe fn rotateByDegrees(&self, angle: CGFloat);
99
100        #[cfg(feature = "objc2-core-foundation")]
101        #[unsafe(method(rotateByRadians:))]
102        #[unsafe(method_family = none)]
103        pub unsafe fn rotateByRadians(&self, angle: CGFloat);
104
105        #[cfg(feature = "objc2-core-foundation")]
106        #[unsafe(method(scaleBy:))]
107        #[unsafe(method_family = none)]
108        pub unsafe fn scaleBy(&self, scale: CGFloat);
109
110        #[cfg(feature = "objc2-core-foundation")]
111        #[unsafe(method(scaleXBy:yBy:))]
112        #[unsafe(method_family = none)]
113        pub unsafe fn scaleXBy_yBy(&self, scale_x: CGFloat, scale_y: CGFloat);
114
115        #[unsafe(method(invert))]
116        #[unsafe(method_family = none)]
117        pub unsafe fn invert(&self);
118
119        #[unsafe(method(appendTransform:))]
120        #[unsafe(method_family = none)]
121        pub unsafe fn appendTransform(&self, transform: &NSAffineTransform);
122
123        #[unsafe(method(prependTransform:))]
124        #[unsafe(method_family = none)]
125        pub unsafe fn prependTransform(&self, transform: &NSAffineTransform);
126
127        #[cfg(all(feature = "NSGeometry", feature = "objc2-core-foundation"))]
128        #[unsafe(method(transformPoint:))]
129        #[unsafe(method_family = none)]
130        pub unsafe fn transformPoint(&self, a_point: NSPoint) -> NSPoint;
131
132        #[cfg(all(feature = "NSGeometry", feature = "objc2-core-foundation"))]
133        #[unsafe(method(transformSize:))]
134        #[unsafe(method_family = none)]
135        pub unsafe fn transformSize(&self, a_size: NSSize) -> NSSize;
136
137        #[cfg(feature = "objc2-core-foundation")]
138        #[unsafe(method(transformStruct))]
139        #[unsafe(method_family = none)]
140        pub unsafe fn transformStruct(&self) -> NSAffineTransformStruct;
141
142        #[cfg(feature = "objc2-core-foundation")]
143        /// Setter for [`transformStruct`][Self::transformStruct].
144        #[unsafe(method(setTransformStruct:))]
145        #[unsafe(method_family = none)]
146        pub unsafe fn setTransformStruct(&self, transform_struct: NSAffineTransformStruct);
147    );
148}
149
150/// Methods declared on superclass `NSObject`.
151impl NSAffineTransform {
152    extern_methods!(
153        #[unsafe(method(new))]
154        #[unsafe(method_family = new)]
155        pub unsafe fn new() -> Retained<Self>;
156    );
157}