objc2_core_graphics/generated/
CGPDFArray.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::cell::UnsafeCell;
4use core::ffi::*;
5use core::marker::{PhantomData, PhantomPinned};
6#[cfg(feature = "objc2")]
7use objc2::__framework_prelude::*;
8
9use crate::*;
10
11/// [Apple's documentation](https://developer.apple.com/documentation/coregraphics/cgpdfarray?language=objc)
12#[repr(C)]
13#[derive(Debug)]
14pub struct CGPDFArray {
15    inner: [u8; 0],
16    _p: UnsafeCell<PhantomData<(*const UnsafeCell<()>, PhantomPinned)>>,
17}
18
19#[cfg(feature = "objc2")]
20unsafe impl RefEncode for CGPDFArray {
21    const ENCODING_REF: Encoding = Encoding::Pointer(&Encoding::Struct("CGPDFArray", &[]));
22}
23
24/// [Apple's documentation](https://developer.apple.com/documentation/coregraphics/cgpdfarrayref?language=objc)
25pub type CGPDFArrayRef = *mut CGPDFArray;
26
27impl CGPDFArray {
28    /// # Safety
29    ///
30    /// `array` must be a valid pointer or null.
31    #[doc(alias = "CGPDFArrayGetCount")]
32    #[inline]
33    pub unsafe fn count(array: CGPDFArrayRef) -> usize {
34        extern "C-unwind" {
35            fn CGPDFArrayGetCount(array: CGPDFArrayRef) -> usize;
36        }
37        unsafe { CGPDFArrayGetCount(array) }
38    }
39
40    /// # Safety
41    ///
42    /// - `array` must be a valid pointer or null.
43    /// - `value` must be a valid pointer or null.
44    #[doc(alias = "CGPDFArrayGetObject")]
45    #[cfg(feature = "CGPDFObject")]
46    #[inline]
47    pub unsafe fn object(array: CGPDFArrayRef, index: usize, value: *mut CGPDFObjectRef) -> bool {
48        extern "C-unwind" {
49            fn CGPDFArrayGetObject(
50                array: CGPDFArrayRef,
51                index: usize,
52                value: *mut CGPDFObjectRef,
53            ) -> bool;
54        }
55        unsafe { CGPDFArrayGetObject(array, index, value) }
56    }
57
58    /// # Safety
59    ///
60    /// `array` must be a valid pointer or null.
61    #[doc(alias = "CGPDFArrayGetNull")]
62    #[inline]
63    pub unsafe fn null(array: CGPDFArrayRef, index: usize) -> bool {
64        extern "C-unwind" {
65            fn CGPDFArrayGetNull(array: CGPDFArrayRef, index: usize) -> bool;
66        }
67        unsafe { CGPDFArrayGetNull(array, index) }
68    }
69
70    /// # Safety
71    ///
72    /// - `array` must be a valid pointer or null.
73    /// - `value` must be a valid pointer or null.
74    #[doc(alias = "CGPDFArrayGetBoolean")]
75    #[cfg(feature = "CGPDFObject")]
76    #[inline]
77    pub unsafe fn boolean(array: CGPDFArrayRef, index: usize, value: *mut CGPDFBoolean) -> bool {
78        extern "C-unwind" {
79            fn CGPDFArrayGetBoolean(
80                array: CGPDFArrayRef,
81                index: usize,
82                value: *mut CGPDFBoolean,
83            ) -> bool;
84        }
85        unsafe { CGPDFArrayGetBoolean(array, index, value) }
86    }
87
88    /// # Safety
89    ///
90    /// - `array` must be a valid pointer or null.
91    /// - `value` must be a valid pointer or null.
92    #[doc(alias = "CGPDFArrayGetInteger")]
93    #[cfg(feature = "CGPDFObject")]
94    #[inline]
95    pub unsafe fn integer(array: CGPDFArrayRef, index: usize, value: *mut CGPDFInteger) -> bool {
96        extern "C-unwind" {
97            fn CGPDFArrayGetInteger(
98                array: CGPDFArrayRef,
99                index: usize,
100                value: *mut CGPDFInteger,
101            ) -> bool;
102        }
103        unsafe { CGPDFArrayGetInteger(array, index, value) }
104    }
105
106    /// # Safety
107    ///
108    /// - `array` must be a valid pointer or null.
109    /// - `value` must be a valid pointer or null.
110    #[doc(alias = "CGPDFArrayGetNumber")]
111    #[cfg(feature = "CGPDFObject")]
112    #[inline]
113    pub unsafe fn number(array: CGPDFArrayRef, index: usize, value: *mut CGPDFReal) -> bool {
114        extern "C-unwind" {
115            fn CGPDFArrayGetNumber(
116                array: CGPDFArrayRef,
117                index: usize,
118                value: *mut CGPDFReal,
119            ) -> bool;
120        }
121        unsafe { CGPDFArrayGetNumber(array, index, value) }
122    }
123
124    /// # Safety
125    ///
126    /// - `array` must be a valid pointer or null.
127    /// - `value` must be a valid pointer or null.
128    #[doc(alias = "CGPDFArrayGetName")]
129    #[inline]
130    pub unsafe fn name(array: CGPDFArrayRef, index: usize, value: *mut *const c_char) -> bool {
131        extern "C-unwind" {
132            fn CGPDFArrayGetName(
133                array: CGPDFArrayRef,
134                index: usize,
135                value: *mut *const c_char,
136            ) -> bool;
137        }
138        unsafe { CGPDFArrayGetName(array, index, value) }
139    }
140
141    /// # Safety
142    ///
143    /// - `array` must be a valid pointer or null.
144    /// - `value` must be a valid pointer or null.
145    #[doc(alias = "CGPDFArrayGetString")]
146    #[cfg(feature = "CGPDFString")]
147    #[inline]
148    pub unsafe fn string(array: CGPDFArrayRef, index: usize, value: *mut CGPDFStringRef) -> bool {
149        extern "C-unwind" {
150            fn CGPDFArrayGetString(
151                array: CGPDFArrayRef,
152                index: usize,
153                value: *mut CGPDFStringRef,
154            ) -> bool;
155        }
156        unsafe { CGPDFArrayGetString(array, index, value) }
157    }
158
159    /// # Safety
160    ///
161    /// - `array` must be a valid pointer or null.
162    /// - `value` must be a valid pointer or null.
163    #[doc(alias = "CGPDFArrayGetArray")]
164    #[inline]
165    pub unsafe fn array(array: CGPDFArrayRef, index: usize, value: *mut CGPDFArrayRef) -> bool {
166        extern "C-unwind" {
167            fn CGPDFArrayGetArray(
168                array: CGPDFArrayRef,
169                index: usize,
170                value: *mut CGPDFArrayRef,
171            ) -> bool;
172        }
173        unsafe { CGPDFArrayGetArray(array, index, value) }
174    }
175
176    /// # Safety
177    ///
178    /// - `array` must be a valid pointer or null.
179    /// - `value` must be a valid pointer or null.
180    #[doc(alias = "CGPDFArrayGetDictionary")]
181    #[cfg(feature = "CGPDFDictionary")]
182    #[inline]
183    pub unsafe fn dictionary(
184        array: CGPDFArrayRef,
185        index: usize,
186        value: *mut CGPDFDictionaryRef,
187    ) -> bool {
188        extern "C-unwind" {
189            fn CGPDFArrayGetDictionary(
190                array: CGPDFArrayRef,
191                index: usize,
192                value: *mut CGPDFDictionaryRef,
193            ) -> bool;
194        }
195        unsafe { CGPDFArrayGetDictionary(array, index, value) }
196    }
197
198    /// # Safety
199    ///
200    /// - `array` must be a valid pointer or null.
201    /// - `value` must be a valid pointer or null.
202    #[doc(alias = "CGPDFArrayGetStream")]
203    #[cfg(feature = "CGPDFStream")]
204    #[inline]
205    pub unsafe fn stream(array: CGPDFArrayRef, index: usize, value: *mut CGPDFStreamRef) -> bool {
206        extern "C-unwind" {
207            fn CGPDFArrayGetStream(
208                array: CGPDFArrayRef,
209                index: usize,
210                value: *mut CGPDFStreamRef,
211            ) -> bool;
212        }
213        unsafe { CGPDFArrayGetStream(array, index, value) }
214    }
215}
216
217/// [Apple's documentation](https://developer.apple.com/documentation/coregraphics/cgpdfarrayapplierblock?language=objc)
218#[cfg(all(feature = "CGPDFObject", feature = "block2"))]
219pub type CGPDFArrayApplierBlock =
220    *mut block2::DynBlock<dyn Fn(usize, CGPDFObjectRef, *mut c_void) -> bool>;
221
222impl CGPDFArray {
223    /// # Safety
224    ///
225    /// - `array` must be a valid pointer or null.
226    /// - `block` must be a valid pointer or null.
227    /// - `info` must be a valid pointer or null.
228    #[doc(alias = "CGPDFArrayApplyBlock")]
229    #[cfg(all(feature = "CGPDFObject", feature = "block2"))]
230    #[inline]
231    pub unsafe fn apply_block(
232        array: CGPDFArrayRef,
233        block: CGPDFArrayApplierBlock,
234        info: *mut c_void,
235    ) {
236        extern "C-unwind" {
237            fn CGPDFArrayApplyBlock(
238                array: CGPDFArrayRef,
239                block: CGPDFArrayApplierBlock,
240                info: *mut c_void,
241            );
242        }
243        unsafe { CGPDFArrayApplyBlock(array, block, info) }
244    }
245}
246
247extern "C-unwind" {
248    #[deprecated = "renamed to `CGPDFArray::count`"]
249    pub fn CGPDFArrayGetCount(array: CGPDFArrayRef) -> usize;
250}
251
252extern "C-unwind" {
253    #[cfg(feature = "CGPDFObject")]
254    #[deprecated = "renamed to `CGPDFArray::object`"]
255    pub fn CGPDFArrayGetObject(
256        array: CGPDFArrayRef,
257        index: usize,
258        value: *mut CGPDFObjectRef,
259    ) -> bool;
260}
261
262extern "C-unwind" {
263    #[deprecated = "renamed to `CGPDFArray::null`"]
264    pub fn CGPDFArrayGetNull(array: CGPDFArrayRef, index: usize) -> bool;
265}
266
267extern "C-unwind" {
268    #[cfg(feature = "CGPDFObject")]
269    #[deprecated = "renamed to `CGPDFArray::boolean`"]
270    pub fn CGPDFArrayGetBoolean(
271        array: CGPDFArrayRef,
272        index: usize,
273        value: *mut CGPDFBoolean,
274    ) -> bool;
275}
276
277extern "C-unwind" {
278    #[cfg(feature = "CGPDFObject")]
279    #[deprecated = "renamed to `CGPDFArray::integer`"]
280    pub fn CGPDFArrayGetInteger(
281        array: CGPDFArrayRef,
282        index: usize,
283        value: *mut CGPDFInteger,
284    ) -> bool;
285}
286
287extern "C-unwind" {
288    #[cfg(feature = "CGPDFObject")]
289    #[deprecated = "renamed to `CGPDFArray::number`"]
290    pub fn CGPDFArrayGetNumber(array: CGPDFArrayRef, index: usize, value: *mut CGPDFReal) -> bool;
291}
292
293extern "C-unwind" {
294    #[deprecated = "renamed to `CGPDFArray::name`"]
295    pub fn CGPDFArrayGetName(array: CGPDFArrayRef, index: usize, value: *mut *const c_char)
296        -> bool;
297}
298
299extern "C-unwind" {
300    #[cfg(feature = "CGPDFString")]
301    #[deprecated = "renamed to `CGPDFArray::string`"]
302    pub fn CGPDFArrayGetString(
303        array: CGPDFArrayRef,
304        index: usize,
305        value: *mut CGPDFStringRef,
306    ) -> bool;
307}
308
309extern "C-unwind" {
310    #[deprecated = "renamed to `CGPDFArray::array`"]
311    pub fn CGPDFArrayGetArray(
312        array: CGPDFArrayRef,
313        index: usize,
314        value: *mut CGPDFArrayRef,
315    ) -> bool;
316}
317
318extern "C-unwind" {
319    #[cfg(feature = "CGPDFDictionary")]
320    #[deprecated = "renamed to `CGPDFArray::dictionary`"]
321    pub fn CGPDFArrayGetDictionary(
322        array: CGPDFArrayRef,
323        index: usize,
324        value: *mut CGPDFDictionaryRef,
325    ) -> bool;
326}
327
328extern "C-unwind" {
329    #[cfg(feature = "CGPDFStream")]
330    #[deprecated = "renamed to `CGPDFArray::stream`"]
331    pub fn CGPDFArrayGetStream(
332        array: CGPDFArrayRef,
333        index: usize,
334        value: *mut CGPDFStreamRef,
335    ) -> bool;
336}
337
338extern "C-unwind" {
339    #[cfg(all(feature = "CGPDFObject", feature = "block2"))]
340    #[deprecated = "renamed to `CGPDFArray::apply_block`"]
341    pub fn CGPDFArrayApplyBlock(
342        array: CGPDFArrayRef,
343        block: CGPDFArrayApplierBlock,
344        info: *mut c_void,
345    );
346}