From 373098cd3a39688b09141f939283d80c9987c8d1 Mon Sep 17 00:00:00 2001 From: "aaronleventhal%moonset.net" Date: Mon, 26 Jun 2006 13:37:03 +0000 Subject: [PATCH] Bug 340665. New ATK: expose links as ATK_ROLE_LINK, if available. r=Evan.Yan --- accessible/src/atk/nsDocAccessibleWrap.cpp | 12 ++++++++++++ accessible/src/base/nsRootAccessible.cpp | 17 ++++++++--------- 2 files changed, 20 insertions(+), 9 deletions(-) diff --git a/accessible/src/atk/nsDocAccessibleWrap.cpp b/accessible/src/atk/nsDocAccessibleWrap.cpp index 404e82258331..8f34597ada74 100644 --- a/accessible/src/atk/nsDocAccessibleWrap.cpp +++ b/accessible/src/atk/nsDocAccessibleWrap.cpp @@ -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 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: diff --git a/accessible/src/base/nsRootAccessible.cpp b/accessible/src/base/nsRootAccessible.cpp index 090025662048..a218c80416bb 100644 --- a/accessible/src/base/nsRootAccessible.cpp +++ b/accessible/src/base/nsRootAccessible.cpp @@ -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 eventType.LowerCaseEqualsLiteral("radiostatechange")) { // it's a XUL accessible->GetFinalState(&stateData.state);