[Libreoffice-commits] core.git: vcl/aqua

Boris Dušek me at dusek.me
Wed Aug 7 12:07:12 PDT 2013


 vcl/aqua/source/a11y/aqua11ywrapper.mm |   29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

New commits:
commit e83f61b29eb74286dbdb053bb3d067fe3e2f8073
Author: Boris Dušek <me at dusek.me>
Date:   Fri Aug 2 00:14:53 2013 +0200

    Add debugging output for OS X accessibility
    
    In case someone needs to debug accessibility on OS X, provide ready
    debugging messages to be enabled by changing #if 0 to #if 1.
    
    Change-Id: I4d0c0b11d12aa2419c53da7656a881f43c436d87
    Reviewed-on: https://gerrit.libreoffice.org/5237
    Reviewed-by: Norbert Thiebaud <nthiebaud at gmail.com>
    Tested-by: Norbert Thiebaud <nthiebaud at gmail.com>

diff --git a/vcl/aqua/source/a11y/aqua11ywrapper.mm b/vcl/aqua/source/a11y/aqua11ywrapper.mm
index 04c29ad..82163ae 100644
--- a/vcl/aqua/source/a11y/aqua11ywrapper.mm
+++ b/vcl/aqua/source/a11y/aqua11ywrapper.mm
@@ -58,6 +58,22 @@ using namespace ::com::sun::star::uno;
 
 static BOOL isPopupMenuOpen = NO;
 
+
+#if 0
+
+static std::ostream &operator<<(std::ostream &s, NSObject *obj) {
+    return s << [[obj description] UTF8String];
+}
+
+static std::ostream &operator<<(std::ostream &s, NSPoint point) {
+    return s << NSStringFromPoint(point);
+}
+#define AX_SAL_DEBUG(...) SAL_DEBUG(__VA_ARGS__)
+
+#else
+#define AX_SAL_DEBUG(...)
+#endif
+
 @implementation AquaA11yWrapper : NSView
 
 #pragma mark -
