use core::ptr::NonNull;
use objc2_core_foundation::*;
#[cfg(feature = "objc2-core-graphics")]
use objc2_core_graphics::*;
use crate::*;
#[cfg(feature = "QLThumbnail")]
impl QLThumbnail {
#[doc(alias = "QLThumbnailImageCreate")]
#[cfg(feature = "objc2-core-graphics")]
#[deprecated = "Use QuickLookThumbnailing to generate thumbnails for files."]
#[inline]
pub unsafe fn image_create(
allocator: Option<&CFAllocator>,
url: Option<&CFURL>,
max_thumbnail_size: CGSize,
options: Option<&CFDictionary>,
) -> Option<CFRetained<CGImage>> {
extern "C-unwind" {
fn QLThumbnailImageCreate(
allocator: Option<&CFAllocator>,
url: Option<&CFURL>,
max_thumbnail_size: CGSize,
options: Option<&CFDictionary>,
) -> Option<NonNull<CGImage>>;
}
let ret = unsafe { QLThumbnailImageCreate(allocator, url, max_thumbnail_size, options) };
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}
}
extern "C" {
pub static kQLThumbnailOptionIconModeKey: Option<&'static CFString>;
}
extern "C" {
pub static kQLThumbnailOptionScaleFactorKey: Option<&'static CFString>;
}
#[cfg(feature = "objc2-core-graphics")]
#[deprecated = "renamed to `QLThumbnail::image_create`"]
#[inline]
pub unsafe extern "C-unwind" fn QLThumbnailImageCreate(
allocator: Option<&CFAllocator>,
url: Option<&CFURL>,
max_thumbnail_size: CGSize,
options: Option<&CFDictionary>,
) -> Option<CFRetained<CGImage>> {
extern "C-unwind" {
fn QLThumbnailImageCreate(
allocator: Option<&CFAllocator>,
url: Option<&CFURL>,
max_thumbnail_size: CGSize,
options: Option<&CFDictionary>,
) -> Option<NonNull<CGImage>>;
}
let ret = unsafe { QLThumbnailImageCreate(allocator, url, max_thumbnail_size, options) };
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}