Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
d8d4682
Add implementations
gcasa Sep 12, 2025
0e2965c
Fix errors and clean up
gcasa Sep 13, 2025
dcf971c
Use macro to call block
gcasa Sep 13, 2025
0a84e7c
Update Source/NSAccessibilityCustomAction.m
gcasa Sep 21, 2025
bac2da9
Update Source/NSAccessibilityElement.m
gcasa Sep 21, 2025
a4f66f0
Update Source/NSAccessibilityCustomRotor.m
gcasa Sep 21, 2025
10c9701
Change label assignment to use ASSIGNCOPY
gcasa Sep 21, 2025
3ef3ab5
Change accessibility setters to use ASSIGNCOPY
gcasa Sep 21, 2025
56d34c1
Fix compilation error
gcasa Sep 22, 2025
1cd788a
Fix compilation error
gcasa Sep 22, 2025
296d644
Merge branch 'master' into NSAccessibilityCustomRotor_branch
gcasa Sep 22, 2025
28d9776
Merge branch 'master' into NSAccessibilityCustomRotor_branch
gcasa Sep 29, 2025
3aae6c3
Add documentation
gcasa Sep 29, 2025
0d355e1
Add protocol methods
gcasa Sep 29, 2025
72b74a5
Add missing switch methods
gcasa Sep 29, 2025
eedf933
Add protocol methods
gcasa Sep 29, 2025
c87ea5e
Merge branch 'master' into NSAccessibilityCustomRotor_branch
gcasa Feb 17, 2026
880fddd
Fix block issues
gcasa Feb 17, 2026
a958eb4
Rest of the implementations of the category for NSAccessibility*. Pa…
gcasa Feb 18, 2026
c6dbcdf
Fix issue in for loop
gcasa Feb 18, 2026
7acb025
Implement all relevant category methods and tests.
gcasa Feb 19, 2026
08953b0
Minor fix for NSSlider.
gcasa Feb 19, 2026
5ef1c58
Fix for loop issue
gcasa Feb 19, 2026
6d56c31
Take out ObjC2.0 conventions
gcasa Feb 19, 2026
cfb318d
Fix ObjC2.0 issues
gcasa Feb 19, 2026
eaed5ae
Fix issue with GCC build
gcasa Feb 19, 2026
e08ed58
Move extra NSView ivars to another object which is lazily loaded, per…
gcasa Feb 20, 2026
dd575e6
Add missing files.
gcasa Feb 20, 2026
76e4624
Move to GNUstepGUI header dir
gcasa Feb 20, 2026
9ac91e1
Explicitly initialize to nil or NO or YES as appropriate
gcasa Feb 20, 2026
51064b1
Add author info.. sorry. Last commit
gcasa Feb 20, 2026
f445445
Add author
gcasa Feb 20, 2026
a9df483
Fixed header.
gcasa Feb 20, 2026
cf0910e
Add header to GNUstepGUI installs
gcasa Feb 20, 2026
6d36f1a
Fix use ASSIGNCOPY for setters
gcasa Feb 20, 2026
037a060
Update with fixes for latest comments
gcasa Feb 20, 2026
dece654
Remove try/catch
gcasa Feb 22, 2026
3ebd58e
Simplify the method that gets accessibilityValue
gcasa Feb 22, 2026
22b5261
Comment the code a little better
gcasa Feb 22, 2026
6e52897
Use TEST_RELEASE as suggested
gcasa Feb 22, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
101 changes: 101 additions & 0 deletions Headers/Additions/GNUstepGUI/GSViewAccessibilityData.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
/** <title>GSViewAccessibilityData</title>

<abstract>Encapsulates accessibility properties for NSView</abstract>

Author: Gregory Casamento <greg.casamento@gmail.com>
Copyright (C) 2026 Free Software Foundation, Inc.

This file is part of the GNUstep GUI Library.

This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public
License along with this library; see the file COPYING.LIB.
If not, see <http://www.gnu.org/licenses/> or write to the
Free Software Foundation, 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/

#ifndef _GNUstep_H_GSViewAccessibilityData
#define _GNUstep_H_GSViewAccessibilityData

#import <Foundation/NSObject.h>
#import <AppKit/NSAccessibilityConstants.h>

@class NSString;
@class NSArray;

/**
* GSViewAccessibilityData encapsulates all accessibility-related properties
* for NSView instances. This allows views to only allocate this object when
* accessibility functionality is actually needed, reducing memory overhead.
*/
@interface GSViewAccessibilityData : NSObject
{
@private
NSString *_accessibilityLabel;
NSString *_accessibilityValue;
NSString *_accessibilityHelp;
NSAccessibilityRole _accessibilityRole;
NSString *_accessibilityTitle;
NSString *_accessibilityRoleDescription;
NSString *_accessibilityIdentifier;
NSArray *_accessibilityUserInputLabels;
NSArray *_accessibilityChildren;
NSArray *_accessibilityCustomActions;
id _accessibilityParent; // weak reference
BOOL _accessibilityFocused;
BOOL _accessibilityEnabled;
}