@@ -668,6 +684,7 @@ static BOOL isPopupMenuOpen = NO;
 #pragma mark Accessibility Protocol
 
 -(id)accessibilityAttributeValue:(NSString *)attribute {
+    AX_SAL_DEBUG("[" << self << " accessibilityAttributeValue:" << attribute << "]");
     // #i90575# guard NSAccessibility protocol against unwanted access
     if ( isPopupMenuOpen ) {
         return nil;
@@ -697,6 +714,7 @@ static BOOL isPopupMenuOpen = NO;
 }
 
 -(BOOL)accessibilityIsIgnored {
+    AX_SAL_DEBUG("[" << self << " accessibilityIsIgnored]");
     // #i90575# guard NSAccessibility protocol against unwanted access
     if ( isPopupMenuOpen ) {
         return NO;
@@ -720,6 +738,7 @@ static BOOL isPopupMenuOpen = NO;
 }
 
 -(NSArray *)accessibilityAttributeNames {
+    AX_SAL_DEBUG("[" << self << " accessibilityAttributeNames]");
     // #i90575# guard NSAccessibility protocol against unwanted access
     if ( isPopupMenuOpen ) {
         return nil;
@@ -800,6 +819,7 @@ static BOOL isPopupMenuOpen = NO;
 }
 
 -(BOOL)accessibilityIsAttributeSettable:(NSString *)attribute {
+    AX_SAL_DEBUG("[" << self << " accessibilityAttributeIsSettable:" << attribute << "]");
     BOOL isSettable = NO;
     if ( [ self accessibleText ] != nil ) {
         isSettable = [ AquaA11yTextWrapper isAttributeSettable: attribute forElement: self ];
@@ -817,6 +837,7 @@ static BOOL isPopupMenuOpen = NO;
 }
 
 -(NSArray *)accessibilityParameterizedAttributeNames {
+    AX_SAL_DEBUG("[" << self << " accessibilityParameterizedAttributeNames]");
     NSMutableArray * attributeNames = [ [ NSMutableArray alloc ] init ];
     // Special Attributes depending on interface
     if ( [ self accessibleText ] != nil ) {
@@ -826,6 +847,7 @@ static BOOL isPopupMenuOpen = NO;
 }
 
 -(id)accessibilityAttributeValue:(NSString *)attribute forParameter:(id)parameter {
+    AX_SAL_DEBUG("[" << self << " accessibilityAttributeValue:" << attribute << " forParameter:" << parameter << "]");
     SEL methodSelector = [ self selectorForAttribute: attribute asGetter: YES withGetterParameter: YES ];
     if ( [ self respondsToSelector: methodSelector ] ) {
         return [ self performSelector: methodSelector withObject: parameter ];
@@ -835,12 +857,14 @@ static BOOL isPopupMenuOpen = NO;
 
 -(BOOL)accessibilitySetOverrideValue:(id)value forAttribute:(NSString *)attribute
 {
+    AX_SAL_DEBUG("[" << self << " accessibilitySetOverrideValue:" << value << " forAttribute:" << attribute << "]");
     (void)value;
     (void)attribute;
     return NO; // TODO
 }
 
 -(void)accessibilitySetValue:(id)value forAttribute:(NSString *)attribute {
+    AX_SAL_DEBUG("[" << self << " accessibilitySetValue:" << value << " forAttribute:" << attribute << "]");
     SEL methodSelector = [ self selectorForAttribute: attribute asGetter: NO withGetterParameter: NO ];
     if ( [ AquaA11yComponentWrapper respondsToSelector: methodSelector ] ) {
         [ AquaA11yComponentWrapper performSelector: methodSelector withObject: self withObject: value ];
@@ -857,6 +881,7 @@ static BOOL isPopupMenuOpen = NO;
 }
 
 -(id)accessibilityFocusedUIElement {
+    AX_SAL_DEBUG("[" << self << " accessibilityFocusedUIElement]");
     // #i90575# guard NSAccessibility protocol against unwanted access
     if ( isPopupMenuOpen ) {
         return nil;
@@ -882,6 +907,7 @@ static BOOL isPopupMenuOpen = NO;
 
 // TODO: hard-coded like the role descriptions. is there a better way?
 -(NSString *)accessibilityActionDescription:(NSString *)action {
+    AX_SAL_DEBUG("[" << self << " accessibilityActionDescription:" << action << "]");
     if ( [ action isEqualToString: NSAccessibilityConfirmAction ] ) {
         return @"confirm";
     } else if ( [ action isEqualToString: NSAccessibilityDecrementAction ] ) {
@@ -933,6 +959,7 @@ static BOOL isPopupMenuOpen = NO;
 }
 
 -(void)accessibilityPerformAction:(NSString *)action {
+    AX_SAL_DEBUG("[" << self << " accessibilityPerformAction:" << action << "]");
     AquaA11yWrapper * actionResponder = [ self actionResponder ];
     if ( actionResponder != nil ) {
         [ AquaA11yActionWrapper doAction: action ofElement: actionResponder ];
@@ -940,6 +967,7 @@ static BOOL isPopupMenuOpen = NO;
 }
 
 -(NSArray *)accessibilityActionNames {
+    AX_SAL_DEBUG("[" << self << " accessibilityActionNames]");
     NSArray * actionNames = nil;
     AquaA11yWrapper * actionResponder = [ self actionResponder ];
     if ( actionResponder != nil ) {
@@ -1022,6 +1050,7 @@ Reference < XAccessibleContext > hitTestRunner ( com::sun::star::awt::Point poin
 }
 
 -(id)accessibilityHitTest:(NSPoint)point {
+    AX_SAL_DEBUG("[" << self << " accessibilityHitTest:" << point << "]");
     static id wrapper = nil;
     if ( nil != wrapper ) {
         [ wrapper release ];


More information about the Libreoffice-commits mailing list