objc2-application-services 0.3.2

Bindings to the ApplicationServices framework
Documentation
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ffi::*;
use objc2_core_foundation::*;

use crate::*;

/// Defines the Universal Access zoom change focus type.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/applicationservices/uazoomchangefocustype?language=objc)
pub type UAZoomChangeFocusType = u32;

/// An event is requesting focus.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/applicationservices/kuazoomfocustypeother?language=objc)
pub const kUAZoomFocusTypeOther: c_uint = 0;
/// The text insertion point has moved.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/applicationservices/kuazoomfocustypeinsertionpoint?language=objc)
pub const kUAZoomFocusTypeInsertionPoint: c_uint = 1;

/// Determines if the Universal Access zoom feature is enabled.
///
/// Returns: Returns
/// <code>
/// true
/// </code>
/// if the Universal Access zoom feature is on,
/// <code>
/// false
/// </code>
/// if the zoom feature is off or if the user
/// has zoomed all the way out.
/// Availability: Available in Mac OS X v10.4 and later (not available in CarbonLib 1.x and not available for nonCarbon CFM).
#[inline]
pub unsafe extern "C-unwind" fn UAZoomEnabled() -> bool {
    extern "C-unwind" {
        fn UAZoomEnabled() -> Boolean;
    }
    let ret = unsafe { UAZoomEnabled() };
    ret != 0
}

extern "C-unwind" {
    /// Tells the Universal Access zoom feature where it should focus.
    ///
    /// This function tells Universal Access the frame of the element in focus and the
    /// part of the element that should be in focus.
    ///
    /// Parameter `inRect`: The frame of the element in focus, in global 72-dot-per-inch (dpi) coordinates.
    ///
    /// Parameter `inHighlightRect`: The frame of the highlighted part of the element in focus, in global 72 dpi coordinates.  If the whole element is in focus,
    /// and not just a smaller part of it, pass the
    /// <code>
    /// inRect
    /// </code>
    /// parameter and pass
    /// <code>
    /// NULL
    /// </code>
    /// for
    /// <code>
    /// inHighlightRect
    /// </code>
    /// .
    ///
    /// Parameter `inType`: A value of type
    ///
    /// ```text
    ///  UAZoomChangeFocusType UAZoomChangeFocusType
    /// ```
    ///
    /// .
    ///
    /// Returns: Returns
    /// <code>
    /// noErr
    /// </code>
    /// if there were no problems, if Universal Access Zoom is zoomed all the way out, or if the feature is off;
    /// returns
    /// <code>
    /// paramErr
    /// </code>
    /// if
    /// <code>
    /// inRect
    /// </code>
    /// is
    /// <code>
    /// NULL
    /// </code>
    /// or if
    /// <code>
    /// inType
    /// </code>
    /// is out of range.
    /// Availability: Available in Mac OS X v10.4 and later (not available in CarbonLib 1.x and not available for nonCarbon CFM).
    ///
    /// # Safety
    ///
    /// - `in_rect` must be a valid pointer.
    /// - `in_highlight_rect` must be a valid pointer.
    pub fn UAZoomChangeFocus(
        in_rect: *const CGRect,
        in_highlight_rect: *const CGRect,
        in_type: UAZoomChangeFocusType,
    ) -> OSStatus;
}