objc2_foundation/generated/
NSGeometry.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/nspointpointer?language=objc)
12#[cfg(feature = "objc2-core-foundation")]
13pub type NSPointPointer = *mut NSPoint;
14
15/// [Apple's documentation](https://developer.apple.com/documentation/foundation/nspointarray?language=objc)
16#[cfg(feature = "objc2-core-foundation")]
17pub type NSPointArray = *mut NSPoint;
18
19/// [Apple's documentation](https://developer.apple.com/documentation/foundation/nssizepointer?language=objc)
20#[cfg(feature = "objc2-core-foundation")]
21pub type NSSizePointer = *mut NSSize;
22
23/// [Apple's documentation](https://developer.apple.com/documentation/foundation/nssizearray?language=objc)
24#[cfg(feature = "objc2-core-foundation")]
25pub type NSSizeArray = *mut NSSize;
26
27/// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsrectpointer?language=objc)
28#[cfg(feature = "objc2-core-foundation")]
29pub type NSRectPointer = *mut NSRect;
30
31/// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsrectarray?language=objc)
32#[cfg(feature = "objc2-core-foundation")]
33pub type NSRectArray = *mut NSRect;
34
35/// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsedgeinsets?language=objc)
36#[cfg(feature = "objc2-core-foundation")]
37#[repr(C)]
38#[derive(Clone, Copy, Debug, PartialEq)]
39pub struct NSEdgeInsets {
40    pub top: CGFloat,
41    pub left: CGFloat,
42    pub bottom: CGFloat,
43    pub right: CGFloat,
44}
45
46#[cfg(feature = "objc2-core-foundation")]
47unsafe impl Encode for NSEdgeInsets {
48    const ENCODING: Encoding = Encoding::Struct(
49        "NSEdgeInsets",
50        &[
51            <CGFloat>::ENCODING,
52            <CGFloat>::ENCODING,
53            <CGFloat>::ENCODING,
54            <CGFloat>::ENCODING,
55        ],
56    );
57}
58
59#[cfg(feature = "objc2-core-foundation")]
60unsafe impl RefEncode for NSEdgeInsets {
61    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
62}
63
64#[cfg(feature = "objc2-core-foundation")]
65unsafe impl Send for NSEdgeInsets {}
66
67#[cfg(feature = "objc2-core-foundation")]
68unsafe impl Sync for NSEdgeInsets {}
69
70/// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsalignmentoptions?language=objc)
71// NS_OPTIONS
72#[repr(transparent)]
73#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
74pub struct NSAlignmentOptions(pub c_ulonglong);
75bitflags::bitflags! {
76    impl NSAlignmentOptions: c_ulonglong {
77        #[doc(alias = "NSAlignMinXInward")]
78        const AlignMinXInward = 1<<0;
79        #[doc(alias = "NSAlignMinYInward")]
80        const AlignMinYInward = 1<<1;
81        #[doc(alias = "NSAlignMaxXInward")]
82        const AlignMaxXInward = 1<<2;
83        #[doc(alias = "NSAlignMaxYInward")]
84        const AlignMaxYInward = 1<<3;
85        #[doc(alias = "NSAlignWidthInward")]
86        const AlignWidthInward = 1<<4;
87        #[doc(alias = "NSAlignHeightInward")]
88        const AlignHeightInward = 1<<5;
89        #[doc(alias = "NSAlignMinXOutward")]
90        const AlignMinXOutward = 1<<8;
91        #[doc(alias = "NSAlignMinYOutward")]
92        const AlignMinYOutward = 1<<9;
93        #[doc(alias = "NSAlignMaxXOutward")]
94        const AlignMaxXOutward = 1<<10;
95        #[doc(alias = "NSAlignMaxYOutward")]
96        const AlignMaxYOutward = 1<<11;
97        #[doc(alias = "NSAlignWidthOutward")]
98        const AlignWidthOutward = 1<<12;
99        #[doc(alias = "NSAlignHeightOutward")]
100        const AlignHeightOutward = 1<<13;
101        #[doc(alias = "NSAlignMinXNearest")]
102        const AlignMinXNearest = 1<<16;
103        #[doc(alias = "NSAlignMinYNearest")]
104        const AlignMinYNearest = 1<<17;
105        #[doc(alias = "NSAlignMaxXNearest")]
106        const AlignMaxXNearest = 1<<18;
107        #[doc(alias = "NSAlignMaxYNearest")]
108        const AlignMaxYNearest = 1<<19;
109        #[doc(alias = "NSAlignWidthNearest")]
110        const AlignWidthNearest = 1<<20;
111        #[doc(alias = "NSAlignHeightNearest")]
112        const AlignHeightNearest = 1<<21;
113        #[doc(alias = "NSAlignRectFlipped")]
114        const AlignRectFlipped = 1<<63;
115        #[doc(alias = "NSAlignAllEdgesInward")]
116        const AlignAllEdgesInward = NSAlignmentOptions::AlignMinXInward.0|NSAlignmentOptions::AlignMaxXInward.0|NSAlignmentOptions::AlignMinYInward.0|NSAlignmentOptions::AlignMaxYInward.0;
117        #[doc(alias = "NSAlignAllEdgesOutward")]
118        const AlignAllEdgesOutward = NSAlignmentOptions::AlignMinXOutward.0|NSAlignmentOptions::AlignMaxXOutward.0|NSAlignmentOptions::AlignMinYOutward.0|NSAlignmentOptions::AlignMaxYOutward.0;
119        #[doc(alias = "NSAlignAllEdgesNearest")]
120        const AlignAllEdgesNearest = NSAlignmentOptions::AlignMinXNearest.0|NSAlignmentOptions::AlignMaxXNearest.0|NSAlignmentOptions::AlignMinYNearest.0|NSAlignmentOptions::AlignMaxYNearest.0;
121    }
122}
123
124unsafe impl Encode for NSAlignmentOptions {
125    const ENCODING: Encoding = c_ulonglong::ENCODING;
126}
127
128unsafe impl RefEncode for NSAlignmentOptions {
129    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
130}
131
132extern "C" {
133    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nszeropoint?language=objc)
134    #[cfg(feature = "objc2-core-foundation")]
135    pub static NSZeroPoint: NSPoint;
136}
137
138extern "C" {
139    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nszerosize?language=objc)
140    #[cfg(feature = "objc2-core-foundation")]
141    pub static NSZeroSize: NSSize;
142}
143
144extern "C" {
145    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nszerorect?language=objc)
146    #[cfg(feature = "objc2-core-foundation")]
147    pub static NSZeroRect: NSRect;
148}
149
150extern "C" {
151    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsedgeinsetszero?language=objc)
152    #[cfg(feature = "objc2-core-foundation")]
153    pub static NSEdgeInsetsZero: NSEdgeInsets;
154}
155
156// TODO: pub fn NSMakePoint(x: CGFloat,y: CGFloat,) -> NSPoint;
157
158// TODO: pub fn NSMakeSize(w: CGFloat,h: CGFloat,) -> NSSize;
159
160// TODO: pub fn NSMakeRect(x: CGFloat,y: CGFloat,w: CGFloat,h: CGFloat,) -> NSRect;
161
162// TODO: pub fn NSMaxX(a_rect: NSRect,) -> CGFloat;
163
164// TODO: pub fn NSMaxY(a_rect: NSRect,) -> CGFloat;
165
166// TODO: pub fn NSMidX(a_rect: NSRect,) -> CGFloat;
167
168// TODO: pub fn NSMidY(a_rect: NSRect,) -> CGFloat;
169
170// TODO: pub fn NSMinX(a_rect: NSRect,) -> CGFloat;
171
172// TODO: pub fn NSMinY(a_rect: NSRect,) -> CGFloat;
173
174// TODO: pub fn NSWidth(a_rect: NSRect,) -> CGFloat;
175
176// TODO: pub fn NSHeight(a_rect: NSRect,) -> CGFloat;
177
178// TODO: pub fn NSRectFromCGRect(cgrect: CGRect,) -> NSRect;
179
180// TODO: pub fn NSRectToCGRect(nsrect: NSRect,) -> CGRect;
181
182// TODO: pub fn NSPointFromCGPoint(cgpoint: CGPoint,) -> NSPoint;
183
184// TODO: pub fn NSPointToCGPoint(nspoint: NSPoint,) -> CGPoint;
185
186// TODO: pub fn NSSizeFromCGSize(cgsize: CGSize,) -> NSSize;
187
188// TODO: pub fn NSSizeToCGSize(nssize: NSSize,) -> CGSize;
189
190#[cfg(feature = "objc2-core-foundation")]
191impl NSEdgeInsets {
192    // TODO: pub fn NSEdgeInsetsMake(top: CGFloat,left: CGFloat,bottom: CGFloat,right: CGFloat,) -> NSEdgeInsets;
193}
194
195#[cfg(feature = "objc2-core-foundation")]
196#[inline]
197pub unsafe extern "C-unwind" fn NSEqualPoints(a_point: NSPoint, b_point: NSPoint) -> bool {
198    extern "C-unwind" {
199        fn NSEqualPoints(a_point: NSPoint, b_point: NSPoint) -> Bool;
200    }
201    unsafe { NSEqualPoints(a_point, b_point) }.as_bool()
202}
203
204#[cfg(feature = "objc2-core-foundation")]
205#[inline]
206pub unsafe extern "C-unwind" fn NSEqualSizes(a_size: NSSize, b_size: NSSize) -> bool {
207    extern "C-unwind" {
208        fn NSEqualSizes(a_size: NSSize, b_size: NSSize) -> Bool;
209    }
210    unsafe { NSEqualSizes(a_size, b_size) }.as_bool()
211}
212
213#[cfg(feature = "objc2-core-foundation")]
214#[inline]
215pub unsafe extern "C-unwind" fn NSEqualRects(a_rect: NSRect, b_rect: NSRect) -> bool {
216    extern "C-unwind" {
217        fn NSEqualRects(a_rect: NSRect, b_rect: NSRect) -> Bool;
218    }
219    unsafe { NSEqualRects(a_rect, b_rect) }.as_bool()
220}
221
222#[cfg(feature = "objc2-core-foundation")]
223#[inline]
224pub unsafe extern "C-unwind" fn NSIsEmptyRect(a_rect: NSRect) -> bool {
225    extern "C-unwind" {
226        fn NSIsEmptyRect(a_rect: NSRect) -> Bool;
227    }
228    unsafe { NSIsEmptyRect(a_rect) }.as_bool()
229}
230
231#[cfg(feature = "objc2-core-foundation")]
232impl NSEdgeInsets {
233    #[doc(alias = "NSEdgeInsetsEqual")]
234    #[cfg(feature = "objc2-core-foundation")]
235    #[inline]
236    pub unsafe fn equal(self: NSEdgeInsets, b_insets: NSEdgeInsets) -> bool {
237        extern "C-unwind" {
238            fn NSEdgeInsetsEqual(a_insets: NSEdgeInsets, b_insets: NSEdgeInsets) -> Bool;
239        }
240        unsafe { NSEdgeInsetsEqual(self, b_insets) }.as_bool()
241    }
242}
243
244extern "C-unwind" {
245    #[cfg(feature = "objc2-core-foundation")]
246    pub fn NSInsetRect(a_rect: NSRect, d_x: CGFloat, d_y: CGFloat) -> NSRect;
247}
248
249extern "C-unwind" {
250    #[cfg(feature = "objc2-core-foundation")]
251    pub fn NSIntegralRect(a_rect: NSRect) -> NSRect;
252}
253
254extern "C-unwind" {
255    #[cfg(feature = "objc2-core-foundation")]
256    pub fn NSIntegralRectWithOptions(a_rect: NSRect, opts: NSAlignmentOptions) -> NSRect;
257}
258
259extern "C-unwind" {
260    #[cfg(feature = "objc2-core-foundation")]
261    pub fn NSUnionRect(a_rect: NSRect, b_rect: NSRect) -> NSRect;
262}
263
264extern "C-unwind" {
265    #[cfg(feature = "objc2-core-foundation")]
266    pub fn NSIntersectionRect(a_rect: NSRect, b_rect: NSRect) -> NSRect;
267}
268
269extern "C-unwind" {
270    #[cfg(feature = "objc2-core-foundation")]
271    pub fn NSOffsetRect(a_rect: NSRect, d_x: CGFloat, d_y: CGFloat) -> NSRect;
272}
273
274extern "C-unwind" {
275    #[cfg(feature = "objc2-core-foundation")]
276    pub fn NSDivideRect(
277        in_rect: NSRect,
278        slice: NonNull<NSRect>,
279        rem: NonNull<NSRect>,
280        amount: CGFloat,
281        edge: NSRectEdge,
282    );
283}
284
285#[cfg(feature = "objc2-core-foundation")]
286#[inline]
287pub unsafe extern "C-unwind" fn NSPointInRect(a_point: NSPoint, a_rect: NSRect) -> bool {
288    extern "C-unwind" {
289        fn NSPointInRect(a_point: NSPoint, a_rect: NSRect) -> Bool;
290    }
291    unsafe { NSPointInRect(a_point, a_rect) }.as_bool()
292}
293
294#[cfg(feature = "objc2-core-foundation")]
295#[inline]
296pub unsafe extern "C-unwind" fn NSMouseInRect(
297    a_point: NSPoint,
298    a_rect: NSRect,
299    flipped: bool,
300) -> bool {
301    extern "C-unwind" {
302        fn NSMouseInRect(a_point: NSPoint, a_rect: NSRect, flipped: Bool) -> Bool;
303    }
304    unsafe { NSMouseInRect(a_point, a_rect, Bool::new(flipped)) }.as_bool()
305}
306
307#[cfg(feature = "objc2-core-foundation")]
308#[inline]
309pub unsafe extern "C-unwind" fn NSContainsRect(a_rect: NSRect, b_rect: NSRect) -> bool {
310    extern "C-unwind" {
311        fn NSContainsRect(a_rect: NSRect, b_rect: NSRect) -> Bool;
312    }
313    unsafe { NSContainsRect(a_rect, b_rect) }.as_bool()
314}
315
316#[cfg(feature = "objc2-core-foundation")]
317#[inline]
318pub unsafe extern "C-unwind" fn NSIntersectsRect(a_rect: NSRect, b_rect: NSRect) -> bool {
319    extern "C-unwind" {
320        fn NSIntersectsRect(a_rect: NSRect, b_rect: NSRect) -> Bool;
321    }
322    unsafe { NSIntersectsRect(a_rect, b_rect) }.as_bool()
323}
324
325#[cfg(feature = "NSString")]
326impl NSString {
327    #[doc(alias = "NSStringFromPoint")]
328    #[cfg(all(feature = "NSString", feature = "objc2-core-foundation"))]
329    #[inline]
330    pub unsafe fn from_point(a_point: NSPoint) -> Retained<NSString> {
331        extern "C-unwind" {
332            fn NSStringFromPoint(a_point: NSPoint) -> *mut NSString;
333        }
334        let ret = unsafe { NSStringFromPoint(a_point) };
335        unsafe { Retained::retain_autoreleased(ret) }
336            .expect("function was marked as returning non-null, but actually returned NULL")
337    }
338
339    #[doc(alias = "NSStringFromSize")]
340    #[cfg(all(feature = "NSString", feature = "objc2-core-foundation"))]
341    #[inline]
342    pub unsafe fn from_size(a_size: NSSize) -> Retained<NSString> {
343        extern "C-unwind" {
344            fn NSStringFromSize(a_size: NSSize) -> *mut NSString;
345        }
346        let ret = unsafe { NSStringFromSize(a_size) };
347        unsafe { Retained::retain_autoreleased(ret) }
348            .expect("function was marked as returning non-null, but actually returned NULL")
349    }
350
351    #[doc(alias = "NSStringFromRect")]
352    #[cfg(all(feature = "NSString", feature = "objc2-core-foundation"))]
353    #[inline]
354    pub unsafe fn from_rect(a_rect: NSRect) -> Retained<NSString> {
355        extern "C-unwind" {
356            fn NSStringFromRect(a_rect: NSRect) -> *mut NSString;
357        }
358        let ret = unsafe { NSStringFromRect(a_rect) };
359        unsafe { Retained::retain_autoreleased(ret) }
360            .expect("function was marked as returning non-null, but actually returned NULL")
361    }
362}
363
364extern "C-unwind" {
365    #[cfg(all(feature = "NSString", feature = "objc2-core-foundation"))]
366    pub fn NSPointFromString(a_string: &NSString) -> NSPoint;
367}
368
369extern "C-unwind" {
370    #[cfg(all(feature = "NSString", feature = "objc2-core-foundation"))]
371    pub fn NSSizeFromString(a_string: &NSString) -> NSSize;
372}
373
374extern "C-unwind" {
375    #[cfg(all(feature = "NSString", feature = "objc2-core-foundation"))]
376    pub fn NSRectFromString(a_string: &NSString) -> NSRect;
377}
378
379/// NSValueGeometryExtensions.
380#[cfg(feature = "NSValue")]
381impl NSValue {
382    extern_methods!(
383        #[cfg(feature = "objc2-core-foundation")]
384        #[unsafe(method(valueWithPoint:))]
385        #[unsafe(method_family = none)]
386        pub unsafe fn valueWithPoint(point: NSPoint) -> Retained<NSValue>;
387
388        #[cfg(feature = "objc2-core-foundation")]
389        #[unsafe(method(valueWithSize:))]
390        #[unsafe(method_family = none)]
391        pub unsafe fn valueWithSize(size: NSSize) -> Retained<NSValue>;
392
393        #[cfg(feature = "objc2-core-foundation")]
394        #[unsafe(method(valueWithRect:))]
395        #[unsafe(method_family = none)]
396        pub unsafe fn valueWithRect(rect: NSRect) -> Retained<NSValue>;
397
398        #[cfg(feature = "objc2-core-foundation")]
399        #[unsafe(method(valueWithEdgeInsets:))]
400        #[unsafe(method_family = none)]
401        pub unsafe fn valueWithEdgeInsets(insets: NSEdgeInsets) -> Retained<NSValue>;
402
403        #[cfg(feature = "objc2-core-foundation")]
404        #[unsafe(method(pointValue))]
405        #[unsafe(method_family = none)]
406        pub unsafe fn pointValue(&self) -> NSPoint;
407
408        #[cfg(feature = "objc2-core-foundation")]
409        #[unsafe(method(sizeValue))]
410        #[unsafe(method_family = none)]
411        pub unsafe fn sizeValue(&self) -> NSSize;
412
413        #[cfg(feature = "objc2-core-foundation")]
414        #[unsafe(method(rectValue))]
415        #[unsafe(method_family = none)]
416        pub unsafe fn rectValue(&self) -> NSRect;
417
418        #[cfg(feature = "objc2-core-foundation")]
419        #[unsafe(method(edgeInsetsValue))]
420        #[unsafe(method_family = none)]
421        pub unsafe fn edgeInsetsValue(&self) -> NSEdgeInsets;
422    );
423}
424
425/// NSGeometryCoding.
426#[cfg(feature = "NSCoder")]
427impl NSCoder {
428    extern_methods!(
429        #[cfg(feature = "objc2-core-foundation")]
430        #[unsafe(method(encodePoint:))]
431        #[unsafe(method_family = none)]
432        pub unsafe fn encodePoint(&self, point: NSPoint);
433
434        #[cfg(feature = "objc2-core-foundation")]
435        #[unsafe(method(decodePoint))]
436        #[unsafe(method_family = none)]
437        pub unsafe fn decodePoint(&self) -> NSPoint;
438
439        #[cfg(feature = "objc2-core-foundation")]
440        #[unsafe(method(encodeSize:))]
441        #[unsafe(method_family = none)]
442        pub unsafe fn encodeSize(&self, size: NSSize);
443
444        #[cfg(feature = "objc2-core-foundation")]
445        #[unsafe(method(decodeSize))]
446        #[unsafe(method_family = none)]
447        pub unsafe fn decodeSize(&self) -> NSSize;
448
449        #[cfg(feature = "objc2-core-foundation")]
450        #[unsafe(method(encodeRect:))]
451        #[unsafe(method_family = none)]
452        pub unsafe fn encodeRect(&self, rect: NSRect);
453
454        #[cfg(feature = "objc2-core-foundation")]
455        #[unsafe(method(decodeRect))]
456        #[unsafe(method_family = none)]
457        pub unsafe fn decodeRect(&self) -> NSRect;
458    );
459}
460
461/// NSGeometryKeyedCoding.
462#[cfg(feature = "NSCoder")]
463impl NSCoder {
464    extern_methods!(
465        #[cfg(all(feature = "NSString", feature = "objc2-core-foundation"))]
466        #[unsafe(method(encodePoint:forKey:))]
467        #[unsafe(method_family = none)]
468        pub unsafe fn encodePoint_forKey(&self, point: NSPoint, key: &NSString);
469
470        #[cfg(all(feature = "NSString", feature = "objc2-core-foundation"))]
471        #[unsafe(method(encodeSize:forKey:))]
472        #[unsafe(method_family = none)]
473        pub unsafe fn encodeSize_forKey(&self, size: NSSize, key: &NSString);
474
475        #[cfg(all(feature = "NSString", feature = "objc2-core-foundation"))]
476        #[unsafe(method(encodeRect:forKey:))]
477        #[unsafe(method_family = none)]
478        pub unsafe fn encodeRect_forKey(&self, rect: NSRect, key: &NSString);
479
480        #[cfg(all(feature = "NSString", feature = "objc2-core-foundation"))]
481        #[unsafe(method(decodePointForKey:))]
482        #[unsafe(method_family = none)]
483        pub unsafe fn decodePointForKey(&self, key: &NSString) -> NSPoint;
484
485        #[cfg(all(feature = "NSString", feature = "objc2-core-foundation"))]
486        #[unsafe(method(decodeSizeForKey:))]
487        #[unsafe(method_family = none)]
488        pub unsafe fn decodeSizeForKey(&self, key: &NSString) -> NSSize;
489
490        #[cfg(all(feature = "NSString", feature = "objc2-core-foundation"))]
491        #[unsafe(method(decodeRectForKey:))]
492        #[unsafe(method_family = none)]
493        pub unsafe fn decodeRectForKey(&self, key: &NSString) -> NSRect;
494    );
495}
496
497#[cfg(feature = "objc2-core-foundation")]
498#[deprecated = "renamed to `NSEdgeInsets::equal`"]
499#[inline]
500pub unsafe extern "C-unwind" fn NSEdgeInsetsEqual(
501    a_insets: NSEdgeInsets,
502    b_insets: NSEdgeInsets,
503) -> bool {
504    extern "C-unwind" {
505        fn NSEdgeInsetsEqual(a_insets: NSEdgeInsets, b_insets: NSEdgeInsets) -> Bool;
506    }
507    unsafe { NSEdgeInsetsEqual(a_insets, b_insets) }.as_bool()
508}
509
510#[cfg(all(feature = "NSString", feature = "objc2-core-foundation"))]
511#[deprecated = "renamed to `NSString::from_point`"]
512#[inline]
513pub unsafe extern "C-unwind" fn NSStringFromPoint(a_point: NSPoint) -> Retained<NSString> {
514    extern "C-unwind" {
515        fn NSStringFromPoint(a_point: NSPoint) -> *mut NSString;
516    }
517    let ret = unsafe { NSStringFromPoint(a_point) };
518    unsafe { Retained::retain_autoreleased(ret) }
519        .expect("function was marked as returning non-null, but actually returned NULL")
520}
521
522#[cfg(all(feature = "NSString", feature = "objc2-core-foundation"))]
523#[deprecated = "renamed to `NSString::from_size`"]
524#[inline]
525pub unsafe extern "C-unwind" fn NSStringFromSize(a_size: NSSize) -> Retained<NSString> {
526    extern "C-unwind" {
527        fn NSStringFromSize(a_size: NSSize) -> *mut NSString;
528    }
529    let ret = unsafe { NSStringFromSize(a_size) };
530    unsafe { Retained::retain_autoreleased(ret) }
531        .expect("function was marked as returning non-null, but actually returned NULL")
532}
533
534#[cfg(all(feature = "NSString", feature = "objc2-core-foundation"))]
535#[deprecated = "renamed to `NSString::from_rect`"]
536#[inline]
537pub unsafe extern "C-unwind" fn NSStringFromRect(a_rect: NSRect) -> Retained<NSString> {
538    extern "C-unwind" {
539        fn NSStringFromRect(a_rect: NSRect) -> *mut NSString;
540    }
541    let ret = unsafe { NSStringFromRect(a_rect) };
542    unsafe { Retained::retain_autoreleased(ret) }
543        .expect("function was marked as returning non-null, but actually returned NULL")
544}