Accessibility Abstraction Layer (axabl) for macOS window management

Related tags

Keychain axabl
Overview

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).

void initialize_nsworkspace(void);

Initializes notification_center and NS observers dictionary.

void finalize_nsworkspace(void);

Uninstalls any remaining observers and releases memory allocated for observer dictionary.

Boolean initialize_axui(void);

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.

void finalize_axui(void);

Uninstalls any remaining observers and releases dictionary used to store observers.


NSWorkspace.h

NSArray *nsworkspace_running_applications(void);

Convenience function used to collect an array of applications running in the shared workspace.

void nsworkspace_install_observer(NSNotificationName, void(^)(NSNotification *));

Installs a given block for a given notification.

void nsworkspace_uninstall_observer(NSNotificationName);

Uninstalls observers from a given notification name.


AXUIElement.h

AXUIElementRef axui_create_application_element(id);

Creates an accessibility object for a given process identifier (stored as an NSNumber). Returns AXUIElementRef.

void axui_destroy_application_element(id);

Releases a given Accessibility UI object.

id axui_encode_element(AXUIElementRef);

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).

AXUIElementRef axui_decode_element(id);

Decodes a given NSObject to an accessibility object.

bool axui_install_observer(AXUIElementRef, CFStringRef, AXObserverCallback);

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.

void axui_uninstall_observer(AXUIElementRef, CFStringRef);

Uninstalls observers attached to the given notification name from a given accessibility object.

CFTypeRef axui_get_attribute(AXUIElementRef, CFStringRef);

Gets a stored structure from an accessibility object. Structures that need specific values decoded should use axui_decode_struct_value().

void axui_set_attribute(AXUIElementRef, CFStringRef, CFTypeRef);

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().

AXValueRef axui_encode_struct_value(AXValueType, void*);

Encodes a value into a structure and returns the reference.

void axui_decode_struct_value(AXValueRef, AXValueType, void*);

Decodes a value from a given structure to a given pointer.


Quartz.h

(tbd)

You might also like...
Reactive WebSockets - A lightweight abstraction layer over Starscream to make it reactive.

RxWebSocket Reactive extensions for websockets. A lightweight abstraction layer over Starscream to make it reactive. Installation RxWebSocket is avail

Nora is a Firebase abstraction layer for FirebaseDatabase and FirebaseStorage
Nora is a Firebase abstraction layer for FirebaseDatabase and FirebaseStorage

Nora is a Firebase abstraction layer for working with FirebaseDatabase and FirebaseStorage. Stop spending all that time cleaning up your view controll

NSURLSession network abstraction layer, using Codable and Decodable for response and Encodable for request. ⚙️🚀
NSURLSession network abstraction layer, using Codable and Decodable for response and Encodable for request. ⚙️🚀

SONetworking NSURLSession network abstraction layer, using Codable and Decodable for response and Encodable for request. Project Folder and File Struc

Network abstraction layer written in Swift.
Network abstraction layer written in Swift.

Moya 15.0.0 A Chinese version of this document can be found here. You're a smart developer. You probably use Alamofire to abstract away access to URLS

☂️ Analytics abstraction layer for Swift

☂️ Umbrella Analytics abstraction layer for Swift. Inspired by Moya. Table of Contents Why? Features At a Glance Getting Started Defining Events Using

Analytics layer abstraction, abstract analytics reporters and collect domain-driven analytic events.

🐙 Tentacles Current State: Work in Progress Documentation & Tests(100% completed, but needs refactoring and structuring) started but not done yet, im

APIProvider - API Provider Package for easier API management inspired by abstraction

APIProvider Using APIProvider you can easily communicate with all API endpoints

An ambient light accessibility framework for iOS.
An ambient light accessibility framework for iOS.

Ambience Brightness aware accessibility theme switching without coding. Special thanks I'd like to thank Meng To and Marcos Griselli and all the Desig

SwiftUICharts - A simple line and bar charting library that supports accessibility written using SwiftUI.
SwiftUICharts - A simple line and bar charting library that supports accessibility written using SwiftUI.

SwiftUICharts - A simple line and bar charting library that supports accessibility written using SwiftUI.

This project is built to show how to support accessibility features in iOS applications in UIKit.
This project is built to show how to support accessibility features in iOS applications in UIKit.

ACCESSIBILITY EXAMPLE This project is built to show how to support accessibility features in iOS applications in a blog post. For the sake of Accessib

Keep track of accessibility settings, leverage high contrast colors, and use scalable fonts to enable users with disabilities to use your app.
Keep track of accessibility settings, leverage high contrast colors, and use scalable fonts to enable users with disabilities to use your app.

Accessibility for iOS, macOS, tvOS, and watchOS 🎉 What's new in Capable 2.0 🎉 Here are the most important changes: 🏛 New framework architecture and

