objc2_game_controller/generated/
GCTypes.rs1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10#[repr(C)]
12#[derive(Clone, Copy, Debug, PartialEq)]
13pub struct GCPoint2 {
14 pub x: c_float,
15 pub y: c_float,
16}
17
18unsafe impl Encode for GCPoint2 {
19 const ENCODING: Encoding =
20 Encoding::Struct("GCPoint2", &[<c_float>::ENCODING, <c_float>::ENCODING]);
21}
22
23unsafe impl RefEncode for GCPoint2 {
24 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
25}
26
27extern "C" {
28 pub static GCPoint2Zero: GCPoint2;
30}
31
32#[inline]
37pub unsafe extern "C-unwind" fn NSStringFromGCPoint2(point: GCPoint2) -> Retained<NSString> {
38 extern "C-unwind" {
39 fn NSStringFromGCPoint2(point: GCPoint2) -> *mut NSString;
40 }
41 let ret = unsafe { NSStringFromGCPoint2(point) };
42 unsafe { Retained::retain_autoreleased(ret) }
43 .expect("function was marked as returning non-null, but actually returned NULL")
44}
45
46mod private_NSValueGCTypes {
47 pub trait Sealed {}
48}
49
50#[doc(alias = "GCTypes")]
52pub unsafe trait NSValueGCTypes: ClassType + Sized + private_NSValueGCTypes::Sealed {
53 extern_methods!(
54 #[unsafe(method(valueWithGCPoint2:))]
55 #[unsafe(method_family = none)]
56 unsafe fn valueWithGCPoint2(point: GCPoint2) -> Retained<Self>;
57
58 #[unsafe(method(GCPoint2Value))]
59 #[unsafe(method_family = none)]
60 unsafe fn GCPoint2Value(&self) -> GCPoint2;
61 );
62}
63
64impl private_NSValueGCTypes::Sealed for NSValue {}
65unsafe impl NSValueGCTypes for NSValue {}