use core::ffi::*;
use core::ptr::NonNull;
use objc2_core_foundation::*;
use crate::*;
extern "C" {
pub static kColorSyncDeviceID: &'static CFString;
}
extern "C" {
pub static kColorSyncDeviceClass: &'static CFString;
}
extern "C" {
pub static kColorSyncCameraDeviceClass: &'static CFString;
}
extern "C" {
pub static kColorSyncDisplayDeviceClass: &'static CFString;
}
extern "C" {
pub static kColorSyncPrinterDeviceClass: &'static CFString;
}
extern "C" {
pub static kColorSyncScannerDeviceClass: &'static CFString;
}
extern "C" {
pub static kColorSyncDeviceProfileURL: &'static CFString;
}
extern "C" {
pub static kColorSyncDeviceDescription: &'static CFString;
}
extern "C" {
pub static kColorSyncDeviceDescriptions: &'static CFString;
}
extern "C" {
pub static kColorSyncFactoryProfiles: &'static CFString;
}
extern "C" {
pub static kColorSyncCustomProfiles: &'static CFString;
}
extern "C" {
pub static kColorSyncDeviceModeDescription: &'static CFString;
}
extern "C" {
pub static kColorSyncDeviceModeDescriptions: &'static CFString;
}
extern "C" {
pub static kColorSyncDeviceDefaultProfileID: &'static CFString;
}
extern "C" {
pub static kColorSyncDeviceHostScope: &'static CFString;
}
extern "C" {
pub static kColorSyncDeviceUserScope: &'static CFString;
}
extern "C" {
pub static kColorSyncProfileHostScope: &'static CFString;
}
extern "C" {
pub static kColorSyncProfileUserScope: &'static CFString;
}
extern "C" {
pub static kColorSyncDeviceProfileIsFactory: &'static CFString;
}
extern "C" {
pub static kColorSyncDeviceProfileIsDefault: &'static CFString;
}
extern "C" {
pub static kColorSyncDeviceProfileIsCurrent: &'static CFString;
}
extern "C" {
pub static kColorSyncDeviceProfileID: &'static CFString;
}
extern "C" {
pub static kColorSyncDeviceRegisteredNotification: &'static CFString;
}
extern "C" {
pub static kColorSyncDeviceUnregisteredNotification: &'static CFString;
}
extern "C" {
pub static kColorSyncDeviceProfilesNotification: &'static CFString;
}
extern "C" {
pub static kColorSyncDisplayDeviceProfilesNotification: &'static CFString;
}
extern "C" {
pub static kColorSyncProfileRepositoryChangeNotification: &'static CFString;
}
extern "C" {
pub static kColorSyncRegistrationUpdateWindowServer: &'static CFString;
}
extern "C-unwind" {
pub fn ColorSyncRegisterDevice(
device_class: &CFString,
device_id: &CFUUID,
device_info: &CFDictionary,
) -> bool;
}
extern "C-unwind" {
pub fn ColorSyncUnregisterDevice(device_class: &CFString, device_id: &CFUUID) -> bool;
}
extern "C-unwind" {
pub fn ColorSyncDeviceSetCustomProfiles(
device_class: &CFString,
device_id: &CFUUID,
profile_info: &CFDictionary,
) -> bool;
}
#[inline]
pub unsafe extern "C-unwind" fn ColorSyncDeviceCopyDeviceInfo(
device_class: &CFString,
dev_id: &CFUUID,
) -> Option<CFRetained<CFDictionary>> {
extern "C-unwind" {
fn ColorSyncDeviceCopyDeviceInfo(
device_class: &CFString,
dev_id: &CFUUID,
) -> Option<NonNull<CFDictionary>>;
}
let ret = unsafe { ColorSyncDeviceCopyDeviceInfo(device_class, dev_id) };
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}
pub type ColorSyncDeviceProfileIterateCallback =
Option<unsafe extern "C-unwind" fn(NonNull<CFDictionary>, *mut c_void) -> bool>;
extern "C-unwind" {
pub fn ColorSyncIterateDeviceProfiles(
call_back: ColorSyncDeviceProfileIterateCallback,
user_info: *mut c_void,
);
}
#[inline]
pub unsafe extern "C-unwind" fn CGDisplayCreateUUIDFromDisplayID(
display_id: u32,
) -> CFRetained<CFUUID> {
extern "C-unwind" {
fn CGDisplayCreateUUIDFromDisplayID(display_id: u32) -> Option<NonNull<CFUUID>>;
}
let ret = unsafe { CGDisplayCreateUUIDFromDisplayID(display_id) };
let ret = ret.expect("function was marked as returning non-null, but actually returned NULL");
unsafe { CFRetained::from_raw(ret) }
}
extern "C-unwind" {
pub fn CGDisplayGetDisplayIDFromUUID(uuid: &CFUUID) -> u32;
}