use core::ffi::*;
use core::ptr::NonNull;
#[cfg(feature = "objc2")]
use objc2::__framework_prelude::*;
use objc2_core_foundation::*;
use crate::*;
#[cfg(all(feature = "CGContext", feature = "CGDataConsumer"))]
#[inline]
pub unsafe extern "C-unwind" fn CGPDFContextCreate(
consumer: Option<&CGDataConsumer>,
media_box: *const CGRect,
auxiliary_info: Option<&CFDictionary>,
) -> Option<CFRetained<CGContext>> {
extern "C-unwind" {
fn CGPDFContextCreate(
consumer: Option<&CGDataConsumer>,
media_box: *const CGRect,
auxiliary_info: Option<&CFDictionary>,
) -> Option<NonNull<CGContext>>;
}
let ret = unsafe { CGPDFContextCreate(consumer, media_box, auxiliary_info) };
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}
#[cfg(feature = "CGContext")]
#[inline]
pub unsafe extern "C-unwind" fn CGPDFContextCreateWithURL(
url: Option<&CFURL>,
media_box: *const CGRect,
auxiliary_info: Option<&CFDictionary>,
) -> Option<CFRetained<CGContext>> {
extern "C-unwind" {
fn CGPDFContextCreateWithURL(
url: Option<&CFURL>,
media_box: *const CGRect,
auxiliary_info: Option<&CFDictionary>,
) -> Option<NonNull<CGContext>>;
}
let ret = unsafe { CGPDFContextCreateWithURL(url, media_box, auxiliary_info) };
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}
#[cfg(feature = "CGContext")]
#[inline]
pub extern "C-unwind" fn CGPDFContextClose(context: Option<&CGContext>) {
extern "C-unwind" {
fn CGPDFContextClose(context: Option<&CGContext>);
}
unsafe { CGPDFContextClose(context) }
}
extern "C-unwind" {
#[cfg(feature = "CGContext")]
pub fn CGPDFContextBeginPage(context: Option<&CGContext>, page_info: Option<&CFDictionary>);
}
#[cfg(feature = "CGContext")]
#[inline]
pub extern "C-unwind" fn CGPDFContextEndPage(context: Option<&CGContext>) {
extern "C-unwind" {
fn CGPDFContextEndPage(context: Option<&CGContext>);
}
unsafe { CGPDFContextEndPage(context) }
}
#[cfg(feature = "CGContext")]
#[inline]
pub extern "C-unwind" fn CGPDFContextAddDocumentMetadata(
context: Option<&CGContext>,
metadata: Option<&CFData>,
) {
extern "C-unwind" {
fn CGPDFContextAddDocumentMetadata(context: Option<&CGContext>, metadata: Option<&CFData>);
}
unsafe { CGPDFContextAddDocumentMetadata(context, metadata) }
}
extern "C-unwind" {
#[cfg(all(feature = "CGContext", feature = "CGPDFDictionary"))]
pub fn CGPDFContextSetParentTree(
context: Option<&CGContext>,
parent_tree_dictionary: CGPDFDictionaryRef,
);
}
extern "C-unwind" {
#[cfg(all(feature = "CGContext", feature = "CGPDFDictionary"))]
pub fn CGPDFContextSetIDTree(
context: Option<&CGContext>,
id_tree_dictionary: CGPDFDictionaryRef,
);
}
extern "C-unwind" {
#[cfg(feature = "CGContext")]
pub fn CGPDFContextSetPageTagStructureTree(
context: Option<&CGContext>,
page_tag_structure_tree_dictionary: &CFDictionary,
);
}
#[cfg(feature = "CGContext")]
#[inline]
pub extern "C-unwind" fn CGPDFContextSetURLForRect(
context: Option<&CGContext>,
url: &CFURL,
rect: CGRect,
) {
extern "C-unwind" {
fn CGPDFContextSetURLForRect(context: Option<&CGContext>, url: &CFURL, rect: CGRect);
}
unsafe { CGPDFContextSetURLForRect(context, url, rect) }
}
#[cfg(feature = "CGContext")]
#[inline]
pub extern "C-unwind" fn CGPDFContextAddDestinationAtPoint(
context: Option<&CGContext>,
name: &CFString,
point: CGPoint,
) {
extern "C-unwind" {
fn CGPDFContextAddDestinationAtPoint(
context: Option<&CGContext>,
name: &CFString,
point: CGPoint,
);
}
unsafe { CGPDFContextAddDestinationAtPoint(context, name, point) }
}
#[cfg(feature = "CGContext")]
#[inline]
pub extern "C-unwind" fn CGPDFContextSetDestinationForRect(
context: Option<&CGContext>,
name: &CFString,
rect: CGRect,
) {
extern "C-unwind" {
fn CGPDFContextSetDestinationForRect(
context: Option<&CGContext>,
name: &CFString,
rect: CGRect,
);
}
unsafe { CGPDFContextSetDestinationForRect(context, name, rect) }
}
extern "C" {
pub static kCGPDFContextMediaBox: &'static CFString;
}
extern "C" {
pub static kCGPDFContextCropBox: &'static CFString;
}
extern "C" {
pub static kCGPDFContextBleedBox: &'static CFString;
}
extern "C" {
pub static kCGPDFContextTrimBox: &'static CFString;
}
extern "C" {
pub static kCGPDFContextArtBox: &'static CFString;
}
extern "C" {
pub static kCGPDFContextTitle: &'static CFString;
}
extern "C" {
pub static kCGPDFContextAuthor: &'static CFString;
}
extern "C" {
pub static kCGPDFContextSubject: &'static CFString;
}
extern "C" {
pub static kCGPDFContextKeywords: &'static CFString;
}
extern "C" {
pub static kCGPDFContextCreator: &'static CFString;
}
extern "C" {
pub static kCGPDFContextOwnerPassword: &'static CFString;
}
extern "C" {
pub static kCGPDFContextUserPassword: &'static CFString;
}
extern "C" {
pub static kCGPDFContextEncryptionKeyLength: &'static CFString;
}
extern "C" {
pub static kCGPDFContextAllowsPrinting: &'static CFString;
}
extern "C" {
pub static kCGPDFContextAllowsCopying: &'static CFString;
}
extern "C" {
pub static kCGPDFContextOutputIntent: &'static CFString;
}
extern "C" {
pub static kCGPDFXOutputIntentSubtype: &'static CFString;
}
extern "C" {
pub static kCGPDFXOutputConditionIdentifier: &'static CFString;
}
extern "C" {
pub static kCGPDFXOutputCondition: &'static CFString;
}
extern "C" {
pub static kCGPDFXRegistryName: &'static CFString;
}
extern "C" {
pub static kCGPDFXInfo: &'static CFString;
}
extern "C" {
pub static kCGPDFXDestinationOutputProfile: &'static CFString;
}
extern "C" {
pub static kCGPDFContextOutputIntents: &'static CFString;
}
extern "C" {
pub static kCGPDFContextAccessPermissions: &'static CFString;
}
extern "C-unwind" {
#[cfg(feature = "CGContext")]
pub fn CGPDFContextSetOutline(context: &CGContext, outline: Option<&CFDictionary>);
}
extern "C" {
pub static kCGPDFContextCreateLinearizedPDF: &'static CFString;
}
extern "C" {
pub static kCGPDFContextCreatePDFA: &'static CFString;
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct CGPDFTagType(pub i32);
impl CGPDFTagType {
#[doc(alias = "CGPDFTagTypeDocument")]
pub const Document: Self = Self(100);
#[doc(alias = "CGPDFTagTypePart")]
pub const Part: Self = Self(101);
#[doc(alias = "CGPDFTagTypeArt")]
pub const Art: Self = Self(102);
#[doc(alias = "CGPDFTagTypeSection")]
pub const Section: Self = Self(103);
#[doc(alias = "CGPDFTagTypeDiv")]
pub const Div: Self = Self(104);
#[doc(alias = "CGPDFTagTypeBlockQuote")]
pub const BlockQuote: Self = Self(105);
#[doc(alias = "CGPDFTagTypeCaption")]
pub const Caption: Self = Self(106);
#[doc(alias = "CGPDFTagTypeTOC")]
pub const TOC: Self = Self(107);
#[doc(alias = "CGPDFTagTypeTOCI")]
pub const TOCI: Self = Self(108);
#[doc(alias = "CGPDFTagTypeIndex")]
pub const Index: Self = Self(109);
#[doc(alias = "CGPDFTagTypeNonStructure")]
pub const NonStructure: Self = Self(110);
#[doc(alias = "CGPDFTagTypePrivate")]
pub const Private: Self = Self(111);
#[doc(alias = "CGPDFTagTypeParagraph")]
pub const Paragraph: Self = Self(200);
#[doc(alias = "CGPDFTagTypeHeader")]
pub const Header: Self = Self(201);
#[doc(alias = "CGPDFTagTypeHeader1")]
pub const Header1: Self = Self(202);
#[doc(alias = "CGPDFTagTypeHeader2")]
pub const Header2: Self = Self(203);
#[doc(alias = "CGPDFTagTypeHeader3")]
pub const Header3: Self = Self(204);
#[doc(alias = "CGPDFTagTypeHeader4")]
pub const Header4: Self = Self(205);
#[doc(alias = "CGPDFTagTypeHeader5")]
pub const Header5: Self = Self(206);
#[doc(alias = "CGPDFTagTypeHeader6")]
pub const Header6: Self = Self(207);
#[doc(alias = "CGPDFTagTypeList")]
pub const List: Self = Self(300);
#[doc(alias = "CGPDFTagTypeListItem")]
pub const ListItem: Self = Self(301);
#[doc(alias = "CGPDFTagTypeLabel")]
pub const Label: Self = Self(302);
#[doc(alias = "CGPDFTagTypeListBody")]
pub const ListBody: Self = Self(303);
#[doc(alias = "CGPDFTagTypeTable")]
pub const Table: Self = Self(400);
#[doc(alias = "CGPDFTagTypeTableRow")]
pub const TableRow: Self = Self(401);
#[doc(alias = "CGPDFTagTypeTableHeaderCell")]
pub const TableHeaderCell: Self = Self(402);
#[doc(alias = "CGPDFTagTypeTableDataCell")]
pub const TableDataCell: Self = Self(403);
#[doc(alias = "CGPDFTagTypeTableHeader")]
pub const TableHeader: Self = Self(404);
#[doc(alias = "CGPDFTagTypeTableBody")]
pub const TableBody: Self = Self(405);
#[doc(alias = "CGPDFTagTypeTableFooter")]
pub const TableFooter: Self = Self(406);
#[doc(alias = "CGPDFTagTypeSpan")]
pub const Span: Self = Self(500);
#[doc(alias = "CGPDFTagTypeQuote")]
pub const Quote: Self = Self(501);
#[doc(alias = "CGPDFTagTypeNote")]
pub const Note: Self = Self(502);
#[doc(alias = "CGPDFTagTypeReference")]
pub const Reference: Self = Self(503);
#[doc(alias = "CGPDFTagTypeBibliography")]
pub const Bibliography: Self = Self(504);
#[doc(alias = "CGPDFTagTypeCode")]
pub const Code: Self = Self(505);
#[doc(alias = "CGPDFTagTypeLink")]
pub const Link: Self = Self(506);
#[doc(alias = "CGPDFTagTypeAnnotation")]
pub const Annotation: Self = Self(507);
#[doc(alias = "CGPDFTagTypeRuby")]
pub const Ruby: Self = Self(600);
#[doc(alias = "CGPDFTagTypeRubyBaseText")]
pub const RubyBaseText: Self = Self(601);
#[doc(alias = "CGPDFTagTypeRubyAnnotationText")]
pub const RubyAnnotationText: Self = Self(602);
#[doc(alias = "CGPDFTagTypeRubyPunctuation")]
pub const RubyPunctuation: Self = Self(603);
#[doc(alias = "CGPDFTagTypeWarichu")]
pub const Warichu: Self = Self(604);
#[doc(alias = "CGPDFTagTypeWarichuText")]
pub const WarichuText: Self = Self(605);
#[doc(alias = "CGPDFTagTypeWarichuPunctiation")]
pub const WarichuPunctiation: Self = Self(606);
#[doc(alias = "CGPDFTagTypeFigure")]
pub const Figure: Self = Self(700);
#[doc(alias = "CGPDFTagTypeFormula")]
pub const Formula: Self = Self(701);
#[doc(alias = "CGPDFTagTypeForm")]
pub const Form: Self = Self(702);
#[doc(alias = "CGPDFTagTypeObject")]
pub const Object: Self = Self(800);
}
#[cfg(feature = "objc2")]
unsafe impl Encode for CGPDFTagType {
const ENCODING: Encoding = i32::ENCODING;
}
#[cfg(feature = "objc2")]
unsafe impl RefEncode for CGPDFTagType {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
impl CGPDFTagType {
#[doc(alias = "CGPDFTagTypeGetName")]
#[inline]
pub fn name(self) -> *const c_char {
extern "C-unwind" {
fn CGPDFTagTypeGetName(tag_type: CGPDFTagType) -> *const c_char;
}
unsafe { CGPDFTagTypeGetName(self) }
}
}
pub type CGPDFTagProperty = CFString;
extern "C" {
pub static kCGPDFTagPropertyActualText: &'static CGPDFTagProperty;
}
extern "C" {
pub static kCGPDFTagPropertyAlternativeText: &'static CGPDFTagProperty;
}
extern "C" {
pub static kCGPDFTagPropertyTitleText: &'static CGPDFTagProperty;
}
extern "C" {
pub static kCGPDFTagPropertyLanguageText: &'static CGPDFTagProperty;
}
extern "C-unwind" {
#[cfg(feature = "CGContext")]
pub fn CGPDFContextBeginTag(
context: &CGContext,
tag_type: CGPDFTagType,
tag_properties: Option<&CFDictionary>,
);
}
#[cfg(feature = "CGContext")]
#[inline]
pub extern "C-unwind" fn CGPDFContextEndTag(context: &CGContext) {
extern "C-unwind" {
fn CGPDFContextEndTag(context: &CGContext);
}
unsafe { CGPDFContextEndTag(context) }
}
#[deprecated = "renamed to `CGPDFTagType::name`"]
#[inline]
pub extern "C-unwind" fn CGPDFTagTypeGetName(tag_type: CGPDFTagType) -> *const c_char {
extern "C-unwind" {
fn CGPDFTagTypeGetName(tag_type: CGPDFTagType) -> *const c_char;
}
unsafe { CGPDFTagTypeGetName(tag_type) }
}