forked from AvaloniaUI/Avalonia
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
macOS: Don't include two windows in a11y tree. (AvaloniaUI#15899)
* Don't include two windows in a11y tree. `AvnRootAccessibilityElement` has been removed and now `AvnWindow` handles the accessibility protocol itself, exposing its children via the `AvnView`. * Remove hack now that issue is fixed. * Fix build errors after merge.
- Loading branch information
Showing
12 changed files
with
182 additions
and
167 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#pragma once | ||
#import <Cocoa/Cocoa.h> | ||
#import "avalonia-native.h" | ||
|
||
// Defines the interface between AvnAutomationNode and objects which implement | ||
// NSAccessibility such as AvnAccessibilityElement or AvnWindow. | ||
@protocol AvnAccessibility <NSAccessibility> | ||
@required | ||
- (void) raiseChildrenChanged; | ||
@optional | ||
- (void) raiseFocusChanged; | ||
- (void) raisePropertyChanged:(AvnAutomationProperty)property; | ||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#pragma once | ||
#include "avalonia-native.h" | ||
#include "AvnAccessibility.h" | ||
|
||
// Defines a means for managed code to raise accessibility events. | ||
class AvnAutomationNode : public ComSingleObject<IAvnAutomationNode, &IID_IAvnAutomationNode> | ||
{ | ||
public: | ||
FORWARD_IUNKNOWN() | ||
AvnAutomationNode(id <AvnAccessibility> owner) { _owner = owner; } | ||
AvnAccessibilityElement* GetOwner() { return _owner; } | ||
virtual void Dispose() override { _owner = nil; } | ||
virtual void ChildrenChanged () override { [_owner raiseChildrenChanged]; } | ||
virtual void PropertyChanged (AvnAutomationProperty property) override { [_owner raisePropertyChanged:property]; } | ||
virtual void FocusChanged () override { [_owner raiseFocusChanged]; } | ||
private: | ||
__strong id <AvnAccessibility> _owner; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,13 @@ | ||
#pragma once | ||
|
||
#import <Cocoa/Cocoa.h> | ||
#include "AvnAccessibility.h" | ||
NS_ASSUME_NONNULL_BEGIN | ||
|
||
class IAvnAutomationPeer; | ||
|
||
@interface AvnAccessibilityElement : NSAccessibilityElement | ||
+ (AvnAccessibilityElement *) acquire:(IAvnAutomationPeer *) peer; | ||
@interface AvnAccessibilityElement : NSAccessibilityElement <AvnAccessibility> | ||
+ (id _Nullable) acquire:(IAvnAutomationPeer *) peer; | ||
@end | ||
|
||
NS_ASSUME_NONNULL_END |
Oops, something went wrong.