diff --git a/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/ButtonAccessibility.h b/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/ButtonAccessibility.h index 6ee1de13f6f..b4065511eb0 100644 --- a/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/ButtonAccessibility.h +++ b/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/ButtonAccessibility.h @@ -31,6 +31,7 @@ @interface ButtonAccessibility : CommonComponentAccessibility { }; -- (nullable NSString *)accessibilityLabel; +- (NSAccessibilityRole _Nonnull)accessibilityRole; +- (NSString * _Nullable)accessibilityLabel; - (BOOL)accessibilityPerformPress; @end diff --git a/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/ButtonAccessibility.m b/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/ButtonAccessibility.m index 3c4a896b7a8..912cef1fa67 100644 --- a/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/ButtonAccessibility.m +++ b/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/ButtonAccessibility.m @@ -29,7 +29,12 @@ * Implementation of the accessibility peer for the pushbutton role */ @implementation ButtonAccessibility -- (nullable NSString *)accessibilityLabel +- (NSAccessibilityRole _Nonnull)accessibilityRole +{ + return NSAccessibilityButtonRole; +} + +- (NSString * _Nullable)accessibilityLabel { return [self accessibilityTitleAttribute]; } diff --git a/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/CheckboxAccessibility.h b/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/CheckboxAccessibility.h index 835567c01c1..50c017299ad 100644 --- a/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/CheckboxAccessibility.h +++ b/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/CheckboxAccessibility.h @@ -28,5 +28,6 @@ @interface CheckboxAccessibility : ButtonAccessibility { }; -- (id)accessibilityValue; +- (NSAccessibilityRole _Nonnull)accessibilityRole; +- (id _Nonnull)accessibilityValue; @end diff --git a/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/CheckboxAccessibility.m b/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/CheckboxAccessibility.m index c61d3a97a8a..bbfaf39fe66 100644 --- a/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/CheckboxAccessibility.m +++ b/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/CheckboxAccessibility.m @@ -31,8 +31,12 @@ * Implementation of the accessibility peer for the checkbox role */ @implementation CheckboxAccessibility +- (NSAccessibilityRole _Nonnull)accessibilityRole +{ + return NSAccessibilityCheckBoxRole; +} -- (id) accessibilityValue +- (id _Nonnull) accessibilityValue { AWT_ASSERT_APPKIT_THREAD; return [self accessibilityValueAttribute]; diff --git a/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/CommonComponentAccessibility.h b/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/CommonComponentAccessibility.h index dadb8fca7ac..4140e0ea5f7 100644 --- a/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/CommonComponentAccessibility.h +++ b/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/CommonComponentAccessibility.h @@ -41,7 +41,7 @@ + (void) initializeRolesMap; + (JavaComponentAccessibility * _Nullable) getComponentAccessibility:(NSString * _Nonnull)role; - (NSRect)accessibilityFrame; -- (nullable id)accessibilityParent; +- (id _Nullable)accessibilityParent; - (BOOL)performAccessibleAction:(int)index; - (BOOL)isAccessibilityElement; @end diff --git a/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/CommonComponentAccessibility.m b/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/CommonComponentAccessibility.m index 7dcdb276ea1..0074f67f90a 100644 --- a/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/CommonComponentAccessibility.m +++ b/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/CommonComponentAccessibility.m @@ -48,7 +48,7 @@ + (void) initializeRolesMap { /* * Here we should keep all the mapping between the accessibility roles and implementing classes */ - rolesMap = [[NSMutableDictionary alloc] initWithCapacity:29]; + rolesMap = [[NSMutableDictionary alloc] initWithCapacity:37]; [rolesMap setObject:@"ButtonAccessibility" forKey:@"pushbutton"]; [rolesMap setObject:@"ImageAccessibility" forKey:@"icon"]; @@ -61,6 +61,14 @@ + (void) initializeRolesMap { // [rolesMap setObject:@"SliderAccessibility" forKey:@"slider"]; [rolesMap setObject:@"ScrollAreaAccessibility" forKey:@"scrollpane"]; [rolesMap setObject:@"ScrollBarAccessibility" forKey:@"scrollbar"]; + [rolesMap setObject:@"GroupAccessibility" forKey:@"awtcomponent"]; + [rolesMap setObject:@"GroupAccessibility" forKey:@"canvas"]; + [rolesMap setObject:@"GroupAccessibility" forKey:@"groupbox"]; + [rolesMap setObject:@"GroupAccessibility" forKey:@"internalframe"]; + [rolesMap setObject:@"GroupAccessibility" forKey:@"swingcomponent"]; + [rolesMap setObject:@"ToolbarAccessibility" forKey:@"toolbar"]; + [rolesMap setObject:@"SplitpaneAccessibility" forKey:@"splitpane"]; + [rolesMap setObject:@"StatusbarAccessibility" forKey:@"statusbar"]; /* * All the components below should be ignored by the accessibility subsystem, @@ -158,7 +166,7 @@ - (NSRect)accessibilityFrame return NSMakeRect(point.x, point.y, size.width, size.height); } -- (nullable id)accessibilityParent +- (id _Nullable)accessibilityParent { return [self accessibilityParentAttribute]; } diff --git a/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/CommonTextAccessibility.h b/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/CommonTextAccessibility.h index c40467cf7bf..667e37f55cd 100644 --- a/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/CommonTextAccessibility.h +++ b/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/CommonTextAccessibility.h @@ -34,9 +34,9 @@ @interface CommonTextAccessibility : CommonComponentAccessibility { } -- (nullable NSString *)accessibilityValueAttribute; +- (NSString * _Nullable)accessibilityValueAttribute; - (NSRange)accessibilityVisibleCharacterRangeAttribute; -- (nullable NSString *)accessibilityStringForRangeAttribute:(NSRange)parameter; +- (NSString * _Nullable)accessibilityStringForRangeAttribute:(NSRange)parameter; @end #endif diff --git a/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/GroupAccessibility.h b/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/GroupAccessibility.h new file mode 100644 index 00000000000..e89e0179082 --- /dev/null +++ b/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/GroupAccessibility.h @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code 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 General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +#import "JavaComponentAccessibility.h" +#import "CommonComponentAccessibility.h" + +#import + +@interface GroupAccessibility : CommonComponentAccessibility { + +}; +- (NSAccessibilityRole _Nonnull)accessibilityRole; +- (NSArray * _Nullable)accessibilityChildren; +@end diff --git a/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/GroupAccessibility.m b/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/GroupAccessibility.m new file mode 100644 index 00000000000..1a33b6a003a --- /dev/null +++ b/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/GroupAccessibility.m @@ -0,0 +1,58 @@ +/* + * Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code 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 General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +#import "GroupAccessibility.h" +#import "JNIUtilities.h" +#import "ThreadUtilities.h" +/* + * This is the protocol for the components that contain children. + * Basic logic of accessibilityChildren might be overridden in the specific implementing + * classes reflecting the logic of the class. + */ +@implementation GroupAccessibility +- (NSAccessibilityRole _Nonnull)accessibilityRole +{ + return NSAccessibilityGroupRole; +} + +/* + * Return all non-ignored children. + */ +- (NSArray *)accessibilityChildren { + JNIEnv *env = [ThreadUtilities getJNIEnv]; + + NSArray *children = [JavaComponentAccessibility childrenOfParent:self + withEnv:env + withChildrenCode:JAVA_AX_ALL_CHILDREN + allowIgnored:NO]; + + if ([children count] == 0) { + return nil; + } else { + return children; + } +} + +@end diff --git a/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/ImageAccessibility.h b/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/ImageAccessibility.h index fcfe9ef281c..5d4a53914ad 100644 --- a/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/ImageAccessibility.h +++ b/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/ImageAccessibility.h @@ -31,5 +31,6 @@ @interface ImageAccessibility : CommonComponentAccessibility { }; -- (nullable NSString *)accessibilityLabel; +- (NSAccessibilityRole _Nonnull)accessibilityRole; +- (NSString * _Nullable)accessibilityLabel; @end diff --git a/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/ImageAccessibility.m b/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/ImageAccessibility.m index de6fcc951f7..4882d709a01 100644 --- a/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/ImageAccessibility.m +++ b/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/ImageAccessibility.m @@ -29,7 +29,12 @@ * Implementation of the accessibility peer for the icon role */ @implementation ImageAccessibility -- (nullable NSString *)accessibilityLabel +- (NSAccessibilityRole _Nonnull)accessibilityRole +{ + return NSAccessibilityImageRole; +} + +- (NSString * _Nullable)accessibilityLabel { return [self accessibilityTitleAttribute]; } diff --git a/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/RadiobuttonAccessibility.h b/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/RadiobuttonAccessibility.h index 80835d810b4..f178ed25949 100644 --- a/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/RadiobuttonAccessibility.h +++ b/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/RadiobuttonAccessibility.h @@ -28,5 +28,6 @@ @interface RadiobuttonAccessibility : ButtonAccessibility { }; -- (id)accessibilityValue; +- (NSAccessibilityRole _Nonnull)accessibilityRole; +- (id _Nonnull)accessibilityValue; @end diff --git a/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/RadiobuttonAccessibility.m b/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/RadiobuttonAccessibility.m index 79325551fa9..8254b63df3d 100644 --- a/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/RadiobuttonAccessibility.m +++ b/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/RadiobuttonAccessibility.m @@ -31,8 +31,12 @@ * Implementation of the accessibility peer for the radiobutton role */ @implementation RadiobuttonAccessibility +- (NSAccessibilityRole _Nonnull)accessibilityRole +{ + return NSAccessibilityRadioButtonRole; +} -- (id) accessibilityValue +- (id _Nonnull) accessibilityValue { AWT_ASSERT_APPKIT_THREAD; return [self accessibilityValueAttribute]; diff --git a/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/ScrollAreaAccessibility.h b/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/ScrollAreaAccessibility.h index 803c83ba9fe..07837c8c967 100644 --- a/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/ScrollAreaAccessibility.h +++ b/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/ScrollAreaAccessibility.h @@ -31,7 +31,7 @@ @interface ScrollAreaAccessibility : CommonComponentAccessibility { }; -- (NSString * _Nonnull)accessibilityRole; +- (NSAccessibilityRole _Nonnull)accessibilityRole; - (NSArray * _Nullable)accessibilityContents; - (id _Nullable)accessibilityHorizontalScrollBar; - (id _Nullable)accessibilityVerticalScrollBar; diff --git a/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/ScrollAreaAccessibility.m b/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/ScrollAreaAccessibility.m index f1c94247650..71c8de3de6a 100644 --- a/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/ScrollAreaAccessibility.m +++ b/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/ScrollAreaAccessibility.m @@ -83,9 +83,9 @@ - (id _Nullable)getScrollBarwithOrientation:(enum NSAccessibilityOrientation)ori return nil; } -- (NSString * _Nonnull)accessibilityRole +- (NSAccessibilityRole _Nonnull)accessibilityRole { - return [self accessibilityRoleAttribute]; + return NSAccessibilityScrollAreaRole; } - (NSArray * _Nullable)accessibilityContents diff --git a/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/ScrollBarAccessibility.h b/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/ScrollBarAccessibility.h index 5ff537545ea..a188928f464 100644 --- a/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/ScrollBarAccessibility.h +++ b/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/ScrollBarAccessibility.h @@ -31,6 +31,6 @@ @interface ScrollBarAccessibility : CommonComponentAccessibility { }; -- (NSString * _Nonnull)accessibilityRole; +- (NSAccessibilityRole _Nonnull)accessibilityRole; - (NSAccessibilityOrientation) accessibilityOrientation; @end diff --git a/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/ScrollBarAccessibility.m b/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/ScrollBarAccessibility.m index b500425f50a..113e8336352 100644 --- a/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/ScrollBarAccessibility.m +++ b/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/ScrollBarAccessibility.m @@ -32,9 +32,9 @@ */ @implementation ScrollBarAccessibility -- (NSString * _Nonnull)accessibilityRole +- (NSAccessibilityRole _Nonnull)accessibilityRole { - return [self accessibilityRoleAttribute]; + return NSAccessibilityScrollBarRole; } - (NSAccessibilityOrientation) accessibilityOrientation diff --git a/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/SliderAccessibility.h b/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/SliderAccessibility.h new file mode 100644 index 00000000000..7af32d572e2 --- /dev/null +++ b/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/SliderAccessibility.h @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code 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 General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +#import "JavaComponentAccessibility.h" +#import "CommonComponentAccessibility.h" + +#import + +@interface SliderAccessibility : CommonComponentAccessibility { + +}; +- (NSAccessibilityRole _Nonnull)accessibilityRole; +- (NSString * _Nullable)accessibilityLabel; +- (id _Nullable)accessibilityValue; +- (BOOL)accessibilityPerformDecrement; +- (BOOL)accessibilityPerformIncrement; +@end diff --git a/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/SpinboxAccessibility.h b/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/SpinboxAccessibility.h index 9476a7ed83a..5503dc43cec 100644 --- a/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/SpinboxAccessibility.h +++ b/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/SpinboxAccessibility.h @@ -31,9 +31,9 @@ @interface SpinboxAccessibility : CommonComponentAccessibility { }; - -- (nullable NSString *)accessibilityLabel; -- (nullable id)accessibilityValue; +- (NSAccessibilityRole _Nonnull)accessibilityRole; +- (NSString * _Nullable)accessibilityLabel; +- (id _Nullable)accessibilityValue; - (BOOL)accessibilityPerformDecrement; - (BOOL)accessibilityPerformIncrement; @end diff --git a/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/SpinboxAccessibility.m b/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/SpinboxAccessibility.m index 49e9e8cde30..7290a2ee848 100644 --- a/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/SpinboxAccessibility.m +++ b/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/SpinboxAccessibility.m @@ -32,12 +32,17 @@ * Implementation of the accessibility peer for the spinner role */ @implementation SpinboxAccessibility -- (nullable NSString *)accessibilityLabel +- (NSAccessibilityRole _Nonnull)accessibilityRole +{ + return NSAccessibilityIncrementorRole; +} + +- (NSString * _Nullable)accessibilityLabel { return [self accessibilityTitleAttribute]; } -- (nullable id)accessibilityValue +- (id _Nullable)accessibilityValue { return [self accessibilityValueAttribute]; } diff --git a/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/SplitpaneAccessibility.h b/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/SplitpaneAccessibility.h new file mode 100644 index 00000000000..09a7790dc80 --- /dev/null +++ b/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/SplitpaneAccessibility.h @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code 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 General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +#import "JavaComponentAccessibility.h" +#import "GroupAccessibility.h" + +#import + +@interface SplitpaneAccessibility : GroupAccessibility { + +}; +- (NSAccessibilityRole _Nonnull)accessibilityRole; +@end diff --git a/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/SplitpaneAccessibility.m b/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/SplitpaneAccessibility.m new file mode 100644 index 00000000000..253667fa9e1 --- /dev/null +++ b/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/SplitpaneAccessibility.m @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code 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 General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +#import "SplitpaneAccessibility.h" + +/* + * Implementation of the accessibility peer for the Splitpane role + */ +@implementation SplitpaneAccessibility + +- (NSAccessibilityRole _Nonnull)accessibilityRole +{ + return NSAccessibilitySplitGroupRole; +} + +@end diff --git a/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/StaticTextAccessibility.h b/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/StaticTextAccessibility.h index e1724542408..17fb3eb778c 100644 --- a/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/StaticTextAccessibility.h +++ b/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/StaticTextAccessibility.h @@ -34,8 +34,9 @@ @interface StaticTextAccessibility : CommonTextAccessibility { }; -- (nullable NSString *)accessibilityAttributedString:(NSRange)range; -- (nullable NSString *)accessibilityValue; +- (NSAccessibilityRole _Nonnull)accessibilityRole; +- (NSString * _Nullable)accessibilityAttributedStringForRange:(NSRange)range; +- (NSString * _Nullable)accessibilityValue; - (NSRange)accessibilityVisibleCharacterRange; @end #endif diff --git a/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/StaticTextAccessibility.m b/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/StaticTextAccessibility.m index 470f0799c38..8e905c45c64 100644 --- a/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/StaticTextAccessibility.m +++ b/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/StaticTextAccessibility.m @@ -27,12 +27,17 @@ @implementation StaticTextAccessibility -- (nullable NSString *)accessibilityAttributedString:(NSRange)range +- (NSAccessibilityRole _Nonnull)accessibilityRole +{ + return NSAccessibilityStaticTextRole; +} + +- (NSString * _Nullable)accessibilityAttributedStringForRange:(NSRange)range { return [self accessibilityStringForRangeAttribute:range]; } -- (nullable NSString *)accessibilityValue +- (NSString * _Nullable)accessibilityValue { return [self accessibilityValueAttribute]; } diff --git a/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/StatusbarAccessibility.h b/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/StatusbarAccessibility.h new file mode 100644 index 00000000000..f275c6b9800 --- /dev/null +++ b/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/StatusbarAccessibility.h @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code 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 General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +#import "JavaComponentAccessibility.h" +#import "GroupAccessibility.h" + +#import + +@interface StatusbarAccessibility : GroupAccessibility { + +}; +- (NSAccessibilityRole _Nonnull)accessibilityRole; +@end diff --git a/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/StatusbarAccessibility.m b/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/StatusbarAccessibility.m new file mode 100644 index 00000000000..84336057def --- /dev/null +++ b/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/StatusbarAccessibility.m @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code 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 General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +#import "StatusbarAccessibility.h" + +/* + * Implementation of the accessibility peer for the Statusbar role + */ +@implementation StatusbarAccessibility + +- (NSAccessibilityRole _Nonnull)accessibilityRole +{ + return NSAccessibilityValueIndicatorRole; +} + +@end diff --git a/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/ToolbarAccessibility.h b/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/ToolbarAccessibility.h new file mode 100644 index 00000000000..88e48e13ba8 --- /dev/null +++ b/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/ToolbarAccessibility.h @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code 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 General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +#import "JavaComponentAccessibility.h" +#import "CommonComponentAccessibility.h" + +#import + +@interface ToolbarAccessibility : CommonComponentAccessibility { + +}; +- (NSAccessibilityRole _Nonnull)accessibilityRole; +@end diff --git a/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/ToolbarAccessibility.m b/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/ToolbarAccessibility.m new file mode 100644 index 00000000000..8609324be8d --- /dev/null +++ b/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/ToolbarAccessibility.m @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code 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 General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +#import "ToolbarAccessibility.h" + +/* + * Implementation of the accessibility peer for the Toolbar role + */ +@implementation ToolbarAccessibility + +- (NSAccessibilityRole _Nonnull)accessibilityRole +{ + return NSAccessibilityToolbarRole; +} +@end