int length = OS.CFArrayGetCount(stringArrayRef); String [] osAllAttributes = new String [length]; for (int i = 0; i < length; i++) { int stringRef = OS.CFArrayGetValueAtIndex(stringArrayRef, i); osAllAttributes[i] = stringRefToString (stringRef);
for (int i = 0; i < requiredAttributes.length; i++) { int stringRef = stringToStringRef(requiredAttributes[i]); OS.CFArrayAppendValue(stringArrayRef, stringRef); OS.CFRelease(stringRef);
	public int internal_kEventAccessibleGetAllAttributeNames (int nextHandler, int theEvent, int userData) {		if (axuielementref != 0) {			int [] arrayRef = new int[1];			OS.GetEventParameter (theEvent, OS.kEventParamAccessibleAttributeNames, OS.typeCFMutableArrayRef, null, 4, null, arrayRef);			int stringArrayRef = arrayRef[0];			int length = OS.CFArrayGetCount(stringArrayRef);			String [] osAllAttributes = new String [length];			for (int i = 0; i < length; i++) {				int stringRef = OS.CFArrayGetValueAtIndex(stringArrayRef, i);				osAllAttributes[i] = stringRefToString (stringRef);			}			/* Add our list of supported attributes to the array. */			String [] requiredAttributes = {				OS.kAXRoleAttribute,				OS.kAXSubroleAttribute,				OS.kAXRoleDescriptionAttribute,				OS.kAXHelpAttribute,				OS.kAXTitleAttribute,				OS.kAXValueAttribute,				OS.kAXEnabledAttribute,				OS.kAXFocusedAttribute,				OS.kAXParentAttribute,				OS.kAXChildrenAttribute,				OS.kAXSelectedChildrenAttribute,				OS.kAXVisibleChildrenAttribute,				OS.kAXWindowAttribute,				OS.kAXTopLevelUIElementAttribute,				OS.kAXPositionAttribute,				OS.kAXSizeAttribute,				OS.kAXDescriptionAttribute,			};			for (int i = 0; i < requiredAttributes.length; i++) {				OS.CFArrayAppendValue(stringArrayRef, stringToStringRef(requiredAttributes[i]));			}			return OS.noErr;		}		return OS.eventNotHandledErr;	}