⚙ Add a preferences window to your macOS app in minutes
⚙ Add a preferences window to your macOS app in minutes

Preferences Add a preferences window to your macOS app in minutes Just pass in some view controllers and this package will take care of the rest. Requ

A window arrangement manager for macOS like BetterSnapTool and Magnet
A window arrangement manager for macOS like BetterSnapTool and Magnet

A window arrangement manager for macOS like BetterSnapTool and Magnet. You can split the foremost window to the left half of the screen, the left two-thirds, etc.

Window preview app for MacOS (on the dock) using AltTab.

DockAltTab The #1 Window manager/Task switcher & Companion for AltTab v1.1 download link https://github.com/steventheworker/DockAltTab/releases/downlo

macOS SwiftUI manager new window's life
macOS SwiftUI manager new window's life

WindowManager macOS swiftUI manager window's life cycle Usage // open DocumentsView WindowUtil.makeWindow(MyDocumentsView.self, viewType: .document)

Demonstration of using UIWindowScene and SwiftUI to provide a native-looking Mac preferences window in Catalyst
Demonstration of using UIWindowScene and SwiftUI to provide a native-looking Mac preferences window in Catalyst

CatalystPrefsWindow Ever wondered how to create a more Mac-like preferences window for Catalyst? Perhaps Settings Bundles are too limiting for the kin

Creating a blurred window background in Mac Catalyst
Creating a blurred window background in Mac Catalyst

TransparentChrome In response to a developer question, I looked for the easiest way to provide a translucent full-window chrome with a blurred backgro

A simple deamon that restores your window positions on external monitors.

Memmon Memmon remembers what your Mac forgets – A simple deamon that restores your window positions on external monitors. FAQ Why‽ I am frustrated! Wh

Droar is a modular, single-line installation debugging window
Droar is a modular, single-line installation debugging window

Droar is a modular, single-line installation debugging window. Overview The idea behind Droar is simple: during app deployment stages, adding quick ap

Owner
Web developer turned lowly C developer.
null
A Layer-2 framework built over Keychain API which helps in using Keychain in all your Apple devices with easiness and flexibility.

Keychain Manager Keychain Manager is a Layer-2 framework built over Keychain API which helps in using Keychain in all your Apple devices with easiness

Gokul Nair 14 Jan 1, 2023
Simple Swift wrapper for Keychain that works on iOS, watchOS, tvOS and macOS.

KeychainAccess KeychainAccess is a simple Swift wrapper for Keychain that works on iOS and OS X. Makes using Keychain APIs extremely easy and much mor

Kishikawa Katsumi 7.2k Jan 5, 2023
Valet lets you securely store data in the iOS, tvOS, or macOS Keychain without knowing a thing about how the Keychain works. It’s easy. We promise.

Valet Valet lets you securely store data in the iOS, tvOS, watchOS, or macOS Keychain without knowing a thing about how the Keychain works. It’s easy.

Square 3.8k Jan 4, 2023
UICKeyChainStore is a simple wrapper for Keychain on iOS, watchOS, tvOS and macOS. Makes using Keychain APIs as easy as NSUserDefaults.

UICKeyChainStore UICKeyChainStore is a simple wrapper for Keychain that works on iOS and OS X. Makes using Keychain APIs as easy as NSUserDefaults. Lo

Kishikawa Katsumi 3.1k Dec 28, 2022
🛶Shallows is a generic abstraction layer over lightweight data storage and persistence.

Shallows Shallows is a generic abstraction layer over lightweight data storage and persistence. It provides a Storage<Key, Value> type, instances of w

Oleg Dreyman 620 Dec 3, 2022
Type-safe networking abstraction layer that associates request type with response type.

APIKit APIKit is a type-safe networking abstraction layer that associates request type with response type. // SearchRepositoriesRequest conforms to Re

Yosuke Ishikawa 1.9k Dec 30, 2022
Dratini is a neat network abstraction layer.

Dratini Dratini is a neat network abstraction layer. If you are looking for a solution to make your network layer neat, Dratini is your choice. Dratin

Kevin Lin 37 Jan 29, 2022
Network abstraction layer written in Swift.

Moya 14.0.0 A Chinese version of this document can be found here. You're a smart developer. You probably use Alamofire to abstract away access to URLS

Moya 14.4k Jan 1, 2023
Elegant network abstraction layer in Swift.

Elegant network abstraction layer in Swift. 中文 Design Features Requirements Communication Installation Usage Base Usage - Target - Request - Download

null 100 Dec 9, 2022
Lightweight network abstraction layer, written on top of Alamofire

TRON is a lightweight network abstraction layer, built on top of Alamofire. It can be used to dramatically simplify interacting with RESTful JSON web-

MLSDev 528 Dec 26, 2022