use core::ffi::*;
use core::ptr::NonNull;
use objc2_core_foundation::*;
#[cfg(feature = "objc2-core-graphics")]
use objc2_core_graphics::*;
use crate::*;
extern "C-unwind" {
#[cfg(feature = "PMDefinitions")]
pub fn PMRetain(object: PMObject) -> OSStatus;
}
extern "C-unwind" {
#[cfg(feature = "PMDefinitions")]
pub fn PMRelease(object: PMObject) -> OSStatus;
}
extern "C-unwind" {
#[cfg(feature = "PMDefinitions")]
pub fn PMCreateSession(print_session: NonNull<PMPrintSession>) -> OSStatus;
}
extern "C-unwind" {
#[cfg(feature = "PMDefinitions")]
pub fn PMSessionError(print_session: PMPrintSession) -> OSStatus;
}
extern "C-unwind" {
#[cfg(feature = "PMDefinitions")]
pub fn PMSessionSetError(print_session: PMPrintSession, print_error: OSStatus) -> OSStatus;
}
extern "C-unwind" {
#[cfg(feature = "PMDefinitions")]
pub fn PMSessionBeginCGDocumentNoDialog(
print_session: PMPrintSession,
print_settings: PMPrintSettings,
page_format: PMPageFormat,
) -> OSStatus;
}
extern "C-unwind" {
#[cfg(feature = "PMDefinitions")]
pub fn PMSessionEndDocumentNoDialog(print_session: PMPrintSession) -> OSStatus;
}
extern "C-unwind" {
#[cfg(feature = "PMDefinitions")]
pub fn PMSessionBeginPageNoDialog(
print_session: PMPrintSession,
page_format: PMPageFormat,
page_frame: *const PMRect,
) -> OSStatus;
}
extern "C-unwind" {
#[cfg(feature = "PMDefinitions")]
pub fn PMSessionEndPageNoDialog(print_session: PMPrintSession) -> OSStatus;
}
extern "C-unwind" {
#[cfg(all(feature = "PMDefinitions", feature = "objc2-core-graphics"))]
pub fn PMSessionGetCGGraphicsContext(
print_session: PMPrintSession,
context: NonNull<*mut CGContext>,
) -> OSStatus;
}
extern "C-unwind" {
#[cfg(feature = "PMDefinitions")]
pub fn PMSessionGetDestinationType(
print_session: PMPrintSession,
print_settings: PMPrintSettings,
dest_type_p: NonNull<PMDestinationType>,
) -> OSStatus;
}
extern "C-unwind" {
#[cfg(feature = "PMDefinitions")]
pub fn PMSessionCopyDestinationFormat(
print_session: PMPrintSession,
print_settings: PMPrintSettings,
dest_format_p: NonNull<*const CFString>,
) -> OSStatus;
}
extern "C-unwind" {
#[cfg(feature = "PMDefinitions")]
pub fn PMSessionCopyDestinationLocation(
print_session: PMPrintSession,
print_settings: PMPrintSettings,
dest_location_p: NonNull<*const CFURL>,
) -> OSStatus;
}
extern "C-unwind" {
#[cfg(feature = "PMDefinitions")]
pub fn PMSessionSetDestination(
print_session: PMPrintSession,
print_settings: PMPrintSettings,
dest_type: PMDestinationType,
dest_format: Option<&CFString>,
dest_location: Option<&CFURL>,
) -> OSStatus;
}
extern "C-unwind" {
#[cfg(feature = "PMDefinitions")]
pub fn PMSessionCopyOutputFormatList(
print_session: PMPrintSession,
dest_type: PMDestinationType,
document_format_p: NonNull<*const CFArray>,
) -> OSStatus;
}
extern "C-unwind" {
#[cfg(feature = "PMDefinitions")]
pub fn PMSessionCreatePageFormatList(
print_session: PMPrintSession,
printer: PMPrinter,
page_format_list: NonNull<*const CFArray>,
) -> OSStatus;
}
extern "C-unwind" {
#[cfg(feature = "PMDefinitions")]
pub fn PMSessionCreatePrinterList(
print_session: PMPrintSession,
printer_list: NonNull<*const CFArray>,
current_index: *mut CFIndex,
current_printer: *mut PMPrinter,
) -> OSStatus;
}
extern "C-unwind" {
#[cfg(feature = "PMDefinitions")]
pub fn PMSessionGetCurrentPrinter(
print_session: PMPrintSession,
current_printer: NonNull<PMPrinter>,
) -> OSStatus;
}
extern "C-unwind" {
#[cfg(feature = "PMDefinitions")]
pub fn PMSessionSetCurrentPMPrinter(session: PMPrintSession, printer: PMPrinter) -> OSStatus;
}
extern "C-unwind" {
#[cfg(feature = "PMDefinitions")]
pub fn PMSessionGetDataFromSession(
print_session: PMPrintSession,
key: &CFString,
data: NonNull<*const CFType>,
) -> OSStatus;
}
extern "C-unwind" {
#[cfg(feature = "PMDefinitions")]
pub fn PMSessionSetDataInSession(
print_session: PMPrintSession,
key: &CFString,
data: &CFType,
) -> OSStatus;
}
extern "C-unwind" {
#[cfg(feature = "PMDefinitions")]
pub fn PMCreatePageFormat(page_format: NonNull<PMPageFormat>) -> OSStatus;
}
extern "C-unwind" {
#[cfg(feature = "PMDefinitions")]
pub fn PMSessionDefaultPageFormat(
print_session: PMPrintSession,
page_format: PMPageFormat,
) -> OSStatus;
}
extern "C-unwind" {
#[cfg(feature = "PMDefinitions")]
pub fn PMSessionValidatePageFormat(
print_session: PMPrintSession,
page_format: PMPageFormat,
changed: *mut Boolean,
) -> OSStatus;
}
extern "C-unwind" {
#[cfg(feature = "PMDefinitions")]
pub fn PMCopyPageFormat(format_src: PMPageFormat, format_dest: PMPageFormat) -> OSStatus;
}
extern "C-unwind" {
#[cfg(feature = "PMDefinitions")]
pub fn PMCreatePageFormatWithPMPaper(
page_format: NonNull<PMPageFormat>,
paper: PMPaper,
) -> OSStatus;
}
extern "C-unwind" {
#[cfg(feature = "PMDefinitions")]
pub fn PMPageFormatCreateDataRepresentation(
page_format: PMPageFormat,
data: NonNull<*const CFData>,
format: PMDataFormat,
) -> OSStatus;
}
extern "C-unwind" {
#[cfg(feature = "PMDefinitions")]
pub fn PMPageFormatCreateWithDataRepresentation(
data: &CFData,
page_format: NonNull<PMPageFormat>,
) -> OSStatus;
}
extern "C-unwind" {
#[cfg(feature = "PMDefinitions")]
pub fn PMGetAdjustedPageRect(page_format: PMPageFormat, page_rect: NonNull<PMRect>)
-> OSStatus;
}
extern "C-unwind" {
#[cfg(feature = "PMDefinitions")]
pub fn PMGetAdjustedPaperRect(
page_format: PMPageFormat,
paper_rect: NonNull<PMRect>,
) -> OSStatus;
}
extern "C-unwind" {
#[cfg(feature = "PMDefinitions")]
pub fn PMGetOrientation(
page_format: PMPageFormat,
orientation: NonNull<PMOrientation>,
) -> OSStatus;
}
extern "C-unwind" {
#[cfg(feature = "PMDefinitions")]
pub fn PMGetPageFormatExtendedData(
page_format: PMPageFormat,
data_id: OSType,
size: *mut u32,
extended_data: *mut c_void,
) -> OSStatus;
}
extern "C-unwind" {
#[cfg(feature = "PMDefinitions")]
pub fn PMPageFormatGetPrinterID(
page_format: PMPageFormat,
printer_id: NonNull<*const CFString>,
) -> OSStatus;
}
extern "C-unwind" {
#[cfg(feature = "PMDefinitions")]
pub fn PMGetScale(page_format: PMPageFormat, scale: NonNull<c_double>) -> OSStatus;
}
extern "C-unwind" {
#[cfg(feature = "PMDefinitions")]
pub fn PMGetUnadjustedPageRect(
page_format: PMPageFormat,
page_rect: NonNull<PMRect>,
) -> OSStatus;
}
extern "C-unwind" {
#[cfg(feature = "PMDefinitions")]
pub fn PMGetUnadjustedPaperRect(
page_format: PMPageFormat,
paper_rect: NonNull<PMRect>,
) -> OSStatus;
}
#[cfg(feature = "PMDefinitions")]
#[inline]
pub unsafe extern "C-unwind" fn PMSetOrientation(
page_format: PMPageFormat,
orientation: PMOrientation,
lock: bool,
) -> OSStatus {
extern "C-unwind" {
fn PMSetOrientation(
page_format: PMPageFormat,
orientation: PMOrientation,
lock: Boolean,
) -> OSStatus;
}
unsafe { PMSetOrientation(page_format, orientation, lock as _) }
}
extern "C-unwind" {
#[cfg(feature = "PMDefinitions")]
pub fn PMSetPageFormatExtendedData(
page_format: PMPageFormat,
data_id: OSType,
size: u32,
extended_data: NonNull<c_void>,
) -> OSStatus;
}
extern "C-unwind" {
#[cfg(feature = "PMDefinitions")]
pub fn PMSetScale(page_format: PMPageFormat, scale: c_double) -> OSStatus;
}
extern "C-unwind" {
#[cfg(feature = "PMDefinitions")]
pub fn PMCreatePrintSettings(print_settings: NonNull<PMPrintSettings>) -> OSStatus;
}
extern "C-unwind" {
#[cfg(feature = "PMDefinitions")]
pub fn PMSessionDefaultPrintSettings(
print_session: PMPrintSession,
print_settings: PMPrintSettings,
) -> OSStatus;
}
extern "C-unwind" {
#[cfg(feature = "PMDefinitions")]
pub fn PMSessionValidatePrintSettings(
print_session: PMPrintSession,
print_settings: PMPrintSettings,
changed: *mut Boolean,
) -> OSStatus;
}
extern "C-unwind" {
#[cfg(feature = "PMDefinitions")]
pub fn PMCopyPrintSettings(
setting_src: PMPrintSettings,
setting_dest: PMPrintSettings,
) -> OSStatus;
}
extern "C-unwind" {
#[cfg(feature = "PMDefinitions")]
pub fn PMPrintSettingsCreateDataRepresentation(
print_settings: PMPrintSettings,
data: NonNull<*const CFData>,
format: PMDataFormat,
) -> OSStatus;
}
extern "C-unwind" {
#[cfg(feature = "PMDefinitions")]
pub fn PMPrintSettingsCreateWithDataRepresentation(
data: &CFData,
print_settings: NonNull<PMPrintSettings>,
) -> OSStatus;
}
extern "C-unwind" {
#[cfg(feature = "PMDefinitions")]
pub fn PMGetCollate(print_settings: PMPrintSettings, collate: NonNull<Boolean>) -> OSStatus;
}
extern "C-unwind" {
#[cfg(feature = "PMDefinitions")]
pub fn PMGetCopies(print_settings: PMPrintSettings, copies: NonNull<u32>) -> OSStatus;
}
extern "C-unwind" {
#[cfg(feature = "PMDefinitions")]
pub fn PMGetDuplex(
print_settings: PMPrintSettings,
duplex_setting: NonNull<PMDuplexMode>,
) -> OSStatus;
}
extern "C-unwind" {
#[cfg(feature = "PMDefinitions")]
pub fn PMGetFirstPage(print_settings: PMPrintSettings, first: NonNull<u32>) -> OSStatus;
}
extern "C-unwind" {
#[cfg(feature = "PMDefinitions")]
pub fn PMGetLastPage(print_settings: PMPrintSettings, last: NonNull<u32>) -> OSStatus;
}
extern "C-unwind" {
#[cfg(feature = "PMDefinitions")]
pub fn PMGetPageRange(
print_settings: PMPrintSettings,
min_page: NonNull<u32>,
max_page: NonNull<u32>,
) -> OSStatus;
}
extern "C-unwind" {
#[cfg(feature = "PMDefinitions")]
pub fn PMPrintSettingsGetJobName(
print_settings: PMPrintSettings,
name: NonNull<*const CFString>,
) -> OSStatus;
}
extern "C-unwind" {
#[cfg(feature = "PMDefinitions")]
pub fn PMPrintSettingsGetValue(
print_settings: PMPrintSettings,
key: &CFString,
value: NonNull<*const CFType>,
) -> OSStatus;
}
#[cfg(feature = "PMDefinitions")]
#[inline]
pub unsafe extern "C-unwind" fn PMSetCollate(
print_settings: PMPrintSettings,
collate: bool,
) -> OSStatus {
extern "C-unwind" {
fn PMSetCollate(print_settings: PMPrintSettings, collate: Boolean) -> OSStatus;
}
unsafe { PMSetCollate(print_settings, collate as _) }
}
#[cfg(feature = "PMDefinitions")]
#[inline]
pub unsafe extern "C-unwind" fn PMSetCopies(
print_settings: PMPrintSettings,
copies: u32,
lock: bool,
) -> OSStatus {
extern "C-unwind" {
fn PMSetCopies(print_settings: PMPrintSettings, copies: u32, lock: Boolean) -> OSStatus;
}
unsafe { PMSetCopies(print_settings, copies, lock as _) }
}
extern "C-unwind" {
#[cfg(feature = "PMDefinitions")]
pub fn PMSetDuplex(print_settings: PMPrintSettings, duplex_setting: PMDuplexMode) -> OSStatus;
}
#[cfg(feature = "PMDefinitions")]
#[inline]
pub unsafe extern "C-unwind" fn PMSetFirstPage(
print_settings: PMPrintSettings,
first: u32,
lock: bool,
) -> OSStatus {
extern "C-unwind" {
fn PMSetFirstPage(print_settings: PMPrintSettings, first: u32, lock: Boolean) -> OSStatus;
}
unsafe { PMSetFirstPage(print_settings, first, lock as _) }
}
#[cfg(feature = "PMDefinitions")]
#[inline]
pub unsafe extern "C-unwind" fn PMSetLastPage(
print_settings: PMPrintSettings,
last: u32,
lock: bool,
) -> OSStatus {
extern "C-unwind" {
fn PMSetLastPage(print_settings: PMPrintSettings, last: u32, lock: Boolean) -> OSStatus;
}
unsafe { PMSetLastPage(print_settings, last, lock as _) }
}
extern "C-unwind" {
#[cfg(feature = "PMDefinitions")]
pub fn PMSetPageRange(
print_settings: PMPrintSettings,
min_page: u32,
max_page: u32,
) -> OSStatus;
}
extern "C-unwind" {
#[cfg(feature = "PMDefinitions")]
pub fn PMPrintSettingsSetJobName(print_settings: PMPrintSettings, name: &CFString) -> OSStatus;
}
#[cfg(feature = "PMDefinitions")]
#[inline]
pub unsafe extern "C-unwind" fn PMPrintSettingsSetValue(
print_settings: PMPrintSettings,
key: &CFString,
value: Option<&CFType>,
locked: bool,
) -> OSStatus {
extern "C-unwind" {
fn PMPrintSettingsSetValue(
print_settings: PMPrintSettings,
key: &CFString,
value: Option<&CFType>,
locked: Boolean,
) -> OSStatus;
}
unsafe { PMPrintSettingsSetValue(print_settings, key, value, locked as _) }
}
extern "C-unwind" {
#[cfg(feature = "PMDefinitions")]
pub fn PMPrintSettingsCopyAsDictionary(
print_settings: PMPrintSettings,
settings_dictionary: NonNull<*const CFDictionary>,
) -> OSStatus;
}
extern "C-unwind" {
#[cfg(feature = "PMDefinitions")]
pub fn PMPrintSettingsCopyKeys(
print_settings: PMPrintSettings,
settings_keys: NonNull<*const CFArray>,
) -> OSStatus;
}
extern "C-unwind" {
#[cfg(feature = "PMDefinitions")]
pub fn PMCreateGenericPrinter(printer: NonNull<PMPrinter>) -> OSStatus;
}
extern "C-unwind" {
#[cfg(feature = "PMDefinitions")]
pub fn PMServerCreatePrinterList(
server: PMServer,
printer_list: NonNull<*const CFArray>,
) -> OSStatus;
}
extern "C-unwind" {
#[cfg(feature = "PMDefinitions")]
pub fn PMServerLaunchPrinterBrowser(
server: PMServer,
options: Option<&CFDictionary>,
) -> OSStatus;
}
extern "C-unwind" {
#[cfg(feature = "PMDefinitions")]
pub fn PMPrinterCreateFromPrinterID(printer_id: &CFString) -> PMPrinter;
}
extern "C-unwind" {
#[cfg(feature = "PMDefinitions")]
pub fn PMPrinterCopyDescriptionURL(
printer: PMPrinter,
description_type: &CFString,
file_url: NonNull<*const CFURL>,
) -> OSStatus;
}
extern "C-unwind" {
#[cfg(feature = "PMDefinitions")]
pub fn PMPrinterCopyDeviceURI(
printer: PMPrinter,
device_uri: NonNull<*const CFURL>,
) -> OSStatus;
}
extern "C-unwind" {
#[cfg(feature = "PMDefinitions")]
pub fn PMPrinterCopyHostName(
printer: PMPrinter,
host_name_p: NonNull<*const CFString>,
) -> OSStatus;
}
extern "C-unwind" {
#[cfg(feature = "PMDefinitions")]
pub fn PMPrinterCopyPresets(
printer: PMPrinter,
preset_list: NonNull<*const CFArray>,
) -> OSStatus;
}
extern "C-unwind" {
#[cfg(feature = "PMDefinitions")]
pub fn PMPrinterGetCommInfo(
printer: PMPrinter,
supports_control_char_range_p: *mut Boolean,
supports_eight_bit_p: *mut Boolean,
) -> OSStatus;
}
#[cfg(feature = "PMDefinitions")]
#[inline]
pub unsafe extern "C-unwind" fn PMPrinterGetID(printer: PMPrinter) -> Option<CFRetained<CFString>> {
extern "C-unwind" {
fn PMPrinterGetID(printer: PMPrinter) -> Option<NonNull<CFString>>;
}
let ret = unsafe { PMPrinterGetID(printer) };
ret.map(|ret| unsafe { CFRetained::retain(ret) })
}
#[cfg(feature = "PMDefinitions")]
#[inline]
pub unsafe extern "C-unwind" fn PMPrinterGetLocation(
printer: PMPrinter,
) -> Option<CFRetained<CFString>> {
extern "C-unwind" {
fn PMPrinterGetLocation(printer: PMPrinter) -> Option<NonNull<CFString>>;
}
let ret = unsafe { PMPrinterGetLocation(printer) };
ret.map(|ret| unsafe { CFRetained::retain(ret) })
}
extern "C-unwind" {
#[cfg(feature = "PMDefinitions")]
pub fn PMPrinterGetDriverCreator(printer: PMPrinter, creator: NonNull<OSType>) -> OSStatus;
}
extern "C-unwind" {
#[cfg(feature = "PMDefinitions")]
pub fn PMPrinterGetPrinterResolutionCount(
printer: PMPrinter,
count_p: NonNull<u32>,
) -> OSStatus;
}
extern "C-unwind" {
#[cfg(feature = "PMDefinitions")]
pub fn PMPrinterGetIndexedPrinterResolution(
printer: PMPrinter,
index: u32,
resolution_p: NonNull<PMResolution>,
) -> OSStatus;
}
extern "C-unwind" {
#[cfg(feature = "PMDefinitions")]
pub fn PMPrinterGetOutputResolution(
printer: PMPrinter,
print_settings: PMPrintSettings,
resolution_p: NonNull<PMResolution>,
) -> OSStatus;
}
extern "C-unwind" {
#[cfg(feature = "PMDefinitions")]
pub fn PMPrinterSetOutputResolution(
printer: PMPrinter,
print_settings: PMPrintSettings,
resolution_p: NonNull<PMResolution>,
) -> OSStatus;
}
extern "C-unwind" {
#[cfg(feature = "PMDefinitions")]
pub fn PMPrinterGetLanguageInfo(printer: PMPrinter, info: NonNull<PMLanguageInfo>) -> OSStatus;
}
extern "C-unwind" {
#[cfg(feature = "PMDefinitions")]
pub fn PMPrinterGetMakeAndModelName(
printer: PMPrinter,
make_and_model: NonNull<*const CFString>,
) -> OSStatus;
}
extern "C-unwind" {
#[cfg(feature = "PMDefinitions")]
pub fn PMPrinterGetMimeTypes(
printer: PMPrinter,
settings: PMPrintSettings,
mime_types: NonNull<*const CFArray>,
) -> OSStatus;
}
#[cfg(feature = "PMDefinitions")]
#[inline]
pub unsafe extern "C-unwind" fn PMPrinterGetName(
printer: PMPrinter,
) -> Option<CFRetained<CFString>> {
extern "C-unwind" {
fn PMPrinterGetName(printer: PMPrinter) -> Option<NonNull<CFString>>;
}
let ret = unsafe { PMPrinterGetName(printer) };
ret.map(|ret| unsafe { CFRetained::retain(ret) })
}
extern "C-unwind" {
#[cfg(feature = "PMDefinitions")]
pub fn PMPrinterGetPaperList(
printer: PMPrinter,
paper_list: NonNull<*const CFArray>,
) -> OSStatus;
}
extern "C-unwind" {
#[cfg(feature = "PMDefinitions")]
pub fn PMPrinterGetState(printer: PMPrinter, state: NonNull<PMPrinterState>) -> OSStatus;
}
#[cfg(feature = "PMDefinitions")]
#[inline]
pub unsafe extern "C-unwind" fn PMPrinterIsDefault(printer: PMPrinter) -> bool {
extern "C-unwind" {
fn PMPrinterIsDefault(printer: PMPrinter) -> Boolean;
}
let ret = unsafe { PMPrinterIsDefault(printer) };
ret != 0
}
#[cfg(feature = "PMDefinitions")]
#[inline]
pub unsafe extern "C-unwind" fn PMPrinterIsFavorite(printer: PMPrinter) -> bool {
extern "C-unwind" {
fn PMPrinterIsFavorite(printer: PMPrinter) -> Boolean;
}
let ret = unsafe { PMPrinterIsFavorite(printer) };
ret != 0
}
#[cfg(feature = "PMDefinitions")]
#[inline]
pub unsafe extern "C-unwind" fn PMPrinterIsPostScriptCapable(printer: PMPrinter) -> bool {
extern "C-unwind" {
fn PMPrinterIsPostScriptCapable(printer: PMPrinter) -> Boolean;
}
let ret = unsafe { PMPrinterIsPostScriptCapable(printer) };
ret != 0
}
extern "C-unwind" {
#[cfg(feature = "PMDefinitions")]
pub fn PMPrinterIsPostScriptPrinter(
printer: PMPrinter,
is_ps_printer: NonNull<Boolean>,
) -> OSStatus;
}
extern "C-unwind" {
#[cfg(feature = "PMDefinitions")]
pub fn PMPrinterIsRemote(printer: PMPrinter, is_remote_p: NonNull<Boolean>) -> OSStatus;
}
extern "C-unwind" {
#[cfg(feature = "PMDefinitions")]
pub fn PMPrinterSetDefault(printer: PMPrinter) -> OSStatus;
}
extern "C-unwind" {
#[cfg(feature = "PMDefinitions")]
pub fn PMPresetCopyName(preset: PMPreset, name: NonNull<*const CFString>) -> OSStatus;
}
extern "C-unwind" {
#[cfg(feature = "PMDefinitions")]
pub fn PMPresetCreatePrintSettings(
preset: PMPreset,
session: PMPrintSession,
print_settings: NonNull<PMPrintSettings>,
) -> OSStatus;
}
extern "C-unwind" {
#[cfg(feature = "PMDefinitions")]
pub fn PMPresetGetAttributes(
preset: PMPreset,
attributes: NonNull<*const CFDictionary>,
) -> OSStatus;
}
extern "C-unwind" {
#[cfg(feature = "PMDefinitions")]
pub fn PMGetPageFormatPaper(format: PMPageFormat, paper: NonNull<PMPaper>) -> OSStatus;
}
extern "C-unwind" {
#[cfg(feature = "PMDefinitions")]
pub fn PMPaperCreateCustom(
printer: PMPrinter,
id: Option<&CFString>,
name: Option<&CFString>,
width: c_double,
height: c_double,
margins: NonNull<PMPaperMargins>,
paper_p: NonNull<PMPaper>,
) -> OSStatus;
}
extern "C-unwind" {
#[cfg(feature = "PMDefinitions")]
pub fn PMPaperGetWidth(paper: PMPaper, paper_width: NonNull<c_double>) -> OSStatus;
}
extern "C-unwind" {
#[cfg(feature = "PMDefinitions")]
pub fn PMPaperGetHeight(paper: PMPaper, paper_height: NonNull<c_double>) -> OSStatus;
}
extern "C-unwind" {
#[cfg(feature = "PMDefinitions")]
pub fn PMPaperGetMargins(paper: PMPaper, paper_margins: NonNull<PMPaperMargins>) -> OSStatus;
}
extern "C-unwind" {
#[cfg(feature = "PMDefinitions")]
pub fn PMPaperGetID(paper: PMPaper, paper_id: NonNull<*const CFString>) -> OSStatus;
}
extern "C-unwind" {
#[cfg(feature = "PMDefinitions")]
pub fn PMPaperGetPPDPaperName(paper: PMPaper, paper_name: NonNull<*const CFString>)
-> OSStatus;
}
extern "C-unwind" {
#[cfg(feature = "PMDefinitions")]
pub fn PMPaperCreateLocalizedName(
paper: PMPaper,
printer: PMPrinter,
paper_name: NonNull<*const CFString>,
) -> OSStatus;
}
extern "C-unwind" {
#[cfg(feature = "PMDefinitions")]
pub fn PMPaperGetPrinterID(paper: PMPaper, printer_id: NonNull<*const CFString>) -> OSStatus;
}
#[cfg(feature = "PMDefinitions")]
#[inline]
pub unsafe extern "C-unwind" fn PMPaperIsCustom(paper: PMPaper) -> bool {
extern "C-unwind" {
fn PMPaperIsCustom(paper: PMPaper) -> Boolean;
}
let ret = unsafe { PMPaperIsCustom(paper) };
ret != 0
}
extern "C-unwind" {
pub fn PMWorkflowCopyItems(workflow_items: NonNull<*const CFArray>) -> OSStatus;
}
extern "C-unwind" {
pub fn PMWorkflowSubmitPDFWithOptions(
workflow_item: &CFURL,
title: Option<&CFString>,
options: *const c_char,
pdf_file: &CFURL,
) -> OSStatus;
}
extern "C-unwind" {
#[cfg(feature = "PMDefinitions")]
pub fn PMWorkflowSubmitPDFWithSettings(
workflow_item: &CFURL,
settings: PMPrintSettings,
pdf_file: &CFURL,
) -> OSStatus;
}
extern "C-unwind" {
#[cfg(all(feature = "PMDefinitions", feature = "objc2-core-graphics"))]
pub fn PMPrinterPrintWithProvider(
printer: PMPrinter,
settings: PMPrintSettings,
format: PMPageFormat,
mime_type: &CFString,
provider: &CGDataProvider,
) -> OSStatus;
}
extern "C-unwind" {
#[cfg(feature = "PMDefinitions")]
pub fn PMPrinterPrintWithFile(
printer: PMPrinter,
settings: PMPrintSettings,
format: PMPageFormat,
mime_type: Option<&CFString>,
file_url: &CFURL,
) -> OSStatus;
}
extern "C-unwind" {
#[cfg(feature = "PMDefinitions")]
pub fn PMPrinterWritePostScriptToURL(
printer: PMPrinter,
settings: PMPrintSettings,
format: PMPageFormat,
mime_type: Option<&CFString>,
source_file_url: &CFURL,
destination_file_url: &CFURL,
) -> OSStatus;
}
extern "C-unwind" {
#[cfg(feature = "PMDefinitions")]
pub fn PMPrintSettingsToOptions(
settings: PMPrintSettings,
options: NonNull<*mut c_char>,
) -> OSStatus;
}
extern "C-unwind" {
#[cfg(feature = "PMDefinitions")]
pub fn PMPrintSettingsToOptionsWithPrinterAndPageFormat(
settings: PMPrintSettings,
printer: PMPrinter,
page_format: PMPageFormat,
options: NonNull<*mut c_char>,
) -> OSStatus;
}
extern "C-unwind" {
#[cfg(feature = "PMDefinitions")]
pub fn PMPrinterSendCommand(
printer: PMPrinter,
command_string: &CFString,
job_title: Option<&CFString>,
options: Option<&CFDictionary>,
) -> OSStatus;
}
extern "C-unwind" {
#[cfg(feature = "PMDefinitions")]
pub fn PMPrinterCopyState(
printer: PMPrinter,
state_dict: NonNull<*const CFDictionary>,
) -> OSStatus;
}
extern "C-unwind" {
#[cfg(feature = "PMDefinitions")]
pub fn PMCopyAvailablePPDs(domain: PMPPDDomain, ppds: NonNull<*const CFArray>) -> OSStatus;
}
extern "C-unwind" {
pub fn PMCopyLocalizedPPD(ppd: &CFURL, localized_ppd: NonNull<*const CFURL>) -> OSStatus;
}
extern "C-unwind" {
pub fn PMCopyPPDData(ppd: &CFURL, data: NonNull<*const CFData>) -> OSStatus;
}
#[cfg(feature = "objc2-core-graphics")]
#[inline]
pub unsafe extern "C-unwind" fn PMCGImageCreateWithEPSDataProvider(
eps_data_provider: Option<&CGDataProvider>,
eps_preview: &CGImage,
) -> Option<CFRetained<CGImage>> {
extern "C-unwind" {
fn PMCGImageCreateWithEPSDataProvider(
eps_data_provider: Option<&CGDataProvider>,
eps_preview: &CGImage,
) -> Option<NonNull<CGImage>>;
}
let ret = unsafe { PMCGImageCreateWithEPSDataProvider(eps_data_provider, eps_preview) };
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}