Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 99124 Details for
Bug 212991
Mac OS X accessibility does not have the standard relations
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
_patch.txt
_patch.txt (text/plain), 13.39 KB, created by
Carolyn MacLeod
on 2008-05-07 13:26:51 EDT
(
hide
)
Description:
_patch.txt
Filename:
MIME Type:
Creator:
Carolyn MacLeod
Created:
2008-05-07 13:26:51 EDT
Size:
13.39 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.swt.tools >Index: JNI Generation/org/eclipse/swt/tools/internal/org.eclipse.swt.internal.carbon.OS.properties >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/org.eclipse.swt.internal.carbon.OS.properties,v >retrieving revision 1.128 >diff -u -r1.128 org.eclipse.swt.internal.carbon.OS.properties >--- JNI Generation/org/eclipse/swt/tools/internal/org.eclipse.swt.internal.carbon.OS.properties 17 Apr 2008 21:13:16 -0000 1.128 >+++ JNI Generation/org/eclipse/swt/tools/internal/org.eclipse.swt.internal.carbon.OS.properties 7 May 2008 17:25:07 -0000 >@@ -3103,6 +3103,12 @@ > OS_HIObjectSetAccessibilityIgnored_0=cast=(HIObjectRef) > OS_HIObjectSetAccessibilityIgnored_1= > >+OS_HIObjectSetAuxiliaryAccessibilityAttribute= >+OS_HIObjectSetAuxiliaryAccessibilityAttribute_0=cast=HIObjectRef >+OS_HIObjectSetAuxiliaryAccessibilityAttribute_1=cast=UInt64 >+OS_HIObjectSetAuxiliaryAccessibilityAttribute_2=cast=CFStringRef >+OS_HIObjectSetAuxiliaryAccessibilityAttribute_3=cast=CFTypeRef >+ > OS_HIScrollViewCreate= > OS_HIScrollViewCreate_0= > OS_HIScrollViewCreate_1=cast=(HIViewRef*) >#P org.eclipse.swt >Index: Eclipse SWT PI/carbon/library/os.c >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.swt/Eclipse SWT PI/carbon/library/os.c,v >retrieving revision 1.153 >diff -u -r1.153 os.c >--- Eclipse SWT PI/carbon/library/os.c 17 Apr 2008 12:58:05 -0000 1.153 >+++ Eclipse SWT PI/carbon/library/os.c 7 May 2008 17:25:43 -0000 >@@ -7658,6 +7658,18 @@ > } > #endif > >+#ifndef NO_HIObjectSetAuxiliaryAccessibilityAttribute >+JNIEXPORT jint JNICALL OS_NATIVE(HIObjectSetAuxiliaryAccessibilityAttribute) >+ (JNIEnv *env, jclass that, jint arg0, jlong arg1, jint arg2, jint arg3) >+{ >+ jint rc = 0; >+ OS_NATIVE_ENTER(env, that, HIObjectSetAuxiliaryAccessibilityAttribute_FUNC); >+ rc = (jint)HIObjectSetAuxiliaryAccessibilityAttribute((HIObjectRef)arg0, (UInt64)arg1, (CFStringRef)arg2, (CFTypeRef)arg3); >+ OS_NATIVE_EXIT(env, that, HIObjectSetAuxiliaryAccessibilityAttribute_FUNC); >+ return rc; >+} >+#endif >+ > #ifndef NO_HIScrollViewCreate > JNIEXPORT jint JNICALL OS_NATIVE(HIScrollViewCreate) > (JNIEnv *env, jclass that, jint arg0, jintArray arg1) >Index: Eclipse SWT PI/carbon/library/os_stats.h >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.swt/Eclipse SWT PI/carbon/library/os_stats.h,v >retrieving revision 1.118 >diff -u -r1.118 os_stats.h >--- Eclipse SWT PI/carbon/library/os_stats.h 17 Apr 2008 21:13:15 -0000 1.118 >+++ Eclipse SWT PI/carbon/library/os_stats.h 7 May 2008 17:25:47 -0000 >@@ -552,6 +552,7 @@ > HIObjectCreate_FUNC, > HIObjectRegisterSubclass_FUNC, > HIObjectSetAccessibilityIgnored_FUNC, >+ HIObjectSetAuxiliaryAccessibilityAttribute_FUNC, > HIScrollViewCreate_FUNC, > HIScrollViewSetScrollBarAutoHide_FUNC, > HISearchFieldChangeAttributes_FUNC, >Index: Eclipse SWT PI/carbon/library/os_stats.c >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.swt/Eclipse SWT PI/carbon/library/os_stats.c,v >retrieving revision 1.118 >diff -u -r1.118 os_stats.c >--- Eclipse SWT PI/carbon/library/os_stats.c 17 Apr 2008 21:13:15 -0000 1.118 >+++ Eclipse SWT PI/carbon/library/os_stats.c 7 May 2008 17:25:45 -0000 >@@ -14,8 +14,8 @@ > > #ifdef NATIVE_STATS > >-int OS_nativeFunctionCount = 969; >-int OS_nativeFunctionCallCount[969]; >+int OS_nativeFunctionCount = 970; >+int OS_nativeFunctionCallCount[970]; > char * OS_nativeFunctionNames[] = { > "AECoerceDesc", > "AECountItems", >@@ -544,6 +544,7 @@ > "HIObjectCreate", > "HIObjectRegisterSubclass", > "HIObjectSetAccessibilityIgnored", >+ "HIObjectSetAuxiliaryAccessibilityAttribute", > "HIScrollViewCreate", > "HIScrollViewSetScrollBarAutoHide", > "HISearchFieldChangeAttributes", >Index: Eclipse SWT/carbon/org/eclipse/swt/widgets/Control.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/Control.java,v >retrieving revision 1.277 >diff -u -r1.277 Control.java >--- Eclipse SWT/carbon/org/eclipse/swt/widgets/Control.java 5 May 2008 20:31:52 -0000 1.277 >+++ Eclipse SWT/carbon/org/eclipse/swt/widgets/Control.java 7 May 2008 17:26:08 -0000 >@@ -403,6 +403,9 @@ > addListener (SWT.MouseWheel, typedListener); > } > >+void addRelation (Control control) { >+} >+ > /** > * Adds the listener to the collection of listeners who will > * be notified when the receiver needs to be painted, by sending it >@@ -634,6 +637,7 @@ > checkBuffered (); > setDefaultFont (); > setZOrder (); >+ setRelations (); > } > > Color defaultBackground () { >@@ -1700,6 +1704,15 @@ > parent.invalWindowRgn (window, rgn); > } > >+/* >+ * Answers a boolean indicating whether a Label that precedes the receiver in >+ * a layout should be read by screen readers as the recevier's label. >+ */ >+boolean isDescribedByLabel () { >+ if (this instanceof org.eclipse.swt.custom.StyledText) return false; >+ return true; >+} >+ > /** > * Returns <code>true</code> if the receiver is enabled and all > * ancestors up to and including the receiver's nearest ancestor >@@ -2443,6 +2456,27 @@ > super.register (); > display.addWidget (handle, this); > } >+ >+void release (boolean destroy) { >+ Control next = null, previous = null; >+ if (destroy && parent != null) { >+ Control[] children = parent._getChildren (); >+ int index = 0; >+ while (index < children.length) { >+ if (children [index] == this) break; >+ index++; >+ } >+ if (0 < index && (index + 1) < children.length) { >+ next = children [index + 1]; >+ previous = children [index - 1]; >+ } >+ } >+ super.release (destroy); >+ if (destroy) { >+ if (previous != null) previous.addRelation (next); >+ } >+} >+ > void releaseHandle () { > super.releaseHandle (); > handle = 0; >@@ -2748,6 +2782,19 @@ > eventTable.unhook(SWT.Paint, listener); > } > >+/* >+ * Remove "Labeled by" relations from the receiver. >+ */ >+void removeRelation () { >+ if (!isDescribedByLabel ()) return; /* there will not be any */ >+ String string = OS.kAXTitleUIElementAttribute; >+ char [] buffer = new char [string.length ()]; >+ string.getChars (0, buffer.length, buffer, 0); >+ int stringRef = OS.CFStringCreateWithCharacters (OS.kCFAllocatorDefault, buffer, buffer.length); >+ OS.HIObjectSetAuxiliaryAccessibilityAttribute(handle, 0, stringRef, 0); >+ OS.CFRelease(stringRef); >+} >+ > /** > * Removes the listener from the collection of listeners who will > * be notified when traversal events occur. >@@ -3595,6 +3642,22 @@ > return false; > } > >+void setRelations () { >+ if (parent == null) return; >+ Control [] children = parent._getChildren (); >+ int count = children.length; >+ if (count > 1) { >+ /* >+ * the receiver is the last item in the list, so its predecessor will >+ * be the second-last item in the list >+ */ >+ Control child = children [count - 2]; >+ if (child != this) { >+ child.addRelation (this); >+ } >+ } >+} >+ > /** > * Sets the receiver's size to the point specified by the arguments. > * <p> >@@ -3746,9 +3809,68 @@ > OS.SetControlBounds (topHandle, rect); > } > >-void setZOrder (Control control, boolean above) { >- int otherControl = control == null ? 0 : control.topHandle (); >- setZOrder (topHandle (), otherControl, above); >+void setZOrder (Control sibling, boolean above) { >+ int siblingHandle = sibling == null ? 0 : sibling.topHandle (); >+ int index = 0, siblingIndex = 0, oldNextIndex = -1; >+ Control[] children = null; >+ /* determine the receiver's and sibling's indexes in the parent */ >+ children = parent._getChildren (); >+ while (index < children.length) { >+ if (children [index] == this) break; >+ index++; >+ } >+ if (sibling != null) { >+ while (siblingIndex < children.length) { >+ if (children [siblingIndex] == sibling) break; >+ siblingIndex++; >+ } >+ } >+ /* remove "Labeled by" relationships that will no longer be valid */ >+ removeRelation (); >+ if (index + 1 < children.length) { >+ oldNextIndex = index + 1; >+ children [oldNextIndex].removeRelation (); >+ } >+ if (sibling != null) { >+ if (above) { >+ sibling.removeRelation (); >+ } else { >+ if (siblingIndex + 1 < children.length) { >+ children [siblingIndex + 1].removeRelation (); >+ } >+ } >+ } >+ setZOrder (topHandle (), siblingHandle, above); >+ /* determine the receiver's new index in the parent */ >+ if (sibling != null) { >+ if (above) { >+ index = siblingIndex - (index < siblingIndex ? 1 : 0); >+ } else { >+ index = siblingIndex + (siblingIndex < index ? 1 : 0); >+ } >+ } else { >+ if (above) { >+ index = 0; >+ } else { >+ index = children.length - 1; >+ } >+ } >+ >+ /* add new "Labeled by" relations as needed */ >+ children = parent._getChildren (); >+ if (0 < index) { >+ children [index - 1].addRelation (this); >+ } >+ if (index + 1 < children.length) { >+ addRelation (children [index + 1]); >+ } >+ if (oldNextIndex != -1) { >+ if (oldNextIndex <= index) oldNextIndex--; >+ /* the last two conditions below ensure that duplicate relations are not hooked */ >+ if (0 < oldNextIndex && oldNextIndex != index && oldNextIndex != index + 1) { >+ children [oldNextIndex - 1].addRelation (children [oldNextIndex]); >+ } >+ } > } > > void sort (int [] items) { >Index: Eclipse SWT/carbon/org/eclipse/swt/widgets/Button.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/Button.java,v >retrieving revision 1.84 >diff -u -r1.84 Button.java >--- Eclipse SWT/carbon/org/eclipse/swt/widgets/Button.java 11 Apr 2008 19:46:56 -0000 1.84 >+++ Eclipse SWT/carbon/org/eclipse/swt/widgets/Button.java 7 May 2008 17:26:02 -0000 >@@ -428,6 +428,10 @@ > return display.buttonInset; > } > >+boolean isDescribedByLabel () { >+ return false; >+} >+ > int kEventAccessibleGetNamedAttribute (int nextHandler, int theEvent, int userData) { > int code = OS.CallNextEventHandler (nextHandler, theEvent); > if ((style & SWT.RADIO) != 0) { >Index: Eclipse SWT/carbon/org/eclipse/swt/widgets/Label.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/Label.java,v >retrieving revision 1.51 >diff -u -r1.51 Label.java >--- Eclipse SWT/carbon/org/eclipse/swt/widgets/Label.java 6 Mar 2008 16:27:27 -0000 1.51 >+++ Eclipse SWT/carbon/org/eclipse/swt/widgets/Label.java 7 May 2008 17:26:08 -0000 >@@ -85,6 +85,31 @@ > super (parent, checkStyle (style)); > } > >+void addRelation (Control control) { >+ if (!control.isDescribedByLabel ()) return; >+ >+ int labelElement = OS.AXUIElementCreateWithHIObjectAndIdentifier (handle, 0); >+ String string = OS.kAXTitleUIElementAttribute; // control LabeledBy this >+ char [] buffer = new char [string.length ()]; >+ string.getChars (0, buffer.length, buffer, 0); >+ int stringRef = OS.CFStringCreateWithCharacters (OS.kCFAllocatorDefault, buffer, buffer.length); >+ OS.HIObjectSetAuxiliaryAccessibilityAttribute(control.focusHandle (), 0, stringRef, labelElement); >+ OS.CFRelease(labelElement); >+ OS.CFRelease(stringRef); >+ >+ int relatedElement = OS.AXUIElementCreateWithHIObjectAndIdentifier (control.focusHandle (), 0); >+ int array = OS.CFArrayCreateMutable(OS.kCFAllocatorDefault, 1, 0); >+ OS.CFArrayAppendValue(array, relatedElement); >+ string = OS.kAXServesAsTitleForUIElementsAttribute; // this LabelFor control >+ buffer = new char [string.length ()]; >+ string.getChars (0, buffer.length, buffer, 0); >+ stringRef = OS.CFStringCreateWithCharacters (OS.kCFAllocatorDefault, buffer, buffer.length); >+ OS.HIObjectSetAuxiliaryAccessibilityAttribute(handle, 0, stringRef, array); >+ OS.CFRelease(relatedElement); >+ OS.CFRelease(stringRef); >+ OS.CFRelease(array); >+} >+ > static int checkStyle (int style) { > style |= SWT.NO_FOCUS; > if ((style & SWT.SEPARATOR) != 0) { >@@ -232,6 +257,22 @@ > return text; > } > >+boolean isDescribedByLabel () { >+ return false; >+} >+ >+/* >+ * Remove "Label for" relations from the receiver. >+ */ >+void removeRelation () { >+ String string = OS.kAXServesAsTitleForUIElementsAttribute; >+ char [] buffer = new char [string.length ()]; >+ string.getChars (0, buffer.length, buffer, 0); >+ int stringRef = OS.CFStringCreateWithCharacters (OS.kCFAllocatorDefault, buffer, buffer.length); >+ OS.HIObjectSetAuxiliaryAccessibilityAttribute(handle, 0, stringRef, 0); >+ OS.CFRelease(stringRef); >+} >+ > /** > * Controls how text and images will be displayed in the receiver. > * The argument should be one of <code>LEFT</code>, <code>RIGHT</code> >Index: Eclipse SWT PI/carbon/org/eclipse/swt/internal/carbon/OS.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.swt/Eclipse SWT PI/carbon/org/eclipse/swt/internal/carbon/OS.java,v >retrieving revision 1.304 >diff -u -r1.304 OS.java >--- Eclipse SWT PI/carbon/org/eclipse/swt/internal/carbon/OS.java 17 Apr 2008 21:13:15 -0000 1.304 >+++ Eclipse SWT PI/carbon/org/eclipse/swt/internal/carbon/OS.java 7 May 2008 17:25:59 -0000 >@@ -2000,6 +2000,7 @@ > public static final native int AXValueCreate (int theType, CFRange range); > public static final native boolean AXValueGetValue (int value, int theType, CFRange range); > public static final native int HIObjectSetAccessibilityIgnored(int inObject, boolean inIgnored); >+public static final native int HIObjectSetAuxiliaryAccessibilityAttribute(int inHIObject, long inIdentifier, int inAttributeName, int inAttributeData); > public static final native int AXUIElementCopyAttributeValue (int element, int attribute, int [] value); > > public static final int kEventClassAccessibility = ('a'<<24) + ('c'<<16) + ('c'<<8) + 'e';
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 212991
: 99124