axabl
accessibility abstraction layer
axabl is an abstraction layer over the accessibility API (and more) provided by Apple to make window management on macOS easier.
axabl provides calls to make general management easier, but it does not make reservations about how the windows themselves should be managed, stored in memory, or otherwise. Everything is left to the developer.
Initialization of axabl
axabl needs calls made to initialize specific dictionaries for stored observers and to do some integrity checks on the system to run. Likewise, for memory safety, calls should be made to deconstruct the abstraction layer. These are referred to as finalizing methods.
The order is not important, just that any particular part is initialized before being used (e.g. calls made in relation to AXUIElementRefs should initialize the AXUI API).
Initializes notification_center
and NS observers dictionary.
Uninstalls any remaining observers and releases memory allocated for observer dictionary.
Performs a trust check to ensure that accessibility permissions have been permitted by the system for the application. If the trust check passes, the observers dictionary is allocated and initialized, enabled the usage of the AXUI API.
Returns true
if AXUI trust check is passed. Returns false
otherwise.
Uninstalls any remaining observers and releases dictionary used to store observers.
NSWorkspace.h
Convenience function used to collect an array of applications running in the shared workspace.
Installs a given block for a given notification.
Uninstalls observers from a given notification name.
AXUIElement.h
Creates an accessibility object for a given process identifier (stored as an NSNumber). Returns AXUIElementRef.
Releases a given Accessibility UI object.
Encodes a given accessibility object into an NSObject. This call is a convenience method provided to assist in storing references to AXUI objects easily. Any encoded references must be decoded before being able to be accessed (axui_decode_element).
Decodes a given NSObject to an accessibility object.
Installs a given callback into a given accessibility object that responds to a given notification (CFStringRef).
Returns false
if the AXUIElementGetPid() or AXObserverAddNotification() calls fail.
Returns true
if successful.
Uninstalls observers attached to the given notification name from a given accessibility object.
Gets a stored structure from an accessibility object. Structures that need specific values decoded should use axui_decode_struct_value().
Sets and stores a structure with a given name for a given accessibility object. Values that need to be stored in a structure should be encoded using axui_encode_struct_value().
Encodes a value into a structure and returns the reference.
Decodes a value from a given structure to a given pointer.
Quartz.h
(tbd)