Revision: 27755
http://sourceforge.net/p/bibdesk/svn/27755
Author: hofman
Date: 2022-07-22 22:47:34 +0000 (Fri, 22 Jul 2022)
Log Message:
-----------
return superview's cell as accessibilityParent of sub controls rather than
using a cell proxy object as accessible child.
Modified Paths:
--------------
trunk/bibdesk/BDSKAddressTextField.m
trunk/bibdesk/BDSKEditorTextField.h
trunk/bibdesk/BDSKEditorTextField.m
trunk/bibdesk/Bibdesk.xcodeproj/project.pbxproj
Removed Paths:
-------------
trunk/bibdesk/BDSKCellProxy.h
trunk/bibdesk/BDSKCellProxy.m
Modified: trunk/bibdesk/BDSKAddressTextField.m
===================================================================
--- trunk/bibdesk/BDSKAddressTextField.m 2022-07-22 14:38:44 UTC (rev
27754)
+++ trunk/bibdesk/BDSKAddressTextField.m 2022-07-22 22:47:34 UTC (rev
27755)
@@ -40,19 +40,15 @@
#import "BDSKAddressTextFieldCell.h"
#import "BDSKDragImageView.h"
#import "NSLayoutConstraint_BDSKExtensions.h"
-#import "BDSKCellProxy.h"
+#import "NSView_BDSKExtensions.h"
#define CONTROL_SIZE 16.0
#define CONTROL_MARGIN 3.0
-@interface BDSKAddressButton : NSButton {
- BDSKButtonCellProxy *cellProxy;
-}
+@interface BDSKAddressButton : NSButton
@end
-@interface BDSKAddressImageView : BDSKDragImageView {
- BDSKImageCellProxy *cellProxy;
-}
+@interface BDSKAddressImageView : BDSKDragImageView
@end
@@ -191,66 +187,31 @@
return [NSArray arrayWithObjects:imageView, button, nil];
}
+- (id)accessibilityHitTest:(NSPoint)point {
+ NSArray *subcontrols = [self subcontrols];
+ for (NSView *view in subcontrols) {
+ if (NSPointInRect(point, [view convertRectToScreen:[view bounds]]))
+ return [view accessibilityHitTest:point];
+ }
+ return NSAccessibilityUnignoredAncestor([self cell]);
+}
+
@end
@implementation BDSKAddressButton
-- (void)dealloc {
- BDSKDESTROY(cellProxy);
- [super dealloc];
+- (id)accessibilityParent {
+ return NSAccessibilityUnignoredAncestor([(NSControl *)[self superview]
cell]);
}
-- (BDSKButtonCellProxy *)cellProxy {
- if (cellProxy == nil)
- cellProxy = [[BDSKButtonCellProxy alloc] initWithParent:[(NSControl
*)[self superview] cell] cell:[self cell]];
- return cellProxy;
-}
-
-- (NSArray *)accessibilityChildren {
- return NSAccessibilityUnignoredChildren([NSArray arrayWithObjects:[self
cellProxy], nil]);
-}
-
-- (id)accessibilityHitTest:(NSPoint)point {
- return NSAccessibilityUnignoredAncestor([self cellProxy]);
-}
-
-- (id)accessibilityAttributeValue:(NSString *)attribute {
- if ([attribute isEqualToString:NSAccessibilityChildrenAttribute])
- return NSAccessibilityUnignoredChildren([NSArray
arrayWithObjects:[self cellProxy], nil]);
- else
- return [super accessibilityAttributeValue:attribute];
-}
-
@end
@implementation BDSKAddressImageView
-- (void)dealloc {
- BDSKDESTROY(cellProxy);
- [super dealloc];
+- (id)accessibilityParent {
+ return NSAccessibilityUnignoredAncestor([(NSControl *)[self superview]
cell]);
}
-- (BDSKImageCellProxy *)cellProxy {
- if (cellProxy == nil)
- cellProxy = [[BDSKImageCellProxy alloc] initWithParent:[(NSControl
*)[self superview] cell] cell:[self cell]];
- return cellProxy;
-}
-
-- (NSArray *)accessibilityChildren {
- return NSAccessibilityUnignoredChildren([NSArray arrayWithObjects:[self
cellProxy], nil]);
-}
-
-- (id)accessibilityHitTest:(NSPoint)point {
- return NSAccessibilityUnignoredAncestor([self cellProxy]);
-}
-
-- (id)accessibilityAttributeValue:(NSString *)attribute {
- if ([attribute isEqualToString:NSAccessibilityChildrenAttribute])
- return NSAccessibilityUnignoredChildren([NSArray
arrayWithObjects:[self cellProxy], nil]);
- else
- return [super accessibilityAttributeValue:attribute];
-}
-
@end
Deleted: trunk/bibdesk/BDSKCellProxy.h
===================================================================
--- trunk/bibdesk/BDSKCellProxy.h 2022-07-22 14:38:44 UTC (rev 27754)
+++ trunk/bibdesk/BDSKCellProxy.h 2022-07-22 22:47:34 UTC (rev 27755)
@@ -1,53 +0,0 @@
-//
-// BDSKCellProxy.h
-// BibDesk
-//
-// Created by Christiaan Hofman on 21/07/2022.
-/*
- This software is Copyright (c) 2022
- Christiaan Hofman. All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions
- are met:
-
- - Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
-
- - Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in
- the documentation and/or other materials provided with the
- distribution.
-
- - Neither the name of Christiaan Hofman nor the names of any
- contributors may be used to endorse or promote products derived
- from this software without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#import <Cocoa/Cocoa.h>
-
-
-@interface BDSKCellProxy : NSObject {
- id parent;
- id cell;
-}
-- (id)initWithParent:(id)aParent cell:(id)aCell;
-@end
-
-@interface BDSKButtonCellProxy : BDSKCellProxy
-@end
-
-@interface BDSKImageCellProxy : BDSKCellProxy
-@end
Deleted: trunk/bibdesk/BDSKCellProxy.m
===================================================================
--- trunk/bibdesk/BDSKCellProxy.m 2022-07-22 14:38:44 UTC (rev 27754)
+++ trunk/bibdesk/BDSKCellProxy.m 2022-07-22 22:47:34 UTC (rev 27755)
@@ -1,185 +0,0 @@
-//
-// BDSKCellProxy.m
-// BibDesk
-//
-// Created by Christiaan Hofman on 21/07/2022.
-/*
- This software is Copyright (c) 2022
- Christiaan Hofman. All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions
- are met:
-
- - Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
-
- - Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in
- the documentation and/or other materials provided with the
- distribution.
-
- - Neither the name of Christiaan Hofman nor the names of any
- contributors may be used to endorse or promote products derived
- from this software without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#import "BDSKCellProxy.h"
-
-@implementation BDSKCellProxy
-
-- (id)initWithParent:(id)aParent cell:(id)aCell {
- self = [super init];
- if (self) {
- parent = aParent;
- cell = [aCell retain];
- }
- return self;
-}
-
-- (void)dealloc {
- parent = nil;
- BDSKDESTROY(cell);
- [super dealloc];
-}
-
-- (id)accessibilityParent {
- return NSAccessibilityUnignoredAncestor(parent);
-}
-
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wpartial-availability"
-
-- (id)accessibilityRole {
- return [cell accessibilityRole];
-}
-
-- (id)accessibilityRoleDescription {
- return [cell accessibilityRoleDescription];
-}
-
-- (NSRect)accessibilityFrame {
- return [cell accessibilityFrame];
-}
-
-- (NSString *)accessibilityHelp {
- return [cell accessibilityHelp];
-}
-
-- (id)accessibilityTopLevelUIElement {
- return [cell accessibilityTopLevelUIElement];
-}
-
-- (id)accessibilityWindow {
- return [cell accessibilityWindow];
-}
-
-- (BOOL)isAccessibilityFocused {
- return [cell isAccessibilityFocused];
-}
-
-- (void)setAccessibilityFocused:(BOOL)focused {
- [cell setAccessibilityFocused:focused];
-}
-
-#pragma clang diagnostic pop
-
-- (id)accessibilityHitTest:(NSPoint)point {
- return NSAccessibilityUnignoredAncestor(self);
-}
-
-- (BOOL)accessibilityIsIgnored {
- return NO;
-}
-
-- (NSArray *)accessibilityAttributeNames {
- return [cell accessibilityAttributeNames];
-}
-
-- (id)accessibilityAttributeValue:(NSString *)attribute {
- if ([attribute isEqualToString:NSAccessibilityParentAttribute])
- return NSAccessibilityUnignoredAncestor(parent);
- else if ([attribute isEqualToString:NSAccessibilityChildrenAttribute])
- return nil;
- else
- return [cell accessibilityAttributeValue:attribute];
-}
-
-- (BOOL)accessibilityIsAttributeSettable:(NSString *)attribute {
- return [cell accessibilityIsAttributeSettable:attribute];
-}
-
-- (void)accessibilitySetValue:(id)value forAttribute:(NSString *)attribute {
- return [cell accessibilitySetValue:value forAttribute:attribute];
-}
-
-- (NSArray *)accessibilityActionNames {
- return [cell accessibilityActionNames];
-}
-
-- (void)accessibilityPerformAction:(NSString *)anAction {
- [cell accessibilityPerformAction:anAction];
-}
-
-@end
-
-
-@implementation BDSKButtonCellProxy
-
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wpartial-availability"
-
-- (NSString *)accessibilityLabel {
- return [cell accessibilityLabel];
-}
-
-- (NSString *)accessibilityTitle {
- return [cell accessibilityTitle];
-}
-
-- (NSString *)accessibilityValue {
- return [cell accessibilityValue];
-}
-
-- (BOOL)isAccessibilityEnabled {
- return [cell isAccessibilityEnabled];
-}
-
-- (BOOL)accessibilityPerformPress {
- return [cell accessibilityPerformPress];
-}
-
-#pragma clang diagnostic pop
-
-@end
-
-
-@implementation BDSKImageCellProxy
-
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wpartial-availability"
-
-- (NSString *)accessibilityLabel {
- return [cell accessibilityLabel];
-}
-
-- (BOOL)isAccessibilityEnabled {
- return [cell isAccessibilityEnabled];
-}
-
-#pragma clang diagnostic pop
-
-@end
-
Modified: trunk/bibdesk/BDSKEditorTextField.h
===================================================================
--- trunk/bibdesk/BDSKEditorTextField.h 2022-07-22 14:38:44 UTC (rev 27754)
+++ trunk/bibdesk/BDSKEditorTextField.h 2022-07-22 22:47:34 UTC (rev 27755)
@@ -57,9 +57,7 @@
@end
-@interface BDSKDragButton : NSButton <NSDraggingSource> {
- id cellProxy;
-}
+@interface BDSKDragButton : NSButton <NSDraggingSource>
@end
@interface BDSKDragButtonCell : NSButtonCell
Modified: trunk/bibdesk/BDSKEditorTextField.m
===================================================================
--- trunk/bibdesk/BDSKEditorTextField.m 2022-07-22 14:38:44 UTC (rev 27754)
+++ trunk/bibdesk/BDSKEditorTextField.m 2022-07-22 22:47:34 UTC (rev 27755)
@@ -40,7 +40,6 @@
#import "NSImage_BDSKExtensions.h"
#import "NSGeometry_BDSKExtensions.h"
#import "NSView_BDSKExtensions.h"
-#import "BDSKCellProxy.h"
#define BUTTON_MARGIN_X 2.0
#define BUTTON_MARGIN_Y 4.0
@@ -139,6 +138,12 @@
return [button superview] ? button : nil;
}
+- (id)accessibilityHitTest:(NSPoint)point {
+ if ([button superview] && NSPointInRect(point, [button
convertRectToScreen:[button bounds]]))
+ return NSAccessibilityUnignoredAncestor([button cell]);
+ return NSAccessibilityUnignoredAncestor(self);
+}
+
@end
@@ -213,11 +218,6 @@
+ (Class)cellClass { return [BDSKDragButtonCell class]; }
-- (void)dealloc {
- BDSKDESTROY(cellProxy);
- [super dealloc];
-}
-
- (BOOL)canBecomeFirstResponder { return NO; }
- (NSDragOperation)draggingSession:(NSDraggingSession *)session
sourceOperationMaskForDraggingContext:(NSDraggingContext)context {
@@ -224,27 +224,10 @@
return NSDragOperationGeneric;
}
-- (BDSKButtonCellProxy *)cellProxy {
- if (cellProxy == nil)
- cellProxy = [[BDSKButtonCellProxy alloc] initWithParent:[(NSControl
*)[self superview] cell] cell:[self cell]];
- return cellProxy;
+- (id)accessibilityParent {
+ return NSAccessibilityUnignoredAncestor([(NSControl *)[self superview]
cell]);
}
-- (NSArray *)accessibilityChildren {
- return NSAccessibilityUnignoredChildren([NSArray arrayWithObjects:[self
cellProxy], nil]);
-}
-
-- (id)accessibilityHitTest:(NSPoint)point {
- return NSAccessibilityUnignoredAncestor([self cellProxy]);
-}
-
-- (id)accessibilityAttributeValue:(NSString *)attribute {
- if ([attribute isEqualToString:NSAccessibilityChildrenAttribute])
- return NSAccessibilityUnignoredChildren([NSArray
arrayWithObjects:[self cellProxy], nil]);
- else
- return [super accessibilityAttributeValue:attribute];
-}
-
@end
Modified: trunk/bibdesk/Bibdesk.xcodeproj/project.pbxproj
===================================================================
--- trunk/bibdesk/Bibdesk.xcodeproj/project.pbxproj 2022-07-22 14:38:44 UTC
(rev 27754)
+++ trunk/bibdesk/Bibdesk.xcodeproj/project.pbxproj 2022-07-22 22:47:34 UTC
(rev 27755)
@@ -728,8 +728,6 @@
CEE23BDD0BFBA781002B746B /* Templates in Copy Files: Shared
Support */ = {isa = PBXBuildFile; fileRef = CE97A3B90A28F19A00CF2DF3 /*
Templates */; };
CEE23BE40BFBA78F002B746B /* previewtemplate.tex in Copy Files:
Shared Support */ = {isa = PBXBuildFile; fileRef = F91B5CC7076579830011ED22 /*
previewtemplate.tex */; };
CEE23BE50BFBA78F002B746B /* template.txt in Copy Files: Shared
Support */ = {isa = PBXBuildFile; fileRef = F91B5CE407657A200011ED22 /*
template.txt */; };
- CEE3E6ED2889FDCB00DD3642 /* BDSKCellProxy.h in Headers */ =
{isa = PBXBuildFile; fileRef = CEE3E6EB2889FDCB00DD3642 /* BDSKCellProxy.h */;
};
- CEE3E6EE2889FDCB00DD3642 /* BDSKCellProxy.m in Sources */ =
{isa = PBXBuildFile; fileRef = CEE3E6EC2889FDCB00DD3642 /* BDSKCellProxy.m */;
};
CEE50487104D662500636237 /* BDSKNotesSearchIndex.m in Sources
*/ = {isa = PBXBuildFile; fileRef = CEE50486104D662500636237 /*
BDSKNotesSearchIndex.m */; };
CEE7ACE9109E2F360072D63C /* NSSplitView_BDSKExtensions.m in
Sources */ = {isa = PBXBuildFile; fileRef = CEE7ACE7109E2F360072D63C /*
NSSplitView_BDSKExtensions.m */; };
CEE882B926697C0500574E12 /* BDSKControlTableCellView.h in
Headers */ = {isa = PBXBuildFile; fileRef = CEE882B726697C0500574E12 /*
BDSKControlTableCellView.h */; };
@@ -1919,8 +1917,6 @@
CEE09F19216147E1009CE63D /* BDSKFieldInfo.h */ = {isa =
PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BDSKFieldInfo.h;
sourceTree = "<group>"; };
CEE09F1A216147E1009CE63D /* BDSKFieldInfo.m */ = {isa =
PBXFileReference; lastKnownFileType = sourcecode.c.objc; path =
BDSKFieldInfo.m; sourceTree = "<group>"; };
CEE23BD50BFBA6D6002B746B /* Scripts */ = {isa =
PBXFileReference; lastKnownFileType = folder; path = Scripts; sourceTree =
"<group>"; };
- CEE3E6EB2889FDCB00DD3642 /* BDSKCellProxy.h */ = {isa =
PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BDSKCellProxy.h;
sourceTree = "<group>"; };
- CEE3E6EC2889FDCB00DD3642 /* BDSKCellProxy.m */ = {isa =
PBXFileReference; lastKnownFileType = sourcecode.c.objc; path =
BDSKCellProxy.m; sourceTree = "<group>"; };
CEE50486104D662500636237 /* BDSKNotesSearchIndex.m */ = {isa =
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path
= BDSKNotesSearchIndex.m; sourceTree = "<group>"; };
CEE50488104D664200636237 /* BDSKNotesSearchIndex.h */ = {isa =
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path =
BDSKNotesSearchIndex.h; sourceTree = "<group>"; };
CEE7ACE6109E2F360072D63C /* NSSplitView_BDSKExtensions.h */ =
{isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h;
path = NSSplitView_BDSKExtensions.h; sourceTree = "<group>"; };
@@ -2605,7 +2601,6 @@
CEA498A01481183600AB81C5 /*
BDSKAddressTextField.m */,
CEA498A41481185100AB81C5 /*
BDSKAddressTextFieldCell.m */,
CE96DB7010C7288800F085F3 /* BDSKButtonBar.m */,
- CEE3E6EC2889FDCB00DD3642 /* BDSKCellProxy.m */,
CE60FF8D26CFE56F0077AF87 /* BDSKColorCell.m */,
CE6003270AF3E465000B5680 /* BDSKColoredView.m
*/,
CE23B2CB233E0B96006390D9 /*
BDSKColorLabelWell.m */,
@@ -3208,7 +3203,6 @@
CE96DB6F10C7288800F085F3 /* BDSKButtonBar.h */,
CE1C94EB26A9CE9A00EF17E8 /*
BDSKCategoryFormatter.h */,
CEFDBDDB0AEA87F8009EE99D /* BDSKCategoryGroup.h
*/,
- CEE3E6EB2889FDCB00DD3642 /* BDSKCellProxy.h */,
CEED2CBB0F4DAD2C0078E87A /* BDSKCFCallBacks.h
*/,
3D866C2608031CEC00FF1724 /*
BDSKCharacterConversion.h */,
CEAB9F570B4FF20800673AC2 /*
BDSKCitationFormatter.h */,
@@ -3809,7 +3803,6 @@
CE2A0A8922459A3100A8F31C /* BDSKTemplateTag.h
in Headers */,
CE2A0ABF22459A4500A8F31C /* BibPref_TeX.h in
Headers */,
CE2A0AAD22459A4100A8F31C /*
BibDocument_Search.h in Headers */,
- CEE3E6ED2889FDCB00DD3642 /* BDSKCellProxy.h in
Headers */,
CE2A0AA222459A3B00A8F31C /*
BDSKWebViewModalDialogController.h in Headers */,
CE2A09F1224599DB00A8F31C /*
BDSKErrorObjectController.h in Headers */,
CE2A09C12245997A00A8F31C /*
BDSKBibTeXWebParser.h in Headers */,
@@ -4718,7 +4711,6 @@
F98DB3180A23C7730040D347 /* BDSKTemplate.m in
Sources */,
CE56D6510A2DAB55003CE000 /*
BDSKDocumentController.m in Sources */,
CE2391620A334890009F3A5B /*
BDSKDocumentInfoWindowController.m in Sources */,
- CEE3E6EE2889FDCB00DD3642 /* BDSKCellProxy.m in
Sources */,
CE3A32D60A345C2400984DC2 /*
NSAttributedString_BDSKExtensions.m in Sources */,
CE6DACC50A503ECF00123185 /* BDSKToolbarItem.m
in Sources */,
F9FD63DD0A61B87800F9871B /*
NSMenu_BDSKExtensions.m in Sources */,
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
_______________________________________________
Bibdesk-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bibdesk-commit