// Property accessors
- (NSString *) accessibilityLabel;
- (void) setAccessibilityLabel: (NSString *)label;

- (NSString *) accessibilityValue;
- (void) setAccessibilityValue: (NSString *)value;

- (NSString *) accessibilityHelp;
- (void) setAccessibilityHelp: (NSString *)help;

- (NSAccessibilityRole) accessibilityRole;
- (void) setAccessibilityRole: (NSAccessibilityRole)role;

- (NSString *) accessibilityTitle;
- (void) setAccessibilityTitle: (NSString *)title;

- (NSString *) accessibilityRoleDescription;
- (void) setAccessibilityRoleDescription: (NSString *)roleDescription;

- (NSString *) accessibilityIdentifier;
- (void) setAccessibilityIdentifier: (NSString *)identifier;

- (NSArray *) accessibilityUserInputLabels;
- (void) setAccessibilityUserInputLabels: (NSArray *)labels;

- (NSArray *) accessibilityChildren;
- (void) setAccessibilityChildren: (NSArray *)children;

- (NSArray *) accessibilityCustomActions;
- (void) setAccessibilityCustomActions: (NSArray *)actions;

- (id) accessibilityParent;
- (void) setAccessibilityParent: (id)parent;

- (BOOL) isAccessibilityFocused;
- (void) setAccessibilityFocused: (BOOL)focused;

- (BOOL) isAccessibilityEnabled;
- (void) setAccessibilityEnabled: (BOOL)enabled;

@end

#endif // _GNUstep_H_GSViewAccessibilityData
10 changes: 10 additions & 0 deletions Headers/AppKit/NSAccessibilityConstants.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,16 @@
#import <AppKit/AppKitDefines.h>
#import <Foundation/Foundation.h>

// MARK: - Type Definitions

typedef NSString * NSAccessibilityRole;
typedef NSString * NSAccessibilitySubrole;
typedef NSString * NSAccessibilityAttribute;
typedef NSString * NSAccessibilityAction;
typedef NSString * NSAccessibilityNotification;

// MARK: - Error Information

APPKIT_EXPORT NSString *const NSAccessibilityErrorCodeExceptionInfo;

APPKIT_EXPORT NSString *const NSAccessibilityRoleAttribute;
Expand Down
83 changes: 72 additions & 11 deletions Headers/AppKit/NSAccessibilityCustomAction.h
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
/* Interface of class NSAccessibilityCustomAction
Copyright (C) 2020 Free Software Foundation, Inc.

By: Gregory John Casamento
Date: Mon 15 Jun 2020 03:18:47 AM EDT

This file is part of the GNUstep Library.

This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Expand All @@ -35,7 +35,13 @@ extern "C" {
#endif

DEFINE_BLOCK_TYPE(GSAccessibilityCustomActionHandler, void, BOOL);


/**
* This class defines an accessibility action to be taken for a
* given accessibility object. An instance of this object should
* be added to accessibilityCustomActions so that it is
* accessible by the NSAccessibilityCustomRotor.
*/
APPKIT_EXPORT_CLASS
@interface NSAccessibilityCustomAction : NSObject
{
Expand All @@ -45,25 +51,81 @@ APPKIT_EXPORT_CLASS
SEL _selector;
}

/**
* Create an action with a name and handler
*/
- (instancetype) initWithName: (NSString *)name
handler: (GSAccessibilityCustomActionHandler)handler;
handler: (GSAccessibilityCustomActionHandler)handler;

