Bug 340665. New ATK: expose links as ATK_ROLE_LINK, if available. r=Evan.Yan

This commit is contained in:
aaronleventhal%moonset.net 2006-06-26 13:37:03 +00:00
parent 8226f61357
commit 373098cd3a
2 changed files with 20 additions and 9 deletions

View File

@ -193,6 +193,18 @@ NS_IMETHODIMP nsDocAccessibleWrap::FireToolkitEvent(PRUint32 aEvent,
pAtkPropChange->newvalue));
rv = NS_OK;
break;
case PROP_VALUE:
{
// Old value not used for anything other than state change events
nsCOMPtr<nsIAccessibleValue> accValue(do_QueryInterface(aAccessible));
NS_ENSURE_TRUE(accValue, NS_ERROR_FAILURE);
double newValue;
rv = accValue->GetCurrentValue(&newValue);
NS_ENSURE_SUCCESS(rv, rv);
g_value_init(&values.new_value, G_TYPE_DOUBLE);
g_value_set_double(&values.new_value, newValue);
}
break;
//Perhaps need more cases in the future
default:

View File

@ -805,18 +805,17 @@ NS_IMETHODIMP nsRootAccessible::HandleEvent(nsIDOMEvent* aEvent)
privAcc->FireToolkitEvent(nsIAccessibleEvent::EVENT_REORDER, accessible, nsnull);
}
}
#if 0
// XXX todo: value change events for ATK are done with
// Value change events for ATK are done with
// AtkPropertyChange, PROP_VALUE. Need the old and new value.
// Not sure how we'll get the old value.
// Aaron: I think this is a problem with the ATK API -- its much harder to
// grab the old value for all the application developers than it is for
// AT's to cache old values when they need to (when would that be!?)
// Don't bother sending old value, it's not used.
else if (eventType.LowerCaseEqualsLiteral("valuechange")) {
privAcc->FireToolkitEvent(nsIAccessibleEvent::EVENT_VALUE_CHANGE,
accessible, nsnull);
AtkPropertyChange propChange;
propChange.type = PROP_VALUE;
propChange.oldvalue = 0; // Not used
propChange.newvalue = 0; // ATK code will get the value directly from accessible
privAcc->FireToolkitEvent(nsIAccessibleEvent::EVENT_ATK_PROPERTY_CHANGE,
accessible, &propChange);
}
#endif
else if (eventType.LowerCaseEqualsLiteral("checkboxstatechange") || // it's a XUL <checkbox>
eventType.LowerCaseEqualsLiteral("radiostatechange")) { // it's a XUL <radio>
accessible->GetFinalState(&stateData.state);