From 6fe183daefd66fbba70d01f50115d37fed08c0a0 Mon Sep 17 00:00:00 2001 From: Ehsan Akhgari Date: Mon, 18 Jan 2010 14:03:47 -0500 Subject: [PATCH] Backout changeset 7a74aa79f2ea because accessibility builds on Mac fail to compile --- accessible/src/atk/nsAccessibleWrap.cpp | 10 ++++---- accessible/src/atk/nsAccessibleWrap.h | 4 ++-- accessible/src/base/nsAccessible.cpp | 2 +- accessible/src/base/nsAccessible.h | 23 +++++++++---------- accessible/src/base/nsEventShell.cpp | 2 +- accessible/src/mac/nsAccessibleWrap.h | 4 ++-- accessible/src/mac/nsAccessibleWrap.mm | 12 ++++++---- accessible/src/msaa/nsAccessibleWrap.cpp | 11 +++++---- accessible/src/msaa/nsAccessibleWrap.h | 4 ++-- .../src/msaa/nsHyperTextAccessibleWrap.cpp | 7 +++--- .../src/msaa/nsHyperTextAccessibleWrap.h | 2 +- accessible/src/other/nsAccessibleWrap.h | 2 +- accessible/src/xul/nsXULTreeAccessible.cpp | 4 ++-- 13 files changed, 48 insertions(+), 39 deletions(-) diff --git a/accessible/src/atk/nsAccessibleWrap.cpp b/accessible/src/atk/nsAccessibleWrap.cpp index c61f0545caba..ec9a80d74b28 100644 --- a/accessible/src/atk/nsAccessibleWrap.cpp +++ b/accessible/src/atk/nsAccessibleWrap.cpp @@ -1107,22 +1107,24 @@ nsAccessibleWrap *GetAccessibleWrap(AtkObject *aAtkObj) } nsresult -nsAccessibleWrap::HandleAccEvent(nsAccEvent *aEvent) +nsAccessibleWrap::FireAccessibleEvent(nsIAccessibleEvent *aEvent) { - nsresult rv = nsAccessible::HandleAccEvent(aEvent); + nsresult rv = nsAccessible::FireAccessibleEvent(aEvent); NS_ENSURE_SUCCESS(rv, rv); return FirePlatformEvent(aEvent); } nsresult -nsAccessibleWrap::FirePlatformEvent(nsAccEvent *aEvent) +nsAccessibleWrap::FirePlatformEvent(nsIAccessibleEvent *aEvent) { nsCOMPtr accessible; aEvent->GetAccessible(getter_AddRefs(accessible)); NS_ENSURE_TRUE(accessible, NS_ERROR_FAILURE); - PRUint32 type = aEvent->GetEventType(); + PRUint32 type = 0; + nsresult rv = aEvent->GetEventType(&type); + NS_ENSURE_SUCCESS(rv, rv); AtkObject *atkObj = nsAccessibleWrap::GetAtkObject(accessible); diff --git a/accessible/src/atk/nsAccessibleWrap.h b/accessible/src/atk/nsAccessibleWrap.h index 6ab94f5d4ce3..18786332c3b0 100644 --- a/accessible/src/atk/nsAccessibleWrap.h +++ b/accessible/src/atk/nsAccessibleWrap.h @@ -100,7 +100,7 @@ public: // return the atk object for this nsAccessibleWrap NS_IMETHOD GetNativeInterface(void **aOutAccessible); - virtual nsresult HandleAccEvent(nsAccEvent *aEvent); + NS_IMETHOD FireAccessibleEvent(nsIAccessibleEvent *aEvent); AtkObject * GetAtkObject(void); static AtkObject * GetAtkObject(nsIAccessible * acc); @@ -118,7 +118,7 @@ public: } protected: - virtual nsresult FirePlatformEvent(nsAccEvent *aEvent); + virtual nsresult FirePlatformEvent(nsIAccessibleEvent *aEvent); nsresult FireAtkStateChangeEvent(nsIAccessibleEvent *aEvent, AtkObject *aObject); diff --git a/accessible/src/base/nsAccessible.cpp b/accessible/src/base/nsAccessible.cpp index de41344cba79..241c0509add8 100644 --- a/accessible/src/base/nsAccessible.cpp +++ b/accessible/src/base/nsAccessible.cpp @@ -1356,7 +1356,7 @@ nsAccessible::GetXULName(nsAString& aLabel) } nsresult -nsAccessible::HandleAccEvent(nsAccEvent *aEvent) +nsAccessible::FireAccessibleEvent(nsIAccessibleEvent *aEvent) { NS_ENSURE_ARG_POINTER(aEvent); nsCOMPtr eventNode; diff --git a/accessible/src/base/nsAccessible.h b/accessible/src/base/nsAccessible.h index 6dd7e14955ad..8861ecea3e6f 100644 --- a/accessible/src/base/nsAccessible.h +++ b/accessible/src/base/nsAccessible.h @@ -104,11 +104,11 @@ private: #define NS_ACCESSIBLE_IMPL_CID \ -{ /* 133c8bf4-4913-4355-bd50-426bd1d6e1ad */ \ - 0x133c8bf4, \ - 0x4913, \ - 0x4355, \ - { 0xbd, 0x50, 0x42, 0x6b, 0xd1, 0xd6, 0xe1, 0xad } \ +{ /* c734df37-7e12-49ec-8983-eea88a186bb8 */ \ + 0xc734df37, \ + 0x7e12, \ + 0x49ec, \ + { 0x89, 0x83, 0xee, 0xa8, 0x8a, 0x18, 0x6b, 0xb8 } \ } class nsAccessible : public nsAccessNodeWrap, @@ -280,10 +280,9 @@ public: // Miscellaneous methods /** - * Handle accessible event, i.e. process it, notifies observers and fires - * platform specific event. + * Fire accessible event. */ - virtual nsresult HandleAccEvent(nsAccEvent *aAccEvent); + virtual nsresult FireAccessibleEvent(nsIAccessibleEvent *aAccEvent); /** * Return true if there are accessible children in anonymous content @@ -447,13 +446,13 @@ protected: /** * Fires platform accessible event. It's notification method only. It does - * change nothing on Gecko side. Don't use it until you're sure what you do - * (see example in XUL tree accessible), use nsEventShell::FireEvent() - * instead. MUST be overridden in wrap classes. + * change nothing on Gecko side. Mostly you should use + * nsIAccessible::FireAccessibleEvent excepting special cases like we have + * in xul:tree accessible to lie to AT. Must be overridden in wrap classes. * * @param aEvent the accessible event to fire. */ - virtual nsresult FirePlatformEvent(nsAccEvent *aEvent) = 0; + virtual nsresult FirePlatformEvent(nsIAccessibleEvent *aEvent) = 0; // Data Members nsRefPtr mParent; diff --git a/accessible/src/base/nsEventShell.cpp b/accessible/src/base/nsEventShell.cpp index c5f5ea29a137..aaa46c258abd 100644 --- a/accessible/src/base/nsEventShell.cpp +++ b/accessible/src/base/nsEventShell.cpp @@ -50,7 +50,7 @@ nsEventShell::FireEvent(nsAccEvent *aEvent) nsAccUtils::QueryObject(aEvent->GetAccessible()); NS_ENSURE_TRUE(acc,); - acc->HandleAccEvent(aEvent); + acc->FireAccessibleEvent(aEvent); } void diff --git a/accessible/src/mac/nsAccessibleWrap.h b/accessible/src/mac/nsAccessibleWrap.h index 9f1d8511c7ed..f26c57b33412 100644 --- a/accessible/src/mac/nsAccessibleWrap.h +++ b/accessible/src/mac/nsAccessibleWrap.h @@ -77,7 +77,7 @@ class nsAccessibleWrap : public nsAccessible virtual nsresult Shutdown (); virtual void InvalidateChildren(); - virtual nsresult FireAccessibleEvent(nsAccEvent *aEvent); + virtual nsresult FireAccessibleEvent(nsIAccessibleEvent *aEvent); // ignored means that the accessible might still have children, but is not displayed // to the user. it also has no native accessible object represented for it. @@ -97,7 +97,7 @@ class nsAccessibleWrap : public nsAccessible protected: - virtual nsresult FirePlatformEvent(nsAccEvent *aEvent); + virtual nsresult FirePlatformEvent(nsIAccessibleEvent *aEvent); PRBool AncestorIsFlat() { // we don't create a native object if we're child of a "flat" accessible; for example, on OS X buttons diff --git a/accessible/src/mac/nsAccessibleWrap.mm b/accessible/src/mac/nsAccessibleWrap.mm index ac7749bc49a2..5e2c353ccd73 100644 --- a/accessible/src/mac/nsAccessibleWrap.mm +++ b/accessible/src/mac/nsAccessibleWrap.mm @@ -160,11 +160,13 @@ nsAccessibleWrap::Shutdown () } nsresult -nsAccessibleWrap::HandleAccEvent(nsAccEvent *aEvent) +nsAccessibleWrap::FireAccessibleEvent(nsIAccessibleEvent *aEvent) { NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT; - nsresult rv = nsAccessible::HandleAccEvent(aEvent); + NS_ENSURE_ARG_POINTER(aEvent); + + nsresult rv = nsAccessible::FireAccessibleEvent(aEvent); NS_ENSURE_SUCCESS(rv, rv); return FirePlatformEvent(aEvent); @@ -173,11 +175,13 @@ nsAccessibleWrap::HandleAccEvent(nsAccEvent *aEvent) } nsresult -nsAccessibleWrap::FirePlatformEvent(nsAccEvent *aEvent) +nsAccessibleWrap::FirePlatformEvent(nsIAccessibleEvent *aEvent) { NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT; - PRUint32 eventType = aEvent->GetEventType(); + PRUint32 eventType; + nsresult rv = aEvent->GetEventType(&eventType); + NS_ENSURE_SUCCESS(rv, rv); // ignore everything but focus-changed and value-changed events for now. if (eventType != nsIAccessibleEvent::EVENT_FOCUS && diff --git a/accessible/src/msaa/nsAccessibleWrap.cpp b/accessible/src/msaa/nsAccessibleWrap.cpp index 6d9f3dabb949..3b203deb2cd4 100644 --- a/accessible/src/msaa/nsAccessibleWrap.cpp +++ b/accessible/src/msaa/nsAccessibleWrap.cpp @@ -1656,18 +1656,21 @@ NS_IMETHODIMP nsAccessibleWrap::GetNativeInterface(void **aOutAccessible) // nsAccessible nsresult -nsAccessibleWrap::HandleAccEvent(nsAccEvent *aEvent) +nsAccessibleWrap::FireAccessibleEvent(nsIAccessibleEvent *aEvent) { - nsresult rv = nsAccessible::HandleAccEvent(aEvent); + NS_ENSURE_ARG(aEvent); + + nsresult rv = nsAccessible::FireAccessibleEvent(aEvent); NS_ENSURE_SUCCESS(rv, rv); return FirePlatformEvent(aEvent); } nsresult -nsAccessibleWrap::FirePlatformEvent(nsAccEvent *aEvent) +nsAccessibleWrap::FirePlatformEvent(nsIAccessibleEvent *aEvent) { - PRUint32 eventType = aEvent->GetEventType(); + PRUint32 eventType = 0; + aEvent->GetEventType(&eventType); NS_ENSURE_TRUE(eventType > 0 && eventType < nsIAccessibleEvent::EVENT_LAST_ENTRY, diff --git a/accessible/src/msaa/nsAccessibleWrap.h b/accessible/src/msaa/nsAccessibleWrap.h index 667857285fd1..30afd8a19da1 100644 --- a/accessible/src/msaa/nsAccessibleWrap.h +++ b/accessible/src/msaa/nsAccessibleWrap.h @@ -307,7 +307,7 @@ class nsAccessibleWrap : public nsAccessible, UINT *puArgErr); // nsAccessible - virtual nsresult HandleAccEvent(nsAccEvent *aEvent); + virtual nsresult FireAccessibleEvent(nsIAccessibleEvent *aEvent); // Helper methods static PRInt32 GetChildIDFor(nsIAccessible* aAccessible); @@ -342,7 +342,7 @@ class nsAccessibleWrap : public nsAccessible, void UnattachIEnumVariant(); protected: - virtual nsresult FirePlatformEvent(nsAccEvent *aEvent); + virtual nsresult FirePlatformEvent(nsIAccessibleEvent *aEvent); // mEnumVARIANTPosition not the current accessible's position, but a "cursor" of // where we are in the current list of children, with respect to diff --git a/accessible/src/msaa/nsHyperTextAccessibleWrap.cpp b/accessible/src/msaa/nsHyperTextAccessibleWrap.cpp index 24e256432e20..68a53b79ae66 100644 --- a/accessible/src/msaa/nsHyperTextAccessibleWrap.cpp +++ b/accessible/src/msaa/nsHyperTextAccessibleWrap.cpp @@ -49,9 +49,10 @@ IMPL_IUNKNOWN_INHERITED2(nsHyperTextAccessibleWrap, CAccessibleEditableText); nsresult -nsHyperTextAccessibleWrap::HandleAccEvent(nsAccEvent *aEvent) +nsHyperTextAccessibleWrap::FireAccessibleEvent(nsIAccessibleEvent *aEvent) { - PRUint32 eventType = aEvent->GetEventType(); + PRUint32 eventType; + aEvent->GetEventType(&eventType); if (eventType == nsIAccessibleEvent::EVENT_TEXT_REMOVED || eventType == nsIAccessibleEvent::EVENT_TEXT_INSERTED) { @@ -73,7 +74,7 @@ nsHyperTextAccessibleWrap::HandleAccEvent(nsAccEvent *aEvent) } } - return nsHyperTextAccessible::HandleAccEvent(aEvent); + return nsHyperTextAccessible::FireAccessibleEvent(aEvent); } nsresult diff --git a/accessible/src/msaa/nsHyperTextAccessibleWrap.h b/accessible/src/msaa/nsHyperTextAccessibleWrap.h index 86a69eb590d6..fbe8f32cdbc2 100644 --- a/accessible/src/msaa/nsHyperTextAccessibleWrap.h +++ b/accessible/src/msaa/nsHyperTextAccessibleWrap.h @@ -61,7 +61,7 @@ public: NS_DECL_ISUPPORTS_INHERITED // nsAccessible - virtual nsresult HandleAccEvent(nsAccEvent *aEvent); + virtual nsresult FireAccessibleEvent(nsIAccessibleEvent *aEvent); protected: virtual nsresult GetModifiedText(PRBool aGetInsertedText, nsAString& aText, diff --git a/accessible/src/other/nsAccessibleWrap.h b/accessible/src/other/nsAccessibleWrap.h index 8aa7c08cb544..b535c34123f5 100644 --- a/accessible/src/other/nsAccessibleWrap.h +++ b/accessible/src/other/nsAccessibleWrap.h @@ -53,7 +53,7 @@ class nsAccessibleWrap : public nsAccessible virtual ~nsAccessibleWrap(); protected: - virtual nsresult FirePlatformEvent(nsAccEvent *aEvent) { + virtual nsresult FirePlatformEvent(nsIAccessibleEvent *aEvent) { return NS_OK; } }; diff --git a/accessible/src/xul/nsXULTreeAccessible.cpp b/accessible/src/xul/nsXULTreeAccessible.cpp index 3f5f5fc79181..8f8d4e790f95 100644 --- a/accessible/src/xul/nsXULTreeAccessible.cpp +++ b/accessible/src/xul/nsXULTreeAccessible.cpp @@ -683,7 +683,7 @@ nsXULTreeAccessible::TreeViewChanged() // Fire only notification destroy/create events on accessible tree to lie to // AT because it should be expensive to fire destroy events for each tree item // in cache. - nsRefPtr eventDestroy = + nsCOMPtr eventDestroy = new nsAccEvent(nsIAccessibleEvent::EVENT_HIDE, this, PR_FALSE); if (!eventDestroy) return; @@ -694,7 +694,7 @@ nsXULTreeAccessible::TreeViewChanged() mTree->GetView(getter_AddRefs(mTreeView)); - nsRefPtr eventCreate = + nsCOMPtr eventCreate = new nsAccEvent(nsIAccessibleEvent::EVENT_SHOW, this, PR_FALSE); if (!eventCreate) return;