From 8226f613575b733d4012a06cf3f4d7a19ae40617 Mon Sep 17 00:00:00 2001 From: "aaronleventhal%moonset.net" Date: Mon, 26 Jun 2006 13:35:36 +0000 Subject: [PATCH] Backing out bug 340672 as a bustage fix. --- accessible/src/atk/nsDocAccessibleWrap.cpp | 7 ++++--- accessible/src/base/nsAccessibleEventData.h | 4 ++-- accessible/src/base/nsRootAccessible.cpp | 22 +++++++++------------ 3 files changed, 15 insertions(+), 18 deletions(-) diff --git a/accessible/src/atk/nsDocAccessibleWrap.cpp b/accessible/src/atk/nsDocAccessibleWrap.cpp index 4165dfeb9622..404e82258331 100644 --- a/accessible/src/atk/nsDocAccessibleWrap.cpp +++ b/accessible/src/atk/nsDocAccessibleWrap.cpp @@ -196,9 +196,10 @@ NS_IMETHODIMP nsDocAccessibleWrap::FireToolkitEvent(PRUint32 aEvent, //Perhaps need more cases in the future default: - // Old value not used for anything other than state change events - g_value_init(&values.new_value, G_TYPE_DOUBLE); - g_value_set_double(&values.new_value, pAtkPropChange->newvalue); + g_value_init (&values.old_value, G_TYPE_POINTER); + g_value_set_pointer (&values.old_value, pAtkPropChange->oldvalue); + g_value_init (&values.new_value, G_TYPE_POINTER); + g_value_set_pointer (&values.new_value, pAtkPropChange->newvalue); rv = NS_OK; } if (NS_SUCCEEDED(rv)) { diff --git a/accessible/src/base/nsAccessibleEventData.h b/accessible/src/base/nsAccessibleEventData.h index 01ee8bdaf0df..b2261841b9c8 100644 --- a/accessible/src/base/nsAccessibleEventData.h +++ b/accessible/src/base/nsAccessibleEventData.h @@ -111,8 +111,8 @@ enum AtkProperty { struct AtkPropertyChange { PRInt32 type; // property type as listed above - double oldvalue; - double newvalue; + void *oldvalue; + void *newvalue; }; struct AtkChildrenChange { diff --git a/accessible/src/base/nsRootAccessible.cpp b/accessible/src/base/nsRootAccessible.cpp index fcf0dd67cc15..090025662048 100644 --- a/accessible/src/base/nsRootAccessible.cpp +++ b/accessible/src/base/nsRootAccessible.cpp @@ -805,22 +805,18 @@ NS_IMETHODIMP nsRootAccessible::HandleEvent(nsIDOMEvent* aEvent) privAcc->FireToolkitEvent(nsIAccessibleEvent::EVENT_REORDER, accessible, nsnull); } } - // Value change events for ATK are done with +#if 0 + // XXX todo: value change events for ATK are done with // AtkPropertyChange, PROP_VALUE. Need the old and new value. - // Don't bother sending old value, it's not used. + // 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!?) else if (eventType.LowerCaseEqualsLiteral("valuechange")) { - nsCOMPtr accValue(do_QueryInterface(privAcc)); - NS_ASSERTION(accValue, "No nsIAccessibleValue for source of value change event"); - if (accValue) { - AtkPropertyChange propChange; - propChange.type = PROP_VALUE; - propChange.oldValue = 0; // Not used - nsresult rv = accValue->GetCurrentValue(&propChange.newValue); - NS_ENSURE_SUCCESS(rv, rv); - privAcc->FireToolkitEvent(nsIAccessibleEvent::EVENT_ATK_PROPERTY_CHANGE, - accessible, &propChange); - } + privAcc->FireToolkitEvent(nsIAccessibleEvent::EVENT_VALUE_CHANGE, + accessible, nsnull); } +#endif else if (eventType.LowerCaseEqualsLiteral("checkboxstatechange") || // it's a XUL eventType.LowerCaseEqualsLiteral("radiostatechange")) { // it's a XUL accessible->GetFinalState(&stateData.state);