objc2_application_services/generated/HIServices/
UniversalAccess.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use objc2_core_foundation::*;
5
6use crate::*;
7
8/// Defines the Universal Access zoom change focus type.
9///
10/// See also [Apple's documentation](https://developer.apple.com/documentation/applicationservices/uazoomchangefocustype?language=objc)
11pub type UAZoomChangeFocusType = u32;
12
13/// An event is requesting focus.
14///
15/// See also [Apple's documentation](https://developer.apple.com/documentation/applicationservices/kuazoomfocustypeother?language=objc)
16pub const kUAZoomFocusTypeOther: c_uint = 0;
17/// The text insertion point has moved.
18///
19/// See also [Apple's documentation](https://developer.apple.com/documentation/applicationservices/kuazoomfocustypeinsertionpoint?language=objc)
20pub const kUAZoomFocusTypeInsertionPoint: c_uint = 1;
21
22/// Determines if the Universal Access zoom feature is enabled.
23///
24/// Returns: Returns
25/// <code>
26/// true
27/// </code>
28/// if the Universal Access zoom feature is on,
29/// <code>
30/// false
31/// </code>
32/// if the zoom feature is off or if the user
33/// has zoomed all the way out.
34/// Availability: Available in Mac OS X v10.4 and later (not available in CarbonLib 1.x and not available for nonCarbon CFM).
35#[inline]
36pub unsafe extern "C-unwind" fn UAZoomEnabled() -> bool {
37    extern "C-unwind" {
38        fn UAZoomEnabled() -> Boolean;
39    }
40    let ret = unsafe { UAZoomEnabled() };
41    ret != 0
42}
43
44extern "C-unwind" {
45    /// Tells the Universal Access zoom feature where it should focus.
46    ///
47    /// This function tells Universal Access the frame of the element in focus and the
48    /// part of the element that should be in focus.
49    ///
50    /// Parameter `inRect`: The frame of the element in focus, in global 72-dot-per-inch (dpi) coordinates.
51    ///
52    /// 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,
53    /// and not just a smaller part of it, pass the
54    /// <code>
55    /// inRect
56    /// </code>
57    /// parameter and pass
58    /// <code>
59    /// NULL
60    /// </code>
61    /// for
62    /// <code>
63    /// inHighlightRect
64    /// </code>
65    /// .
66    ///
67    /// Parameter `inType`: A value of type
68    ///
69    /// ```text
70    ///  UAZoomChangeFocusType UAZoomChangeFocusType
71    /// ```
72    ///
73    /// .
74    ///
75    /// Returns: Returns
76    /// <code>
77    /// noErr
78    /// </code>
79    /// if there were no problems, if Universal Access Zoom is zoomed all the way out, or if the feature is off;
80    /// returns
81    /// <code>
82    /// paramErr
83    /// </code>
84    /// if
85    /// <code>
86    /// inRect
87    /// </code>
88    /// is
89    /// <code>
90    /// NULL
91    /// </code>
92    /// or if
93    /// <code>
94    /// inType
95    /// </code>
96    /// is out of range.
97    /// Availability: Available in Mac OS X v10.4 and later (not available in CarbonLib 1.x and not available for nonCarbon CFM).
98    ///
99    /// # Safety
100    ///
101    /// - `in_rect` must be a valid pointer.
102    /// - `in_highlight_rect` must be a valid pointer.
103    pub fn UAZoomChangeFocus(
104        in_rect: *const CGRect,
105        in_highlight_rect: *const CGRect,
106        in_type: UAZoomChangeFocusType,
107    ) -> OSStatus;
108}