Mercurial > projects > dwt-mac
diff dwt/accessibility/Accessible.d @ 123:63a09873578e
Fixed compile errors
author | Jacob Carlborg <doob@me.com> |
---|---|
date | Thu, 15 Jan 2009 23:08:54 +0100 |
parents | c74ba20de292 |
children | 07399639c0c8 |
line wrap: on
line diff
--- a/dwt/accessibility/Accessible.d Wed Dec 31 21:01:13 2008 +0100 +++ b/dwt/accessibility/Accessible.d Thu Jan 15 23:08:54 2009 +0100 @@ -73,27 +73,27 @@ * @since 2.0 */ public class Accessible { - + static NSString[] baseAttributes; - + static NSString[] baseTextAttributes; static NSString[] baseParameterizedAttributes; - + NSMutableArray attributeNames = null; NSMutableArray parameterizedAttributeNames = null; NSMutableArray actionNames = null; - + AccessibleListener[] accessibleListeners; AccessibleControlListener[] accessibleControlListeners; AccessibleTextListener[] accessibleTextListeners; Control control; - + HashMap!(int, SWTAccessibleDelegate) children; this (Control control) { - + this.control = control; baseAttributes = [ @@ -107,7 +107,7 @@ OS.NSAccessibilitySizeAttribute, OS.NSAccessibilityWindowAttribute, OS.NSAccessibilityTopLevelUIElementAttribute - ]; + ]; baseTextAttributes = [ OS.NSAccessibilityNumberOfCharactersAttribute, @@ -117,12 +117,12 @@ OS.NSAccessibilitySelectedTextRangesAttribute, OS.NSAccessibilityVisibleCharacterRangeAttribute, OS.NSAccessibilityValueAttribute - ]; + ]; baseParameterizedAttributes = [ OS.NSAccessibilityStringForRangeParameterizedAttribute, OS.NSAccessibilityRangeForLineParameterizedAttribute - ]; + ]; } /** @@ -141,7 +141,7 @@ public static Accessible internal_new_Accessible(Control control) { return new Accessible(control); } - + /** * Adds the listener to the collection of listeners who will * be notified when an accessible client asks for certain strings, @@ -168,7 +168,7 @@ if (listener is null) DWT.error(DWT.ERROR_NULL_ARGUMENT); accessibleListeners.addElement(listener); } - + /** * Adds the listener to the collection of listeners who will * be notified when an accessible client asks for custom control @@ -195,7 +195,7 @@ if (listener is null) DWT.error(DWT.ERROR_NULL_ARGUMENT); accessibleControlListeners.addElement(listener); } - + /** * Adds the listener to the collection of listeners who will * be notified when an accessible client asks for custom text control @@ -229,7 +229,7 @@ // TODO No action support for now. return NSString.stringWith(""); } - + public NSArray internal_accessibilityActionNames(int childID) { // The supported action list depends on the role played by the control. AccessibleControlEvent event = new AccessibleControlEvent(this); @@ -239,7 +239,7 @@ AccessibleControlListener listener = elementAt(accessibleControlListeners, i); listener.getRole(event); } - + // No accessible listener is overriding the role of the control, so let Cocoa return the default set for the control. if (event.detail is -1) { return null; @@ -252,21 +252,21 @@ NSMutableArray returnValue = NSMutableArray.arrayWithCapacity(5); switch (event.detail) { - case ACC.ROLE_PUSHBUTTON: - case ACC.ROLE_RADIOBUTTON: - case ACC.ROLE_CHECKBUTTON: - case ACC.ROLE_TABITEM: - returnValue.addObject(OS.NSAccessibilityPressAction); - break; + case ACC.ROLE_PUSHBUTTON: + case ACC.ROLE_RADIOBUTTON: + case ACC.ROLE_CHECKBUTTON: + case ACC.ROLE_TABITEM: + returnValue.addObject(OS.NSAccessibilityPressAction); + break; } - + switch (event.detail) { - case ACC.ROLE_COMBOBOX: - returnValue.addObject(OS.NSAccessibilityConfirmAction); - break; + case ACC.ROLE_COMBOBOX: + returnValue.addObject(OS.NSAccessibilityConfirmAction); + break; } - - + + if (childID is ACC.CHILDID_SELF) { actionNames = returnValue; actionNames.retain(); @@ -276,7 +276,7 @@ return returnValue; } } - + public NSArray internal_accessibilityAttributeNames(int childID) { // The supported attribute set depends on the role played by the control. // We may need to add or remove from the base set as needed. @@ -287,7 +287,7 @@ AccessibleControlListener listener = accessibleControlListeners.elementAt(i); listener.getRole(event); } - + // No accessible listener is overriding the role of the control, so let Cocoa // return the default set for the control. if (event.detail is -1) @@ -298,7 +298,7 @@ } NSMutableArray returnValue = NSMutableArray.arrayWithCapacity(baseAttributes.length); - + /* Add our list of supported attributes to the array. * Make sure each attribute name is not already in the array before appending. */ @@ -318,37 +318,37 @@ // The following are expected to have a value (AXValue) switch (event.detail) { - case ACC.ROLE_CHECKBUTTON: - case ACC.ROLE_RADIOBUTTON: - case ACC.ROLE_LABEL: - case ACC.ROLE_TABITEM: - case ACC.ROLE_TABFOLDER: - returnValue.addObject(OS.NSAccessibilityValueAttribute); - break; + case ACC.ROLE_CHECKBUTTON: + case ACC.ROLE_RADIOBUTTON: + case ACC.ROLE_LABEL: + case ACC.ROLE_TABITEM: + case ACC.ROLE_TABFOLDER: + returnValue.addObject(OS.NSAccessibilityValueAttribute); + break; } // The following are expected to report their enabled status (AXEnabled) switch (event.detail) { - case ACC.ROLE_CHECKBUTTON: - case ACC.ROLE_RADIOBUTTON: - case ACC.ROLE_LABEL: - case ACC.ROLE_TABITEM: - case ACC.ROLE_PUSHBUTTON: - case ACC.ROLE_COMBOBOX: - returnValue.addObject(OS.NSAccessibilityEnabledAttribute); - break; + case ACC.ROLE_CHECKBUTTON: + case ACC.ROLE_RADIOBUTTON: + case ACC.ROLE_LABEL: + case ACC.ROLE_TABITEM: + case ACC.ROLE_PUSHBUTTON: + case ACC.ROLE_COMBOBOX: + returnValue.addObject(OS.NSAccessibilityEnabledAttribute); + break; } // The following are expected to report a title (AXTitle) switch (event.detail) { - case ACC.ROLE_CHECKBUTTON: - case ACC.ROLE_RADIOBUTTON: - case ACC.ROLE_PUSHBUTTON: - case ACC.ROLE_TABITEM: - returnValue.addObject(OS.NSAccessibilityTitleAttribute); - break; + case ACC.ROLE_CHECKBUTTON: + case ACC.ROLE_RADIOBUTTON: + case ACC.ROLE_PUSHBUTTON: + case ACC.ROLE_TABITEM: + returnValue.addObject(OS.NSAccessibilityTitleAttribute); + break; } - + // Accessibility verifier says these attributes must be reported for combo boxes. if (event.detail is ACC.ROLE_COMBOBOX) { returnValue.addObject(OS.NSAccessibilityExpandedAttribute); @@ -359,7 +359,7 @@ returnValue.addObject(OS.NSAccessibilityContentsAttribute); returnValue.addObject(OS.NSAccessibilityTabsAttribute); } - + /* * Only report back sub-roles when the DWT role maps to a sub-role. */ @@ -369,7 +369,7 @@ if (dwt.dwthelper.utils.indexOf(osRole, ':') is -1) returnValue.removeObject(OS.NSAccessibilitySubroleAttribute); } - + /* * Children never return their own children, so remove that attribute. */ @@ -386,7 +386,7 @@ return returnValue; } } - + public cocoa.id internal_accessibilityAttributeValue(NSString attribute, int childID) { if (attribute.isEqualToString(OS.NSAccessibilityRoleAttribute)) return getRoleAttribute(childID); if (attribute.isEqualToString(OS.NSAccessibilitySubroleAttribute)) return getSubroleAttribute(childID); @@ -423,7 +423,7 @@ if (attribute.isEqualToString(OS.NSAccessibilityRangeForLineParameterizedAttribute)) return getRangeForLineParameterizedAttribute(parameter, childID); return null; } - + // Returns the UI Element that has the focus. You can assume that the search for the focus has already been narrowed down to the receiver. // Override this method to do a deeper search with a UIElement - e.g. a NSMatrix would determine if one of its cells has the focus. public cocoa.id internal_accessibilityFocusedUIElement(int childID) { @@ -448,10 +448,10 @@ if (event.childID is ACC.CHILDID_SELF || event.childID is ACC.CHILDID_NONE) { return new cocoa.id(OS.NSAccessibilityUnignoredAncestor(control.view.id)); } - + return new cocoa.id(OS.NSAccessibilityUnignoredAncestor(childIDToOs(event.childID).id)); } - + // Returns the deepest descendant of the UIElement hierarchy that contains the point. // You can assume the point has already been determined to lie within the receiver. // Override this method to do deeper hit testing within a UIElement - e.g. a NSMatrix would test its cells. The point is bottom-left relative screen coordinates. @@ -460,7 +460,7 @@ event.x = cast(int) point.x; dwt.widgets.Monitor.Monitor primaryMonitor = Display.getCurrent().getPrimaryMonitor(); event.y = cast(int) (primaryMonitor.getBounds().height - point.y); - + // Set an impossible value to determine if anything responded to the event. event.childID = ACC.CHILDID_MULTIPLE; for (int i = 0; i < accessibleControlListeners.size(); i++) { @@ -475,41 +475,41 @@ if (event.accessible !is null) { return new cocoa.id(OS.NSAccessibilityUnignoredAncestor(event.accessible.control.view.id)); } - + if (event.childID is ACC.CHILDID_SELF || event.childID is ACC.CHILDID_NONE) { return new cocoa.id(OS.NSAccessibilityUnignoredAncestor(control.view.id)); } - + return new cocoa.id(OS.NSAccessibilityUnignoredAncestor(childIDToOs(event.childID).id)); } - + public bool internal_accessibilityIsAttributeSettable(NSString attribute, int childID) { return false; } - + // Return YES if the UIElement doesn't show up to the outside world - i.e. its parent should return the UIElement's children as its own - cutting the UIElement out. E.g. NSControls are ignored when they are single-celled. public bool internal_accessibilityIsIgnored(int childID) { return false; } - + // parameterized attribute methods public NSArray internal_accessibilityParameterizedAttributeNames(int childID) { - + if ((childID is ACC.CHILDID_SELF) && (parameterizedAttributeNames !is null)) { return retainedAutoreleased(parameterizedAttributeNames); } - + NSMutableArray returnValue = NSMutableArray.arrayWithCapacity(4); - + if (accessibleTextListeners.size() > 0) { for (int i = 0; i < baseParameterizedAttributes.length; i++) { if (!returnValue.containsObject(baseParameterizedAttributes[i])) { returnValue.addObject(baseParameterizedAttributes[i]); } } - + } - + if (childID is ACC.CHILDID_SELF) { parameterizedAttributeNames = returnValue; parameterizedAttributeNames.retain(); @@ -519,12 +519,12 @@ return returnValue; } } - + public void internal_accessibilityPerformAction(NSString action, int childID) { // TODO Auto-generated method stub // No action support for now. } - + /** * Returns the control for this Accessible object. * @@ -534,7 +534,7 @@ public Control getControl() { return control; } - + /** * Invokes platform specific functionality to dispose an accessible object. * <p> @@ -554,7 +554,7 @@ parameterizedAttributeNames = null; foreach (childDelegate ; children) - childDelegate.internal_dispose_SWTAccessibleDelegate(); + childDelegate.internal_dispose_SWTAccessibleDelegate(); children.clear(); } @@ -563,7 +563,7 @@ // TODO: May need to expand the API so the combo box state can be reported. return NSNumber.numberWithBool(false); } - + cocoa.id getHelpAttribute (int childID) { cocoa.id returnValue = null; AccessibleEvent event = new AccessibleEvent(this); @@ -595,7 +595,7 @@ if (index !is -1) appRole = appRole.substring(0, index); returnValue = NSString.stringWith(appRole); } - + return returnValue; } @@ -650,9 +650,9 @@ cocoa.id returnValue = null;//NSString.stringWith(""); /* - * Feature of the Macintosh. The text of a Label is returned in its value, - * not its title, so ensure that the role is not Label before asking for the title. - */ + * Feature of the Macintosh. The text of a Label is returned in its value, + * not its title, so ensure that the role is not Label before asking for the title. + */ AccessibleControlEvent roleEvent = new AccessibleControlEvent(this); roleEvent.childID = childID; roleEvent.detail = -1; @@ -688,65 +688,65 @@ } int role = event.detail; String value = event.result; - + switch (role) { - case ACC.ROLE_RADIOBUTTON: // 1 = on, 0 = off - case ACC.ROLE_CHECKBUTTON: // 1 = checked, 0 = unchecked, 2 = mixed - case ACC.ROLE_SCROLLBAR: // numeric value representing the position of the scroller - case ACC.ROLE_SLIDER: // the value associated with the position of the slider thumb - case ACC.ROLE_PROGRESSBAR: // the value associated with the fill level of the progress bar - if (value !is null) { - try { - int number = Integer.parseInt(value); - returnValue = NSNumber.numberWithInt(number); - } catch (NumberFormatException ex) { - if (value.equalsIgnoreCase("true")) { - returnValue = NSNumber.numberWithBool(true); - } else if (value.equalsIgnoreCase("false")) { - returnValue = NSNumber.numberWithBool(false); + case ACC.ROLE_RADIOBUTTON: // 1 = on, 0 = off + case ACC.ROLE_CHECKBUTTON: // 1 = checked, 0 = unchecked, 2 = mixed + case ACC.ROLE_SCROLLBAR: // numeric value representing the position of the scroller + case ACC.ROLE_SLIDER: // the value associated with the position of the slider thumb + case ACC.ROLE_PROGRESSBAR: // the value associated with the fill level of the progress bar + if (value !is null) { + try { + int number = Integer.parseInt(value); + returnValue = NSNumber.numberWithInt(number); + } catch (NumberFormatException ex) { + if (value.equalsIgnoreCase("true")) { + returnValue = NSNumber.numberWithBool(true); + } else if (value.equalsIgnoreCase("false")) { + returnValue = NSNumber.numberWithBool(false); + } } + } else { + returnValue = NSNumber.numberWithBool(false); + } + break; + case ACC.ROLE_TABFOLDER: // the accessibility object representing the currently selected tab item + case ACC.ROLE_TABITEM: // 1 = selected, 0 = not selected + AccessibleControlEvent ace = new AccessibleControlEvent(this); + ace.childID = -4; + for (int i = 0; i < accessibleControlListeners.size(); i++) { + AccessibleControlListener listener = accessibleControlListeners.elementAt(i); + listener.getSelection(ace); } - } else { - returnValue = NSNumber.numberWithBool(false); - } - break; - case ACC.ROLE_TABFOLDER: // the accessibility object representing the currently selected tab item - case ACC.ROLE_TABITEM: // 1 = selected, 0 = not selected - AccessibleControlEvent ace = new AccessibleControlEvent(this); - ace.childID = -4; - for (int i = 0; i < accessibleControlListeners.size(); i++) { - AccessibleControlListener listener = accessibleControlListeners.elementAt(i); - listener.getSelection(ace); - } - if (ace.childID >= ACC.CHILDID_SELF) { - if (role is ACC.ROLE_TABITEM) { - returnValue = NSNumber.numberWithBool(ace.childID is childID); + if (ace.childID >= ACC.CHILDID_SELF) { + if (role is ACC.ROLE_TABITEM) { + returnValue = NSNumber.numberWithBool(ace.childID is childID); + } else { + returnValue = new cocoa.id(OS.NSAccessibilityUnignoredAncestor(childIDToOs(ace.childID).id)); + } } else { - returnValue = new cocoa.id(OS.NSAccessibilityUnignoredAncestor(childIDToOs(ace.childID).id)); + returnValue = NSNumber.numberWithBool(false); } - } else { - returnValue = NSNumber.numberWithBool(false); - } - break; - case ACC.ROLE_COMBOBOX: // text of the currently selected item - case ACC.ROLE_TEXT: // text in the text field - if (value !is null) returnValue = NSString.stringWith(value); - break; - case ACC.ROLE_LABEL: // text in the label - /* On a Mac, the 'value' of a label is the same as the 'name' of the label. */ - AccessibleEvent e = new AccessibleEvent(this); - e.childID = childID; - e.result = null; - for (int i = 0; i < accessibleListeners.size(); i++) { - AccessibleListener listener = accessibleListeners.elementAt(i); - listener.getName(e); - } - if (e.result !is null) { - returnValue = NSString.stringWith(e.result); - } else { + break; + case ACC.ROLE_COMBOBOX: // text of the currently selected item + case ACC.ROLE_TEXT: // text in the text field if (value !is null) returnValue = NSString.stringWith(value); - } - break; + break; + case ACC.ROLE_LABEL: // text in the label + /* On a Mac, the 'value' of a label is the same as the 'name' of the label. */ + AccessibleEvent e = new AccessibleEvent(this); + e.childID = childID; + e.result = null; + for (int i = 0; i < accessibleListeners.size(); i++) { + AccessibleListener listener = accessibleListeners.elementAt(i); + listener.getName(e); + } + if (e.result !is null) { + returnValue = NSString.stringWith(e.result); + } else { + if (value !is null) returnValue = NSString.stringWith(value); + } + break; } return returnValue; @@ -759,7 +759,7 @@ AccessibleControlListener listener = accessibleControlListeners.elementAt(i); listener.getState(event); } - + return NSNumber.numberWithBool(control.isEnabled()); } @@ -771,13 +771,13 @@ AccessibleControlListener listener = accessibleControlListeners.elementAt(i); listener.getFocus(event); } - + /* The application can optionally answer an accessible. */ // FIXME: -// if (event.accessible !is null) { -// bool hasFocus = (event.accessible.childID is childID) && (event.accessible.control is this.control); -// return NSNumber.numberWithBool(hasFocus); -// } + // if (event.accessible !is null) { + // bool hasFocus = (event.accessible.childID is childID) && (event.accessible.control is this.control); + // return NSNumber.numberWithBool(hasFocus); + // } /* Or the application can answer a valid child ID, including CHILDID_SELF and CHILDID_NONE. */ if (event.childID is ACC.CHILDID_SELF) { @@ -791,7 +791,7 @@ /* Other valid childID. */ return NSNumber.numberWithBool(event.childID is childID); } - + // Invalid childID at this point means the application did not implement getFocus, so // let the default handler return the native focus. bool hasFocus = (this.control.view.window().firstResponder() is control.view); @@ -825,7 +825,7 @@ if (appChildren !is null && appChildren.length > 0) { /* return an NSArray of NSAccessible objects. */ NSMutableArray childArray = NSMutableArray.arrayWithCapacity(appChildren.length); - + for (int i = 0; i < appChildren.length; i++) { Object child = appChildren[i]; if (cast(Integer) child) { @@ -835,7 +835,7 @@ childArray.addObject((cast(Accessible)child).control.view); } } - + returnValue = new cocoa.id(OS.NSAccessibilityUnignoredChildren(childArray.id)); } } @@ -844,7 +844,7 @@ // Don't return null if there are no children -- always return an empty array. returnValue = NSArray.array(); } - + // Returning null here means we want the control itself to determine its children. If the accessible listener // implemented getChildCount/getChildren, references to those objects would have been returned above. return returnValue; @@ -869,7 +869,7 @@ if (appChildren !is null && appChildren.length > 0) { /* return an NSArray of NSAccessible objects. */ NSMutableArray childArray = NSMutableArray.arrayWithCapacity(appChildren.length); - + for (int i = 0; i < appChildren.length; i++) { Object child = appChildren[i]; if (cast(Integer)child) { @@ -889,7 +889,7 @@ childArray.addObject((cast(Accessible)child).control.view); } } - + returnValue = new cocoa.id(OS.NSAccessibilityUnignoredChildren(childArray.id)); } } @@ -898,7 +898,7 @@ // Don't return null if there are no children -- always return an empty array. returnValue = NSArray.array(); } - + // Returning null here means we want the control itself to determine its children. If the accessible listener // implemented getChildCount/getChildren, references to those objects would have been returned above. return returnValue; @@ -922,7 +922,7 @@ AccessibleControlListener listener = accessibleControlListeners.elementAt(i); listener.getLocation(event); } - + dwt.widgets.Monitor.Monitor primaryMonitor = Display.getCurrent().getPrimaryMonitor(); NSPoint osPositionAttribute = NSPoint (); @@ -935,12 +935,12 @@ if (childID !is ACC.CHILDID_SELF) { Point pt = null; Rectangle location = control.getBounds(); - + if (control.getParent() !is null) pt = control.getParent().toDisplay(location.x, location.y); else pt = (cast(Shell)control).toDisplay(location.x, location.y); - + osPositionAttribute.x = pt.x; osPositionAttribute.y = pt.y; returnValue = NSValue.valueWithPoint(osPositionAttribute); @@ -955,12 +955,12 @@ AccessibleControlEvent event = new AccessibleControlEvent(this); event.childID = childID; event.width = -1; - + for (int i = 0; i < accessibleControlListeners.size(); i++) { AccessibleControlListener listener = accessibleControlListeners.elementAt(i); listener.getLocation(event); } - + NSSize controlSize = NSSize (); if (event.width !is -1) { controlSize.width = event.width; @@ -985,14 +985,14 @@ AccessibleListener listener = accessibleListeners.elementAt(i); listener.getDescription(event); } - + returnValue = (event.result !is null ? NSString.stringWith(event.result) : null); - + // If no description was provided, try the name. if (returnValue is null) { if (cast(Composite) control) returnValue = NSString.stringWith(""); } - + return returnValue; } @@ -1037,7 +1037,7 @@ cocoa.id getRangeForLineParameterizedAttribute (cocoa.id parameter, int childID) { cocoa.id returnValue = null; - + // The parameter is an NSNumber with the line number. NSNumber lineNumberObj = new NSNumber(parameter.id); int lineNumber = lineNumberObj.intValue(); @@ -1119,11 +1119,11 @@ listener.getValue(event); } String appValue = event.result; - + if (appValue !is null) { returnValue = NSString.stringWith(appValue.substring(range.location, range.location + range.length)); } - + return returnValue; } @@ -1160,18 +1160,18 @@ } NSRange range = NSRange(); - + if (event.result !is null) { range.location = 0; range.length = event.result.length(); } else { return null; -// range.location = range.length = 0; + // range.location = range.length = 0; } - + return NSValue.valueWithRange(range); } - + int lineNumberForOffset (String text, int offset) { int lineNumber = 1; int length = text.length(); @@ -1188,7 +1188,7 @@ } return lineNumber; } - + NSRange rangeForLineNumber (int lineNumber, String text) { NSRange range = NSRange(); range.location = -1; @@ -1214,7 +1214,7 @@ range.length = count; return range; } - + /** * Removes the listener from the collection of listeners who will * be notified when an accessible client asks for certain strings, @@ -1239,7 +1239,7 @@ if (listener is null) DWT.error(DWT.ERROR_NULL_ARGUMENT); accessibleListeners.removeElement(listener); } - + /** * Removes the listener from the collection of listeners who will * be notified when an accessible client asks for custom control @@ -1264,7 +1264,7 @@ if (listener is null) DWT.error(DWT.ERROR_NULL_ARGUMENT); accessibleControlListeners.removeElement(listener); } - + /** * Removes the listener from the collection of listeners who will * be notified when an accessible client asks for custom text control @@ -1291,7 +1291,7 @@ if (listener is null) DWT.error (DWT.ERROR_NULL_ARGUMENT); accessibleTextListeners.removeElement (listener); } - + static NSArray retainedAutoreleased(NSArray inObject) { cocoa.id temp = inObject.retain(); cocoa.id temp2 = (new NSObject(temp.id)).autorelease(); @@ -1313,7 +1313,7 @@ checkWidget(); OS.NSAccessibilityPostNotification(control.view.id, OS.NSAccessibilitySelectedChildrenChangedNotification.id); } - + /** * Sends a message to accessible clients indicating that the focus * has changed within a custom control. @@ -1329,7 +1329,7 @@ checkWidget(); OS.NSAccessibilityPostNotification(control.view.id, OS.NSAccessibilityFocusedUIElementChangedNotification.id); } - + /** * Sends a message to accessible clients that the text * caret has moved within a custom control. @@ -1347,7 +1347,7 @@ checkWidget(); OS.NSAccessibilityPostNotification(control.view.id, OS.NSAccessibilitySelectedTextChangedNotification.id); } - + /** * Sends a message to accessible clients that the text * within a custom control has changed. @@ -1371,7 +1371,7 @@ checkWidget(); OS.NSAccessibilityPostNotification(control.view.id, OS.NSAccessibilityValueChangedNotification.id); } - + /** * Sends a message to accessible clients that the text * selection has changed within a custom control. @@ -1392,7 +1392,7 @@ if (childID is ACC.CHILDID_SELF) { return control.view; } - + /* Check cache for childID, if found, return corresponding osChildID. */ SWTAccessibleDelegate childRef = children[childID]; @@ -1403,7 +1403,7 @@ return childRef; } - + NSString concatStringsAsRole(NSString str1, NSString str2) { NSString returnValue = str1; returnValue = returnValue.stringByAppendingString(NSString.stringWith(":")); @@ -1455,10 +1455,10 @@ case ACC.ROLE_SLIDER: nsReturnValue = OS.NSAccessibilitySliderRole; break; case ACC.ROLE_LINK: nsReturnValue = OS.NSAccessibilityLinkRole; break; } - + return nsReturnValue.getString(); } - + int osToRole(NSString osRole) { if (osRole is null) return 0; if (osRole.isEqualToString(OS.NSAccessibilityWindowRole)) return ACC.ROLE_WINDOW; @@ -1498,10 +1498,10 @@ if (!isValidThread ()) DWT.error (DWT.ERROR_THREAD_INVALID_ACCESS); if (control.isDisposed ()) DWT.error (DWT.ERROR_WIDGET_DISPOSED); } - + /* isValidThread was copied from Widget, and rewritten to work in this package */ bool isValidThread () { return control.getDisplay ().getThread () is Thread.getThis (); } - + }