objc2_core_graphics/generated/
CGPDFObject.rs1use core::cell::UnsafeCell;
4use core::ffi::*;
5use core::marker::{PhantomData, PhantomPinned};
6#[cfg(feature = "objc2")]
7use objc2::__framework_prelude::*;
8use objc2_core_foundation::*;
9
10use crate::*;
11
12pub type CGPDFBoolean = c_uchar;
14
15pub type CGPDFInteger = c_long;
17
18pub type CGPDFReal = CGFloat;
20
21#[repr(C)]
23#[derive(Debug)]
24pub struct CGPDFObject {
25 inner: [u8; 0],
26 _p: UnsafeCell<PhantomData<(*const UnsafeCell<()>, PhantomPinned)>>,
27}
28
29#[cfg(feature = "objc2")]
30unsafe impl RefEncode for CGPDFObject {
31 const ENCODING_REF: Encoding = Encoding::Pointer(&Encoding::Struct("CGPDFObject", &[]));
32}
33
34pub type CGPDFObjectRef = *mut CGPDFObject;
36
37#[repr(transparent)]
40#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
41pub struct CGPDFObjectType(pub i32);
42impl CGPDFObjectType {
43 #[doc(alias = "kCGPDFObjectTypeNull")]
44 pub const Null: Self = Self(1);
45 #[doc(alias = "kCGPDFObjectTypeBoolean")]
46 pub const Boolean: Self = Self(2);
47 #[doc(alias = "kCGPDFObjectTypeInteger")]
48 pub const Integer: Self = Self(3);
49 #[doc(alias = "kCGPDFObjectTypeReal")]
50 pub const Real: Self = Self(4);
51 #[doc(alias = "kCGPDFObjectTypeName")]
52 pub const Name: Self = Self(5);
53 #[doc(alias = "kCGPDFObjectTypeString")]
54 pub const String: Self = Self(6);
55 #[doc(alias = "kCGPDFObjectTypeArray")]
56 pub const Array: Self = Self(7);
57 #[doc(alias = "kCGPDFObjectTypeDictionary")]
58 pub const Dictionary: Self = Self(8);
59 #[doc(alias = "kCGPDFObjectTypeStream")]
60 pub const Stream: Self = Self(9);
61}
62
63#[cfg(feature = "objc2")]
64unsafe impl Encode for CGPDFObjectType {
65 const ENCODING: Encoding = i32::ENCODING;
66}
67
68#[cfg(feature = "objc2")]
69unsafe impl RefEncode for CGPDFObjectType {
70 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
71}
72
73impl CGPDFObject {
74 #[doc(alias = "CGPDFObjectGetType")]
78 #[inline]
79 pub unsafe fn r#type(object: CGPDFObjectRef) -> CGPDFObjectType {
80 extern "C-unwind" {
81 fn CGPDFObjectGetType(object: CGPDFObjectRef) -> CGPDFObjectType;
82 }
83 unsafe { CGPDFObjectGetType(object) }
84 }
85
86 #[doc(alias = "CGPDFObjectGetValue")]
91 #[inline]
92 pub unsafe fn value(
93 object: CGPDFObjectRef,
94 r#type: CGPDFObjectType,
95 value: *mut c_void,
96 ) -> bool {
97 extern "C-unwind" {
98 fn CGPDFObjectGetValue(
99 object: CGPDFObjectRef,
100 r#type: CGPDFObjectType,
101 value: *mut c_void,
102 ) -> bool;
103 }
104 unsafe { CGPDFObjectGetValue(object, r#type, value) }
105 }
106}
107
108extern "C-unwind" {
109 #[deprecated = "renamed to `CGPDFObject::type`"]
110 pub fn CGPDFObjectGetType(object: CGPDFObjectRef) -> CGPDFObjectType;
111}
112
113extern "C-unwind" {
114 #[deprecated = "renamed to `CGPDFObject::value`"]
115 pub fn CGPDFObjectGetValue(
116 object: CGPDFObjectRef,
117 r#type: CGPDFObjectType,
118 value: *mut c_void,
119 ) -> bool;
120}