objc2_core_graphics/generated/
CGPDFContext.rs1use core::ffi::*;
4use core::ptr::NonNull;
5#[cfg(feature = "objc2")]
6use objc2::__framework_prelude::*;
7use objc2_core_foundation::*;
8
9use crate::*;
10
11#[cfg(all(feature = "CGContext", feature = "CGDataConsumer"))]
16#[inline]
17pub unsafe extern "C-unwind" fn CGPDFContextCreate(
18 consumer: Option<&CGDataConsumer>,
19 media_box: *const CGRect,
20 auxiliary_info: Option<&CFDictionary>,
21) -> Option<CFRetained<CGContext>> {
22 extern "C-unwind" {
23 fn CGPDFContextCreate(
24 consumer: Option<&CGDataConsumer>,
25 media_box: *const CGRect,
26 auxiliary_info: Option<&CFDictionary>,
27 ) -> Option<NonNull<CGContext>>;
28 }
29 let ret = unsafe { CGPDFContextCreate(consumer, media_box, auxiliary_info) };
30 ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
31}
32
33#[cfg(feature = "CGContext")]
38#[inline]
39pub unsafe extern "C-unwind" fn CGPDFContextCreateWithURL(
40 url: Option<&CFURL>,
41 media_box: *const CGRect,
42 auxiliary_info: Option<&CFDictionary>,
43) -> Option<CFRetained<CGContext>> {
44 extern "C-unwind" {
45 fn CGPDFContextCreateWithURL(
46 url: Option<&CFURL>,
47 media_box: *const CGRect,
48 auxiliary_info: Option<&CFDictionary>,
49 ) -> Option<NonNull<CGContext>>;
50 }
51 let ret = unsafe { CGPDFContextCreateWithURL(url, media_box, auxiliary_info) };
52 ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
53}
54
55#[cfg(feature = "CGContext")]
56#[inline]
57pub extern "C-unwind" fn CGPDFContextClose(context: Option<&CGContext>) {
58 extern "C-unwind" {
59 fn CGPDFContextClose(context: Option<&CGContext>);
60 }
61 unsafe { CGPDFContextClose(context) }
62}
63
64extern "C-unwind" {
65 #[cfg(feature = "CGContext")]
69 pub fn CGPDFContextBeginPage(context: Option<&CGContext>, page_info: Option<&CFDictionary>);
70}
71
72#[cfg(feature = "CGContext")]
73#[inline]
74pub extern "C-unwind" fn CGPDFContextEndPage(context: Option<&CGContext>) {
75 extern "C-unwind" {
76 fn CGPDFContextEndPage(context: Option<&CGContext>);
77 }
78 unsafe { CGPDFContextEndPage(context) }
79}
80
81#[cfg(feature = "CGContext")]
82#[inline]
83pub extern "C-unwind" fn CGPDFContextAddDocumentMetadata(
84 context: Option<&CGContext>,
85 metadata: Option<&CFData>,
86) {
87 extern "C-unwind" {
88 fn CGPDFContextAddDocumentMetadata(context: Option<&CGContext>, metadata: Option<&CFData>);
89 }
90 unsafe { CGPDFContextAddDocumentMetadata(context, metadata) }
91}
92
93extern "C-unwind" {
94 #[cfg(all(feature = "CGContext", feature = "CGPDFDictionary"))]
98 pub fn CGPDFContextSetParentTree(
99 context: Option<&CGContext>,
100 parent_tree_dictionary: CGPDFDictionaryRef,
101 );
102}
103
104extern "C-unwind" {
105 #[cfg(all(feature = "CGContext", feature = "CGPDFDictionary"))]
109 pub fn CGPDFContextSetIDTree(
110 context: Option<&CGContext>,
111 id_tree_dictionary: CGPDFDictionaryRef,
112 );
113}
114
115extern "C-unwind" {
116 #[cfg(feature = "CGContext")]
120 pub fn CGPDFContextSetPageTagStructureTree(
121 context: Option<&CGContext>,
122 page_tag_structure_tree_dictionary: &CFDictionary,
123 );
124}
125
126#[cfg(feature = "CGContext")]
127#[inline]
128pub extern "C-unwind" fn CGPDFContextSetURLForRect(
129 context: Option<&CGContext>,
130 url: &CFURL,
131 rect: CGRect,
132) {
133 extern "C-unwind" {
134 fn CGPDFContextSetURLForRect(context: Option<&CGContext>, url: &CFURL, rect: CGRect);
135 }
136 unsafe { CGPDFContextSetURLForRect(context, url, rect) }
137}
138
139#[cfg(feature = "CGContext")]
140#[inline]
141pub extern "C-unwind" fn CGPDFContextAddDestinationAtPoint(
142 context: Option<&CGContext>,
143 name: &CFString,
144 point: CGPoint,
145) {
146 extern "C-unwind" {
147 fn CGPDFContextAddDestinationAtPoint(
148 context: Option<&CGContext>,
149 name: &CFString,
150 point: CGPoint,
151 );
152 }
153 unsafe { CGPDFContextAddDestinationAtPoint(context, name, point) }
154}
155
156#[cfg(feature = "CGContext")]
157#[inline]
158pub extern "C-unwind" fn CGPDFContextSetDestinationForRect(
159 context: Option<&CGContext>,
160 name: &CFString,
161 rect: CGRect,
162) {
163 extern "C-unwind" {
164 fn CGPDFContextSetDestinationForRect(
165 context: Option<&CGContext>,
166 name: &CFString,
167 rect: CGRect,
168 );
169 }
170 unsafe { CGPDFContextSetDestinationForRect(context, name, rect) }
171}
172
173extern "C" {
174 pub static kCGPDFContextMediaBox: &'static CFString;
176}
177
178extern "C" {
179 pub static kCGPDFContextCropBox: &'static CFString;
181}
182
183extern "C" {
184 pub static kCGPDFContextBleedBox: &'static CFString;
186}
187
188extern "C" {
189 pub static kCGPDFContextTrimBox: &'static CFString;
191}
192
193extern "C" {
194 pub static kCGPDFContextArtBox: &'static CFString;
196}
197
198extern "C" {
199 pub static kCGPDFContextTitle: &'static CFString;
201}
202
203extern "C" {
204 pub static kCGPDFContextAuthor: &'static CFString;
206}
207
208extern "C" {
209 pub static kCGPDFContextSubject: &'static CFString;
211}
212
213extern "C" {
214 pub static kCGPDFContextKeywords: &'static CFString;
216}
217
218extern "C" {
219 pub static kCGPDFContextCreator: &'static CFString;
221}
222
223extern "C" {
224 pub static kCGPDFContextOwnerPassword: &'static CFString;
226}
227
228extern "C" {
229 pub static kCGPDFContextUserPassword: &'static CFString;
231}
232
233extern "C" {
234 pub static kCGPDFContextEncryptionKeyLength: &'static CFString;
236}
237
238extern "C" {
239 pub static kCGPDFContextAllowsPrinting: &'static CFString;
241}
242
243extern "C" {
244 pub static kCGPDFContextAllowsCopying: &'static CFString;
246}
247
248extern "C" {
249 pub static kCGPDFContextOutputIntent: &'static CFString;
251}
252
253extern "C" {
254 pub static kCGPDFXOutputIntentSubtype: &'static CFString;
256}
257
258extern "C" {
259 pub static kCGPDFXOutputConditionIdentifier: &'static CFString;
261}
262
263extern "C" {
264 pub static kCGPDFXOutputCondition: &'static CFString;
266}
267
268extern "C" {
269 pub static kCGPDFXRegistryName: &'static CFString;
271}
272
273extern "C" {
274 pub static kCGPDFXInfo: &'static CFString;
276}
277
278extern "C" {
279 pub static kCGPDFXDestinationOutputProfile: &'static CFString;
281}
282
283extern "C" {
284 pub static kCGPDFContextOutputIntents: &'static CFString;
286}
287
288extern "C" {
289 pub static kCGPDFContextAccessPermissions: &'static CFString;
291}
292
293extern "C-unwind" {
294 #[cfg(feature = "CGContext")]
298 pub fn CGPDFContextSetOutline(context: &CGContext, outline: Option<&CFDictionary>);
299}
300
301extern "C" {
302 pub static kCGPDFContextCreateLinearizedPDF: &'static CFString;
304}
305
306extern "C" {
307 pub static kCGPDFContextCreatePDFA: &'static CFString;
309}
310
311#[repr(transparent)]
314#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
315pub struct CGPDFTagType(pub i32);
316impl CGPDFTagType {
317 #[doc(alias = "CGPDFTagTypeDocument")]
318 pub const Document: Self = Self(100);
319 #[doc(alias = "CGPDFTagTypePart")]
320 pub const Part: Self = Self(101);
321 #[doc(alias = "CGPDFTagTypeArt")]
322 pub const Art: Self = Self(102);
323 #[doc(alias = "CGPDFTagTypeSection")]
324 pub const Section: Self = Self(103);
325 #[doc(alias = "CGPDFTagTypeDiv")]
326 pub const Div: Self = Self(104);
327 #[doc(alias = "CGPDFTagTypeBlockQuote")]
328 pub const BlockQuote: Self = Self(105);
329 #[doc(alias = "CGPDFTagTypeCaption")]
330 pub const Caption: Self = Self(106);
331 #[doc(alias = "CGPDFTagTypeTOC")]
332 pub const TOC: Self = Self(107);
333 #[doc(alias = "CGPDFTagTypeTOCI")]
334 pub const TOCI: Self = Self(108);
335 #[doc(alias = "CGPDFTagTypeIndex")]
336 pub const Index: Self = Self(109);
337 #[doc(alias = "CGPDFTagTypeNonStructure")]
338 pub const NonStructure: Self = Self(110);
339 #[doc(alias = "CGPDFTagTypePrivate")]
340 pub const Private: Self = Self(111);
341 #[doc(alias = "CGPDFTagTypeParagraph")]
342 pub const Paragraph: Self = Self(200);
343 #[doc(alias = "CGPDFTagTypeHeader")]
344 pub const Header: Self = Self(201);
345 #[doc(alias = "CGPDFTagTypeHeader1")]
346 pub const Header1: Self = Self(202);
347 #[doc(alias = "CGPDFTagTypeHeader2")]
348 pub const Header2: Self = Self(203);
349 #[doc(alias = "CGPDFTagTypeHeader3")]
350 pub const Header3: Self = Self(204);
351 #[doc(alias = "CGPDFTagTypeHeader4")]
352 pub const Header4: Self = Self(205);
353 #[doc(alias = "CGPDFTagTypeHeader5")]
354 pub const Header5: Self = Self(206);
355 #[doc(alias = "CGPDFTagTypeHeader6")]
356 pub const Header6: Self = Self(207);
357 #[doc(alias = "CGPDFTagTypeList")]
358 pub const List: Self = Self(300);
359 #[doc(alias = "CGPDFTagTypeListItem")]
360 pub const ListItem: Self = Self(301);
361 #[doc(alias = "CGPDFTagTypeLabel")]
362 pub const Label: Self = Self(302);
363 #[doc(alias = "CGPDFTagTypeListBody")]
364 pub const ListBody: Self = Self(303);
365 #[doc(alias = "CGPDFTagTypeTable")]
366 pub const Table: Self = Self(400);
367 #[doc(alias = "CGPDFTagTypeTableRow")]
368 pub const TableRow: Self = Self(401);
369 #[doc(alias = "CGPDFTagTypeTableHeaderCell")]
370 pub const TableHeaderCell: Self = Self(402);
371 #[doc(alias = "CGPDFTagTypeTableDataCell")]
372 pub const TableDataCell: Self = Self(403);
373 #[doc(alias = "CGPDFTagTypeTableHeader")]
374 pub const TableHeader: Self = Self(404);
375 #[doc(alias = "CGPDFTagTypeTableBody")]
376 pub const TableBody: Self = Self(405);
377 #[doc(alias = "CGPDFTagTypeTableFooter")]
378 pub const TableFooter: Self = Self(406);
379 #[doc(alias = "CGPDFTagTypeSpan")]
380 pub const Span: Self = Self(500);
381 #[doc(alias = "CGPDFTagTypeQuote")]
382 pub const Quote: Self = Self(501);
383 #[doc(alias = "CGPDFTagTypeNote")]
384 pub const Note: Self = Self(502);
385 #[doc(alias = "CGPDFTagTypeReference")]
386 pub const Reference: Self = Self(503);
387 #[doc(alias = "CGPDFTagTypeBibliography")]
388 pub const Bibliography: Self = Self(504);
389 #[doc(alias = "CGPDFTagTypeCode")]
390 pub const Code: Self = Self(505);
391 #[doc(alias = "CGPDFTagTypeLink")]
392 pub const Link: Self = Self(506);
393 #[doc(alias = "CGPDFTagTypeAnnotation")]
394 pub const Annotation: Self = Self(507);
395 #[doc(alias = "CGPDFTagTypeRuby")]
396 pub const Ruby: Self = Self(600);
397 #[doc(alias = "CGPDFTagTypeRubyBaseText")]
398 pub const RubyBaseText: Self = Self(601);
399 #[doc(alias = "CGPDFTagTypeRubyAnnotationText")]
400 pub const RubyAnnotationText: Self = Self(602);
401 #[doc(alias = "CGPDFTagTypeRubyPunctuation")]
402 pub const RubyPunctuation: Self = Self(603);
403 #[doc(alias = "CGPDFTagTypeWarichu")]
404 pub const Warichu: Self = Self(604);
405 #[doc(alias = "CGPDFTagTypeWarichuText")]
406 pub const WarichuText: Self = Self(605);
407 #[doc(alias = "CGPDFTagTypeWarichuPunctiation")]
408 pub const WarichuPunctiation: Self = Self(606);
409 #[doc(alias = "CGPDFTagTypeFigure")]
410 pub const Figure: Self = Self(700);
411 #[doc(alias = "CGPDFTagTypeFormula")]
412 pub const Formula: Self = Self(701);
413 #[doc(alias = "CGPDFTagTypeForm")]
414 pub const Form: Self = Self(702);
415 #[doc(alias = "CGPDFTagTypeObject")]
416 pub const Object: Self = Self(800);
417}
418
419#[cfg(feature = "objc2")]
420unsafe impl Encode for CGPDFTagType {
421 const ENCODING: Encoding = i32::ENCODING;
422}
423
424#[cfg(feature = "objc2")]
425unsafe impl RefEncode for CGPDFTagType {
426 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
427}
428
429impl CGPDFTagType {
430 #[doc(alias = "CGPDFTagTypeGetName")]
431 #[inline]
432 pub fn name(self) -> *const c_char {
433 extern "C-unwind" {
434 fn CGPDFTagTypeGetName(tag_type: CGPDFTagType) -> *const c_char;
435 }
436 unsafe { CGPDFTagTypeGetName(self) }
437 }
438}
439
440pub type CGPDFTagProperty = CFString;
443
444extern "C" {
445 pub static kCGPDFTagPropertyActualText: &'static CGPDFTagProperty;
447}
448
449extern "C" {
450 pub static kCGPDFTagPropertyAlternativeText: &'static CGPDFTagProperty;
452}
453
454extern "C" {
455 pub static kCGPDFTagPropertyTitleText: &'static CGPDFTagProperty;
457}
458
459extern "C" {
460 pub static kCGPDFTagPropertyLanguageText: &'static CGPDFTagProperty;
462}
463
464extern "C-unwind" {
465 #[cfg(feature = "CGContext")]
469 pub fn CGPDFContextBeginTag(
470 context: &CGContext,
471 tag_type: CGPDFTagType,
472 tag_properties: Option<&CFDictionary>,
473 );
474}
475
476#[cfg(feature = "CGContext")]
477#[inline]
478pub extern "C-unwind" fn CGPDFContextEndTag(context: &CGContext) {
479 extern "C-unwind" {
480 fn CGPDFContextEndTag(context: &CGContext);
481 }
482 unsafe { CGPDFContextEndTag(context) }
483}
484
485#[deprecated = "renamed to `CGPDFTagType::name`"]
486#[inline]
487pub extern "C-unwind" fn CGPDFTagTypeGetName(tag_type: CGPDFTagType) -> *const c_char {
488 extern "C-unwind" {
489 fn CGPDFTagTypeGetName(tag_type: CGPDFTagType) -> *const c_char;
490 }
491 unsafe { CGPDFTagTypeGetName(tag_type) }
492}