Backout changeset 7a74aa79f2ea because accessibility builds on Mac fail to compile

This commit is contained in:
Ehsan Akhgari 2010-01-18 14:03:47 -05:00
parent 884977a4ad
commit 6fe183daef
13 changed files with 48 additions and 39 deletions

View File

@ -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<nsIAccessible> 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);

View File

@ -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);

View File

@ -1356,7 +1356,7 @@ nsAccessible::GetXULName(nsAString& aLabel)
}
nsresult
nsAccessible::HandleAccEvent(nsAccEvent *aEvent)
nsAccessible::FireAccessibleEvent(nsIAccessibleEvent *aEvent)
{
NS_ENSURE_ARG_POINTER(aEvent);
nsCOMPtr<nsIDOMNode> eventNode;

View File

@ -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<nsAccessible> mParent;

View File

@ -50,7 +50,7 @@ nsEventShell::FireEvent(nsAccEvent *aEvent)
nsAccUtils::QueryObject<nsAccessible>(aEvent->GetAccessible());
NS_ENSURE_TRUE(acc,);
acc->HandleAccEvent(aEvent);
acc->FireAccessibleEvent(aEvent);
}
void

View File

@ -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

View File

@ -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 &&

View File

@ -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,

View File

@ -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

View File

@ -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

View File

@ -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,

View File

@ -53,7 +53,7 @@ class nsAccessibleWrap : public nsAccessible
virtual ~nsAccessibleWrap();
protected:
virtual nsresult FirePlatformEvent(nsAccEvent *aEvent) {
virtual nsresult FirePlatformEvent(nsIAccessibleEvent *aEvent) {
return NS_OK;
}
};

View File

@ -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<nsAccEvent> eventDestroy =
nsCOMPtr<nsIAccessibleEvent> eventDestroy =
new nsAccEvent(nsIAccessibleEvent::EVENT_HIDE, this, PR_FALSE);
if (!eventDestroy)
return;
@ -694,7 +694,7 @@ nsXULTreeAccessible::TreeViewChanged()
mTree->GetView(getter_AddRefs(mTreeView));
nsRefPtr<nsAccEvent> eventCreate =
nsCOMPtr<nsIAccessibleEvent> eventCreate =
new nsAccEvent(nsIAccessibleEvent::EVENT_SHOW, this, PR_FALSE);
if (!eventCreate)
return;