/**
* Create an action with a name, handler, and selector.
*/
- (instancetype) initWithName: (NSString *)name
target: (id)target
selector: (SEL)selector;
target: (id)target
selector: (SEL)selector;

/**
* Return name
*/
- (NSString *) name;

/**
* Set name
*/
- (void) setName: (NSString *)name;


/**
* Return handler
*/
- (GSAccessibilityCustomActionHandler) handler;

/**
* Set handler
*/
- (void) setHandler: (GSAccessibilityCustomActionHandler)handler;

/**
* Return target
*/
- (id) target;

/**
* Set target
*/
- (void) setTarget: (id)target;

/**
* Return selector
*/
- (SEL) selector;

/**
* Set selector
*/
- (void) setSelector: (SEL)selector;


@end

@interface NSAccessibilityCustomAction (GNUstep)

/**
* Convenience factory returning an autoreleased custom action that invokes a block.
*/
+ (instancetype) actionWithName: (NSString *)name
handler: (GSAccessibilityCustomActionHandler)handler;

/**
* Convenience factory returning an autoreleased custom action that sends selector to target.
*/
+ (instancetype) actionWithName: (NSString *)name
target: (id)target
selector: (SEL)selector;

/**
* Perform the custom action. Returns YES on success (block executed or target responded)
*/
- (BOOL) perform;

@end

#if defined(__cplusplus)
Expand All @@ -73,4 +135,3 @@ APPKIT_EXPORT_CLASS
#endif /* GS_API_MACOSX */

#endif /* _NSAccessibilityCustomAction_h_GNUSTEP_GUI_INCLUDE */

32 changes: 22 additions & 10 deletions Headers/AppKit/NSAccessibilityCustomRotor.h
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
/* Interface of class NSAccessibilityCustomRotor
Copyright (C) 2020 Free Software Foundation, Inc.

By: Gregory John Casamento
Date: Mon 15 Jun 2020 03:18:59 AM EDT

This file is part of the GNUstep Library.

This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Expand Down Expand Up @@ -46,14 +46,14 @@ extern "C" {
@class NSAccessibilityCustomRotorSearchParameters;
@class NSString;
@class NSAccessibilityElement;

enum
{
NSAccessibilityCustomRotorSearchDirectionPrevious,
NSAccessibilityCustomRotorSearchDirectionNext,
};
typedef NSInteger NSAccessibilityCustomRotorSearchDirection;

enum
{
NSAccessibilityCustomRotorTypeCustom = 0,
Expand All @@ -77,13 +77,19 @@ enum
NSAccessibilityCustomRotorTypeTextField,
NSAccessibilityCustomRotorTypeUnderlinedText,
NSAccessibilityCustomRotorTypeVisitedLink,
};
};
typedef NSInteger NSAccessibilityCustomRotorType;

// Rotor...
APPKIT_EXPORT_CLASS
@interface NSAccessibilityCustomRotor : NSObject

{
NSString *_label;
id<NSAccessibilityCustomRotorItemSearchDelegate> _itemSearchDelegate;
id<NSAccessibilityElementLoading> _itemLoadingDelegate;
NSAccessibilityCustomRotorType _type;
}

- (instancetype) initWithLabel: (NSString *)label
itemSearchDelegate: (id<NSAccessibilityCustomRotorItemSearchDelegate>)delegate;

Expand All @@ -101,20 +107,26 @@ APPKIT_EXPORT_CLASS

- (id<NSAccessibilityElementLoading>) itemLoadingDelegate;
- (void) setItemLoadingDelegate: (id<NSAccessibilityElementLoading>) delegate;

@end

// Results...
APPKIT_EXPORT_CLASS
@interface NSAccessibilityCustomRotorItemResult : NSObject
{
id<NSAccessibilityElement> _targetElement;
id<NSAccessibilityLoadingToken> _itemLoadingToken;
NSString *_customLabel;
NSRange _targetRange;
}

- (instancetype)initWithTargetElement:(id<NSAccessibilityElement>)targetElement;

- (instancetype)initWithItemLoadingToken: (id<NSAccessibilityLoadingToken>)token
customLabel: (NSString *)customLabel;

- (id<NSAccessibilityElement>) targetElement;

- (id<NSAccessibilityLoadingToken>) itemLoadingToken;

- (NSRange) targetRange;
Expand Down
Loading