author | Ed Morley <emorley@mozilla.com> |
Tue, 29 May 2012 12:49:27 +0100 | |
changeset 95240 | 78852a6d11abb1402be20ef77691a45bc34b724f |
parent 95239 | 2582b429e8969ae9f09a99a542d090643393ffba (current diff) |
parent 95159 | ce3d4fd7033b660c8e62fb545bd4cca715da7566 (diff) |
child 95241 | 3e32a1d1f1a8566fe498cffee70865c23aaee88d |
push id | 10021 |
push user | emorley@mozilla.com |
push date | Wed, 30 May 2012 12:26:57 +0000 |
treeherder | mozilla-inbound@3d44f463aad4 [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
milestone | 15.0a1 |
first release with | nightly linux32
78852a6d11ab
/
15.0a1
/
20120529052711
/
files
nightly linux64
78852a6d11ab
/
15.0a1
/
20120529052711
/
files
nightly mac
78852a6d11ab
/
15.0a1
/
20120529052711
/
files
nightly win32
78852a6d11ab
/
15.0a1
/
20120529052711
/
files
nightly win64
78852a6d11ab
/
15.0a1
/
20120529052711
/
files
|
last release without | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
releases | nightly linux32
15.0a1
/
20120529052711
/
pushlog to previous
nightly linux64
15.0a1
/
20120529052711
/
pushlog to previous
nightly mac
15.0a1
/
20120529052711
/
pushlog to previous
nightly win32
15.0a1
/
20120529052711
/
pushlog to previous
nightly win64
15.0a1
/
20120529052711
/
pushlog to previous
|
--- a/accessible/public/nsIAccessibilityService.h +++ b/accessible/public/nsIAccessibilityService.h @@ -7,17 +7,17 @@ #ifndef _nsIAccessibilityService_h_ #define _nsIAccessibilityService_h_ #include "nsIAccessibleRetrieval.h" #include "nsIAccessibleEvent.h" #include "nsAutoPtr.h" -class nsAccessible; +class Accessible; class nsINode; class nsIContent; class nsIDocument; class nsIFrame; class nsIPresShell; class nsObjectFrame; // 10ff6dca-b219-4b64-9a4c-67a62b86edce @@ -32,36 +32,36 @@ public: /** * Return an accessible object for a DOM node in the given pres shell. * * @param aNode [in] the DOM node to get an accessible for * @param aPresShell [in] the presentation shell which contains layout info * for the DOM node */ - virtual nsAccessible* GetAccessible(nsINode* aNode, - nsIPresShell* aPresShell) = 0; + virtual Accessible* GetAccessible(nsINode* aNode, + nsIPresShell* aPresShell) = 0; /** * Return root document accessible that is or contains a document accessible * for the given presshell. * * @param aPresShell [in] the presshell * @param aCanCreate [in] points whether the root document accessible * should be returned from the cache or can be created */ - virtual nsAccessible* GetRootDocumentAccessible(nsIPresShell* aPresShell, - bool aCanCreate) = 0; + virtual Accessible* GetRootDocumentAccessible(nsIPresShell* aPresShell, + bool aCanCreate) = 0; /** * Adds/remove ATK root accessible for gtk+ native window to/from children * of the application accessible. */ - virtual nsAccessible* AddNativeRootAccessible(void* aAtkAccessible) = 0; - virtual void RemoveNativeRootAccessible(nsAccessible* aRootAccessible) = 0; + virtual Accessible* AddNativeRootAccessible(void* aAtkAccessible) = 0; + virtual void RemoveNativeRootAccessible(Accessible* aRootAccessible) = 0; /** * Notification used to update the accessible tree when new content is * inserted. */ virtual void ContentRangeInserted(nsIPresShell* aPresShell, nsIContent* aContainer, nsIContent* aStartChild, @@ -86,17 +86,17 @@ public: virtual void PresShellDestroyed(nsIPresShell *aPresShell) = 0; /** * Fire accessible event of the given type for the given target. * * @param aEvent [in] accessible event type * @param aTarget [in] target of accessible event */ - virtual void FireAccessibleEvent(PRUint32 aEvent, nsAccessible* aTarget) = 0; + virtual void FireAccessibleEvent(PRUint32 aEvent, Accessible* aTarget) = 0; }; NS_DEFINE_STATIC_IID_ACCESSOR(nsIAccessibilityService, NS_IACCESSIBILITYSERVICE_IID) // for component registration // {DE401C37-9A7F-4278-A6F8-3DE2833989EF} #define NS_ACCESSIBILITY_SERVICE_CID \
--- a/accessible/public/nsIAccessibleText.idl +++ b/accessible/public/nsIAccessibleText.idl @@ -1,38 +1,38 @@ /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "nsISupports.idl" -typedef long nsAccessibleTextBoundary; +typedef long AccessibleTextBoundary; interface nsIAccessible; interface nsIPersistentProperties; [scriptable, uuid(0f4633b1-550c-4b50-8c04-0eb1005eef2f)] interface nsIAccessibleText : nsISupports { // In parameters for character offsets: // -1 will be treated as the equal to the end of the text // -2 will be treated as the caret position const PRInt32 TEXT_OFFSET_END_OF_TEXT = -1; const PRInt32 TEXT_OFFSET_CARET = -2; - const nsAccessibleTextBoundary BOUNDARY_CHAR = 0; - const nsAccessibleTextBoundary BOUNDARY_WORD_START = 1; - const nsAccessibleTextBoundary BOUNDARY_WORD_END = 2; - const nsAccessibleTextBoundary BOUNDARY_SENTENCE_START = 3; // don't use, deprecated - const nsAccessibleTextBoundary BOUNDARY_SENTENCE_END = 4; // don't use, deprecated - const nsAccessibleTextBoundary BOUNDARY_LINE_START = 5; - const nsAccessibleTextBoundary BOUNDARY_LINE_END = 6; - const nsAccessibleTextBoundary BOUNDARY_ATTRIBUTE_RANGE = 7; + const AccessibleTextBoundary BOUNDARY_CHAR = 0; + const AccessibleTextBoundary BOUNDARY_WORD_START = 1; + const AccessibleTextBoundary BOUNDARY_WORD_END = 2; + const AccessibleTextBoundary BOUNDARY_SENTENCE_START = 3; // don't use, deprecated + const AccessibleTextBoundary BOUNDARY_SENTENCE_END = 4; // don't use, deprecated + const AccessibleTextBoundary BOUNDARY_LINE_START = 5; + const AccessibleTextBoundary BOUNDARY_LINE_END = 6; + const AccessibleTextBoundary BOUNDARY_ATTRIBUTE_RANGE = 7; /** * The current current caret offset. * If set < 0 then caret will be placed at the end of the text */ attribute long caretOffset; readonly attribute long characterCount; @@ -42,27 +42,27 @@ interface nsIAccessibleText : nsISupport * String methods may need to return multibyte-encoded strings, * since some locales can't be encoded using 16-bit chars. * So the methods below might return UTF-16 strings, or they could * return "string" values which are UTF-8. */ AString getText (in long startOffset, in long endOffset); AString getTextAfterOffset (in long offset, - in nsAccessibleTextBoundary boundaryType, + in AccessibleTextBoundary boundaryType, out long startOffset, out long endOffset); AString getTextAtOffset (in long offset, - in nsAccessibleTextBoundary boundaryType, + in AccessibleTextBoundary boundaryType, out long startOffset, out long endOffset); AString getTextBeforeOffset (in long offset, - in nsAccessibleTextBoundary boundaryType, + in AccessibleTextBoundary boundaryType, out long startOffset, out long endOffset); /** * It would be better to return an unsigned long here, * to allow unicode chars > 16 bits */ wchar getCharacterAtOffset (in long offset);
rename from accessible/src/atk/nsAccessibleWrap.cpp rename to accessible/src/atk/AccessibleWrap.cpp --- a/accessible/src/atk/nsAccessibleWrap.cpp +++ b/accessible/src/atk/AccessibleWrap.cpp @@ -1,15 +1,15 @@ /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* vim: set ts=2 et sw=2 tw=80: */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#include "nsAccessibleWrap.h" +#include "AccessibleWrap.h" #include "Accessible-inl.h" #include "ApplicationAccessibleWrap.h" #include "InterfaceInitFuncs.h" #include "nsAccUtils.h" #include "nsIAccessibleRelation.h" #include "RootAccessible.h" #include "nsIAccessibleValue.h" @@ -25,17 +25,17 @@ #include "mozilla/Util.h" #include "nsXPCOMStrings.h" #include "nsComponentManagerUtils.h" using namespace mozilla; using namespace mozilla::a11y; -nsAccessibleWrap::EAvailableAtkSignals nsAccessibleWrap::gAvailableAtkSignals = +AccessibleWrap::EAvailableAtkSignals AccessibleWrap::gAvailableAtkSignals = eUnknown; //defined in ApplicationAccessibleWrap.cpp extern "C" GType g_atk_hyperlink_impl_type; /* MaiAtkObject */ enum { @@ -120,22 +120,22 @@ static const GInterfaceInfo atk_if_infos (GInterfaceFinalizeFunc) NULL, NULL} }; /** * This MaiAtkObject is a thin wrapper, in the MAI namespace, for AtkObject */ struct MaiAtkObject { - AtkObject parent; - /* - * The nsAccessibleWrap whose properties and features are exported - * via this object instance. - */ - nsAccessibleWrap *accWrap; + AtkObject parent; + /* + * The AccessibleWrap whose properties and features are exported + * via this object instance. + */ + AccessibleWrap* accWrap; }; struct MaiAtkObjectClass { AtkObjectClass parent_class; }; static guint mai_atk_object_signals [LAST_SIGNAL] = { 0, }; @@ -227,64 +227,66 @@ mai_atk_object_get_type(void) type = g_type_register_static(ATK_TYPE_OBJECT, "MaiAtkObject", &tinfo, GTypeFlags(0)); quark_mai_hyperlink = g_quark_from_static_string("MaiHyperlink"); } return type; } #ifdef MAI_LOGGING -PRInt32 nsAccessibleWrap::mAccWrapCreated = 0; -PRInt32 nsAccessibleWrap::mAccWrapDeleted = 0; +PRInt32 AccessibleWrap::mAccWrapCreated = 0; +PRInt32 AccessibleWrap::mAccWrapDeleted = 0; #endif -nsAccessibleWrap:: - nsAccessibleWrap(nsIContent* aContent, DocAccessible* aDoc) : - nsAccessible(aContent, aDoc), mAtkObject(nsnull) +AccessibleWrap:: + AccessibleWrap(nsIContent* aContent, DocAccessible* aDoc) : + Accessible(aContent, aDoc), mAtkObject(nsnull) { #ifdef MAI_LOGGING - ++mAccWrapCreated; + ++mAccWrapCreated; #endif - MAI_LOG_DEBUG(("==nsAccessibleWrap creating: this=%p,total=%d left=%d\n", - (void*)this, mAccWrapCreated, - (mAccWrapCreated-mAccWrapDeleted))); + MAI_LOG_DEBUG(("==AccessibleWrap creating: this=%p,total=%d left=%d\n", + (void*)this, mAccWrapCreated, + (mAccWrapCreated-mAccWrapDeleted))); } -nsAccessibleWrap::~nsAccessibleWrap() +AccessibleWrap::~AccessibleWrap() { NS_ASSERTION(!mAtkObject, "ShutdownAtkObject() is not called"); #ifdef MAI_LOGGING ++mAccWrapDeleted; #endif - MAI_LOG_DEBUG(("==nsAccessibleWrap deleting: this=%p,total=%d left=%d\n", + MAI_LOG_DEBUG(("==AccessibleWrap deleting: this=%p,total=%d left=%d\n", (void*)this, mAccWrapDeleted, (mAccWrapCreated-mAccWrapDeleted))); } -void nsAccessibleWrap::ShutdownAtkObject() +void +AccessibleWrap::ShutdownAtkObject() { if (mAtkObject) { if (IS_MAI_OBJECT(mAtkObject)) { MAI_ATK_OBJECT(mAtkObject)->accWrap = nsnull; } SetMaiHyperlink(nsnull); g_object_unref(mAtkObject); mAtkObject = nsnull; } } void -nsAccessibleWrap::Shutdown() +AccessibleWrap::Shutdown() { - ShutdownAtkObject(); - nsAccessible::Shutdown(); + ShutdownAtkObject(); + Accessible::Shutdown(); } -MaiHyperlink* nsAccessibleWrap::GetMaiHyperlink(bool aCreate /* = true */) +MaiHyperlink* +AccessibleWrap::GetMaiHyperlink(bool aCreate /* = true */) { // make sure mAtkObject is created GetAtkObject(); NS_ASSERTION(quark_mai_hyperlink, "quark_mai_hyperlink not initialized"); NS_ASSERTION(IS_MAI_OBJECT(mAtkObject), "Invalid AtkObject"); MaiHyperlink* maiHyperlink = nsnull; if (quark_mai_hyperlink && IS_MAI_OBJECT(mAtkObject)) { @@ -293,32 +295,34 @@ MaiHyperlink* nsAccessibleWrap::GetMaiHy if (!maiHyperlink && aCreate) { maiHyperlink = new MaiHyperlink(this); SetMaiHyperlink(maiHyperlink); } } return maiHyperlink; } -void nsAccessibleWrap::SetMaiHyperlink(MaiHyperlink* aMaiHyperlink) +void +AccessibleWrap::SetMaiHyperlink(MaiHyperlink* aMaiHyperlink) { NS_ASSERTION(quark_mai_hyperlink, "quark_mai_hyperlink not initialized"); NS_ASSERTION(IS_MAI_OBJECT(mAtkObject), "Invalid AtkObject"); if (quark_mai_hyperlink && IS_MAI_OBJECT(mAtkObject)) { MaiHyperlink* maiHyperlink = GetMaiHyperlink(false); if (!maiHyperlink && !aMaiHyperlink) { return; // Never set and we're shutting down } delete maiHyperlink; g_object_set_qdata(G_OBJECT(mAtkObject), quark_mai_hyperlink, aMaiHyperlink); } } -NS_IMETHODIMP nsAccessibleWrap::GetNativeInterface(void **aOutAccessible) +NS_IMETHODIMP +AccessibleWrap::GetNativeInterface(void** aOutAccessible) { *aOutAccessible = nsnull; if (!mAtkObject) { if (IsDefunct() || !nsAccUtils::IsEmbeddedObject(this)) { // We don't create ATK objects for node which has been shutdown, or // nsIAccessible plain text leaves return NS_ERROR_FAILURE; @@ -336,36 +340,36 @@ NS_IMETHODIMP nsAccessibleWrap::GetNativ mAtkObject->layer = ATK_LAYER_INVALID; } *aOutAccessible = mAtkObject; return NS_OK; } AtkObject * -nsAccessibleWrap::GetAtkObject(void) +AccessibleWrap::GetAtkObject(void) { void *atkObj = nsnull; GetNativeInterface(&atkObj); return static_cast<AtkObject *>(atkObj); } // Get AtkObject from nsIAccessible interface /* static */ AtkObject * -nsAccessibleWrap::GetAtkObject(nsIAccessible * acc) +AccessibleWrap::GetAtkObject(nsIAccessible* acc) { void *atkObjPtr = nsnull; acc->GetNativeInterface(&atkObjPtr); return atkObjPtr ? ATK_OBJECT(atkObjPtr) : nsnull; } /* private */ PRUint16 -nsAccessibleWrap::CreateMaiInterfaces(void) +AccessibleWrap::CreateMaiInterfaces(void) { PRUint16 interfacesBits = 0; // The Component interface is supported by all accessibles. interfacesBits |= 1 << MAI_INTERFACE_COMPONENT; // Add Action interface if the action count is more than zero. if (ActionCount() > 0) @@ -464,34 +468,35 @@ GetMaiAtkType(PRUint16 interfacesBits) GetAtkTypeForMai((MaiInterfaceType)index), &atk_if_infos[index]); } } return type; } -static const char * +static const char* GetUniqueMaiAtkTypeName(PRUint16 interfacesBits) { #define MAI_ATK_TYPE_NAME_LEN (30) /* 10+sizeof(PRUint16)*8/4+1 < 30 */ static gchar namePrefix[] = "MaiAtkType"; /* size = 10 */ static gchar name[MAI_ATK_TYPE_NAME_LEN + 1]; PR_snprintf(name, MAI_ATK_TYPE_NAME_LEN, "%s%x", namePrefix, interfacesBits); name[MAI_ATK_TYPE_NAME_LEN] = '\0'; MAI_LOG_DEBUG(("MaiWidget::LastedTypeName=%s\n", name)); return name; } -bool nsAccessibleWrap::IsValidObject() +bool +AccessibleWrap::IsValidObject() { // to ensure we are not shut down return !IsDefunct(); } /* static functions for ATK callbacks */ void classInitCB(AtkObjectClass *aClass) @@ -593,19 +598,19 @@ initializeCB(AtkObject *aAtkObj, gpointe /* call parent init function */ /* AtkObjectClass has not a "initialize" function now, * maybe it has later */ if (ATK_OBJECT_CLASS(parent_class)->initialize) ATK_OBJECT_CLASS(parent_class)->initialize(aAtkObj, aData); - /* initialize object */ - MAI_ATK_OBJECT(aAtkObj)->accWrap = - static_cast<nsAccessibleWrap*>(aData); + /* initialize object */ + MAI_ATK_OBJECT(aAtkObj)->accWrap = + static_cast<AccessibleWrap*>(aData); #ifdef MAI_LOGGING ++sMaiAtkObjCreated; #endif MAI_LOG_DEBUG(("MaiAtkObj Create obj=%p for AccWrap=%p, all=%d, left=%d\n", (void*)aAtkObj, (void*)aData, sMaiAtkObjCreated, (sMaiAtkObjCreated-sMaiAtkObjDeleted))); } @@ -628,34 +633,34 @@ finalizeCB(GObject *aObj) // finalize of GObjectClass will unref the accessible parent if has if (G_OBJECT_CLASS (parent_class)->finalize) G_OBJECT_CLASS (parent_class)->finalize(aObj); } const gchar* getNameCB(AtkObject* aAtkObj) { - nsAccessibleWrap* accWrap = GetAccessibleWrap(aAtkObj); + AccessibleWrap* accWrap = GetAccessibleWrap(aAtkObj); if (!accWrap) return nsnull; nsAutoString uniName; accWrap->Name(uniName); NS_ConvertUTF8toUTF16 objName(aAtkObj->name); if (!uniName.Equals(objName)) atk_object_set_name(aAtkObj, NS_ConvertUTF16toUTF8(uniName).get()); return aAtkObj->name; } const gchar * getDescriptionCB(AtkObject *aAtkObj) { - nsAccessibleWrap *accWrap = GetAccessibleWrap(aAtkObj); + AccessibleWrap* accWrap = GetAccessibleWrap(aAtkObj); if (!accWrap || accWrap->IsDefunct()) return nsnull; /* nsIAccessible is responsible for the non-NULL description */ nsAutoString uniDesc; accWrap->Description(uniDesc); NS_ConvertUTF8toUTF16 objDesc(aAtkObj->description); @@ -664,17 +669,17 @@ getDescriptionCB(AtkObject *aAtkObj) NS_ConvertUTF16toUTF8(uniDesc).get()); return aAtkObj->description; } AtkRole getRoleCB(AtkObject *aAtkObj) { - nsAccessibleWrap* accWrap = GetAccessibleWrap(aAtkObj); + AccessibleWrap* accWrap = GetAccessibleWrap(aAtkObj); if (!accWrap) return ATK_ROLE_INVALID; #ifdef DEBUG NS_ASSERTION(nsAccUtils::IsTextInterfaceSupportCorrect(accWrap), "Does not support nsIAccessibleText when it should"); #endif @@ -732,17 +737,17 @@ ConvertToAtkAttributeSet(nsIPersistentPr objAttributeSet = g_slist_prepend(objAttributeSet, objAttr); } //libspi will free it return objAttributeSet; } AtkAttributeSet* -GetAttributeSet(nsAccessible* aAccessible) +GetAttributeSet(Accessible* aAccessible) { nsCOMPtr<nsIPersistentProperties> attributes; aAccessible->GetAttributes(getter_AddRefs(attributes)); if (attributes) { // Deal with attributes that we only need to expose in ATK if (aAccessible->State() & states::HASPOPUP) { // There is no ATK state for haspopup, must use object attribute to expose the same info @@ -755,69 +760,68 @@ GetAttributeSet(nsAccessible* aAccessibl } return nsnull; } AtkAttributeSet * getAttributesCB(AtkObject *aAtkObj) { - nsAccessibleWrap *accWrap = GetAccessibleWrap(aAtkObj); - - return accWrap ? GetAttributeSet(accWrap) : nsnull; + AccessibleWrap* accWrap = GetAccessibleWrap(aAtkObj); + return accWrap ? GetAttributeSet(accWrap) : nsnull; } AtkObject * getParentCB(AtkObject *aAtkObj) { if (!aAtkObj->accessible_parent) { - nsAccessibleWrap* accWrap = GetAccessibleWrap(aAtkObj); + AccessibleWrap* accWrap = GetAccessibleWrap(aAtkObj); if (!accWrap) return nsnull; - nsAccessible* accParent = accWrap->Parent(); + Accessible* accParent = accWrap->Parent(); if (!accParent) return nsnull; - AtkObject* parent = nsAccessibleWrap::GetAtkObject(accParent); + AtkObject* parent = AccessibleWrap::GetAtkObject(accParent); if (parent) atk_object_set_parent(aAtkObj, parent); } return aAtkObj->accessible_parent; } gint getChildCountCB(AtkObject *aAtkObj) { - nsAccessibleWrap *accWrap = GetAccessibleWrap(aAtkObj); + AccessibleWrap* accWrap = GetAccessibleWrap(aAtkObj); if (!accWrap || nsAccUtils::MustPrune(accWrap)) { return 0; } return static_cast<gint>(accWrap->EmbeddedChildCount()); } AtkObject * refChildCB(AtkObject *aAtkObj, gint aChildIndex) { // aChildIndex should not be less than zero if (aChildIndex < 0) { return nsnull; } - nsAccessibleWrap *accWrap = GetAccessibleWrap(aAtkObj); + AccessibleWrap* accWrap = GetAccessibleWrap(aAtkObj); if (!accWrap || nsAccUtils::MustPrune(accWrap)) { return nsnull; } - nsAccessible* accChild = accWrap->GetEmbeddedChildAt(aChildIndex); + Accessible* accChild = accWrap->GetEmbeddedChildAt(aChildIndex); if (!accChild) return nsnull; - AtkObject* childAtkObj = nsAccessibleWrap::GetAtkObject(accChild); + AtkObject* childAtkObj = AccessibleWrap::GetAtkObject(accChild); NS_ASSERTION(childAtkObj, "Fail to get AtkObj"); if (!childAtkObj) return nsnull; g_object_ref(childAtkObj); if (aAtkObj != childAtkObj->accessible_parent) atk_object_set_parent(childAtkObj, aAtkObj); @@ -825,22 +829,22 @@ refChildCB(AtkObject *aAtkObj, gint aChi return childAtkObj; } gint getIndexInParentCB(AtkObject *aAtkObj) { // We don't use nsIAccessible::GetIndexInParent() because // for ATK we don't want to include text leaf nodes as children - nsAccessibleWrap *accWrap = GetAccessibleWrap(aAtkObj); + AccessibleWrap* accWrap = GetAccessibleWrap(aAtkObj); if (!accWrap) { return -1; } - nsAccessible* parent = accWrap->Parent(); + Accessible* parent = accWrap->Parent(); if (!parent) return -1; // No parent return parent->GetIndexOfEmbeddedChild(accWrap); } static void TranslateStates(PRUint64 aState, AtkStateSet* aStateSet) @@ -865,17 +869,17 @@ TranslateStates(PRUint64 aState, AtkStat } AtkStateSet * refStateSetCB(AtkObject *aAtkObj) { AtkStateSet *state_set = nsnull; state_set = ATK_OBJECT_CLASS(parent_class)->ref_state_set(aAtkObj); - nsAccessibleWrap *accWrap = GetAccessibleWrap(aAtkObj); + AccessibleWrap* accWrap = GetAccessibleWrap(aAtkObj); if (!accWrap) { TranslateStates(states::DEFUNCT, state_set); return state_set; } // Map states TranslateStates(accWrap->State(), state_set); @@ -883,17 +887,17 @@ refStateSetCB(AtkObject *aAtkObj) } AtkRelationSet * refRelationSetCB(AtkObject *aAtkObj) { AtkRelationSet* relation_set = ATK_OBJECT_CLASS(parent_class)->ref_relation_set(aAtkObj); - nsAccessibleWrap *accWrap = GetAccessibleWrap(aAtkObj); + AccessibleWrap* accWrap = GetAccessibleWrap(aAtkObj); if (!accWrap) return relation_set; PRUint32 relationTypes[] = { nsIAccessibleRelation::RELATION_LABELLED_BY, nsIAccessibleRelation::RELATION_LABEL_FOR, nsIAccessibleRelation::RELATION_NODE_CHILD_OF, nsIAccessibleRelation::RELATION_CONTROLLED_BY, @@ -909,79 +913,80 @@ refRelationSetCB(AtkObject *aAtkObj) AtkRelationType atkType = static_cast<AtkRelationType>(relationTypes[i]); AtkRelation* atkRelation = atk_relation_set_get_relation_by_type(relation_set, atkType); if (atkRelation) atk_relation_set_remove(relation_set, atkRelation); Relation rel(accWrap->RelationByType(relationTypes[i])); nsTArray<AtkObject*> targets; - nsAccessible* tempAcc = nsnull; + Accessible* tempAcc = nsnull; while ((tempAcc = rel.Next())) - targets.AppendElement(nsAccessibleWrap::GetAtkObject(tempAcc)); + targets.AppendElement(AccessibleWrap::GetAtkObject(tempAcc)); if (targets.Length()) { atkRelation = atk_relation_new(targets.Elements(), targets.Length(), atkType); atk_relation_set_add(relation_set, atkRelation); g_object_unref(atkRelation); } } return relation_set; } -// Check if aAtkObj is a valid MaiAtkObject, and return the nsAccessibleWrap +// Check if aAtkObj is a valid MaiAtkObject, and return the AccessibleWrap // for it. -nsAccessibleWrap *GetAccessibleWrap(AtkObject *aAtkObj) +AccessibleWrap* +GetAccessibleWrap(AtkObject* aAtkObj) { NS_ENSURE_TRUE(IS_MAI_OBJECT(aAtkObj), nsnull); - nsAccessibleWrap* accWrap = MAI_ATK_OBJECT(aAtkObj)->accWrap; + AccessibleWrap* accWrap = MAI_ATK_OBJECT(aAtkObj)->accWrap; // Check if the accessible was deconstructed. if (!accWrap) return nsnull; NS_ENSURE_TRUE(accWrap->GetAtkObject() == aAtkObj, nsnull); - nsAccessibleWrap* appAccWrap = nsAccessNode::GetApplicationAccessible(); + AccessibleWrap* appAccWrap = nsAccessNode::GetApplicationAccessible(); if (appAccWrap != accWrap && !accWrap->IsValidObject()) return nsnull; return accWrap; } nsresult -nsAccessibleWrap::HandleAccEvent(AccEvent* aEvent) +AccessibleWrap::HandleAccEvent(AccEvent* aEvent) { - nsresult rv = nsAccessible::HandleAccEvent(aEvent); - NS_ENSURE_SUCCESS(rv, rv); + nsresult rv = Accessible::HandleAccEvent(aEvent); + NS_ENSURE_SUCCESS(rv, rv); - return FirePlatformEvent(aEvent); + return FirePlatformEvent(aEvent); } nsresult -nsAccessibleWrap::FirePlatformEvent(AccEvent* aEvent) +AccessibleWrap::FirePlatformEvent(AccEvent* aEvent) { - nsAccessible *accessible = aEvent->GetAccessible(); + Accessible* accessible = aEvent->GetAccessible(); NS_ENSURE_TRUE(accessible, NS_ERROR_FAILURE); PRUint32 type = aEvent->GetEventType(); - AtkObject *atkObj = nsAccessibleWrap::GetAtkObject(accessible); + AtkObject* atkObj = AccessibleWrap::GetAtkObject(accessible); // We don't create ATK objects for nsIAccessible plain text leaves, // just return NS_OK in such case if (!atkObj) { NS_ASSERTION(type == nsIAccessibleEvent::EVENT_SHOW || type == nsIAccessibleEvent::EVENT_HIDE, "Event other than SHOW and HIDE fired for plain text leaves"); return NS_OK; } - nsAccessibleWrap *accWrap = GetAccessibleWrap(atkObj); + AccessibleWrap* accWrap = GetAccessibleWrap(atkObj); if (!accWrap) { return NS_OK; // Node is shut down } switch (type) { case nsIAccessibleEvent::EVENT_STATE_CHANGE: return FireAtkStateChangeEvent(aEvent, atkObj); @@ -1025,17 +1030,17 @@ nsAccessibleWrap::FirePlatformEvent(AccE case nsIAccessibleEvent::EVENT_SELECTION: case nsIAccessibleEvent::EVENT_SELECTION_ADD: case nsIAccessibleEvent::EVENT_SELECTION_REMOVE: { // XXX: dupe events may be fired MAI_LOG_DEBUG(("\n\nReceived: EVENT_SELECTION_CHANGED\n")); AccSelChangeEvent* selChangeEvent = downcast_accEvent(aEvent); - g_signal_emit_by_name(nsAccessibleWrap::GetAtkObject(selChangeEvent->Widget()), + g_signal_emit_by_name(AccessibleWrap::GetAtkObject(selChangeEvent->Widget()), "selection_changed"); break; } case nsIAccessibleEvent::EVENT_SELECTION_WITHIN: { MAI_LOG_DEBUG(("\n\nReceived: EVENT_SELECTION_CHANGED\n")); g_signal_emit_by_name(atkObj, "selection_changed"); @@ -1253,18 +1258,18 @@ nsAccessibleWrap::FirePlatformEvent(AccE atk_object_notify_state_change(atkObj, ATK_STATE_SHOWING, false); break; } return NS_OK; } nsresult -nsAccessibleWrap::FireAtkStateChangeEvent(AccEvent* aEvent, - AtkObject *aObject) +AccessibleWrap::FireAtkStateChangeEvent(AccEvent* aEvent, + AtkObject* aObject) { MAI_LOG_DEBUG(("\n\nReceived: EVENT_STATE_CHANGE\n")); AccStateChangeEvent* event = downcast_accEvent(aEvent); NS_ENSURE_TRUE(event, NS_ERROR_FAILURE); bool isEnabled = event->IsStateEnabled(); PRInt32 stateIndex = AtkStateMap::GetStateIndexFor(event->GetState()); @@ -1285,18 +1290,18 @@ nsAccessibleWrap::FireAtkStateChangeEven isEnabled); } } return NS_OK; } nsresult -nsAccessibleWrap::FireAtkTextChangedEvent(AccEvent* aEvent, - AtkObject *aObject) +AccessibleWrap::FireAtkTextChangedEvent(AccEvent* aEvent, + AtkObject* aObject) { MAI_LOG_DEBUG(("\n\nReceived: EVENT_TEXT_REMOVED/INSERTED\n")); AccTextChangeEvent* event = downcast_accEvent(aEvent); NS_ENSURE_TRUE(event, NS_ERROR_FAILURE); PRInt32 start = event->GetStartOffset(); PRUint32 length = event->GetLength(); @@ -1326,18 +1331,18 @@ nsAccessibleWrap::FireAtkTextChangedEven NS_ConvertUTF16toUTF8(text).get()); } g_free(signal_name); return NS_OK; } nsresult -nsAccessibleWrap::FireAtkShowHideEvent(AccEvent* aEvent, - AtkObject *aObject, bool aIsAdded) +AccessibleWrap::FireAtkShowHideEvent(AccEvent* aEvent, + AtkObject* aObject, bool aIsAdded) { if (aIsAdded) { MAI_LOG_DEBUG(("\n\nReceived: Show event\n")); } else { MAI_LOG_DEBUG(("\n\nReceived: Hide event\n")); } PRInt32 indexInParent = getIndexInParentCB(aObject);
rename from accessible/src/atk/nsAccessibleWrap.h rename to accessible/src/atk/AccessibleWrap.h --- a/accessible/src/atk/nsAccessibleWrap.h +++ b/accessible/src/atk/AccessibleWrap.h @@ -3,17 +3,17 @@ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef __NS_ACCESSIBLE_WRAP_H__ #define __NS_ACCESSIBLE_WRAP_H__ #include "nsCOMPtr.h" -#include "nsAccessible.h" +#include "Accessible.h" #include "prlog.h" #ifdef PR_LOGGING #define MAI_LOGGING #endif /* #ifdef PR_LOGGING */ struct _AtkObject; typedef struct _AtkObject AtkObject; @@ -39,75 +39,75 @@ struct AtkPropertyChange { PRInt32 type; // property type as listed above void *oldvalue; void *newvalue; }; class MaiHyperlink; /** - * nsAccessibleWrap, and its descendents in atk directory provide the + * AccessibleWrap, and its descendents in atk directory provide the * implementation of AtkObject. */ -class nsAccessibleWrap: public nsAccessible +class AccessibleWrap : public Accessible { public: - nsAccessibleWrap(nsIContent* aContent, DocAccessible* aDoc); - virtual ~nsAccessibleWrap(); - void ShutdownAtkObject(); + AccessibleWrap(nsIContent* aContent, DocAccessible* aDoc); + virtual ~AccessibleWrap(); + void ShutdownAtkObject(); - // nsAccessNode - virtual void Shutdown(); + // nsAccessNode + virtual void Shutdown(); #ifdef MAI_LOGGING - virtual void DumpnsAccessibleWrapInfo(int aDepth) {} - static PRInt32 mAccWrapCreated; - static PRInt32 mAccWrapDeleted; + virtual void DumpAccessibleWrapInfo(int aDepth) {} + static PRInt32 mAccWrapCreated; + static PRInt32 mAccWrapDeleted; #endif - // return the atk object for this nsAccessibleWrap - NS_IMETHOD GetNativeInterface(void **aOutAccessible); - virtual nsresult HandleAccEvent(AccEvent* aEvent); + // return the atk object for this AccessibleWrap + NS_IMETHOD GetNativeInterface(void **aOutAccessible); + virtual nsresult HandleAccEvent(AccEvent* aEvent); - AtkObject * GetAtkObject(void); - static AtkObject * GetAtkObject(nsIAccessible * acc); + AtkObject * GetAtkObject(void); + static AtkObject * GetAtkObject(nsIAccessible * acc); - bool IsValidObject(); + bool IsValidObject(); - // get/set the MaiHyperlink object for this nsAccessibleWrap - MaiHyperlink* GetMaiHyperlink(bool aCreate = true); - void SetMaiHyperlink(MaiHyperlink* aMaiHyperlink); + // get/set the MaiHyperlink object for this AccessibleWrap + MaiHyperlink* GetMaiHyperlink(bool aCreate = true); + void SetMaiHyperlink(MaiHyperlink* aMaiHyperlink); - static const char * ReturnString(nsAString &aString) { - static nsCString returnedString; - returnedString = NS_ConvertUTF16toUTF8(aString); - return returnedString.get(); - } + static const char * ReturnString(nsAString &aString) { + static nsCString returnedString; + returnedString = NS_ConvertUTF16toUTF8(aString); + return returnedString.get(); + } protected: - virtual nsresult FirePlatformEvent(AccEvent* aEvent); + virtual nsresult FirePlatformEvent(AccEvent* aEvent); - nsresult FireAtkStateChangeEvent(AccEvent* aEvent, AtkObject *aObject); - nsresult FireAtkTextChangedEvent(AccEvent* aEvent, AtkObject *aObject); - nsresult FireAtkShowHideEvent(AccEvent* aEvent, AtkObject *aObject, - bool aIsAdded); + nsresult FireAtkStateChangeEvent(AccEvent* aEvent, AtkObject *aObject); + nsresult FireAtkTextChangedEvent(AccEvent* aEvent, AtkObject *aObject); + nsresult FireAtkShowHideEvent(AccEvent* aEvent, AtkObject *aObject, + bool aIsAdded); - AtkObject *mAtkObject; + AtkObject *mAtkObject; private: /* * do we have text-remove and text-insert signals if not we need to use - * text-changed see nsAccessibleWrap::FireAtkTextChangedEvent() and + * text-changed see AccessibleWrap::FireAtkTextChangedEvent() and * bug 619002 */ enum EAvailableAtkSignals { eUnknown, eHaveNewAtkTextSignals, eNoNewAtkSignals }; static EAvailableAtkSignals gAvailableAtkSignals; - PRUint16 CreateMaiInterfaces(void); + PRUint16 CreateMaiInterfaces(void); }; #endif /* __NS_ACCESSIBLE_WRAP_H__ */
--- a/accessible/src/atk/ApplicationAccessibleWrap.cpp +++ b/accessible/src/atk/ApplicationAccessibleWrap.cpp @@ -515,18 +515,18 @@ static nsresult LoadGtkModule(GnomeAcces ApplicationAccessibleWrap::ApplicationAccessibleWrap(): ApplicationAccessible() { MAI_LOG_DEBUG(("======Create AppRootAcc=%p\n", (void*)this)); } ApplicationAccessibleWrap::~ApplicationAccessibleWrap() { - MAI_LOG_DEBUG(("======Destory AppRootAcc=%p\n", (void*)this)); - nsAccessibleWrap::ShutdownAtkObject(); + MAI_LOG_DEBUG(("======Destory AppRootAcc=%p\n", (void*)this)); + AccessibleWrap::ShutdownAtkObject(); } static gboolean toplevel_event_watcher(GSignalInvocationHint* ihint, guint n_param_values, const GValue* param_values, gpointer data) { @@ -546,25 +546,25 @@ toplevel_event_watcher(GSignalInvocation // GTK native dialog if (!IS_MAI_OBJECT(child) && (atk_object_get_role(child) == ATK_ROLE_DIALOG)) { if (data == reinterpret_cast<gpointer>(nsIAccessibleEvent::EVENT_SHOW)) { // Attach the dialog accessible to app accessible tree - nsAccessible* windowAcc = GetAccService()->AddNativeRootAccessible(child); + Accessible* windowAcc = GetAccService()->AddNativeRootAccessible(child); g_object_set_qdata(G_OBJECT(child), sQuark_gecko_acc_obj, reinterpret_cast<gpointer>(windowAcc)); } else { // Deattach the dialog accessible - nsAccessible* windowAcc = - reinterpret_cast<nsAccessible*> + Accessible* windowAcc = + reinterpret_cast<Accessible*> (g_object_get_qdata(G_OBJECT(child), sQuark_gecko_acc_obj)); if (windowAcc) { GetAccService()->RemoveNativeRootAccessible(windowAcc); g_object_set_qdata(G_OBJECT(child), sQuark_gecko_acc_obj, NULL); } } } @@ -701,23 +701,23 @@ gboolean fireRootAccessibleAddedCB(gpoin g_object_unref(eventData->app_accessible); g_object_unref(eventData->root_accessible); free(data); return FALSE; } bool -ApplicationAccessibleWrap::AppendChild(nsAccessible* aChild) +ApplicationAccessibleWrap::AppendChild(Accessible* aChild) { - if (!ApplicationAccessible::AppendChild(aChild)) - return false; + if (!ApplicationAccessible::AppendChild(aChild)) + return false; - AtkObject *atkAccessible = nsAccessibleWrap::GetAtkObject(aChild); - atk_object_set_parent(atkAccessible, mAtkObject); + AtkObject* atkAccessible = AccessibleWrap::GetAtkObject(aChild); + atk_object_set_parent(atkAccessible, mAtkObject); PRUint32 count = mChildren.Length(); // Emit children_changed::add in a timeout // to make sure aRootAccWrap is fully initialized. AtkRootAccessibleAddedEvent* eventData = (AtkRootAccessibleAddedEvent*) malloc(sizeof(AtkRootAccessibleAddedEvent)); if (eventData) { @@ -728,26 +728,26 @@ ApplicationAccessibleWrap::AppendChild(n g_object_ref(atkAccessible); g_timeout_add(0, fireRootAccessibleAddedCB, eventData); } return true; } bool -ApplicationAccessibleWrap::RemoveChild(nsAccessible* aChild) +ApplicationAccessibleWrap::RemoveChild(Accessible* aChild) { - PRInt32 index = aChild->IndexInParent(); + PRInt32 index = aChild->IndexInParent(); - AtkObject *atkAccessible = nsAccessibleWrap::GetAtkObject(aChild); - atk_object_set_parent(atkAccessible, NULL); - g_signal_emit_by_name(mAtkObject, "children_changed::remove", index, - atkAccessible, NULL); + AtkObject* atkAccessible = AccessibleWrap::GetAtkObject(aChild); + atk_object_set_parent(atkAccessible, NULL); + g_signal_emit_by_name(mAtkObject, "children_changed::remove", index, + atkAccessible, NULL); - return ApplicationAccessible::RemoveChild(aChild); + return ApplicationAccessible::RemoveChild(aChild); } void ApplicationAccessibleWrap::PreCreate() { if (!sATKChecked) { sATKLib = PR_LoadLibrary(sATKLibName); if (sATKLib) {
--- a/accessible/src/atk/ApplicationAccessibleWrap.h +++ b/accessible/src/atk/ApplicationAccessibleWrap.h @@ -20,20 +20,20 @@ public: public: ApplicationAccessibleWrap(); virtual ~ApplicationAccessibleWrap(); // nsAccessNode virtual bool Init(); - // nsAccessible + // Accessible virtual mozilla::a11y::ENameValueFlag Name(nsString& aName); - virtual bool AppendChild(nsAccessible* aChild); - virtual bool RemoveChild(nsAccessible* aChild); + virtual bool AppendChild(Accessible* aChild); + virtual bool RemoveChild(Accessible* aChild); /** * Return the atk object for app root accessible. */ NS_IMETHOD GetNativeInterface(void** aOutAccessible); }; } // namespace a11y
--- a/accessible/src/atk/AtkSocketAccessible.cpp +++ b/accessible/src/atk/AtkSocketAccessible.cpp @@ -35,17 +35,17 @@ extern "C" GType mai_atk_socket_get_type #define MAI_ATK_SOCKET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj),\ MAI_TYPE_ATK_SOCKET,\ MaiAtkSocketClass)) typedef struct _MaiAtkSocket { AtkSocket parent; - nsAccessibleWrap* accWrap; + AccessibleWrap* accWrap; } MaiAtkSocket; typedef struct _MaiAtkSocketClass { AtkSocketClass parent_class; } MaiAtkSocketClass; G_DEFINE_TYPE_EXTENDED(MaiAtkSocket, mai_atk_socket, @@ -59,17 +59,17 @@ mai_atk_socket_class_init(MaiAtkSocketCl } void mai_atk_socket_init(MaiAtkSocket* aAcc) { } static AtkObject* -mai_atk_socket_new(nsAccessibleWrap* aAccWrap) +mai_atk_socket_new(AccessibleWrap* aAccWrap) { NS_ENSURE_TRUE(aAccWrap, NULL); MaiAtkSocket* acc = nsnull; acc = static_cast<MaiAtkSocket*>(g_object_new(MAI_TYPE_ATK_SOCKET, NULL)); NS_ENSURE_TRUE(acc, NULL); acc->accWrap = aAccWrap; @@ -110,17 +110,17 @@ mai_atk_component_iface_init(AtkComponen aIface->ref_accessible_at_point = RefAccessibleAtPoint; aIface->get_extents = GetExtents; } AtkSocketAccessible::AtkSocketAccessible(nsIContent* aContent, DocAccessible* aDoc, const nsCString& aPlugId) : - nsAccessibleWrap(aContent, aDoc) + AccessibleWrap(aContent, aDoc) { mAtkObject = mai_atk_socket_new(this); if (!mAtkObject) return; // Embeds the children of an AtkPlug, specified by plugId, as the children of // this socket. // Using G_TYPE macros instead of ATK_SOCKET macros to avoid undefined @@ -144,10 +144,10 @@ void AtkSocketAccessible::Shutdown() { if (mAtkObject) { if (MAI_IS_ATK_SOCKET(mAtkObject)) MAI_ATK_SOCKET(mAtkObject)->accWrap = nsnull; g_object_unref(mAtkObject); mAtkObject = nsnull; } - nsAccessibleWrap::Shutdown(); + AccessibleWrap::Shutdown(); }
--- a/accessible/src/atk/AtkSocketAccessible.h +++ b/accessible/src/atk/AtkSocketAccessible.h @@ -2,31 +2,31 @@ /* vim: set ts=2 et sw=2 tw=80: */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _AtkSocketAccessible_H_ #define _AtkSocketAccessible_H_ -#include "nsAccessibleWrap.h" +#include "AccessibleWrap.h" // This file gets included by nsAccessibilityService.cpp, which can't include // atk.h (or glib.h), so we can't rely on it being included. #ifdef __ATK_H__ extern "C" typedef void (*AtkSocketEmbedType) (AtkSocket*, gchar*); #else extern "C" typedef void (*AtkSocketEmbedType) (void*, void*); #endif /** - * Provides a nsAccessibleWrap wrapper around AtkSocket for out-of-process + * Provides a AccessibleWrap wrapper around AtkSocket for out-of-process * accessibles. */ -class AtkSocketAccessible: public nsAccessibleWrap +class AtkSocketAccessible : public AccessibleWrap { public: // Soft references to AtkSocket static AtkSocketEmbedType g_atk_socket_embed; #ifdef __ATK_H__ static GType g_atk_socket_type; #endif
--- a/accessible/src/atk/InterfaceInitFuncs.h +++ b/accessible/src/atk/InterfaceInitFuncs.h @@ -4,17 +4,17 @@ * * License, v. 2.0. If a copy of the MPL was not distributed with this file, * * You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef ATK_INTERFACE_INIT_FUNCS_H_ #define ATK_INTERFACE_INIT_FUNCS_H_ #include <atk/atk.h> -class nsAccessibleWrap; +class AccessibleWrap; extern "C" { void actionInterfaceInitCB(AtkActionIface* aIface); void componentInterfaceInitCB(AtkComponentIface* aIface); void documentInterfaceInitCB(AtkDocumentIface *aIface); void editableTextInterfaceInitCB(AtkEditableTextIface* aIface); void hyperlinkImplInterfaceInitCB(AtkHyperlinkImplIface *aIface); void hypertextInterfaceInitCB(AtkHypertextIface* aIface); @@ -23,15 +23,15 @@ void selectionInterfaceInitCB(AtkSelecti void tableInterfaceInitCB(AtkTableIface *aIface); void textInterfaceInitCB(AtkTextIface* aIface); void valueInterfaceInitCB(AtkValueIface *aIface); } /** * XXX these should live in a file of utils for atk. */ -AtkObject* refAccessibleAtPointHelper(nsAccessibleWrap* aAccWrap, +AtkObject* refAccessibleAtPointHelper(AccessibleWrap* aAccWrap, gint aX, gint aY, AtkCoordType aCoordType); -void getExtentsHelper(nsAccessibleWrap* aAccWrap, +void getExtentsHelper(AccessibleWrap* aAccWrap, gint* aX, gint* aY, gint* aWidth, gint* aHeight, AtkCoordType aCoordType); #endif // ATK_INTERFACE_INIT_FUNCS_H_
--- a/accessible/src/atk/Makefile.in +++ b/accessible/src/atk/Makefile.in @@ -11,21 +11,21 @@ include $(DEPTH)/config/autoconf.mk MODULE = accessibility LIBRARY_NAME = accessibility_toolkit_s EXPORT_LIBRARY = .. LIBXUL_LIBRARY = 1 CPPSRCS = \ + AccessibleWrap.cpp \ + ApplicationAccessibleWrap.cpp \ AtkSocketAccessible.cpp \ DocAccessibleWrap.cpp \ nsAccessNodeWrap.cpp \ - nsAccessibleWrap.cpp \ - ApplicationAccessibleWrap.cpp \ nsMaiInterfaceComponent.cpp \ nsMaiInterfaceAction.cpp \ nsMaiInterfaceText.cpp \ nsMaiInterfaceEditableText.cpp \ nsMaiInterfaceSelection.cpp \ nsMaiInterfaceValue.cpp \ nsMaiHyperlink.cpp \ nsMaiInterfaceHypertext.cpp \
--- a/accessible/src/atk/nsMai.h +++ b/accessible/src/atk/nsMai.h @@ -6,17 +6,17 @@ #ifndef __NS_MAI_H__ #define __NS_MAI_H__ #include <atk/atk.h> #include <glib.h> #include <glib-object.h> -#include "nsAccessibleWrap.h" +#include "AccessibleWrap.h" extern PRLogModuleInfo *gMaiLog; #ifdef MAI_LOGGING #define MAI_LOG(level, args) \ PR_BEGIN_MACRO \ if (!gMaiLog) { \ gMaiLog = PR_NewLogModule("Mai"); \ @@ -41,11 +41,11 @@ PR_END_MACRO #define IS_MAI_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \ MAI_TYPE_ATK_OBJECT)) #define IS_MAI_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), \ MAI_TYPE_ATK_OBJECT)) #define MAI_ATK_OBJECT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), \ MAI_TYPE_ATK_OBJECT, \ MaiAtkObjectClass)) GType mai_atk_object_get_type(void); -nsAccessibleWrap *GetAccessibleWrap(AtkObject *aAtkObj); +AccessibleWrap* GetAccessibleWrap(AtkObject* aAtkObj); #endif /* __NS_MAI_H__ */
--- a/accessible/src/atk/nsMaiHyperlink.cpp +++ b/accessible/src/atk/nsMaiHyperlink.cpp @@ -54,17 +54,17 @@ static gchar *getUriCB(AtkHyperlink *aLi static AtkObject *getObjectCB(AtkHyperlink *aLink, gint aLinkIndex); static gint getEndIndexCB(AtkHyperlink *aLink); static gint getStartIndexCB(AtkHyperlink *aLink); static gboolean isValidCB(AtkHyperlink *aLink); static gint getAnchorCountCB(AtkHyperlink *aLink); G_END_DECLS static gpointer parent_class = NULL; -static nsAccessible* +static Accessible* get_accessible_hyperlink(AtkHyperlink *aHyperlink); GType mai_atk_hyperlink_get_type(void) { static GType type = 0; if (!type) { @@ -83,17 +83,17 @@ mai_atk_hyperlink_get_type(void) type = g_type_register_static(ATK_TYPE_HYPERLINK, "MaiAtkHyperlink", &tinfo, GTypeFlags(0)); } return type; } -MaiHyperlink::MaiHyperlink(nsAccessible* aHyperLink) : +MaiHyperlink::MaiHyperlink(Accessible* aHyperLink) : mHyperlink(aHyperLink), mMaiAtkHyperlink(nsnull) { } MaiHyperlink::~MaiHyperlink() { if (mMaiAtkHyperlink) { @@ -174,83 +174,83 @@ finalizeCB(GObject *aObj) /* call parent finalize function */ if (G_OBJECT_CLASS (parent_class)->finalize) G_OBJECT_CLASS (parent_class)->finalize(aObj); } gchar * getUriCB(AtkHyperlink *aLink, gint aLinkIndex) { - nsAccessible* hyperlink = get_accessible_hyperlink(aLink); + Accessible* hyperlink = get_accessible_hyperlink(aLink); NS_ENSURE_TRUE(hyperlink, nsnull); nsCOMPtr<nsIURI> uri = hyperlink->AnchorURIAt(aLinkIndex); if (!uri) return nsnull; nsCAutoString cautoStr; nsresult rv = uri->GetSpec(cautoStr); NS_ENSURE_SUCCESS(rv, nsnull); return g_strdup(cautoStr.get()); } AtkObject * getObjectCB(AtkHyperlink *aLink, gint aLinkIndex) { - nsAccessible* hyperlink = get_accessible_hyperlink(aLink); + Accessible* hyperlink = get_accessible_hyperlink(aLink); NS_ENSURE_TRUE(hyperlink, nsnull); - nsAccessible* anchor = hyperlink->AnchorAt(aLinkIndex); + Accessible* anchor = hyperlink->AnchorAt(aLinkIndex); NS_ENSURE_TRUE(anchor, nsnull); - AtkObject *atkObj = nsAccessibleWrap::GetAtkObject(anchor); + AtkObject* atkObj = AccessibleWrap::GetAtkObject(anchor); //no need to add ref it, because it is "get" not "ref" return atkObj; } gint getEndIndexCB(AtkHyperlink *aLink) { - nsAccessible* hyperlink = get_accessible_hyperlink(aLink); + Accessible* hyperlink = get_accessible_hyperlink(aLink); NS_ENSURE_TRUE(hyperlink, -1); return static_cast<gint>(hyperlink->EndOffset()); } gint getStartIndexCB(AtkHyperlink *aLink) { - nsAccessible* hyperlink = get_accessible_hyperlink(aLink); + Accessible* hyperlink = get_accessible_hyperlink(aLink); NS_ENSURE_TRUE(hyperlink, -1); return static_cast<gint>(hyperlink->StartOffset()); } gboolean isValidCB(AtkHyperlink *aLink) { - nsAccessible* hyperlink = get_accessible_hyperlink(aLink); + Accessible* hyperlink = get_accessible_hyperlink(aLink); NS_ENSURE_TRUE(hyperlink, FALSE); return static_cast<gboolean>(hyperlink->IsLinkValid()); } gint getAnchorCountCB(AtkHyperlink *aLink) { - nsAccessible* hyperlink = get_accessible_hyperlink(aLink); + Accessible* hyperlink = get_accessible_hyperlink(aLink); NS_ENSURE_TRUE(hyperlink, -1); return static_cast<gint>(hyperlink->AnchorCount()); } // Check if aHyperlink is a valid MaiHyperlink, and return the // HyperLinkAccessible related. -nsAccessible* +Accessible* get_accessible_hyperlink(AtkHyperlink *aHyperlink) { NS_ENSURE_TRUE(MAI_IS_ATK_HYPERLINK(aHyperlink), nsnull); MaiHyperlink * maiHyperlink = MAI_ATK_HYPERLINK(aHyperlink)->maiHyperlink; NS_ENSURE_TRUE(maiHyperlink != nsnull, nsnull); NS_ENSURE_TRUE(maiHyperlink->GetAtkHyperlink() == aHyperlink, nsnull); return maiHyperlink->GetAccHyperlink();
--- a/accessible/src/atk/nsMaiHyperlink.h +++ b/accessible/src/atk/nsMaiHyperlink.h @@ -3,35 +3,35 @@ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef __MAI_HYPERLINK_H__ #define __MAI_HYPERLINK_H__ #include "nsMai.h" -#include "nsAccessible.h" +#include "Accessible.h" struct _AtkHyperlink; typedef struct _AtkHyperlink AtkHyperlink; /* * MaiHyperlink is a auxiliary class for MaiInterfaceHyperText. */ class MaiHyperlink { public: - MaiHyperlink(nsAccessible* aHyperLink); - ~MaiHyperlink(); + MaiHyperlink(Accessible* aHyperLink); + ~MaiHyperlink(); public: - AtkHyperlink *GetAtkHyperlink(void); - nsAccessible* GetAccHyperlink() - { return mHyperlink && mHyperlink->IsLink() ? mHyperlink : nsnull; } + AtkHyperlink *GetAtkHyperlink(void); + Accessible* GetAccHyperlink() + { return mHyperlink && mHyperlink->IsLink() ? mHyperlink : nsnull; } protected: - nsAccessible* mHyperlink; - AtkHyperlink *mMaiAtkHyperlink; + Accessible* mHyperlink; + AtkHyperlink* mMaiAtkHyperlink; public: - static nsresult Initialize(AtkHyperlink *aObj, MaiHyperlink *aClass); + static nsresult Initialize(AtkHyperlink *aObj, MaiHyperlink *aClass); }; #endif /* __MAI_HYPERLINK_H__ */
--- a/accessible/src/atk/nsMaiInterfaceAction.cpp +++ b/accessible/src/atk/nsMaiInterfaceAction.cpp @@ -14,73 +14,73 @@ using namespace mozilla::a11y; extern "C" { static gboolean doActionCB(AtkAction *aAction, gint aActionIndex) { - nsAccessibleWrap *accWrap = GetAccessibleWrap(ATK_OBJECT(aAction)); - if (!accWrap) - return FALSE; + AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aAction)); + if (!accWrap) + return FALSE; - nsresult rv = accWrap->DoAction(aActionIndex); - return (NS_FAILED(rv)) ? FALSE : TRUE; + nsresult rv = accWrap->DoAction(aActionIndex); + return (NS_FAILED(rv)) ? FALSE : TRUE; } static gint getActionCountCB(AtkAction *aAction) { - nsAccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aAction)); + AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aAction)); return accWrap ? accWrap->ActionCount() : 0; } static const gchar* getActionDescriptionCB(AtkAction *aAction, gint aActionIndex) { - nsAccessibleWrap *accWrap = GetAccessibleWrap(ATK_OBJECT(aAction)); - if (!accWrap) - return nsnull; + AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aAction)); + if (!accWrap) + return nsnull; - nsAutoString description; - nsresult rv = accWrap->GetActionDescription(aActionIndex, description); - NS_ENSURE_SUCCESS(rv, nsnull); - return nsAccessibleWrap::ReturnString(description); + nsAutoString description; + nsresult rv = accWrap->GetActionDescription(aActionIndex, description); + NS_ENSURE_SUCCESS(rv, nsnull); + return AccessibleWrap::ReturnString(description); } static const gchar* getActionNameCB(AtkAction *aAction, gint aActionIndex) { - nsAccessibleWrap *accWrap = GetAccessibleWrap(ATK_OBJECT(aAction)); + AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aAction)); if (!accWrap) return nsnull; nsAutoString autoStr; nsresult rv = accWrap->GetActionName(aActionIndex, autoStr); NS_ENSURE_SUCCESS(rv, nsnull); - return nsAccessibleWrap::ReturnString(autoStr); + return AccessibleWrap::ReturnString(autoStr); } static const gchar* getKeyBindingCB(AtkAction *aAction, gint aActionIndex) { - nsAccessibleWrap* acc = GetAccessibleWrap(ATK_OBJECT(aAction)); + AccessibleWrap* acc = GetAccessibleWrap(ATK_OBJECT(aAction)); if (!acc) return nsnull; // Return all key bindings including access key and keyboard shortcut. nsAutoString keyBindingsStr; // Get access key. KeyBinding keyBinding = acc->AccessKey(); if (!keyBinding.IsEmpty()) { keyBinding.AppendToString(keyBindingsStr, KeyBinding::eAtkFormat); - nsAccessible* parent = acc->Parent(); + Accessible* parent = acc->Parent(); roles::Role role = parent ? parent->Role() : roles::NOTHING; if (role == roles::PARENT_MENUITEM || role == roles::MENUITEM || role == roles::RADIO_MENU_ITEM || role == roles::CHECK_MENU_ITEM) { // It is submenu, expose keyboard shortcuts from menu hierarchy like // "s;<Alt>f:s" nsAutoString keysInHierarchyStr = keyBindingsStr; do { KeyBinding parentKeyBinding = parent->AccessKey(); @@ -103,17 +103,17 @@ getKeyBindingCB(AtkAction *aAction, gint // Get keyboard shortcut. keyBindingsStr.Append(';'); keyBinding = acc->KeyboardShortcut(); if (!keyBinding.IsEmpty()) { keyBinding.AppendToString(keyBindingsStr, KeyBinding::eAtkFormat); } - return nsAccessibleWrap::ReturnString(keyBindingsStr); + return AccessibleWrap::ReturnString(keyBindingsStr); } } void actionInterfaceInitCB(AtkActionIface* aIface) { NS_ASSERTION(aIface, "Invalid aIface"); if (NS_UNLIKELY(!aIface))
--- a/accessible/src/atk/nsMaiInterfaceComponent.cpp +++ b/accessible/src/atk/nsMaiInterfaceComponent.cpp @@ -1,17 +1,17 @@ /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* vim: set ts=2 et sw=2 tw=80: */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "InterfaceInitFuncs.h" -#include "nsAccessibleWrap.h" +#include "AccessibleWrap.h" #include "nsAccUtils.h" #include "nsCoreUtils.h" #include "nsMai.h" extern "C" { static AtkObject* refAccessibleAtPointCB(AtkComponent* aComponent, gint aAccX, gint aAccY, @@ -27,53 +27,53 @@ getExtentsCB(AtkComponent* aComponent, g { getExtentsHelper(GetAccessibleWrap(ATK_OBJECT(aComponent)), aX, aY, aWidth, aHeight, aCoordType); } static gboolean grabFocusCB(AtkComponent* aComponent) { - nsAccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aComponent)); + AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aComponent)); if (!accWrap) return FALSE; nsresult rv = accWrap->TakeFocus(); return (NS_FAILED(rv)) ? FALSE : TRUE; } } AtkObject* -refAccessibleAtPointHelper(nsAccessibleWrap* aAccWrap, gint aX, gint aY, +refAccessibleAtPointHelper(AccessibleWrap* aAccWrap, gint aX, gint aY, AtkCoordType aCoordType) { if (!aAccWrap || aAccWrap->IsDefunct() || nsAccUtils::MustPrune(aAccWrap)) return nsnull; - // nsAccessible::ChildAtPoint(x,y) is in screen pixels. + // Accessible::ChildAtPoint(x,y) is in screen pixels. if (aCoordType == ATK_XY_WINDOW) { nsIntPoint winCoords = nsCoreUtils::GetScreenCoordsForWindow(aAccWrap->GetNode()); aX += winCoords.x; aY += winCoords.y; } - nsAccessible* accAtPoint = aAccWrap->ChildAtPoint(aX, aY, - nsAccessible::eDirectChild); + Accessible* accAtPoint = aAccWrap->ChildAtPoint(aX, aY, + Accessible::eDirectChild); if (!accAtPoint) return nsnull; - AtkObject* atkObj = nsAccessibleWrap::GetAtkObject(accAtPoint); + AtkObject* atkObj = AccessibleWrap::GetAtkObject(accAtPoint); if (atkObj) g_object_ref(atkObj); return atkObj; } void -getExtentsHelper(nsAccessibleWrap* aAccWrap, +getExtentsHelper(AccessibleWrap* aAccWrap, gint* aX, gint* aY, gint* aWidth, gint* aHeight, AtkCoordType aCoordType) { *aX = *aY = *aWidth = *aHeight = 0; if (!aAccWrap || aAccWrap->IsDefunct()) return;
--- a/accessible/src/atk/nsMaiInterfaceDocument.cpp +++ b/accessible/src/atk/nsMaiInterfaceDocument.cpp @@ -1,17 +1,17 @@ /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* vim: set ts=2 et sw=2 tw=80: */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "InterfaceInitFuncs.h" -#include "nsAccessibleWrap.h" +#include "AccessibleWrap.h" #include "DocAccessible.h" #include "nsMai.h" static const char* const kDocTypeName = "W3C-doctype"; static const char* const kDocUrlName = "DocURL"; static const char* const kMimeTypeName = "MimeType"; // below functions are vfuncs on an ATK interface so they need to be C call @@ -37,23 +37,23 @@ documentInterfaceInitCB(AtkDocumentIface aIface->get_document_attributes = getDocumentAttributesCB; aIface->get_document_attribute_value = getDocumentAttributeValueCB; aIface->get_document_locale = getDocumentLocaleCB; } const gchar * getDocumentLocaleCB(AtkDocument *aDocument) { - nsAccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aDocument)); + AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aDocument)); if (!accWrap) return nsnull; nsAutoString locale; accWrap->Language(locale); - return locale.IsEmpty() ? nsnull : nsAccessibleWrap::ReturnString(locale); + return locale.IsEmpty() ? nsnull : AccessibleWrap::ReturnString(locale); } static inline GSList * prependToList(GSList *aList, const char *const aName, const nsAutoString &aValue) { if (aValue.IsEmpty()) return aList; @@ -62,17 +62,17 @@ prependToList(GSList *aList, const char atkAttr->name = g_strdup(aName); atkAttr->value = g_strdup(NS_ConvertUTF16toUTF8(aValue).get()); return g_slist_prepend(aList, atkAttr); } AtkAttributeSet * getDocumentAttributesCB(AtkDocument *aDocument) { - nsAccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aDocument)); + AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aDocument)); if (!accWrap || !accWrap->IsDoc()) return nsnull; // according to atkobject.h, AtkAttributeSet is a GSList GSList* attributes = nsnull; DocAccessible* document = accWrap->AsDoc(); nsAutoString aURL; nsresult rv = document->GetURL(aURL); @@ -91,28 +91,28 @@ getDocumentAttributesCB(AtkDocument *aDo return attributes; } const gchar * getDocumentAttributeValueCB(AtkDocument *aDocument, const gchar *aAttrName) { - nsAccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aDocument)); + AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aDocument)); if (!accWrap || !accWrap->IsDoc()) return nsnull; DocAccessible* document = accWrap->AsDoc(); nsresult rv; nsAutoString attrValue; if (!strcasecmp(aAttrName, kDocTypeName)) rv = document->GetDocType(attrValue); else if (!strcasecmp(aAttrName, kDocUrlName)) rv = document->GetURL(attrValue); else if (!strcasecmp(aAttrName, kMimeTypeName)) rv = document->GetMimeType(attrValue); else return nsnull; NS_ENSURE_SUCCESS(rv, nsnull); - return attrValue.IsEmpty() ? nsnull : nsAccessibleWrap::ReturnString(attrValue); + return attrValue.IsEmpty() ? nsnull : AccessibleWrap::ReturnString(attrValue); } }
--- a/accessible/src/atk/nsMaiInterfaceEditableText.cpp +++ b/accessible/src/atk/nsMaiInterfaceEditableText.cpp @@ -12,19 +12,19 @@ #include "nsString.h" extern "C" { static gboolean setRunAttributesCB(AtkEditableText *aText, AtkAttributeSet *aAttribSet, gint aStartOffset, gint aEndOffset) { - nsAccessibleWrap *accWrap = GetAccessibleWrap(ATK_OBJECT(aText)); - if (!accWrap) - return FALSE; + AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aText)); + if (!accWrap) + return FALSE; nsCOMPtr<nsIAccessibleEditableText> accText; accWrap->QueryInterface(NS_GET_IID(nsIAccessibleEditableText), getter_AddRefs(accText)); NS_ENSURE_TRUE(accText, FALSE); nsCOMPtr<nsISupports> attrSet; /* how to insert attributes into nsISupports ??? */ @@ -32,19 +32,19 @@ setRunAttributesCB(AtkEditableText *aTex nsresult rv = accText->SetAttributes(aStartOffset, aEndOffset, attrSet); return NS_FAILED(rv) ? FALSE : TRUE; } static void setTextContentsCB(AtkEditableText *aText, const gchar *aString) { - nsAccessibleWrap *accWrap = GetAccessibleWrap(ATK_OBJECT(aText)); - if (!accWrap) - return; + AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aText)); + if (!accWrap) + return; nsCOMPtr<nsIAccessibleEditableText> accText; accWrap->QueryInterface(NS_GET_IID(nsIAccessibleEditableText), getter_AddRefs(accText)); if (!accText) return; MAI_LOG_DEBUG(("EditableText: setTextContentsCB, aString=%s", aString)); @@ -52,19 +52,19 @@ setTextContentsCB(AtkEditableText *aText NS_ConvertUTF8toUTF16 strContent(aString); accText->SetTextContents(strContent); } static void insertTextCB(AtkEditableText *aText, const gchar *aString, gint aLength, gint *aPosition) { - nsAccessibleWrap *accWrap = GetAccessibleWrap(ATK_OBJECT(aText)); - if (!accWrap) - return; + AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aText)); + if (!accWrap) + return; nsCOMPtr<nsIAccessibleEditableText> accText; accWrap->QueryInterface(NS_GET_IID(nsIAccessibleEditableText), getter_AddRefs(accText)); if (!accText) return; NS_ConvertUTF8toUTF16 strContent(aString, aLength); @@ -79,72 +79,72 @@ insertTextCB(AtkEditableText *aText, MAI_LOG_DEBUG(("EditableText: insert aString=%s, aLength=%d, aPosition=%d", aString, aLength, *aPosition)); } static void copyTextCB(AtkEditableText *aText, gint aStartPos, gint aEndPos) { - nsAccessibleWrap *accWrap = GetAccessibleWrap(ATK_OBJECT(aText)); - if (!accWrap) - return; + AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aText)); + if (!accWrap) + return; nsCOMPtr<nsIAccessibleEditableText> accText; accWrap->QueryInterface(NS_GET_IID(nsIAccessibleEditableText), getter_AddRefs(accText)); if (!accText) return; MAI_LOG_DEBUG(("EditableText: copyTextCB, aStartPos=%d, aEndPos=%d", aStartPos, aEndPos)); accText->CopyText(aStartPos, aEndPos); } static void cutTextCB(AtkEditableText *aText, gint aStartPos, gint aEndPos) { - nsAccessibleWrap *accWrap = GetAccessibleWrap(ATK_OBJECT(aText)); - if (!accWrap) - return; + AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aText)); + if (!accWrap) + return; nsCOMPtr<nsIAccessibleEditableText> accText; accWrap->QueryInterface(NS_GET_IID(nsIAccessibleEditableText), getter_AddRefs(accText)); if (!accText) return; MAI_LOG_DEBUG(("EditableText: cutTextCB, aStartPos=%d, aEndPos=%d", aStartPos, aEndPos)); accText->CutText(aStartPos, aEndPos); } static void deleteTextCB(AtkEditableText *aText, gint aStartPos, gint aEndPos) { - nsAccessibleWrap *accWrap = GetAccessibleWrap(ATK_OBJECT(aText)); - if (!accWrap) - return; + AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aText)); + if (!accWrap) + return; nsCOMPtr<nsIAccessibleEditableText> accText; accWrap->QueryInterface(NS_GET_IID(nsIAccessibleEditableText), getter_AddRefs(accText)); if (!accText) return; MAI_LOG_DEBUG(("EditableText: deleteTextCB, aStartPos=%d, aEndPos=%d", aStartPos, aEndPos)); accText->DeleteText(aStartPos, aEndPos); } static void pasteTextCB(AtkEditableText *aText, gint aPosition) { - nsAccessibleWrap *accWrap = GetAccessibleWrap(ATK_OBJECT(aText)); - if (!accWrap) - return; + AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aText)); + if (!accWrap) + return; nsCOMPtr<nsIAccessibleEditableText> accText; accWrap->QueryInterface(NS_GET_IID(nsIAccessibleEditableText), getter_AddRefs(accText)); if (!accText) return; MAI_LOG_DEBUG(("EditableText: pasteTextCB, aPosition=%d", aPosition));
--- a/accessible/src/atk/nsMaiInterfaceHyperlinkImpl.cpp +++ b/accessible/src/atk/nsMaiInterfaceHyperlinkImpl.cpp @@ -7,17 +7,17 @@ #include "InterfaceInitFuncs.h" #include "nsMaiHyperlink.h" extern "C" { static AtkHyperlink* getHyperlinkCB(AtkHyperlinkImpl* aImpl) { - nsAccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aImpl)); + AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aImpl)); if (!accWrap) return nsnull; NS_ENSURE_TRUE(accWrap->IsLink(), nsnull); MaiHyperlink* maiHyperlink = accWrap->GetMaiHyperlink(); NS_ENSURE_TRUE(maiHyperlink, nsnull); return maiHyperlink->GetAtkHyperlink();
--- a/accessible/src/atk/nsMaiInterfaceHypertext.cpp +++ b/accessible/src/atk/nsMaiInterfaceHypertext.cpp @@ -10,64 +10,64 @@ #include "nsMai.h" #include "nsMaiHyperlink.h" extern "C" { static AtkHyperlink* getLinkCB(AtkHypertext *aText, gint aLinkIndex) { - nsAccessibleWrap *accWrap = GetAccessibleWrap(ATK_OBJECT(aText)); - if (!accWrap) - return nsnull; + AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aText)); + if (!accWrap) + return nsnull; - nsHyperTextAccessible* hyperText = accWrap->AsHyperText(); - NS_ENSURE_TRUE(hyperText, nsnull); + nsHyperTextAccessible* hyperText = accWrap->AsHyperText(); + NS_ENSURE_TRUE(hyperText, nsnull); - nsAccessible* hyperLink = hyperText->GetLinkAt(aLinkIndex); - if (!hyperLink) - return nsnull; + Accessible* hyperLink = hyperText->GetLinkAt(aLinkIndex); + if (!hyperLink) + return nsnull; - AtkObject* hyperLinkAtkObj = nsAccessibleWrap::GetAtkObject(hyperLink); - nsAccessibleWrap *accChild = GetAccessibleWrap(hyperLinkAtkObj); - NS_ENSURE_TRUE(accChild, nsnull); + AtkObject* hyperLinkAtkObj = AccessibleWrap::GetAtkObject(hyperLink); + AccessibleWrap* accChild = GetAccessibleWrap(hyperLinkAtkObj); + NS_ENSURE_TRUE(accChild, nsnull); - MaiHyperlink *maiHyperlink = accChild->GetMaiHyperlink(); - NS_ENSURE_TRUE(maiHyperlink, nsnull); - return maiHyperlink->GetAtkHyperlink(); + MaiHyperlink *maiHyperlink = accChild->GetMaiHyperlink(); + NS_ENSURE_TRUE(maiHyperlink, nsnull); + return maiHyperlink->GetAtkHyperlink(); } static gint getLinkCountCB(AtkHypertext *aText) { - nsAccessibleWrap *accWrap = GetAccessibleWrap(ATK_OBJECT(aText)); - if (!accWrap) - return -1; + AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aText)); + if (!accWrap) + return -1; - nsHyperTextAccessible* hyperText = accWrap->AsHyperText(); - NS_ENSURE_TRUE(hyperText, -1); + nsHyperTextAccessible* hyperText = accWrap->AsHyperText(); + NS_ENSURE_TRUE(hyperText, -1); - return hyperText->GetLinkCount(); + return hyperText->GetLinkCount(); } static gint getLinkIndexCB(AtkHypertext *aText, gint aCharIndex) { - nsAccessibleWrap *accWrap = GetAccessibleWrap(ATK_OBJECT(aText)); - if (!accWrap) - return -1; + AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aText)); + if (!accWrap) + return -1; - nsHyperTextAccessible* hyperText = accWrap->AsHyperText(); - NS_ENSURE_TRUE(hyperText, -1); + nsHyperTextAccessible* hyperText = accWrap->AsHyperText(); + NS_ENSURE_TRUE(hyperText, -1); - PRInt32 index = -1; - nsresult rv = hyperText->GetLinkIndexAtOffset(aCharIndex, &index); - NS_ENSURE_SUCCESS(rv, -1); + PRInt32 index = -1; + nsresult rv = hyperText->GetLinkIndexAtOffset(aCharIndex, &index); + NS_ENSURE_SUCCESS(rv, -1); - return index; + return index; } } void hypertextInterfaceInitCB(AtkHypertextIface* aIface) { NS_ASSERTION(aIface, "no interface!"); if (NS_UNLIKELY(!aIface))
--- a/accessible/src/atk/nsMaiInterfaceImage.cpp +++ b/accessible/src/atk/nsMaiInterfaceImage.cpp @@ -1,28 +1,28 @@ /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* vim: set ts=2 et sw=2 tw=80: */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "InterfaceInitFuncs.h" -#include "nsAccessibleWrap.h" +#include "AccessibleWrap.h" #include "nsHTMLImageAccessible.h" #include "nsMai.h" extern "C" { const gchar* getDescriptionCB(AtkObject* aAtkObj); static void getImagePositionCB(AtkImage* aImage, gint* aAccX, gint* aAccY, AtkCoordType aCoordType) { - nsAccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aImage)); + AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aImage)); if (!accWrap || !accWrap->IsImage()) return; nsHTMLImageAccessible* image = accWrap->AsImage(); PRUint32 geckoCoordType = (aCoordType == ATK_XY_WINDOW) ? nsIAccessibleCoordinateType::COORDTYPE_WINDOW_RELATIVE : nsIAccessibleCoordinateType::COORDTYPE_SCREEN_RELATIVE; // Returned in screen coordinates @@ -33,17 +33,17 @@ static const gchar* getImageDescriptionCB(AtkImage* aImage) { return getDescriptionCB(ATK_OBJECT(aImage)); } static void getImageSizeCB(AtkImage* aImage, gint* aAccWidth, gint* aAccHeight) { - nsAccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aImage)); + AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aImage)); if (!accWrap || !accWrap->IsImage()) return; accWrap->AsImage()->GetImageSize(aAccWidth, aAccHeight); } } void
--- a/accessible/src/atk/nsMaiInterfaceSelection.cpp +++ b/accessible/src/atk/nsMaiInterfaceSelection.cpp @@ -1,99 +1,99 @@ /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* vim: set ts=2 et sw=2 tw=80: */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "InterfaceInitFuncs.h" -#include "nsAccessibleWrap.h" +#include "AccessibleWrap.h" #include "nsMai.h" #include <atk/atk.h> extern "C" { static gboolean addSelectionCB(AtkSelection *aSelection, gint i) { - nsAccessibleWrap *accWrap = GetAccessibleWrap(ATK_OBJECT(aSelection)); - if (!accWrap || !accWrap->IsSelect()) - return FALSE; + AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aSelection)); + if (!accWrap || !accWrap->IsSelect()) + return FALSE; - return accWrap->AddItemToSelection(i); + return accWrap->AddItemToSelection(i); } static gboolean clearSelectionCB(AtkSelection *aSelection) { - nsAccessibleWrap *accWrap = GetAccessibleWrap(ATK_OBJECT(aSelection)); - if (!accWrap || !accWrap->IsSelect()) - return FALSE; + AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aSelection)); + if (!accWrap || !accWrap->IsSelect()) + return FALSE; - return accWrap->UnselectAll(); + return accWrap->UnselectAll(); } static AtkObject* refSelectionCB(AtkSelection *aSelection, gint i) { - nsAccessibleWrap *accWrap = GetAccessibleWrap(ATK_OBJECT(aSelection)); - if (!accWrap || !accWrap->IsSelect()) - return nsnull; + AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aSelection)); + if (!accWrap || !accWrap->IsSelect()) + return nsnull; - nsAccessible* selectedItem = accWrap->GetSelectedItem(i); - if (!selectedItem) - return nsnull; + Accessible* selectedItem = accWrap->GetSelectedItem(i); + if (!selectedItem) + return nsnull; - AtkObject* atkObj = nsAccessibleWrap::GetAtkObject(selectedItem); - if (atkObj) { - g_object_ref(atkObj); - } - return atkObj; + AtkObject* atkObj = AccessibleWrap::GetAtkObject(selectedItem); + if (atkObj) + g_object_ref(atkObj); + + return atkObj; } static gint getSelectionCountCB(AtkSelection *aSelection) { - nsAccessibleWrap *accWrap = GetAccessibleWrap(ATK_OBJECT(aSelection)); - if (!accWrap || !accWrap->IsSelect()) - return -1; + AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aSelection)); + if (!accWrap || !accWrap->IsSelect()) + return -1; - return accWrap->SelectedItemCount(); + return accWrap->SelectedItemCount(); } static gboolean isChildSelectedCB(AtkSelection *aSelection, gint i) { - nsAccessibleWrap *accWrap = GetAccessibleWrap(ATK_OBJECT(aSelection)); - if (!accWrap || !accWrap->IsSelect()) - return FALSE; + AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aSelection)); + if (!accWrap || !accWrap->IsSelect()) + return FALSE; - return accWrap->IsItemSelected(i); + return accWrap->IsItemSelected(i); } static gboolean removeSelectionCB(AtkSelection *aSelection, gint i) { - nsAccessibleWrap *accWrap = GetAccessibleWrap(ATK_OBJECT(aSelection)); - if (!accWrap || !accWrap->IsSelect()) - return FALSE; + AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aSelection)); + if (!accWrap || !accWrap->IsSelect()) + return FALSE; - return accWrap->RemoveItemFromSelection(i); + return accWrap->RemoveItemFromSelection(i); } static gboolean selectAllSelectionCB(AtkSelection *aSelection) { - nsAccessibleWrap *accWrap = GetAccessibleWrap(ATK_OBJECT(aSelection)); - if (!accWrap || !accWrap->IsSelect()) - return FALSE; + AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aSelection)); + if (!accWrap || !accWrap->IsSelect()) + return FALSE; - return accWrap->SelectAll(); + return accWrap->SelectAll(); } } void selectionInterfaceInitCB(AtkSelectionIface* aIface) { NS_ASSERTION(aIface, "Invalid aIface"); if (NS_UNLIKELY(!aIface))
--- a/accessible/src/atk/nsMaiInterfaceTable.cpp +++ b/accessible/src/atk/nsMaiInterfaceTable.cpp @@ -1,127 +1,127 @@ /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* vim: set ts=2 et sw=2 tw=80: */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "InterfaceInitFuncs.h" -#include "nsAccessibleWrap.h" +#include "AccessibleWrap.h" #include "nsAccUtils.h" #include "nsIAccessibleTable.h" #include "TableAccessible.h" #include "nsMai.h" #include "nsArrayUtils.h" using namespace mozilla::a11y; extern "C" { static AtkObject* refAtCB(AtkTable *aTable, gint aRow, gint aColumn) { - nsAccessibleWrap *accWrap = GetAccessibleWrap(ATK_OBJECT(aTable)); - if (!accWrap) - return nsnull; + AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aTable)); + if (!accWrap) + return nsnull; nsCOMPtr<nsIAccessibleTable> accTable; accWrap->QueryInterface(NS_GET_IID(nsIAccessibleTable), getter_AddRefs(accTable)); NS_ENSURE_TRUE(accTable, nsnull); nsCOMPtr<nsIAccessible> cell; nsresult rv = accTable->GetCellAt(aRow, aColumn,getter_AddRefs(cell)); if (NS_FAILED(rv) || !cell) return nsnull; - AtkObject *cellAtkObj = nsAccessibleWrap::GetAtkObject(cell); + AtkObject* cellAtkObj = AccessibleWrap::GetAtkObject(cell); if (cellAtkObj) { g_object_ref(cellAtkObj); } return cellAtkObj; } static gint getIndexAtCB(AtkTable* aTable, gint aRow, gint aColumn) { - nsAccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aTable)); + AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aTable)); if (!accWrap) return -1; TableAccessible* table = accWrap->AsTable(); NS_ENSURE_TRUE(table, -1); return static_cast<gint>(table->CellIndexAt(aRow, aColumn)); } static gint getColumnAtIndexCB(AtkTable *aTable, gint aIndex) { - nsAccessibleWrap *accWrap = GetAccessibleWrap(ATK_OBJECT(aTable)); - if (!accWrap) - return -1; + AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aTable)); + if (!accWrap) + return -1; nsCOMPtr<nsIAccessibleTable> accTable; accWrap->QueryInterface(NS_GET_IID(nsIAccessibleTable), getter_AddRefs(accTable)); NS_ENSURE_TRUE(accTable, -1); PRInt32 col; nsresult rv = accTable->GetColumnIndexAt(aIndex, &col); NS_ENSURE_SUCCESS(rv, -1); return static_cast<gint>(col); } static gint getRowAtIndexCB(AtkTable *aTable, gint aIndex) { - nsAccessibleWrap *accWrap = GetAccessibleWrap(ATK_OBJECT(aTable)); - if (!accWrap) - return -1; + AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aTable)); + if (!accWrap) + return -1; nsCOMPtr<nsIAccessibleTable> accTable; accWrap->QueryInterface(NS_GET_IID(nsIAccessibleTable), getter_AddRefs(accTable)); NS_ENSURE_TRUE(accTable, -1); PRInt32 row; nsresult rv = accTable->GetRowIndexAt(aIndex, &row); NS_ENSURE_SUCCESS(rv, -1); return static_cast<gint>(row); } static gint getColumnCountCB(AtkTable *aTable) { - nsAccessibleWrap *accWrap = GetAccessibleWrap(ATK_OBJECT(aTable)); - if (!accWrap) - return -1; + AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aTable)); + if (!accWrap) + return -1; nsCOMPtr<nsIAccessibleTable> accTable; accWrap->QueryInterface(NS_GET_IID(nsIAccessibleTable), getter_AddRefs(accTable)); NS_ENSURE_TRUE(accTable, -1); PRInt32 count; nsresult rv = accTable->GetColumnCount(&count); NS_ENSURE_SUCCESS(rv, -1); return static_cast<gint>(count); } static gint getRowCountCB(AtkTable *aTable) { - nsAccessibleWrap *accWrap = GetAccessibleWrap(ATK_OBJECT(aTable)); - if (!accWrap) - return -1; + AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aTable)); + if (!accWrap) + return -1; nsCOMPtr<nsIAccessibleTable> accTable; accWrap->QueryInterface(NS_GET_IID(nsIAccessibleTable), getter_AddRefs(accTable)); NS_ENSURE_TRUE(accTable, -1); PRInt32 count; nsresult rv = accTable->GetRowCount(&count); @@ -129,19 +129,19 @@ getRowCountCB(AtkTable *aTable) return static_cast<gint>(count); } static gint getColumnExtentAtCB(AtkTable *aTable, gint aRow, gint aColumn) { - nsAccessibleWrap *accWrap = GetAccessibleWrap(ATK_OBJECT(aTable)); - if (!accWrap) - return -1; + AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aTable)); + if (!accWrap) + return -1; nsCOMPtr<nsIAccessibleTable> accTable; accWrap->QueryInterface(NS_GET_IID(nsIAccessibleTable), getter_AddRefs(accTable)); NS_ENSURE_TRUE(accTable, -1); PRInt32 extent; nsresult rv = accTable->GetColumnExtentAt(aRow, aColumn, &extent); @@ -149,184 +149,184 @@ getColumnExtentAtCB(AtkTable *aTable, return static_cast<gint>(extent); } static gint getRowExtentAtCB(AtkTable *aTable, gint aRow, gint aColumn) { - nsAccessibleWrap *accWrap = GetAccessibleWrap(ATK_OBJECT(aTable)); - if (!accWrap) - return -1; + AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aTable)); + if (!accWrap) + return -1; nsCOMPtr<nsIAccessibleTable> accTable; accWrap->QueryInterface(NS_GET_IID(nsIAccessibleTable), getter_AddRefs(accTable)); NS_ENSURE_TRUE(accTable, -1); PRInt32 extent; nsresult rv = accTable->GetRowExtentAt(aRow, aColumn, &extent); NS_ENSURE_SUCCESS(rv, -1); return static_cast<gint>(extent); } static AtkObject* getCaptionCB(AtkTable* aTable) { - nsAccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aTable)); + AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aTable)); if (!accWrap) return nsnull; TableAccessible* table = accWrap->AsTable(); NS_ENSURE_TRUE(table, nsnull); - nsAccessible* caption = table->Caption(); - return caption ? nsAccessibleWrap::GetAtkObject(caption) : nsnull; + Accessible* caption = table->Caption(); + return caption ? AccessibleWrap::GetAtkObject(caption) : nsnull; } static const gchar* getColumnDescriptionCB(AtkTable *aTable, gint aColumn) { - nsAccessibleWrap *accWrap = GetAccessibleWrap(ATK_OBJECT(aTable)); - if (!accWrap) - return nsnull; + AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aTable)); + if (!accWrap) + return nsnull; nsCOMPtr<nsIAccessibleTable> accTable; accWrap->QueryInterface(NS_GET_IID(nsIAccessibleTable), getter_AddRefs(accTable)); NS_ENSURE_TRUE(accTable, nsnull); nsAutoString autoStr; nsresult rv = accTable->GetColumnDescription(aColumn, autoStr); NS_ENSURE_SUCCESS(rv, nsnull); - return nsAccessibleWrap::ReturnString(autoStr); + return AccessibleWrap::ReturnString(autoStr); } static AtkObject* getColumnHeaderCB(AtkTable *aTable, gint aColumn) { - nsAccessibleWrap *accWrap = GetAccessibleWrap(ATK_OBJECT(aTable)); - if (!accWrap) - return nsnull; + AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aTable)); + if (!accWrap) + return nsnull; nsCOMPtr<nsIAccessibleTable> accTable; accWrap->QueryInterface(NS_GET_IID(nsIAccessibleTable), getter_AddRefs(accTable)); NS_ENSURE_TRUE(accTable, nsnull); nsCOMPtr<nsIAccessible> accCell; accTable->GetCellAt(0, aColumn, getter_AddRefs(accCell)); if (!accCell) return nsnull; // If the cell at the first row is column header then assume it is column // header for all rows, if (nsAccUtils::Role(accCell) == nsIAccessibleRole::ROLE_COLUMNHEADER) - return nsAccessibleWrap::GetAtkObject(accCell); + return AccessibleWrap::GetAtkObject(accCell); // otherwise get column header for the data cell at the first row. nsCOMPtr<nsIAccessibleTableCell> accTableCell = do_QueryInterface(accCell); if (accTableCell) { nsCOMPtr<nsIArray> headerCells; accTableCell->GetColumnHeaderCells(getter_AddRefs(headerCells)); if (headerCells) { nsresult rv; nsCOMPtr<nsIAccessible> accHeaderCell = do_QueryElementAt(headerCells, 0, &rv); NS_ENSURE_SUCCESS(rv, nsnull); - return nsAccessibleWrap::GetAtkObject(accHeaderCell); + return AccessibleWrap::GetAtkObject(accHeaderCell); } } return nsnull; } static const gchar* getRowDescriptionCB(AtkTable *aTable, gint aRow) { - nsAccessibleWrap *accWrap = GetAccessibleWrap(ATK_OBJECT(aTable)); - if (!accWrap) - return nsnull; + AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aTable)); + if (!accWrap) + return nsnull; nsCOMPtr<nsIAccessibleTable> accTable; accWrap->QueryInterface(NS_GET_IID(nsIAccessibleTable), getter_AddRefs(accTable)); NS_ENSURE_TRUE(accTable, nsnull); nsAutoString autoStr; nsresult rv = accTable->GetRowDescription(aRow, autoStr); NS_ENSURE_SUCCESS(rv, nsnull); - return nsAccessibleWrap::ReturnString(autoStr); + return AccessibleWrap::ReturnString(autoStr); } static AtkObject* getRowHeaderCB(AtkTable *aTable, gint aRow) { - nsAccessibleWrap *accWrap = GetAccessibleWrap(ATK_OBJECT(aTable)); - if (!accWrap) - return nsnull; + AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aTable)); + if (!accWrap) + return nsnull; nsCOMPtr<nsIAccessibleTable> accTable; accWrap->QueryInterface(NS_GET_IID(nsIAccessibleTable), getter_AddRefs(accTable)); NS_ENSURE_TRUE(accTable, nsnull); nsCOMPtr<nsIAccessible> accCell; accTable->GetCellAt(aRow, 0, getter_AddRefs(accCell)); if (!accCell) return nsnull; // If the cell at the first column is row header then assume it is row // header for all columns, if (nsAccUtils::Role(accCell) == nsIAccessibleRole::ROLE_ROWHEADER) - return nsAccessibleWrap::GetAtkObject(accCell); + return AccessibleWrap::GetAtkObject(accCell); // otherwise get row header for the data cell at the first column. nsCOMPtr<nsIAccessibleTableCell> accTableCell = do_QueryInterface(accCell); if (accTableCell) { nsCOMPtr<nsIArray> headerCells; accTableCell->GetRowHeaderCells(getter_AddRefs(headerCells)); if (headerCells) { nsresult rv; nsCOMPtr<nsIAccessible> accHeaderCell = do_QueryElementAt(headerCells, 0, &rv); NS_ENSURE_SUCCESS(rv, nsnull); - return nsAccessibleWrap::GetAtkObject(accHeaderCell); + return AccessibleWrap::GetAtkObject(accHeaderCell); } } return nsnull; } static AtkObject* getSummaryCB(AtkTable *aTable) { - // Neither html:table nor xul:tree nor ARIA grid/tree have an ability to - // link an accessible object to specify a summary. There is closes method - // in nsIAccessibleTable::summary to get a summary as a string which is not - // mapped directly to ATK. - return nsnull; + // Neither html:table nor xul:tree nor ARIA grid/tree have an ability to + // link an accessible object to specify a summary. There is closes method + // in nsIAccessibleTable::summary to get a summary as a string which is not + // mapped directly to ATK. + return nsnull; } static gint getSelectedColumnsCB(AtkTable *aTable, gint **aSelected) { - nsAccessibleWrap *accWrap = GetAccessibleWrap(ATK_OBJECT(aTable)); - if (!accWrap) - return 0; + AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aTable)); + if (!accWrap) + return 0; nsCOMPtr<nsIAccessibleTable> accTable; accWrap->QueryInterface(NS_GET_IID(nsIAccessibleTable), getter_AddRefs(accTable)); NS_ENSURE_TRUE(accTable, 0); PRUint32 size = 0; PRInt32 *columns = NULL; @@ -349,17 +349,17 @@ getSelectedColumnsCB(AtkTable *aTable, g *aSelected = atkColumns; return size; } static gint getSelectedRowsCB(AtkTable *aTable, gint **aSelected) { - nsAccessibleWrap *accWrap = GetAccessibleWrap(ATK_OBJECT(aTable)); + AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aTable)); if (!accWrap) return 0; nsCOMPtr<nsIAccessibleTable> accTable; accWrap->QueryInterface(NS_GET_IID(nsIAccessibleTable), getter_AddRefs(accTable)); NS_ENSURE_TRUE(accTable, 0); @@ -384,53 +384,53 @@ getSelectedRowsCB(AtkTable *aTable, gint *aSelected = atkRows; return size; } static gboolean isColumnSelectedCB(AtkTable *aTable, gint aColumn) { - nsAccessibleWrap *accWrap = GetAccessibleWrap(ATK_OBJECT(aTable)); + AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aTable)); if (!accWrap) return FALSE; nsCOMPtr<nsIAccessibleTable> accTable; accWrap->QueryInterface(NS_GET_IID(nsIAccessibleTable), getter_AddRefs(accTable)); NS_ENSURE_TRUE(accTable, FALSE); bool outValue; nsresult rv = accTable->IsColumnSelected(aColumn, &outValue); return NS_FAILED(rv) ? FALSE : static_cast<gboolean>(outValue); } static gboolean isRowSelectedCB(AtkTable *aTable, gint aRow) { - nsAccessibleWrap *accWrap = GetAccessibleWrap(ATK_OBJECT(aTable)); - if (!accWrap) - return FALSE; + AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aTable)); + if (!accWrap) + return FALSE; nsCOMPtr<nsIAccessibleTable> accTable; accWrap->QueryInterface(NS_GET_IID(nsIAccessibleTable), getter_AddRefs(accTable)); NS_ENSURE_TRUE(accTable, FALSE); bool outValue; nsresult rv = accTable->IsRowSelected(aRow, &outValue); return NS_FAILED(rv) ? FALSE : static_cast<gboolean>(outValue); } static gboolean isCellSelectedCB(AtkTable *aTable, gint aRow, gint aColumn) { - nsAccessibleWrap *accWrap = GetAccessibleWrap(ATK_OBJECT(aTable)); - if (!accWrap) - return FALSE; + AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aTable)); + if (!accWrap) + return FALSE; nsCOMPtr<nsIAccessibleTable> accTable; accWrap->QueryInterface(NS_GET_IID(nsIAccessibleTable), getter_AddRefs(accTable)); NS_ENSURE_TRUE(accTable, FALSE); bool outValue; nsresult rv = accTable->IsCellSelected(aRow, aColumn, &outValue);
--- a/accessible/src/atk/nsMaiInterfaceText.cpp +++ b/accessible/src/atk/nsMaiInterfaceText.cpp @@ -11,33 +11,33 @@ #include "nsIPersistentProperties2.h" using namespace mozilla::a11y; AtkAttributeSet* ConvertToAtkAttributeSet(nsIPersistentProperties* aAttributes); static void -ConvertTexttoAsterisks(nsAccessibleWrap* accWrap, nsAString& aString) +ConvertTexttoAsterisks(AccessibleWrap* accWrap, nsAString& aString) { // convert each char to "*" when it's "password text" if (accWrap->NativeRole() == roles::PASSWORD_TEXT) { for (PRUint32 i = 0; i < aString.Length(); i++) aString.Replace(i, 1, NS_LITERAL_STRING("*")); } } extern "C" { static gchar* getTextCB(AtkText *aText, gint aStartOffset, gint aEndOffset) { - nsAccessibleWrap *accWrap = GetAccessibleWrap(ATK_OBJECT(aText)); - if (!accWrap) - return nsnull; + AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aText)); + if (!accWrap) + return nsnull; nsCOMPtr<nsIAccessibleText> accText; accWrap->QueryInterface(NS_GET_IID(nsIAccessibleText), getter_AddRefs(accText)); NS_ENSURE_TRUE(accText, nsnull); nsAutoString autoStr; nsresult rv = accText->GetText(aStartOffset, aEndOffset, autoStr); @@ -50,19 +50,19 @@ getTextCB(AtkText *aText, gint aStartOff return (cautoStr.get()) ? g_strdup(cautoStr.get()) : nsnull; } static gchar* getTextAfterOffsetCB(AtkText *aText, gint aOffset, AtkTextBoundary aBoundaryType, gint *aStartOffset, gint *aEndOffset) { - nsAccessibleWrap *accWrap = GetAccessibleWrap(ATK_OBJECT(aText)); - if (!accWrap) - return nsnull; + AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aText)); + if (!accWrap) + return nsnull; nsCOMPtr<nsIAccessibleText> accText; accWrap->QueryInterface(NS_GET_IID(nsIAccessibleText), getter_AddRefs(accText)); NS_ENSURE_TRUE(accText, nsnull); nsAutoString autoStr; PRInt32 startOffset = 0, endOffset = 0; @@ -79,19 +79,19 @@ getTextAfterOffsetCB(AtkText *aText, gin return (cautoStr.get()) ? g_strdup(cautoStr.get()) : nsnull; } static gchar* getTextAtOffsetCB(AtkText *aText, gint aOffset, AtkTextBoundary aBoundaryType, gint *aStartOffset, gint *aEndOffset) { - nsAccessibleWrap *accWrap = GetAccessibleWrap(ATK_OBJECT(aText)); - if (!accWrap) - return nsnull; + AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aText)); + if (!accWrap) + return nsnull; nsCOMPtr<nsIAccessibleText> accText; accWrap->QueryInterface(NS_GET_IID(nsIAccessibleText), getter_AddRefs(accText)); NS_ENSURE_TRUE(accText, nsnull); nsAutoString autoStr; PRInt32 startOffset = 0, endOffset = 0; @@ -106,17 +106,17 @@ getTextAtOffsetCB(AtkText *aText, gint a ConvertTexttoAsterisks(accWrap, autoStr); NS_ConvertUTF16toUTF8 cautoStr(autoStr); return (cautoStr.get()) ? g_strdup(cautoStr.get()) : nsnull; } static gunichar getCharacterAtOffsetCB(AtkText* aText, gint aOffset) { - nsAccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aText)); + AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aText)); if (!accWrap) return 0; nsCOMPtr<nsIAccessibleText> accText; accWrap->QueryInterface(NS_GET_IID(nsIAccessibleText), getter_AddRefs(accText)); NS_ENSURE_TRUE(accText, 0); @@ -134,19 +134,19 @@ getCharacterAtOffsetCB(AtkText* aText, g return static_cast<gunichar>(uniChar); } static gchar* getTextBeforeOffsetCB(AtkText *aText, gint aOffset, AtkTextBoundary aBoundaryType, gint *aStartOffset, gint *aEndOffset) { - nsAccessibleWrap *accWrap = GetAccessibleWrap(ATK_OBJECT(aText)); - if (!accWrap) - return nsnull; + AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aText)); + if (!accWrap) + return nsnull; nsCOMPtr<nsIAccessibleText> accText; accWrap->QueryInterface(NS_GET_IID(nsIAccessibleText), getter_AddRefs(accText)); NS_ENSURE_TRUE(accText, nsnull); nsAutoString autoStr; PRInt32 startOffset = 0, endOffset = 0; @@ -161,41 +161,41 @@ getTextBeforeOffsetCB(AtkText *aText, gi ConvertTexttoAsterisks(accWrap, autoStr); NS_ConvertUTF16toUTF8 cautoStr(autoStr); return (cautoStr.get()) ? g_strdup(cautoStr.get()) : nsnull; } static gint getCaretOffsetCB(AtkText *aText) { - nsAccessibleWrap *accWrap = GetAccessibleWrap(ATK_OBJECT(aText)); - if (!accWrap) - return 0; + AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aText)); + if (!accWrap) + return 0; nsCOMPtr<nsIAccessibleText> accText; accWrap->QueryInterface(NS_GET_IID(nsIAccessibleText), getter_AddRefs(accText)); NS_ENSURE_TRUE(accText, 0); PRInt32 offset; nsresult rv = accText->GetCaretOffset(&offset); return (NS_FAILED(rv)) ? 0 : static_cast<gint>(offset); } static AtkAttributeSet* getRunAttributesCB(AtkText *aText, gint aOffset, gint *aStartOffset, gint *aEndOffset) { - *aStartOffset = -1; - *aEndOffset = -1; + *aStartOffset = -1; + *aEndOffset = -1; - nsAccessibleWrap *accWrap = GetAccessibleWrap(ATK_OBJECT(aText)); - if (!accWrap) - return nsnull; + AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aText)); + if (!accWrap) + return nsnull; nsCOMPtr<nsIAccessibleText> accText; accWrap->QueryInterface(NS_GET_IID(nsIAccessibleText), getter_AddRefs(accText)); NS_ENSURE_TRUE(accText, nsnull); nsCOMPtr<nsIPersistentProperties> attributes; PRInt32 startOffset = 0, endOffset = 0; @@ -208,19 +208,19 @@ getRunAttributesCB(AtkText *aText, gint *aEndOffset = endOffset; return ConvertToAtkAttributeSet(attributes); } static AtkAttributeSet* getDefaultAttributesCB(AtkText *aText) { - nsAccessibleWrap *accWrap = GetAccessibleWrap(ATK_OBJECT(aText)); - if (!accWrap) - return nsnull; + AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aText)); + if (!accWrap) + return nsnull; nsCOMPtr<nsIAccessibleText> accText; accWrap->QueryInterface(NS_GET_IID(nsIAccessibleText), getter_AddRefs(accText)); NS_ENSURE_TRUE(accText, nsnull); nsCOMPtr<nsIPersistentProperties> attributes; nsresult rv = accText->GetDefaultTextAttributes(getter_AddRefs(attributes)); @@ -231,19 +231,19 @@ getDefaultAttributesCB(AtkText *aText) } static void getCharacterExtentsCB(AtkText *aText, gint aOffset, gint *aX, gint *aY, gint *aWidth, gint *aHeight, AtkCoordType aCoords) { - nsAccessibleWrap *accWrap = GetAccessibleWrap(ATK_OBJECT(aText)); - if(!accWrap || !aX || !aY || !aWidth || !aHeight) - return; + AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aText)); + if(!accWrap || !aX || !aY || !aWidth || !aHeight) + return; nsCOMPtr<nsIAccessibleText> accText; accWrap->QueryInterface(NS_GET_IID(nsIAccessibleText), getter_AddRefs(accText)); if (!accText) return; PRInt32 extY = 0, extX = 0; @@ -268,19 +268,19 @@ getCharacterExtentsCB(AtkText *aText, gi NS_ASSERTION(NS_SUCCEEDED(rv), "MaiInterfaceText::GetCharacterExtents, failed\n"); } static void getRangeExtentsCB(AtkText *aText, gint aStartOffset, gint aEndOffset, AtkCoordType aCoords, AtkTextRectangle *aRect) { - nsAccessibleWrap *accWrap = GetAccessibleWrap(ATK_OBJECT(aText)); - if(!accWrap || !aRect) - return; + AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aText)); + if(!accWrap || !aRect) + return; nsCOMPtr<nsIAccessibleText> accText; accWrap->QueryInterface(NS_GET_IID(nsIAccessibleText), getter_AddRefs(accText)); if (!accText) return; PRInt32 extY = 0, extX = 0; @@ -305,33 +305,33 @@ getRangeExtentsCB(AtkText *aText, gint a aRect->height = extHeight; NS_ASSERTION(NS_SUCCEEDED(rv), "MaiInterfaceText::GetRangeExtents, failed\n"); } static gint getCharacterCountCB(AtkText *aText) { - nsAccessibleWrap *accWrap = GetAccessibleWrap(ATK_OBJECT(aText)); - if (!accWrap) - return 0; + AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aText)); + if (!accWrap) + return 0; - nsHyperTextAccessible* textAcc = accWrap->AsHyperText(); - return textAcc->IsDefunct() ? - 0 : static_cast<gint>(textAcc->CharacterCount()); + nsHyperTextAccessible* textAcc = accWrap->AsHyperText(); + return textAcc->IsDefunct() ? + 0 : static_cast<gint>(textAcc->CharacterCount()); } static gint getOffsetAtPointCB(AtkText *aText, gint aX, gint aY, AtkCoordType aCoords) { - nsAccessibleWrap *accWrap = GetAccessibleWrap(ATK_OBJECT(aText)); - if (!accWrap) - return -1; + AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aText)); + if (!accWrap) + return -1; nsCOMPtr<nsIAccessibleText> accText; accWrap->QueryInterface(NS_GET_IID(nsIAccessibleText), getter_AddRefs(accText)); NS_ENSURE_TRUE(accText, -1); PRInt32 offset = 0; PRUint32 geckoCoordType; @@ -342,38 +342,38 @@ getOffsetAtPointCB(AtkText *aText, accText->GetOffsetAtPoint(aX, aY, geckoCoordType, &offset); return static_cast<gint>(offset); } static gint getTextSelectionCountCB(AtkText *aText) { - nsAccessibleWrap *accWrap = GetAccessibleWrap(ATK_OBJECT(aText)); - if (!accWrap) - return nsnull; + AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aText)); + if (!accWrap) + return nsnull; nsCOMPtr<nsIAccessibleText> accText; accWrap->QueryInterface(NS_GET_IID(nsIAccessibleText), getter_AddRefs(accText)); NS_ENSURE_TRUE(accText, nsnull); PRInt32 selectionCount; nsresult rv = accText->GetSelectionCount(&selectionCount); return NS_FAILED(rv) ? 0 : selectionCount; } static gchar* getTextSelectionCB(AtkText *aText, gint aSelectionNum, gint *aStartOffset, gint *aEndOffset) { - nsAccessibleWrap *accWrap = GetAccessibleWrap(ATK_OBJECT(aText)); - if (!accWrap) - return nsnull; + AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aText)); + if (!accWrap) + return nsnull; nsCOMPtr<nsIAccessibleText> accText; accWrap->QueryInterface(NS_GET_IID(nsIAccessibleText), getter_AddRefs(accText)); NS_ENSURE_TRUE(accText, nsnull); PRInt32 startOffset = 0, endOffset = 0; nsresult rv = accText->GetSelectionBounds(aSelectionNum, @@ -388,72 +388,72 @@ getTextSelectionCB(AtkText *aText, gint } // set methods static gboolean addTextSelectionCB(AtkText *aText, gint aStartOffset, gint aEndOffset) { - nsAccessibleWrap *accWrap = GetAccessibleWrap(ATK_OBJECT(aText)); - if (!accWrap) - return FALSE; + AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aText)); + if (!accWrap) + return FALSE; nsCOMPtr<nsIAccessibleText> accText; accWrap->QueryInterface(NS_GET_IID(nsIAccessibleText), getter_AddRefs(accText)); NS_ENSURE_TRUE(accText, FALSE); nsresult rv = accText->AddSelection(aStartOffset, aEndOffset); return NS_SUCCEEDED(rv) ? TRUE : FALSE; } static gboolean removeTextSelectionCB(AtkText *aText, gint aSelectionNum) { - nsAccessibleWrap *accWrap = GetAccessibleWrap(ATK_OBJECT(aText)); - if (!accWrap) - return FALSE; + AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aText)); + if (!accWrap) + return FALSE; nsCOMPtr<nsIAccessibleText> accText; accWrap->QueryInterface(NS_GET_IID(nsIAccessibleText), getter_AddRefs(accText)); NS_ENSURE_TRUE(accText, FALSE); nsresult rv = accText->RemoveSelection(aSelectionNum); return NS_SUCCEEDED(rv) ? TRUE : FALSE; } static gboolean setTextSelectionCB(AtkText *aText, gint aSelectionNum, gint aStartOffset, gint aEndOffset) { - nsAccessibleWrap *accWrap = GetAccessibleWrap(ATK_OBJECT(aText)); - if (!accWrap) - return FALSE; + AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aText)); + if (!accWrap) + return FALSE; nsCOMPtr<nsIAccessibleText> accText; accWrap->QueryInterface(NS_GET_IID(nsIAccessibleText), getter_AddRefs(accText)); NS_ENSURE_TRUE(accText, FALSE); nsresult rv = accText->SetSelectionBounds(aSelectionNum, aStartOffset, aEndOffset); return NS_SUCCEEDED(rv) ? TRUE : FALSE; } static gboolean setCaretOffsetCB(AtkText *aText, gint aOffset) { - nsAccessibleWrap *accWrap = GetAccessibleWrap(ATK_OBJECT(aText)); - if (!accWrap) - return FALSE; + AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aText)); + if (!accWrap) + return FALSE; nsCOMPtr<nsIAccessibleText> accText; accWrap->QueryInterface(NS_GET_IID(nsIAccessibleText), getter_AddRefs(accText)); NS_ENSURE_TRUE(accText, FALSE); nsresult rv = accText->SetCaretOffset(aOffset); return NS_SUCCEEDED(rv) ? TRUE : FALSE;
--- a/accessible/src/atk/nsMaiInterfaceValue.cpp +++ b/accessible/src/atk/nsMaiInterfaceValue.cpp @@ -1,27 +1,27 @@ /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* vim: set ts=2 et sw=2 tw=80: */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "InterfaceInitFuncs.h" -#include "nsAccessibleWrap.h" +#include "AccessibleWrap.h" #include "nsMai.h" extern "C" { static void getCurrentValueCB(AtkValue *obj, GValue *value) { - nsAccessibleWrap *accWrap = GetAccessibleWrap(ATK_OBJECT(obj)); - if (!accWrap) - return; + AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(obj)); + if (!accWrap) + return; nsCOMPtr<nsIAccessibleValue> accValue; accWrap->QueryInterface(NS_GET_IID(nsIAccessibleValue), getter_AddRefs(accValue)); if (!accValue) return; memset (value, 0, sizeof (GValue)); @@ -30,19 +30,19 @@ getCurrentValueCB(AtkValue *obj, GValue return; g_value_init (value, G_TYPE_DOUBLE); g_value_set_double (value, accDouble); } static void getMaximumValueCB(AtkValue *obj, GValue *value) { - nsAccessibleWrap *accWrap = GetAccessibleWrap(ATK_OBJECT(obj)); - if (!accWrap) - return; + AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(obj)); + if (!accWrap) + return; nsCOMPtr<nsIAccessibleValue> accValue; accWrap->QueryInterface(NS_GET_IID(nsIAccessibleValue), getter_AddRefs(accValue)); if (!accValue) return; memset (value, 0, sizeof (GValue)); @@ -51,19 +51,19 @@ getMaximumValueCB(AtkValue *obj, GValue return; g_value_init (value, G_TYPE_DOUBLE); g_value_set_double (value, accDouble); } static void getMinimumValueCB(AtkValue *obj, GValue *value) { - nsAccessibleWrap *accWrap = GetAccessibleWrap(ATK_OBJECT(obj)); - if (!accWrap) - return; + AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(obj)); + if (!accWrap) + return; nsCOMPtr<nsIAccessibleValue> accValue; accWrap->QueryInterface(NS_GET_IID(nsIAccessibleValue), getter_AddRefs(accValue)); if (!accValue) return; memset (value, 0, sizeof (GValue)); @@ -72,19 +72,19 @@ getMinimumValueCB(AtkValue *obj, GValue return; g_value_init (value, G_TYPE_DOUBLE); g_value_set_double (value, accDouble); } static void getMinimumIncrementCB(AtkValue *obj, GValue *minimumIncrement) { - nsAccessibleWrap *accWrap = GetAccessibleWrap(ATK_OBJECT(obj)); - if (!accWrap) - return; + AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(obj)); + if (!accWrap) + return; nsCOMPtr<nsIAccessibleValue> accValue; accWrap->QueryInterface(NS_GET_IID(nsIAccessibleValue), getter_AddRefs(accValue)); if (!accValue) return; memset (minimumIncrement, 0, sizeof (GValue)); @@ -93,19 +93,19 @@ getMinimumIncrementCB(AtkValue *obj, GVa return; g_value_init (minimumIncrement, G_TYPE_DOUBLE); g_value_set_double (minimumIncrement, accDouble); } static gboolean setCurrentValueCB(AtkValue *obj, const GValue *value) { - nsAccessibleWrap *accWrap = GetAccessibleWrap(ATK_OBJECT(obj)); - if (!accWrap) - return FALSE; + AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(obj)); + if (!accWrap) + return FALSE; nsCOMPtr<nsIAccessibleValue> accValue; accWrap->QueryInterface(NS_GET_IID(nsIAccessibleValue), getter_AddRefs(accValue)); NS_ENSURE_TRUE(accValue, FALSE); double accDouble =g_value_get_double (value); return !NS_FAILED(accValue->SetCurrentValue(accDouble));
--- a/accessible/src/atk/nsStateMap.h +++ b/accessible/src/atk/nsStateMap.h @@ -1,16 +1,16 @@ /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* vim: set ts=2 et sw=2 tw=80: */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include <atk/atk.h> -#include "nsAccessibleWrap.h" +#include "AccessibleWrap.h" /****************************************************************************** The following nsIAccessible states aren't translated, just ignored: STATE_READONLY: Supported indirectly via EXT_STATE_EDITABLE STATE_HOTTRACKED: No ATK equivalent. No known use case. The nsIAccessible state is not currently supported. STATE_FLOATING: No ATK equivalent. No known use case. The nsIAccessible state is not currently supported.
--- a/accessible/src/base/AccCollector.cpp +++ b/accessible/src/base/AccCollector.cpp @@ -1,114 +1,114 @@ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "AccCollector.h" -#include "nsAccessible.h" +#include "Accessible.h" //////////////////////////////////////////////////////////////////////////////// // nsAccCollector //////////////////////////////////////////////////////////////////////////////// AccCollector:: - AccCollector(nsAccessible* aRoot, filters::FilterFuncPtr aFilterFunc) : + AccCollector(Accessible* aRoot, filters::FilterFuncPtr aFilterFunc) : mFilterFunc(aFilterFunc), mRoot(aRoot), mRootChildIdx(0) { } AccCollector::~AccCollector() { } PRUint32 AccCollector::Count() { EnsureNGetIndex(nsnull); return mObjects.Length(); } -nsAccessible* +Accessible* AccCollector::GetAccessibleAt(PRUint32 aIndex) { - nsAccessible *accessible = mObjects.SafeElementAt(aIndex, nsnull); + Accessible* accessible = mObjects.SafeElementAt(aIndex, nsnull); if (accessible) return accessible; return EnsureNGetObject(aIndex); } PRInt32 -AccCollector::GetIndexAt(nsAccessible *aAccessible) +AccCollector::GetIndexAt(Accessible* aAccessible) { PRInt32 index = mObjects.IndexOf(aAccessible); if (index != -1) return index; return EnsureNGetIndex(aAccessible); } //////////////////////////////////////////////////////////////////////////////// // nsAccCollector protected -nsAccessible* +Accessible* AccCollector::EnsureNGetObject(PRUint32 aIndex) { PRUint32 childCount = mRoot->ChildCount(); while (mRootChildIdx < childCount) { - nsAccessible* child = mRoot->GetChildAt(mRootChildIdx++); + Accessible* child = mRoot->GetChildAt(mRootChildIdx++); if (!mFilterFunc(child)) continue; AppendObject(child); if (mObjects.Length() - 1 == aIndex) return mObjects[aIndex]; } return nsnull; } PRInt32 -AccCollector::EnsureNGetIndex(nsAccessible* aAccessible) +AccCollector::EnsureNGetIndex(Accessible* aAccessible) { PRUint32 childCount = mRoot->ChildCount(); while (mRootChildIdx < childCount) { - nsAccessible* child = mRoot->GetChildAt(mRootChildIdx++); + Accessible* child = mRoot->GetChildAt(mRootChildIdx++); if (!mFilterFunc(child)) continue; AppendObject(child); if (child == aAccessible) return mObjects.Length() - 1; } return -1; } void -AccCollector::AppendObject(nsAccessible* aAccessible) +AccCollector::AppendObject(Accessible* aAccessible) { mObjects.AppendElement(aAccessible); } //////////////////////////////////////////////////////////////////////////////// // EmbeddedObjCollector //////////////////////////////////////////////////////////////////////////////// PRInt32 -EmbeddedObjCollector::GetIndexAt(nsAccessible *aAccessible) +EmbeddedObjCollector::GetIndexAt(Accessible* aAccessible) { if (aAccessible->mParent != mRoot) return -1; if (aAccessible->mIndexOfEmbeddedChild != -1) return aAccessible->mIndexOfEmbeddedChild; return mFilterFunc(aAccessible) ? EnsureNGetIndex(aAccessible) : -1; } void -EmbeddedObjCollector::AppendObject(nsAccessible* aAccessible) +EmbeddedObjCollector::AppendObject(Accessible* aAccessible) { aAccessible->mIndexOfEmbeddedChild = mObjects.Length(); mObjects.AppendElement(aAccessible); }
--- a/accessible/src/base/AccCollector.h +++ b/accessible/src/base/AccCollector.h @@ -12,55 +12,55 @@ /** * Collect accessible children complying with filter function. Provides quick * access to accessible by index. */ class AccCollector { public: - AccCollector(nsAccessible* aRoot, filters::FilterFuncPtr aFilterFunc); + AccCollector(Accessible* aRoot, filters::FilterFuncPtr aFilterFunc); virtual ~AccCollector(); /** * Return accessible count within the collection. */ PRUint32 Count(); /** * Return an accessible from the collection at the given index. */ - nsAccessible* GetAccessibleAt(PRUint32 aIndex); + Accessible* GetAccessibleAt(PRUint32 aIndex); /** * Return index of the given accessible within the collection. */ - virtual PRInt32 GetIndexAt(nsAccessible* aAccessible); + virtual PRInt32 GetIndexAt(Accessible* aAccessible); protected: /** * Ensure accessible at the given index is stored and return it. */ - nsAccessible* EnsureNGetObject(PRUint32 aIndex); + Accessible* EnsureNGetObject(PRUint32 aIndex); /** * Ensure index for the given accessible is stored and return it. */ - PRInt32 EnsureNGetIndex(nsAccessible* aAccessible); + PRInt32 EnsureNGetIndex(Accessible* aAccessible); /** * Append the object to collection. */ - virtual void AppendObject(nsAccessible* aAccessible); + virtual void AppendObject(Accessible* aAccessible); filters::FilterFuncPtr mFilterFunc; - nsAccessible* mRoot; + Accessible* mRoot; PRUint32 mRootChildIdx; - nsTArray<nsAccessible*> mObjects; + nsTArray<Accessible*> mObjects; private: AccCollector(); AccCollector(const AccCollector&); AccCollector& operator =(const AccCollector&); }; /** @@ -68,21 +68,21 @@ private: * vice versa. */ class EmbeddedObjCollector : public AccCollector { public: virtual ~EmbeddedObjCollector() { }; public: - virtual PRInt32 GetIndexAt(nsAccessible* aAccessible); + virtual PRInt32 GetIndexAt(Accessible* aAccessible); protected: - // Make sure it's used by nsAccessible class only. - EmbeddedObjCollector(nsAccessible* aRoot) : + // Make sure it's used by Accessible class only. + EmbeddedObjCollector(Accessible* aRoot) : AccCollector(aRoot, filters::GetEmbeddedObject) { } - virtual void AppendObject(nsAccessible* aAccessible); + virtual void AppendObject(Accessible* aAccessible); - friend class nsAccessible; + friend class Accessible; }; #endif
--- a/accessible/src/base/AccEvent.cpp +++ b/accessible/src/base/AccEvent.cpp @@ -24,34 +24,34 @@ using namespace mozilla::a11y; //////////////////////////////////////////////////////////////////////////////// // AccEvent //////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// // AccEvent constructors -AccEvent::AccEvent(PRUint32 aEventType, nsAccessible* aAccessible, +AccEvent::AccEvent(PRUint32 aEventType, Accessible* aAccessible, EIsFromUserInput aIsFromUserInput, EEventRule aEventRule) : mEventType(aEventType), mEventRule(aEventRule), mAccessible(aAccessible) { CaptureIsFromUserInput(aIsFromUserInput); } AccEvent::AccEvent(PRUint32 aEventType, nsINode* aNode, EIsFromUserInput aIsFromUserInput, EEventRule aEventRule) : mEventType(aEventType), mEventRule(aEventRule), mNode(aNode) { CaptureIsFromUserInput(aIsFromUserInput); } //////////////////////////////////////////////////////////////////////////////// // AccEvent public methods -nsAccessible * +Accessible* AccEvent::GetAccessible() { if (!mAccessible) mAccessible = GetAccessibleForNode(); return mAccessible; } @@ -100,17 +100,17 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NATIVE NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END NS_IMPL_CYCLE_COLLECTION_ROOT_NATIVE(AccEvent, AddRef) NS_IMPL_CYCLE_COLLECTION_UNROOT_NATIVE(AccEvent, Release) //////////////////////////////////////////////////////////////////////////////// // AccEvent protected methods -nsAccessible* +Accessible* AccEvent::GetAccessibleForNode() const { if (mNode) { DocAccessible* document = GetAccService()->GetDocAccessible(mNode->OwnerDoc()); if (document) return document->GetAccessible(mNode); } @@ -163,17 +163,17 @@ AccEvent::CaptureIsFromUserInput(EIsFrom //////////////////////////////////////////////////////////////////////////////// // AccStateChangeEvent //////////////////////////////////////////////////////////////////////////////// // Note: we pass in eAllowDupes to the base class because we don't currently // support correct state change coalescence (XXX Bug 569356). Also we need to // decide how to coalesce events created via accessible (instead of node). AccStateChangeEvent:: - AccStateChangeEvent(nsAccessible* aAccessible, PRUint64 aState, + AccStateChangeEvent(Accessible* aAccessible, PRUint64 aState, bool aIsEnabled, EIsFromUserInput aIsFromUserInput): AccEvent(nsIAccessibleEvent::EVENT_STATE_CHANGE, aAccessible, aIsFromUserInput, eAllowDupes), mState(aState), mIsEnabled(aIsEnabled) { } AccStateChangeEvent:: @@ -188,17 +188,17 @@ AccStateChangeEvent:: AccStateChangeEvent(nsINode* aNode, PRUint64 aState) : AccEvent(::nsIAccessibleEvent::EVENT_STATE_CHANGE, aNode, eAutoDetect, eAllowDupes), mState(aState) { // Use GetAccessibleForNode() because we do not want to store an accessible // since it leads to problems with delayed events in the case when // an accessible gets reorder event before delayed event is processed. - nsAccessible *accessible = GetAccessibleForNode(); + Accessible* accessible = GetAccessibleForNode(); mIsEnabled = accessible && ((accessible->State() & mState) != 0); } already_AddRefed<nsAccEvent> AccStateChangeEvent::CreateXPCOMObject() { nsAccEvent* event = new nsAccStateChangeEvent(this); NS_IF_ADDREF(event); @@ -214,17 +214,17 @@ AccStateChangeEvent::CreateXPCOMObject() // events coalescence. We fire delayed text change events in DocAccessible but // we continue to base the event off the accessible object rather than just the // node. This means we won't try to create an accessible based on the node when // we are ready to fire the event and so we will no longer assert at that point // if the node was removed from the document. Either way, the AT won't work with // a defunct accessible so the behaviour should be equivalent. // XXX revisit this when coalescence is faster (eCoalesceFromSameSubtree) AccTextChangeEvent:: - AccTextChangeEvent(nsAccessible* aAccessible, PRInt32 aStart, + AccTextChangeEvent(Accessible* aAccessible, PRInt32 aStart, const nsAString& aModifiedText, bool aIsInserted, EIsFromUserInput aIsFromUserInput) : AccEvent(aIsInserted ? static_cast<PRUint32>(nsIAccessibleEvent::EVENT_TEXT_INSERTED) : static_cast<PRUint32>(nsIAccessibleEvent::EVENT_TEXT_REMOVED), aAccessible, aIsFromUserInput, eAllowDupes) , mStart(aStart) , mIsInserted(aIsInserted) @@ -245,30 +245,30 @@ AccTextChangeEvent::CreateXPCOMObject() } //////////////////////////////////////////////////////////////////////////////// // AccMutationEvent //////////////////////////////////////////////////////////////////////////////// AccMutationEvent:: - AccMutationEvent(PRUint32 aEventType, nsAccessible* aTarget, + AccMutationEvent(PRUint32 aEventType, Accessible* aTarget, nsINode* aTargetNode) : AccEvent(aEventType, aTarget, eAutoDetect, eCoalesceFromSameSubtree) { mNode = aTargetNode; } //////////////////////////////////////////////////////////////////////////////// // AccHideEvent //////////////////////////////////////////////////////////////////////////////// AccHideEvent:: - AccHideEvent(nsAccessible* aTarget, nsINode* aTargetNode) : + AccHideEvent(Accessible* aTarget, nsINode* aTargetNode) : AccMutationEvent(::nsIAccessibleEvent::EVENT_HIDE, aTarget, aTargetNode) { mParent = mAccessible->Parent(); mNextSibling = mAccessible->NextSibling(); mPrevSibling = mAccessible->PrevSibling(); } already_AddRefed<nsAccEvent> @@ -280,28 +280,28 @@ AccHideEvent::CreateXPCOMObject() } //////////////////////////////////////////////////////////////////////////////// // AccShowEvent //////////////////////////////////////////////////////////////////////////////// AccShowEvent:: - AccShowEvent(nsAccessible* aTarget, nsINode* aTargetNode) : + AccShowEvent(Accessible* aTarget, nsINode* aTargetNode) : AccMutationEvent(::nsIAccessibleEvent::EVENT_SHOW, aTarget, aTargetNode) { } //////////////////////////////////////////////////////////////////////////////// // AccCaretMoveEvent //////////////////////////////////////////////////////////////////////////////// AccCaretMoveEvent:: - AccCaretMoveEvent(nsAccessible* aAccessible, PRInt32 aCaretOffset) : + AccCaretMoveEvent(Accessible* aAccessible, PRInt32 aCaretOffset) : AccEvent(::nsIAccessibleEvent::EVENT_TEXT_CARET_MOVED, aAccessible), mCaretOffset(aCaretOffset) { } AccCaretMoveEvent:: AccCaretMoveEvent(nsINode* aNode) : AccEvent(::nsIAccessibleEvent::EVENT_TEXT_CARET_MOVED, aNode), @@ -318,17 +318,17 @@ AccCaretMoveEvent::CreateXPCOMObject() } //////////////////////////////////////////////////////////////////////////////// // AccSelChangeEvent //////////////////////////////////////////////////////////////////////////////// AccSelChangeEvent:: - AccSelChangeEvent(nsAccessible* aWidget, nsAccessible* aItem, + AccSelChangeEvent(Accessible* aWidget, Accessible* aItem, SelChangeType aSelChangeType) : AccEvent(0, aItem, eAutoDetect, eCoalesceSelectionChange), mWidget(aWidget), mItem(aItem), mSelChangeType(aSelChangeType), mPreceedingCount(0), mPackedEvent(nsnull) { if (aSelChangeType == eSelectionAdd) { if (mWidget->GetSelectedItem(1)) mEventType = nsIAccessibleEvent::EVENT_SELECTION_ADD; @@ -340,17 +340,17 @@ AccSelChangeEvent:: } //////////////////////////////////////////////////////////////////////////////// // AccTableChangeEvent //////////////////////////////////////////////////////////////////////////////// AccTableChangeEvent:: - AccTableChangeEvent(nsAccessible* aAccessible, PRUint32 aEventType, + AccTableChangeEvent(Accessible* aAccessible, PRUint32 aEventType, PRInt32 aRowOrColIndex, PRInt32 aNumRowsOrCols) : AccEvent(aEventType, aAccessible), mRowOrColIndex(aRowOrColIndex), mNumRowsOrCols(aNumRowsOrCols) { } already_AddRefed<nsAccEvent> AccTableChangeEvent::CreateXPCOMObject() @@ -361,17 +361,17 @@ AccTableChangeEvent::CreateXPCOMObject() } //////////////////////////////////////////////////////////////////////////////// // AccVCChangeEvent //////////////////////////////////////////////////////////////////////////////// AccVCChangeEvent:: - AccVCChangeEvent(nsAccessible* aAccessible, + AccVCChangeEvent(Accessible* aAccessible, nsIAccessible* aOldAccessible, PRInt32 aOldStart, PRInt32 aOldEnd) : AccEvent(::nsIAccessibleEvent::EVENT_VIRTUALCURSOR_CHANGED, aAccessible), mOldAccessible(aOldAccessible), mOldStart(aOldStart), mOldEnd(aOldEnd) { } already_AddRefed<nsAccEvent>
--- a/accessible/src/base/AccEvent.h +++ b/accessible/src/base/AccEvent.h @@ -3,17 +3,17 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _AccEvent_H_ #define _AccEvent_H_ #include "nsIAccessibleEvent.h" -#include "nsAccessible.h" +#include "Accessible.h" class nsAccEvent; class DocAccessible; // Constants used to point whether the event is from user input. enum EIsFromUserInput { // eNoUserInput: event is not from user input @@ -54,31 +54,31 @@ public: // will be emitted. eRemoveDupes, // eDoNotEmit : This event is confirmed as a duplicate, do not emit it. eDoNotEmit }; // Initialize with an nsIAccessible - AccEvent(PRUint32 aEventType, nsAccessible* aAccessible, + AccEvent(PRUint32 aEventType, Accessible* aAccessible, EIsFromUserInput aIsFromUserInput = eAutoDetect, EEventRule aEventRule = eRemoveDupes); // Initialize with an nsIDOMNode AccEvent(PRUint32 aEventType, nsINode* aNode, EIsFromUserInput aIsFromUserInput = eAutoDetect, EEventRule aEventRule = eRemoveDupes); virtual ~AccEvent() {} // AccEvent PRUint32 GetEventType() const { return mEventType; } EEventRule GetEventRule() const { return mEventRule; } bool IsFromUserInput() const { return mIsFromUserInput; } - nsAccessible *GetAccessible(); + Accessible* GetAccessible(); DocAccessible* GetDocAccessible(); nsINode* GetNode(); /** * Create and return an XPCOM object for accessible event object. */ virtual already_AddRefed<nsAccEvent> CreateXPCOMObject(); @@ -109,41 +109,41 @@ public: */ NS_INLINE_DECL_REFCOUNTING(AccEvent) NS_DECL_CYCLE_COLLECTION_NATIVE_CLASS(AccEvent) protected: /** * Get an accessible from event target node. */ - nsAccessible *GetAccessibleForNode() const; + Accessible* GetAccessibleForNode() const; /** * Determine whether the event is from user input by event state manager if * it's not pointed explicetly. */ void CaptureIsFromUserInput(EIsFromUserInput aIsFromUserInput); bool mIsFromUserInput; PRUint32 mEventType; EEventRule mEventRule; - nsRefPtr<nsAccessible> mAccessible; + nsRefPtr<Accessible> mAccessible; nsCOMPtr<nsINode> mNode; friend class NotificationController; }; /** * Accessible state change event. */ class AccStateChangeEvent: public AccEvent { public: - AccStateChangeEvent(nsAccessible* aAccessible, PRUint64 aState, + AccStateChangeEvent(Accessible* aAccessible, PRUint64 aState, bool aIsEnabled, EIsFromUserInput aIsFromUserInput = eAutoDetect); AccStateChangeEvent(nsINode* aNode, PRUint64 aState, bool aIsEnabled); AccStateChangeEvent(nsINode* aNode, PRUint64 aState); // AccEvent @@ -166,17 +166,17 @@ private: /** * Accessible text change event. */ class AccTextChangeEvent: public AccEvent { public: - AccTextChangeEvent(nsAccessible* aAccessible, PRInt32 aStart, + AccTextChangeEvent(Accessible* aAccessible, PRInt32 aStart, const nsAString& aModifiedText, bool aIsInserted, EIsFromUserInput aIsFromUserInput = eAutoDetect); // AccEvent virtual already_AddRefed<nsAccEvent> CreateXPCOMObject(); static const EventGroup kEventGroup = eTextChangeEvent; virtual unsigned int GetEventGroups() const @@ -201,17 +201,17 @@ private: /** * Base class for show and hide accessible events. */ class AccMutationEvent: public AccEvent { public: - AccMutationEvent(PRUint32 aEventType, nsAccessible* aTarget, + AccMutationEvent(PRUint32 aEventType, Accessible* aTarget, nsINode* aTargetNode); // Event static const EventGroup kEventGroup = eMutationEvent; virtual unsigned int GetEventGroups() const { return AccEvent::GetEventGroups() | (1U << eMutationEvent); } @@ -228,65 +228,65 @@ protected: /** * Accessible hide event. */ class AccHideEvent: public AccMutationEvent { public: - AccHideEvent(nsAccessible* aTarget, nsINode* aTargetNode); + AccHideEvent(Accessible* aTarget, nsINode* aTargetNode); // Event virtual already_AddRefed<nsAccEvent> CreateXPCOMObject(); static const EventGroup kEventGroup = eHideEvent; virtual unsigned int GetEventGroups() const { return AccMutationEvent::GetEventGroups() | (1U << eHideEvent); } // AccHideEvent - nsAccessible* TargetParent() const { return mParent; } - nsAccessible* TargetNextSibling() const { return mNextSibling; } - nsAccessible* TargetPrevSibling() const { return mPrevSibling; } + Accessible* TargetParent() const { return mParent; } + Accessible* TargetNextSibling() const { return mNextSibling; } + Accessible* TargetPrevSibling() const { return mPrevSibling; } protected: - nsRefPtr<nsAccessible> mParent; - nsRefPtr<nsAccessible> mNextSibling; - nsRefPtr<nsAccessible> mPrevSibling; + nsRefPtr<Accessible> mParent; + nsRefPtr<Accessible> mNextSibling; + nsRefPtr<Accessible> mPrevSibling; friend class NotificationController; }; /** * Accessible show event. */ class AccShowEvent: public AccMutationEvent { public: - AccShowEvent(nsAccessible* aTarget, nsINode* aTargetNode); + AccShowEvent(Accessible* aTarget, nsINode* aTargetNode); // Event static const EventGroup kEventGroup = eShowEvent; virtual unsigned int GetEventGroups() const { return AccMutationEvent::GetEventGroups() | (1U << eShowEvent); } }; /** * Accessible caret move event. */ class AccCaretMoveEvent: public AccEvent { public: - AccCaretMoveEvent(nsAccessible* aAccessible, PRInt32 aCaretOffset); + AccCaretMoveEvent(Accessible* aAccessible, PRInt32 aCaretOffset); AccCaretMoveEvent(nsINode* aNode); // AccEvent virtual already_AddRefed<nsAccEvent> CreateXPCOMObject(); static const EventGroup kEventGroup = eCaretMoveEvent; virtual unsigned int GetEventGroups() const { @@ -307,49 +307,49 @@ private: class AccSelChangeEvent : public AccEvent { public: enum SelChangeType { eSelectionAdd, eSelectionRemove }; - AccSelChangeEvent(nsAccessible* aWidget, nsAccessible* aItem, + AccSelChangeEvent(Accessible* aWidget, Accessible* aItem, SelChangeType aSelChangeType); virtual ~AccSelChangeEvent() { } // AccEvent static const EventGroup kEventGroup = eSelectionChangeEvent; virtual unsigned int GetEventGroups() const { return AccEvent::GetEventGroups() | (1U << eSelectionChangeEvent); } // AccSelChangeEvent - nsAccessible* Widget() const { return mWidget; } + Accessible* Widget() const { return mWidget; } private: - nsRefPtr<nsAccessible> mWidget; - nsRefPtr<nsAccessible> mItem; + nsRefPtr<Accessible> mWidget; + nsRefPtr<Accessible> mItem; SelChangeType mSelChangeType; PRUint32 mPreceedingCount; AccSelChangeEvent* mPackedEvent; friend class NotificationController; }; /** * Accessible table change event. */ class AccTableChangeEvent : public AccEvent { public: - AccTableChangeEvent(nsAccessible* aAccessible, PRUint32 aEventType, + AccTableChangeEvent(Accessible* aAccessible, PRUint32 aEventType, PRInt32 aRowOrColIndex, PRInt32 aNumRowsOrCols); // AccEvent virtual already_AddRefed<nsAccEvent> CreateXPCOMObject(); static const EventGroup kEventGroup = eTableChangeEvent; virtual unsigned int GetEventGroups() const { @@ -366,17 +366,17 @@ private: }; /** * Accessible virtual cursor change event. */ class AccVCChangeEvent : public AccEvent { public: - AccVCChangeEvent(nsAccessible* aAccessible, + AccVCChangeEvent(Accessible* aAccessible, nsIAccessible* aOldAccessible, PRInt32 aOldStart, PRInt32 aOldEnd); virtual ~AccVCChangeEvent() { } // AccEvent virtual already_AddRefed<nsAccEvent> CreateXPCOMObject();
--- a/accessible/src/base/AccGroupInfo.cpp +++ b/accessible/src/base/AccGroupInfo.cpp @@ -4,38 +4,38 @@ #include "AccGroupInfo.h" #include "Role.h" #include "States.h" using namespace mozilla::a11y; -AccGroupInfo::AccGroupInfo(nsAccessible* aItem, role aRole) : +AccGroupInfo::AccGroupInfo(Accessible* aItem, role aRole) : mPosInSet(0), mSetSize(0), mParent(nsnull) { MOZ_COUNT_CTOR(AccGroupInfo); - nsAccessible* parent = aItem->Parent(); + Accessible* parent = aItem->Parent(); if (!parent) return; PRInt32 indexInParent = aItem->IndexInParent(); PRUint32 siblingCount = parent->ChildCount(); if (indexInParent == -1 || indexInParent >= static_cast<PRInt32>(siblingCount)) { NS_ERROR("Wrong index in parent! Tree invalidation problem."); return; } PRInt32 level = nsAccUtils::GetARIAOrDefaultLevel(aItem); // Compute position in set. mPosInSet = 1; for (PRInt32 idx = indexInParent - 1; idx >= 0 ; idx--) { - nsAccessible* sibling = parent->GetChildAt(idx); + Accessible* sibling = parent->GetChildAt(idx); roles::Role siblingRole = sibling->Role(); // If the sibling is separator then the group is ended. if (siblingRole == roles::SEPARATOR) break; // If sibling is not visible and hasn't the same base role. if (BaseRole(siblingRole) != aRole || sibling->State() & states::INVISIBLE) @@ -66,17 +66,17 @@ AccGroupInfo::AccGroupInfo(nsAccessible* mPosInSet++; } // Compute set size. mSetSize = mPosInSet; for (PRUint32 idx = indexInParent + 1; idx < siblingCount; idx++) { - nsAccessible* sibling = parent->GetChildAt(idx); + Accessible* sibling = parent->GetChildAt(idx); roles::Role siblingRole = sibling->Role(); // If the sibling is separator then the group is ended. if (siblingRole == roles::SEPARATOR) break; // If sibling is visible and has the same base role @@ -112,17 +112,17 @@ AccGroupInfo::AccGroupInfo(nsAccessible* // In the case of ARIA tree (not ARIA treegrid) a tree can be arranged by // using ARIA groups to organize levels. In this case the parent of the tree // item will be a group and the previous treeitem of that should be the tree // item parent. if (parentRole != roles::GROUPING || aRole != roles::OUTLINEITEM) return; - nsAccessible* parentPrevSibling = parent->PrevSibling(); + Accessible* parentPrevSibling = parent->PrevSibling(); if (!parentPrevSibling) return; roles::Role parentPrevSiblingRole = parentPrevSibling->Role(); if (parentPrevSiblingRole == roles::TEXT_LEAF) { // XXX Sometimes an empty text accessible is in the hierarchy here, // although the text does not appear to be rendered, GetRenderedText() // says that it is so we need to skip past it to find the true
--- a/accessible/src/base/AccGroupInfo.h +++ b/accessible/src/base/AccGroupInfo.h @@ -9,27 +9,27 @@ #include "nsAccUtils.h" /** * Calculate and store group information. */ class AccGroupInfo { public: - AccGroupInfo(nsAccessible* aItem, mozilla::a11y::role aRole); + AccGroupInfo(Accessible* aItem, mozilla::a11y::role aRole); ~AccGroupInfo() { MOZ_COUNT_DTOR(AccGroupInfo); } PRInt32 PosInSet() const { return mPosInSet; } PRUint32 SetSize() const { return mSetSize; } - nsAccessible* ConceptualParent() const { return mParent; } + Accessible* ConceptualParent() const { return mParent; } /** * Create group info. */ - static AccGroupInfo* CreateGroupInfo(nsAccessible* aAccessible) + static AccGroupInfo* CreateGroupInfo(Accessible* aAccessible) { mozilla::a11y::role role = aAccessible->Role(); if (role != mozilla::a11y::roles::ROW && role != mozilla::a11y::roles::GRID_CELL && role != mozilla::a11y::roles::OUTLINEITEM && role != mozilla::a11y::roles::OPTION && role != mozilla::a11y::roles::LISTITEM && role != mozilla::a11y::roles::MENUITEM && @@ -68,12 +68,12 @@ private: * Return true if the given parent role is conceptual parent of the given * role. */ static bool IsConceptualParent(mozilla::a11y::role aRole, mozilla::a11y::role aParentRole); PRUint32 mPosInSet; PRUint32 mSetSize; - nsAccessible* mParent; + Accessible* mParent; }; #endif
--- a/accessible/src/base/AccIterator.cpp +++ b/accessible/src/base/AccIterator.cpp @@ -1,48 +1,48 @@ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "AccIterator.h" #include "nsAccessibilityService.h" -#include "nsAccessible.h" +#include "Accessible.h" #include "mozilla/dom/Element.h" #include "nsBindingManager.h" using namespace mozilla; //////////////////////////////////////////////////////////////////////////////// // AccIterator //////////////////////////////////////////////////////////////////////////////// -AccIterator::AccIterator(nsAccessible *aAccessible, +AccIterator::AccIterator(Accessible* aAccessible, filters::FilterFuncPtr aFilterFunc, IterationType aIterationType) : mFilterFunc(aFilterFunc), mIsDeep(aIterationType != eFlatNav) { mState = new IteratorState(aAccessible); } AccIterator::~AccIterator() { while (mState) { IteratorState *tmp = mState; mState = tmp->mParentState; delete tmp; } } -nsAccessible* +Accessible* AccIterator::Next() { while (mState) { - nsAccessible *child = mState->mParent->GetChildAt(mState->mIndex++); + Accessible* child = mState->mParent->GetChildAt(mState->mIndex++); if (!child) { IteratorState *tmp = mState; mState = mState->mParentState; delete tmp; continue; } @@ -57,17 +57,17 @@ AccIterator::Next() } return nsnull; } //////////////////////////////////////////////////////////////////////////////// // nsAccIterator::IteratorState -AccIterator::IteratorState::IteratorState(nsAccessible *aParent, +AccIterator::IteratorState::IteratorState(Accessible* aParent, IteratorState *mParentState) : mParent(aParent), mIndex(0), mParentState(mParentState) { } //////////////////////////////////////////////////////////////////////////////// // RelatedAccIterator @@ -83,34 +83,34 @@ RelatedAccIterator:: nsIAtom* IDAttr = mBindingParent ? nsGkAtoms::anonid : aDependentContent->GetIDAttributeName(); nsAutoString id; if (aDependentContent->GetAttr(kNameSpaceID_None, IDAttr, id)) mProviders = mDocument->mDependentIDsHash.Get(id); } -nsAccessible* +Accessible* RelatedAccIterator::Next() { if (!mProviders) return nsnull; while (mIndex < mProviders->Length()) { DocAccessible::AttrRelProvider* provider = (*mProviders)[mIndex++]; // Return related accessible for the given attribute and if the provider // content is in the same binding in the case of XBL usage. if (provider->mRelAttr == mRelAttr) { nsIContent* bindingParent = provider->mContent->GetBindingParent(); bool inScope = mBindingParent == bindingParent || mBindingParent == provider->mContent; if (inScope) { - nsAccessible* related = mDocument->GetAccessible(provider->mContent); + Accessible* related = mDocument->GetAccessible(provider->mContent); if (related) return related; // If the document content is pointed by relation then return the document // itself. if (provider->mContent == mDocument->GetContent()) return mDocument; } @@ -121,42 +121,42 @@ RelatedAccIterator::Next() } //////////////////////////////////////////////////////////////////////////////// // HTMLLabelIterator //////////////////////////////////////////////////////////////////////////////// HTMLLabelIterator:: - HTMLLabelIterator(DocAccessible* aDocument, const nsAccessible* aAccessible, + HTMLLabelIterator(DocAccessible* aDocument, const Accessible* aAccessible, LabelFilter aFilter) : mRelIter(aDocument, aAccessible->GetContent(), nsGkAtoms::_for), mAcc(aAccessible), mLabelFilter(aFilter) { } -nsAccessible* +Accessible* HTMLLabelIterator::Next() { // Get either <label for="[id]"> element which explicitly points to given // element, or <label> ancestor which implicitly point to it. - nsAccessible* label = nsnull; + Accessible* label = nsnull; while ((label = mRelIter.Next())) { if (label->GetContent()->Tag() == nsGkAtoms::label) return label; } // Ignore ancestor label on not widget accessible. if (mLabelFilter == eSkipAncestorLabel || !mAcc->IsWidget()) return nsnull; // Go up tree to get a name of ancestor label if there is one (an ancestor // <label> implicitly points to us). Don't go up farther than form or // document. - nsAccessible* walkUp = mAcc->Parent(); + Accessible* walkUp = mAcc->Parent(); while (walkUp && !walkUp->IsDoc()) { nsIContent* walkUpElm = walkUp->GetContent(); if (walkUpElm->IsHTML()) { if (walkUpElm->Tag() == nsGkAtoms::label && !walkUpElm->HasAttr(kNameSpaceID_None, nsGkAtoms::_for)) { mLabelFilter = eSkipAncestorLabel; // prevent infinite loop return walkUp; } @@ -177,20 +177,20 @@ HTMLLabelIterator::Next() //////////////////////////////////////////////////////////////////////////////// HTMLOutputIterator:: HTMLOutputIterator(DocAccessible* aDocument, nsIContent* aElement) : mRelIter(aDocument, aElement, nsGkAtoms::_for) { } -nsAccessible* +Accessible* HTMLOutputIterator::Next() { - nsAccessible* output = nsnull; + Accessible* output = nsnull; while ((output = mRelIter.Next())) { if (output->GetContent()->Tag() == nsGkAtoms::output) return output; } return nsnull; } @@ -200,20 +200,20 @@ HTMLOutputIterator::Next() //////////////////////////////////////////////////////////////////////////////// XULLabelIterator:: XULLabelIterator(DocAccessible* aDocument, nsIContent* aElement) : mRelIter(aDocument, aElement, nsGkAtoms::control) { } -nsAccessible* +Accessible* XULLabelIterator::Next() { - nsAccessible* label = nsnull; + Accessible* label = nsnull; while ((label = mRelIter.Next())) { if (label->GetContent()->Tag() == nsGkAtoms::label) return label; } return nsnull; } @@ -223,20 +223,20 @@ XULLabelIterator::Next() //////////////////////////////////////////////////////////////////////////////// XULDescriptionIterator:: XULDescriptionIterator(DocAccessible* aDocument, nsIContent* aElement) : mRelIter(aDocument, aElement, nsGkAtoms::control) { } -nsAccessible* +Accessible* XULDescriptionIterator::Next() { - nsAccessible* descr = nsnull; + Accessible* descr = nsnull; while ((descr = mRelIter.Next())) { if (descr->GetContent()->Tag() == nsGkAtoms::description) return descr; } return nsnull; } @@ -317,23 +317,23 @@ IDRefsIterator::GetElem(const nsDependen if (mContent->OwnerDoc()->BindingManager()->GetBinding(mContent)) { return mContent->OwnerDoc()-> GetAnonymousElementByAttribute(mContent, nsGkAtoms::anonid, aID); } return nsnull; } -nsAccessible* +Accessible* IDRefsIterator::Next() { nsIContent* nextElm = NextElem(); return nextElm ? mDoc->GetAccessible(nextElm) : nsnull; } -nsAccessible* +Accessible* SingleAccIterator::Next() { - nsRefPtr<nsAccessible> nextAcc; + nsRefPtr<Accessible> nextAcc; mAcc.swap(nextAcc); return (nextAcc && !nextAcc->IsDefunct()) ? nextAcc : nsnull; }
--- a/accessible/src/base/AccIterator.h +++ b/accessible/src/base/AccIterator.h @@ -14,17 +14,17 @@ /** * AccIterable is a basic interface for iterators over accessibles. */ class AccIterable { public: virtual ~AccIterable() { } - virtual nsAccessible* Next() = 0; + virtual Accessible* Next() = 0; private: friend class Relation; nsAutoPtr<AccIterable> mNextIter; }; /** * Allows to iterate through accessible children or subtree complying with @@ -44,36 +44,36 @@ public: /** * Navigation through subtree excluding iterator root; if the accessible * complies with filter, iterator ignores its children. */ eTreeNav }; - AccIterator(nsAccessible* aRoot, filters::FilterFuncPtr aFilterFunc, + AccIterator(Accessible* aRoot, filters::FilterFuncPtr aFilterFunc, IterationType aIterationType = eFlatNav); virtual ~AccIterator(); /** * Return next accessible complying with filter function. Return the first * accessible for the first time. */ - virtual nsAccessible *Next(); + virtual Accessible* Next(); private: AccIterator(); AccIterator(const AccIterator&); AccIterator& operator =(const AccIterator&); struct IteratorState { - IteratorState(nsAccessible *aParent, IteratorState *mParentState = nsnull); + IteratorState(Accessible* aParent, IteratorState* mParentState = nsnull); - nsAccessible *mParent; + Accessible* mParent; PRInt32 mIndex; IteratorState *mParentState; }; filters::FilterFuncPtr mFilterFunc; bool mIsDeep; IteratorState *mState; }; @@ -99,17 +99,17 @@ public: RelatedAccIterator(DocAccessible* aDocument, nsIContent* aDependentContent, nsIAtom* aRelAttr); virtual ~RelatedAccIterator() { } /** * Return next related accessible for the given dependent accessible. */ - virtual nsAccessible* Next(); + virtual Accessible* Next(); private: RelatedAccIterator(); RelatedAccIterator(const RelatedAccIterator&); RelatedAccIterator& operator = (const RelatedAccIterator&); DocAccessible* mDocument; nsIAtom* mRelAttr; @@ -125,52 +125,52 @@ private: class HTMLLabelIterator : public AccIterable { public: enum LabelFilter { eAllLabels, eSkipAncestorLabel }; - HTMLLabelIterator(DocAccessible* aDocument, const nsAccessible* aAccessible, + HTMLLabelIterator(DocAccessible* aDocument, const Accessible* aAccessible, LabelFilter aFilter = eAllLabels); virtual ~HTMLLabelIterator() { } /** * Return next label accessible associated with the given element. */ - virtual nsAccessible* Next(); + virtual Accessible* Next(); private: HTMLLabelIterator(); HTMLLabelIterator(const HTMLLabelIterator&); HTMLLabelIterator& operator = (const HTMLLabelIterator&); RelatedAccIterator mRelIter; // XXX: replace it on weak reference (bug 678429), it's safe to use raw // pointer now because iterators life cycle is short. - const nsAccessible* mAcc; + const Accessible* mAcc; LabelFilter mLabelFilter; }; /** * Used to iterate through HTML outputs associated with the given element. */ class HTMLOutputIterator : public AccIterable { public: HTMLOutputIterator(DocAccessible* aDocument, nsIContent* aElement); virtual ~HTMLOutputIterator() { } /** * Return next output accessible associated with the given element. */ - virtual nsAccessible* Next(); + virtual Accessible* Next(); private: HTMLOutputIterator(); HTMLOutputIterator(const HTMLOutputIterator&); HTMLOutputIterator& operator = (const HTMLOutputIterator&); RelatedAccIterator mRelIter; }; @@ -183,17 +183,17 @@ class XULLabelIterator : public AccItera { public: XULLabelIterator(DocAccessible* aDocument, nsIContent* aElement); virtual ~XULLabelIterator() { } /** * Return next label accessible associated with the given element. */ - virtual nsAccessible* Next(); + virtual Accessible* Next(); private: XULLabelIterator(); XULLabelIterator(const XULLabelIterator&); XULLabelIterator& operator = (const XULLabelIterator&); RelatedAccIterator mRelIter; }; @@ -206,17 +206,17 @@ class XULDescriptionIterator : public Ac { public: XULDescriptionIterator(DocAccessible* aDocument, nsIContent* aElement); virtual ~XULDescriptionIterator() { } /** * Return next description accessible associated with the given element. */ - virtual nsAccessible* Next(); + virtual Accessible* Next(); private: XULDescriptionIterator(); XULDescriptionIterator(const XULDescriptionIterator&); XULDescriptionIterator& operator = (const XULDescriptionIterator&); RelatedAccIterator mRelIter; }; @@ -244,17 +244,17 @@ public: nsIContent* NextElem(); /** * Return the element with the given ID. */ nsIContent* GetElem(const nsDependentSubstring& aID); // AccIterable - virtual nsAccessible* Next(); + virtual Accessible* Next(); private: IDRefsIterator(); IDRefsIterator(const IDRefsIterator&); IDRefsIterator operator = (const IDRefsIterator&); nsString mIDs; nsIContent* mContent; @@ -264,22 +264,22 @@ private: /** * Iterator that points to a single accessible returning it on the first call * to Next(). */ class SingleAccIterator : public AccIterable { public: - SingleAccIterator(nsAccessible* aTarget): mAcc(aTarget) { } + SingleAccIterator(Accessible* aTarget): mAcc(aTarget) { } virtual ~SingleAccIterator() { } - virtual nsAccessible* Next(); + virtual Accessible* Next(); private: SingleAccIterator(); SingleAccIterator(const SingleAccIterator&); SingleAccIterator& operator = (const SingleAccIterator&); - nsRefPtr<nsAccessible> mAcc; + nsRefPtr<Accessible> mAcc; }; #endif
--- a/accessible/src/base/FocusManager.cpp +++ b/accessible/src/base/FocusManager.cpp @@ -19,34 +19,34 @@ using namespace mozilla::a11y; FocusManager::FocusManager() { } FocusManager::~FocusManager() { } -nsAccessible* +Accessible* FocusManager::FocusedAccessible() const { if (mActiveItem) return mActiveItem; nsINode* focusedNode = FocusedDOMNode(); if (focusedNode) { DocAccessible* doc = GetAccService()->GetDocAccessible(focusedNode->OwnerDoc()); return doc ? doc->GetAccessibleOrContainer(focusedNode) : nsnull; } return nsnull; } bool -FocusManager::IsFocused(const nsAccessible* aAccessible) const +FocusManager::IsFocused(const Accessible* aAccessible) const { if (mActiveItem) return mActiveItem == aAccessible; nsINode* focusedNode = FocusedDOMNode(); if (focusedNode) { // XXX: Before getting an accessible for node having a DOM focus make sure // they belong to the same document because it can trigger unwanted document @@ -60,41 +60,41 @@ FocusManager::IsFocused(const nsAccessib return aAccessible == (doc ? doc->GetAccessibleOrContainer(focusedNode) : nsnull); } } return false; } bool -FocusManager::IsFocusWithin(const nsAccessible* aContainer) const +FocusManager::IsFocusWithin(const Accessible* aContainer) const { - nsAccessible* child = FocusedAccessible(); + Accessible* child = FocusedAccessible(); while (child) { if (child == aContainer) return true; child = child->Parent(); } return false; } FocusManager::FocusDisposition -FocusManager::IsInOrContainsFocus(const nsAccessible* aAccessible) const +FocusManager::IsInOrContainsFocus(const Accessible* aAccessible) const { - nsAccessible* focus = FocusedAccessible(); + Accessible* focus = FocusedAccessible(); if (!focus) return eNone; // If focused. if (focus == aAccessible) return eFocused; // If contains the focus. - nsAccessible* child = focus->Parent(); + Accessible* child = focus->Parent(); while (child) { if (child == aAccessible) return eContainsFocus; child = child->Parent(); } // If contained by focus. @@ -153,39 +153,39 @@ FocusManager::NotifyOfDOMBlur(nsISupport if (document) { document->HandleNotification<FocusManager, nsINode> (this, &FocusManager::ProcessDOMFocus, DOMDoc); } } } void -FocusManager::ActiveItemChanged(nsAccessible* aItem, bool aCheckIfActive) +FocusManager::ActiveItemChanged(Accessible* aItem, bool aCheckIfActive) { A11YDEBUG_FOCUS_NOTIFICATION_ACCTARGET("active item changed", "Active item", aItem) // Nothing changed, happens for XUL trees and HTML selects. if (aItem && aItem == mActiveItem) return; mActiveItem = nsnull; if (aItem && aCheckIfActive) { - nsAccessible* widget = aItem->ContainerWidget(); + Accessible* widget = aItem->ContainerWidget(); A11YDEBUG_FOCUS_LOG_WIDGET("Active item widget", widget) if (!widget || !widget->IsActiveWidget() || !widget->AreItemsOperable()) return; } mActiveItem = aItem; // If active item is changed then fire accessible focus event on it, otherwise // if there's no an active item then fire focus event to accessible having // DOM focus. - nsAccessible* target = FocusedAccessible(); + Accessible* target = FocusedAccessible(); if (target) DispatchFocusEvent(target->Document(), target); } void FocusManager::ForceFocusEvent() { nsINode* focusedNode = FocusedDOMNode(); @@ -196,17 +196,17 @@ FocusManager::ForceFocusEvent() document->HandleNotification<FocusManager, nsINode> (this, &FocusManager::ProcessDOMFocus, focusedNode); } } } void FocusManager::DispatchFocusEvent(DocAccessible* aDocument, - nsAccessible* aTarget) + Accessible* aTarget) { NS_PRECONDITION(aDocument, "No document for focused accessible!"); if (aDocument) { nsRefPtr<AccEvent> event = new AccEvent(nsIAccessibleEvent::EVENT_FOCUS, aTarget, eAutoDetect, AccEvent::eCoalesceOfSameType); aDocument->FireDelayedAccessibleEvent(event); @@ -218,26 +218,26 @@ void FocusManager::ProcessDOMFocus(nsINode* aTarget) { A11YDEBUG_FOCUS_NOTIFICATION_DOMTARGET("Process DOM focus", "Notification target", aTarget) DocAccessible* document = GetAccService()->GetDocAccessible(aTarget->OwnerDoc()); - nsAccessible* target = document->GetAccessibleOrContainer(aTarget); + Accessible* target = document->GetAccessibleOrContainer(aTarget); if (target && document) { // Check if still focused. Otherwise we can end up with storing the active // item for control that isn't focused anymore. - nsAccessible* DOMFocus = + Accessible* DOMFocus = document->GetAccessibleOrContainer(FocusedDOMNode()); if (target != DOMFocus) return; - nsAccessible* activeItem = target->CurrentItem(); + Accessible* activeItem = target->CurrentItem(); if (activeItem) { mActiveItem = activeItem; target = activeItem; } DispatchFocusEvent(document, target); } } @@ -248,38 +248,38 @@ FocusManager::ProcessFocusEvent(AccEvent NS_PRECONDITION(aEvent->GetEventType() == nsIAccessibleEvent::EVENT_FOCUS, "Focus event is expected!"); EIsFromUserInput fromUserInputFlag = aEvent->IsFromUserInput() ? eFromUserInput : eNoUserInput; // Emit focus event if event target is the active item. Otherwise then check // if it's still focused and then update active item and emit focus event. - nsAccessible* target = aEvent->GetAccessible(); + Accessible* target = aEvent->GetAccessible(); if (target != mActiveItem) { // Check if still focused. Otherwise we can end up with storing the active // item for control that isn't focused anymore. DocAccessible* document = aEvent->GetDocAccessible(); - nsAccessible* DOMFocus = document->GetAccessibleOrContainer(FocusedDOMNode()); + Accessible* DOMFocus = document->GetAccessibleOrContainer(FocusedDOMNode()); if (target != DOMFocus) return; - nsAccessible* activeItem = target->CurrentItem(); + Accessible* activeItem = target->CurrentItem(); if (activeItem) { mActiveItem = activeItem; target = activeItem; } } // Fire menu start/end events for ARIA menus. if (target->ARIARole() == roles::MENUITEM) { // The focus was moved into menu. - nsAccessible* ARIAMenubar = + Accessible* ARIAMenubar = nsAccUtils::GetAncestorWithRole(target, roles::MENUBAR); if (ARIAMenubar != mActiveARIAMenubar) { // Leaving ARIA menu. Fire menu_end event on current menubar. if (mActiveARIAMenubar) { nsRefPtr<AccEvent> menuEndEvent = new AccEvent(nsIAccessibleEvent::EVENT_MENU_END, mActiveARIAMenubar, fromUserInputFlag); @@ -312,17 +312,17 @@ FocusManager::ProcessFocusEvent(AccEvent nsRefPtr<AccEvent> focusEvent = new AccEvent(nsIAccessibleEvent::EVENT_FOCUS, target, fromUserInputFlag); nsEventShell::FireEvent(focusEvent); // Fire scrolling_start event when the document receives the focus if it has // an anchor jump. If an accessible within the document receive the focus // then null out the anchor jump because it no longer applies. DocAccessible* targetDocument = target->Document(); - nsAccessible* anchorJump = targetDocument->AnchorJump(); + Accessible* anchorJump = targetDocument->AnchorJump(); if (anchorJump) { if (target == targetDocument) { // XXX: bug 625699, note in some cases the node could go away before we // we receive focus event, for example if the node is removed from DOM. nsEventShell::FireEvent(nsIAccessibleEvent::EVENT_SCROLLING_START, anchorJump, fromUserInputFlag); } targetDocument->SetAnchorJump(nsnull);
--- a/accessible/src/base/FocusManager.h +++ b/accessible/src/base/FocusManager.h @@ -4,69 +4,69 @@ #ifndef mozilla_a11y_FocusManager_h_ #define mozilla_a11y_FocusManager_h_ #include "nsAutoPtr.h" #include "mozilla/dom/Element.h" class AccEvent; -class nsAccessible; +class Accessible; class DocAccessible; namespace mozilla { namespace a11y { /** * Manage the accessible focus. Used to fire and process accessible events. */ class FocusManager { public: virtual ~FocusManager(); /** * Return a focused accessible. */ - nsAccessible* FocusedAccessible() const; + Accessible* FocusedAccessible() const; /** * Return true if given accessible is focused. */ - bool IsFocused(const nsAccessible* aAccessible) const; + bool IsFocused(const Accessible* aAccessible) const; /** * Return true if the given accessible is an active item, i.e. an item that * is current within the active widget. */ - inline bool IsActiveItem(const nsAccessible* aAccessible) + inline bool IsActiveItem(const Accessible* aAccessible) { return aAccessible == mActiveItem; } /** * Return true if given DOM node has DOM focus. */ inline bool HasDOMFocus(const nsINode* aNode) const { return aNode == FocusedDOMNode(); } /** * Return true if focused accessible is within the given container. */ - bool IsFocusWithin(const nsAccessible* aContainer) const; + bool IsFocusWithin(const Accessible* aContainer) const; /** * Return whether the given accessible is focused or contains the focus or * contained by focused accessible. */ enum FocusDisposition { eNone, eFocused, eContainsFocus, eContainedByFocus }; - FocusDisposition IsInOrContainsFocus(const nsAccessible* aAccessible) const; + FocusDisposition IsInOrContainsFocus(const Accessible* aAccessible) const; ////////////////////////////////////////////////////////////////////////////// // Focus notifications and processing (don't use until you know what you do). /** * Called when DOM focus event is fired. */ void NotifyOfDOMFocus(nsISupports* aTarget); @@ -75,27 +75,27 @@ public: * Called when DOM blur event is fired. */ void NotifyOfDOMBlur(nsISupports* aTarget); /** * Called when active item is changed. Note: must be called when accessible * tree is up to date. */ - void ActiveItemChanged(nsAccessible* aItem, bool aCheckIfActive = true); + void ActiveItemChanged(Accessible* aItem, bool aCheckIfActive = true); /** * Dispatch delayed focus event for the current focus accessible. */ void ForceFocusEvent(); /** * Dispatch delayed focus event for the given target. */ - void DispatchFocusEvent(DocAccessible* aDocument, nsAccessible* aTarget); + void DispatchFocusEvent(DocAccessible* aDocument, Accessible* aTarget); /** * Process DOM focus notification. */ void ProcessDOMFocus(nsINode* aTarget); /** * Process the delayed accessible event. @@ -116,18 +116,18 @@ private: nsINode* FocusedDOMNode() const; /** * Return DOM document having DOM focus. */ nsIDocument* FocusedDOMDocument() const; private: - nsRefPtr<nsAccessible> mActiveItem; - nsRefPtr<nsAccessible> mActiveARIAMenubar; + nsRefPtr<Accessible> mActiveItem; + nsRefPtr<Accessible> mActiveARIAMenubar; }; } // namespace a11y } // namespace mozilla //#define A11YDEBUG_FOCUS
--- a/accessible/src/base/Logging.cpp +++ b/accessible/src/base/Logging.cpp @@ -426,17 +426,17 @@ logging::DocDestroy(const char* aMsg, ns DocAccessible* document = aDocument ? aDocument : GetAccService()->GetDocAccessibleFromCache(aDocumentNode); printf("\nA11Y DOCDESTROY: %s\n", aMsg); LogDocInfo(aDocumentNode, document); } void -logging::Address(const char* aDescr, nsAccessible* aAcc) +logging::Address(const char* aDescr, Accessible* aAcc) { nsINode* node = aAcc->GetNode(); nsIDocument* docNode = aAcc->GetDocumentNode(); DocAccessible* doc = GetAccService()->GetDocAccessibleFromCache(docNode); printf(" %s accessible: %p, node: %p\n", aDescr, static_cast<void*>(aAcc), static_cast<void*>(node)); printf(" docacc for %s accessible: %p, node: %p\n", aDescr, static_cast<void*>(doc), static_cast<void*>(docNode));
--- a/accessible/src/base/Logging.h +++ b/accessible/src/base/Logging.h @@ -6,17 +6,17 @@ #ifndef mozilla_a11y_logs_h__ #define mozilla_a11y_logs_h__ #include "nscore.h" #include "nsAString.h" class AccEvent; -class nsAccessible; +class Accessible; class DocAccessible; class nsIDocument; class nsIRequest; class nsIWebProgress; namespace mozilla { namespace a11y { namespace logging { @@ -70,17 +70,17 @@ void Msg(const char* aMsg); /** * Log the text, two spaces offset is used. */ void Text(const char* aText); /** * Log the accesisble object address, two spaces offset is used. */ -void Address(const char* aDescr, nsAccessible* aAcc); +void Address(const char* aDescr, Accessible* aAcc); /** * Log the call stack, two spaces offset is used. */ void Stack(); /** * Enable logging of the specified modules, all other modules aren't logged.
--- a/accessible/src/base/Makefile.in +++ b/accessible/src/base/Makefile.in @@ -24,17 +24,16 @@ CPPSRCS = \ FocusManager.cpp \ NotificationController.cpp \ nsAccDocManager.cpp \ nsAccessNode.cpp \ nsARIAMap.cpp \ nsCoreUtils.cpp \ nsAccUtils.cpp \ nsAccessibilityService.cpp \ - nsAccessible.cpp \ nsAccessiblePivot.cpp \ nsAccTreeWalker.cpp \ nsBaseWidgetAccessible.cpp \ nsEventShell.cpp \ nsCaretAccessible.cpp \ nsTextEquivUtils.cpp \ RoleAsserts.cpp \ StyleInfo.cpp \ @@ -47,17 +46,16 @@ CPPSRCS += \ Logging.cpp \ $(NULL) endif EXPORTS = \ a11yGeneric.h \ nsAccDocManager.h \ nsAccessibilityService.h \ - nsAccessible.h \ nsAccessNode.h \ $(NULL) EXPORTS_NAMESPACES = mozilla/a11y EXPORTS_mozilla/a11y = \ FocusManager.h \ States.h \
--- a/accessible/src/base/NotificationController.cpp +++ b/accessible/src/base/NotificationController.cpp @@ -123,17 +123,17 @@ void NotificationController::ScheduleChildDocBinding(DocAccessible* aDocument) { // Schedule child document binding to the tree. mHangingChildDocuments.AppendElement(aDocument); ScheduleProcessing(); } void -NotificationController::ScheduleContentInsertion(nsAccessible* aContainer, +NotificationController::ScheduleContentInsertion(Accessible* aContainer, nsIContent* aStartChildNode, nsIContent* aEndChildNode) { nsRefPtr<ContentInsertion> insertion = new ContentInsertion(mDocument, aContainer); if (insertion && insertion->InitChildList(aStartChildNode, aEndChildNode) && mContentInsertions.AppendElement(insertion)) { ScheduleProcessing(); @@ -230,17 +230,17 @@ NotificationController::WillRefresh(mozi for (PRUint32 idx = 0; idx < hangingDocCnt; idx++) { DocAccessible* childDoc = mHangingChildDocuments[idx]; if (childDoc->IsDefunct()) continue; nsIContent* ownerContent = mDocument->GetDocumentNode()-> FindContentForSubDocument(childDoc->GetDocumentNode()); if (ownerContent) { - nsAccessible* outerDocAcc = mDocument->GetAccessible(ownerContent); + Accessible* outerDocAcc = mDocument->GetAccessible(ownerContent); if (outerDocAcc && outerDocAcc->AppendChild(childDoc)) { if (mDocument->AppendChildDocument(childDoc)) continue; outerDocAcc->RemoveChild(childDoc); } // Failed to bind the child document, destroy it. @@ -290,17 +290,17 @@ NotificationController::WillRefresh(mozi // Process only currently queued events. nsTArray<nsRefPtr<AccEvent> > events; events.SwapElements(mEvents); PRUint32 eventCount = events.Length(); for (PRUint32 idx = 0; idx < eventCount; idx++) { AccEvent* accEvent = events[idx]; if (accEvent->mEventRule != AccEvent::eDoNotEmit) { - nsAccessible* target = accEvent->GetAccessible(); + Accessible* target = accEvent->GetAccessible(); if (!target || target->IsDefunct()) continue; // Dispatch the focus event if target is still focused. if (accEvent->mEventType == nsIAccessibleEvent::EVENT_FOCUS) { FocusMgr()->ProcessFocusEvent(accEvent); continue; } @@ -637,17 +637,17 @@ NotificationController::CoalesceTextChan aTailEvent->mTextChangeEvent.swap(aThisEvent->mTextChangeEvent); } void NotificationController::CreateTextChangeEventFor(AccMutationEvent* aEvent) { DocAccessible* document = aEvent->GetDocAccessible(); - nsAccessible* container = document->GetContainerAccessible(aEvent->mNode); + Accessible* container = document->GetContainerAccessible(aEvent->mNode); if (!container) return; nsHyperTextAccessible* textAccessible = container->AsHyperText(); if (!textAccessible) return; // Don't fire event for the first html:br in an editor. @@ -677,17 +677,17 @@ NotificationController::CreateTextChange // Notification controller: text leaf accessible text update PLDHashOperator NotificationController::TextEnumerator(nsCOMPtrHashKey<nsIContent>* aEntry, void* aUserArg) { DocAccessible* document = static_cast<DocAccessible*>(aUserArg); nsIContent* textNode = aEntry->GetKey(); - nsAccessible* textAcc = document->GetAccessible(textNode); + Accessible* textAcc = document->GetAccessible(textNode); // If the text node is not in tree or doesn't have frame then this case should // have been handled already by content removal notifications. nsINode* containerNode = textNode->GetNodeParent(); if (!containerNode) { NS_ASSERTION(!textAcc, "Text node was removed but accessible is kept alive!"); return PL_DHASH_NEXT; @@ -766,17 +766,17 @@ NotificationController::TextEnumerator(n atomid->ToUTF8String(id); } printf("\npending text node insertion: container: %s@id='%s', index in container: %d\n\n", tag.get(), id.get(), index); #endif // Make sure the text node is in accessible document still. - nsAccessible* container = document->GetAccessibleOrContainer(containerNode); + Accessible* container = document->GetAccessibleOrContainer(containerNode); NS_ASSERTION(container, "Text node having rendered text hasn't accessible document!"); if (container) { nsTArray<nsCOMPtr<nsIContent> > insertedContents; insertedContents.AppendElement(textNode); document->ProcessContentInserted(container, &insertedContents); } } @@ -784,17 +784,17 @@ NotificationController::TextEnumerator(n return PL_DHASH_NEXT; } //////////////////////////////////////////////////////////////////////////////// // NotificationController: content inserted notification NotificationController::ContentInsertion:: - ContentInsertion(DocAccessible* aDocument, nsAccessible* aContainer) : + ContentInsertion(DocAccessible* aDocument, Accessible* aContainer) : mDocument(aDocument), mContainer(aContainer) { } bool NotificationController::ContentInsertion:: InitChildList(nsIContent* aStartChildNode, nsIContent* aEndChildNode) {
--- a/accessible/src/base/NotificationController.h +++ b/accessible/src/base/NotificationController.h @@ -5,17 +5,17 @@ #ifndef NotificationController_h_ #define NotificationController_h_ #include "AccEvent.h" #include "nsCycleCollectionParticipant.h" #include "nsRefreshDriver.h" -class nsAccessible; +class Accessible; class DocAccessible; class nsIContent; // Uncomment to log notifications processing. //#define DEBUG_NOTIFICATIONS #ifdef DEBUG_NOTIFICATIONS #define DEBUG_CONTENTMUTATION @@ -117,17 +117,17 @@ public: { if (mTextHash.PutEntry(aTextNode)) ScheduleProcessing(); } /** * Pend accessible tree update for content insertion. */ - void ScheduleContentInsertion(nsAccessible* aContainer, + void ScheduleContentInsertion(Accessible* aContainer, nsIContent* aStartChildNode, nsIContent* aEndChildNode); /** * Process the generic notification synchronously if there are no pending * layout changes and no notifications are pending or being processed right * now. Otherwise, queue it up to process asynchronously. * @@ -267,17 +267,17 @@ private: nsTArray<nsRefPtr<DocAccessible> > mHangingChildDocuments; /** * Storage for content inserted notification information. */ class ContentInsertion { public: - ContentInsertion(DocAccessible* aDocument, nsAccessible* aContainer); + ContentInsertion(DocAccessible* aDocument, Accessible* aContainer); virtual ~ContentInsertion() { mDocument = nsnull; } NS_INLINE_DECL_REFCOUNTING(ContentInsertion) NS_DECL_CYCLE_COLLECTION_NATIVE_CLASS(ContentInsertion) bool InitChildList(nsIContent* aStartChildNode, nsIContent* aEndChildNode); void Process(); @@ -287,17 +287,17 @@ private: ContentInsertion& operator = (const ContentInsertion&); // The document used to process content insertion, matched to document of // the notification controller that this notification belongs to, therefore // it's ok to keep it as weak ref. DocAccessible* mDocument; // The container accessible that content insertion occurs within. - nsRefPtr<nsAccessible> mContainer; + nsRefPtr<Accessible> mContainer; // Array of inserted contents. nsTArray<nsCOMPtr<nsIContent> > mInsertedContent; }; /** * A pending accessible tree update notifications for content insertions. * Don't make this an nsAutoTArray; we use SwapElements() on it.
--- a/accessible/src/base/Relation.h +++ b/accessible/src/base/Relation.h @@ -32,17 +32,17 @@ class Relation public: Relation() : mFirstIter(nsnull), mLastIter(nsnull) { } Relation(const RelationCopyHelper aRelation) : mFirstIter(aRelation.mFirstIter), mLastIter(aRelation.mLastIter) { } Relation(AccIterable* aIter) : mFirstIter(aIter), mLastIter(aIter) { } - Relation(nsAccessible* aAcc) : + Relation(Accessible* aAcc) : mFirstIter(nsnull), mLastIter(nsnull) { AppendTarget(aAcc); } Relation(DocAccessible* aDocument, nsIContent* aContent) : mFirstIter(nsnull), mLastIter(nsnull) { AppendTarget(aDocument, aContent); } Relation& operator = (const RelationCopyHelper& aRH) @@ -72,17 +72,17 @@ public: mFirstIter = aIter; mLastIter = aIter; } /** * Append the given accessible to the set of related accessibles. */ - inline void AppendTarget(nsAccessible* aAcc) + inline void AppendTarget(Accessible* aAcc) { if (aAcc) AppendIter(new SingleAccIterator(aAcc)); } /** * Append the one accessible for this content node to the set of related * accessibles. @@ -91,19 +91,19 @@ public: { if (aContent) AppendTarget(aDocument->GetAccessible(aContent)); } /** * compute and return the next related accessible. */ - inline nsAccessible* Next() + inline Accessible* Next() { - nsAccessible* target = nsnull; + Accessible* target = nsnull; // a trick nsAutoPtr deletes what it used to point to when assigned to while (mFirstIter && !(target = mFirstIter->Next())) mFirstIter = mFirstIter->mNextIter; if (!mFirstIter) mLastIter = nsnull;
--- a/accessible/src/base/TextAttrs.cpp +++ b/accessible/src/base/TextAttrs.cpp @@ -39,27 +39,27 @@ TextAttrsMgr::GetAttributes(nsIPersisten (!mOffsetAcc && mOffsetAccIdx == -1 && !aStartHTOffset && !aEndHTOffset && mIncludeDefAttrs && aAttributes)), "Wrong usage of TextAttrsMgr!"); // Embedded objects are combined into own range with empty attributes set. if (mOffsetAcc && nsAccUtils::IsEmbeddedObject(mOffsetAcc)) { for (PRInt32 childIdx = mOffsetAccIdx - 1; childIdx >= 0; childIdx--) { - nsAccessible *currAcc = mHyperTextAcc->GetChildAt(childIdx); + Accessible* currAcc = mHyperTextAcc->GetChildAt(childIdx); if (!nsAccUtils::IsEmbeddedObject(currAcc)) break; (*aStartHTOffset)--; } PRUint32 childCount = mHyperTextAcc->ChildCount(); for (PRUint32 childIdx = mOffsetAccIdx + 1; childIdx < childCount; childIdx++) { - nsAccessible *currAcc = mHyperTextAcc->GetChildAt(childIdx); + Accessible* currAcc = mHyperTextAcc->GetChildAt(childIdx); if (!nsAccUtils::IsEmbeddedObject(currAcc)) break; (*aEndHTOffset)++; } return; } @@ -132,17 +132,17 @@ TextAttrsMgr::GetAttributes(nsIPersisten } void TextAttrsMgr::GetRange(TextAttr* aAttrArray[], PRUint32 aAttrArrayLen, PRInt32* aStartHTOffset, PRInt32* aEndHTOffset) { // Navigate backward from anchor accessible to find start offset. for (PRInt32 childIdx = mOffsetAccIdx - 1; childIdx >= 0; childIdx--) { - nsAccessible *currAcc = mHyperTextAcc->GetChildAt(childIdx); + Accessible* currAcc = mHyperTextAcc->GetChildAt(childIdx); // Stop on embedded accessible since embedded accessibles are combined into // own range. if (nsAccUtils::IsEmbeddedObject(currAcc)) break; nsIContent* currElm = nsCoreUtils::GetDOMElementFor(currAcc->GetContent()); if (!currElm) @@ -161,17 +161,17 @@ TextAttrsMgr::GetRange(TextAttr* aAttrAr break; *(aStartHTOffset) -= nsAccUtils::TextLength(currAcc); } // Navigate forward from anchor accessible to find end offset. PRUint32 childLen = mHyperTextAcc->ChildCount(); for (PRUint32 childIdx = mOffsetAccIdx + 1; childIdx < childLen; childIdx++) { - nsAccessible *currAcc = mHyperTextAcc->GetChildAt(childIdx); + Accessible* currAcc = mHyperTextAcc->GetChildAt(childIdx); if (nsAccUtils::IsEmbeddedObject(currAcc)) break; nsIContent* currElm = nsCoreUtils::GetDOMElementFor(currAcc->GetContent()); if (!currElm) return; bool offsetFound = false;
--- a/accessible/src/base/TextAttrs.h +++ b/accessible/src/base/TextAttrs.h @@ -42,17 +42,17 @@ public: * attributes should be included into list of exposed * text attributes * @param oOffsetAcc [optional] offset an accessible the text attributes * should be calculated for * @param oOffsetAccIdx [optional] index in parent of offset accessible */ TextAttrsMgr(nsHyperTextAccessible* aHyperTextAcc, bool aIncludeDefAttrs, - nsAccessible* aOffsetAcc, + Accessible* aOffsetAcc, PRInt32 aOffsetAccIdx) : mOffsetAcc(aOffsetAcc), mHyperTextAcc(aHyperTextAcc), mOffsetAccIdx(aOffsetAccIdx), mIncludeDefAttrs(aIncludeDefAttrs) { } /* * Return text attributes and hyper text offsets where these attributes are * applied. Offsets are calculated in the case of non default attributes. * @@ -78,17 +78,17 @@ protected: * @param aStartHTOffset [in, out] the start offset * @param aEndHTOffset [in, out] the end offset */ class TextAttr; void GetRange(TextAttr* aAttrArray[], PRUint32 aAttrArrayLen, PRInt32* aStartHTOffset, PRInt32* aEndHTOffset); private: - nsAccessible* mOffsetAcc; + Accessible* mOffsetAcc; nsHyperTextAccessible* mHyperTextAcc; PRInt32 mOffsetAccIdx; bool mIncludeDefAttrs; protected: /** * Interface class of text attribute class implementations.
--- a/accessible/src/base/TextUpdater.cpp +++ b/accessible/src/base/TextUpdater.cpp @@ -34,17 +34,17 @@ TextUpdater::Run(DocAccessible* aDocumen updater.DoUpdate(aNewText, oldText, skipStart); } } void TextUpdater::DoUpdate(const nsAString& aNewText, const nsAString& aOldText, PRUint32 aSkipStart) { - nsAccessible* parent = mTextLeaf->Parent(); + Accessible* parent = mTextLeaf->Parent(); if (!parent) return; mHyperText = parent->AsHyperText(); if (!mHyperText) { NS_ERROR("Text leaf parent is not hypertext!"); return; }
--- a/accessible/src/base/filters.cpp +++ b/accessible/src/base/filters.cpp @@ -7,38 +7,38 @@ #include "Accessible-inl.h" #include "nsAccUtils.h" #include "Role.h" #include "States.h" using namespace mozilla::a11y; bool -filters::GetSelected(nsAccessible* aAccessible) +filters::GetSelected(Accessible* aAccessible) { return aAccessible->State() & states::SELECTED; } bool -filters::GetSelectable(nsAccessible* aAccessible) +filters::GetSelectable(Accessible* aAccessible) { return aAccessible->State() & states::SELECTABLE; } bool -filters::GetRow(nsAccessible* aAccessible) +filters::GetRow(Accessible* aAccessible) { return aAccessible->Role() == roles::ROW; } bool -filters::GetCell(nsAccessible* aAccessible) +filters::GetCell(Accessible* aAccessible) { roles::Role role = aAccessible->Role(); return role == roles::GRID_CELL || role == roles::ROWHEADER || role == roles::COLUMNHEADER; } bool -filters::GetEmbeddedObject(nsAccessible* aAccessible) +filters::GetEmbeddedObject(Accessible* aAccessible) { return nsAccUtils::IsEmbeddedObject(aAccessible); }
--- a/accessible/src/base/filters.h +++ b/accessible/src/base/filters.h @@ -1,27 +1,27 @@ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef a11yFilters_h_ #define a11yFilters_h_ -class nsAccessible; +class Accessible; /** * Predefined filters used for nsAccIterator and nsAccCollector. */ namespace filters { /** * Return true if the traversed accessible complies with filter. */ - typedef bool (*FilterFuncPtr) (nsAccessible*); + typedef bool (*FilterFuncPtr) (Accessible*); - bool GetSelected(nsAccessible* aAccessible); - bool GetSelectable(nsAccessible* aAccessible); - bool GetRow(nsAccessible* aAccessible); - bool GetCell(nsAccessible* aAccessible); - bool GetEmbeddedObject(nsAccessible* aAccessible); + bool GetSelected(Accessible* aAccessible); + bool GetSelectable(Accessible* aAccessible); + bool GetRow(Accessible* aAccessible); + bool GetCell(Accessible* aAccessible); + bool GetEmbeddedObject(Accessible* aAccessible); } #endif
--- a/accessible/src/base/nsARIAMap.h +++ b/accessible/src/base/nsARIAMap.h @@ -86,25 +86,25 @@ const bool kUseMapRole = true; const bool kUseNativeRole = false; //////////////////////////////////////////////////////////////////////////////// // ARIA attribute characteristic masks /** * This mask indicates the attribute should not be exposed as an object - * attribute via the catch-all logic in nsAccessible::GetAttributes. + * attribute via the catch-all logic in Accessible::GetAttributes. * This means it either isn't mean't to be exposed as an object attribute, or * that it should, but is already handled in other code. */ const PRUint8 ATTR_BYPASSOBJ = 0x0001; /** * This mask indicates the attribute is expected to have an NMTOKEN or bool value. - * (See for example usage in nsAccessible::GetAttributes) + * (See for example usage in Accessible::GetAttributes) */ const PRUint8 ATTR_VALTOKEN = 0x0010; /** * Small footprint storage of persistent aria attribute characteristics. */ struct nsAttributeCharacteristics {
--- a/accessible/src/base/nsAccCache.h +++ b/accessible/src/base/nsAccCache.h @@ -28,19 +28,19 @@ ClearCacheEntry(const void* aKey, nsRefP return PL_DHASH_REMOVE; } /** * Clear the cache and shutdown the accessibles. */ static void -ClearCache(nsAccessibleHashtable & aCache) +ClearCache(AccessibleHashtable& aCache) { - aCache.Enumerate(ClearCacheEntry<nsAccessible>, nsnull); + aCache.Enumerate(ClearCacheEntry<Accessible>, nsnull); } /** * Traverse the accessible cache entry for cycle collector. */ template <class T> static PLDHashOperator CycleCollectorTraverseCacheEntry(const void *aKey, T *aAccessible, @@ -56,15 +56,15 @@ CycleCollectorTraverseCacheEntry(const v return PL_DHASH_NEXT; } /** * Traverse the accessible cache for cycle collector. */ static void -CycleCollectorTraverseCache(nsAccessibleHashtable & aCache, +CycleCollectorTraverseCache(AccessibleHashtable& aCache, nsCycleCollectionTraversalCallback *aCallback) { - aCache.EnumerateRead(CycleCollectorTraverseCacheEntry<nsAccessible>, aCallback); + aCache.EnumerateRead(CycleCollectorTraverseCacheEntry<Accessible>, aCallback); } #endif
--- a/accessible/src/base/nsAccDocManager.cpp +++ b/accessible/src/base/nsAccDocManager.cpp @@ -48,17 +48,17 @@ nsAccDocManager::GetDocAccessible(nsIDoc DocAccessible* docAcc = mDocAccessibleCache.GetWeak(aDocument); if (docAcc) return docAcc; return CreateDocOrRootAccessible(aDocument); } -nsAccessible* +Accessible* nsAccDocManager::FindAccessibleInCache(nsINode* aNode) const { nsSearchAccessibleInCacheArg arg; arg.mNode = aNode; mDocAccessibleCache.EnumerateRead(SearchAccessibleInDocCache, static_cast<void*>(&arg)); @@ -390,17 +390,17 @@ nsAccDocManager::CreateDocOrRootAccessib if (!docAcc->Init()) { docAcc->Shutdown(); return nsnull; } docAcc->SetRoleMapEntry(aria::GetRoleMap(aDocument)); // Bind the document to the tree. if (isRootDoc) { - nsAccessible* appAcc = nsAccessNode::GetApplicationAccessible(); + Accessible* appAcc = nsAccessNode::GetApplicationAccessible(); if (!appAcc->AppendChild(docAcc)) { docAcc->Shutdown(); return nsnull; } // Fire reorder event to notify new accessible document has been attached to // the tree. The reorder event is delivered after the document tree is // constructed because event processing and tree construction are done by
--- a/accessible/src/base/nsAccDocManager.h +++ b/accessible/src/base/nsAccDocManager.h @@ -8,17 +8,17 @@ #include "nsIDocument.h" #include "nsIDOMEventListener.h" #include "nsRefPtrHashtable.h" #include "nsIWebProgress.h" #include "nsIWebProgressListener.h" #include "nsWeakReference.h" #include "nsIPresShell.h" -class nsAccessible; +class Accessible; class DocAccessible; /** * Manage the document accessible life cycle. */ class nsAccDocManager : public nsIWebProgressListener, public nsIDOMEventListener, public nsSupportsWeakReference @@ -42,17 +42,17 @@ public: { return aPresShell ? GetDocAccessible(aPresShell->GetDocument()) : nsnull; } /** * Search through all document accessibles for an accessible with the given * unique id. */ - nsAccessible* FindAccessibleInCache(nsINode* aNode) const; + Accessible* FindAccessibleInCache(nsINode* aNode) const; /** * Return document accessible from the cache. Convenient method for testing. */ inline DocAccessible* GetDocAccessibleFromCache(nsIDocument* aDocument) const { return mDocAccessibleCache.GetWeak(aDocument); } @@ -121,17 +121,17 @@ private: /** * Clear the cache and shutdown the document accessibles. */ void ClearDocCache(); struct nsSearchAccessibleInCacheArg { - nsAccessible *mAccessible; + Accessible* mAccessible; nsINode* mNode; }; static PLDHashOperator SearchAccessibleInDocCache(const nsIDocument* aKey, DocAccessible* aDocAccessible, void* aUserArg);
--- a/accessible/src/base/nsAccTreeWalker.cpp +++ b/accessible/src/base/nsAccTreeWalker.cpp @@ -1,16 +1,16 @@ /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "nsAccTreeWalker.h" -#include "nsAccessible.h" +#include "Accessible.h" #include "nsAccessibilityService.h" #include "DocAccessible.h" #include "nsINodeList.h" //////////////////////////////////////////////////////////////////////////////// // WalkState //////////////////////////////////////////////////////////////////////////////// @@ -55,17 +55,17 @@ nsAccTreeWalker::~nsAccTreeWalker() PopState(); MOZ_COUNT_DTOR(nsAccTreeWalker); } //////////////////////////////////////////////////////////////////////////////// // nsAccTreeWalker: private -nsAccessible* +Accessible* nsAccTreeWalker::NextChildInternal(bool aNoWalkUp) { if (!mState || !mState->content) return nsnull; if (!mState->childList) mState->childList = mState->content->GetChildren(mChildFilter); @@ -73,17 +73,17 @@ nsAccTreeWalker::NextChildInternal(bool if (mState->childList) mState->childList->GetLength(&length); while (mState->childIdx < length) { nsIContent* childNode = mState->childList->GetNodeAt(mState->childIdx); mState->childIdx++; bool isSubtreeHidden = false; - nsAccessible* accessible = mWalkCache ? mDoc->GetAccessible(childNode) : + Accessible* accessible = mWalkCache ? mDoc->GetAccessible(childNode) : GetAccService()->GetOrCreateAccessible(childNode, mDoc, &isSubtreeHidden); if (accessible) return accessible; // Walk down into subtree to find accessibles. if (!isSubtreeHidden) { if (!PushState(childNode))
--- a/accessible/src/base/nsAccTreeWalker.h +++ b/accessible/src/base/nsAccTreeWalker.h @@ -4,17 +4,17 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _nsAccTreeWalker_H_ #define _nsAccTreeWalker_H_ #include "nsAutoPtr.h" #include "nsIContent.h" -class nsAccessible; +class Accessible; class DocAccessible; struct WalkState; /** * This class is used to walk the DOM tree to create accessible tree. */ class nsAccTreeWalker { @@ -25,31 +25,31 @@ public: /** * Return the next child accessible. * * @note Returned accessible is bound to the document, if the accessible is * rejected during tree creation then the caller should be unbind it * from the document. */ - inline nsAccessible* NextChild() + Accessible* NextChild() { return NextChildInternal(false); } private: /** * Return the next child accessible. * * @param aNoWalkUp [in] specifies the walk direction, true means we * shouldn't go up through the tree if we failed find * accessible children. */ - nsAccessible* NextChildInternal(bool aNoWalkUp); + Accessible* NextChildInternal(bool aNoWalkUp); /** * Create new state for the given node and push it on top of stack. * * @note State stack is used to navigate up/down the DOM subtree during * accessible children search. */ bool PushState(nsIContent *aNode);
--- a/accessible/src/base/nsAccUtils.cpp +++ b/accessible/src/base/nsAccUtils.cpp @@ -63,36 +63,36 @@ nsAccUtils::SetAccGroupAttrs(nsIPersiste value.Truncate(); value.AppendInt(aSetSize); SetAccAttr(aAttributes, nsGkAtoms::setsize, value); } } PRInt32 -nsAccUtils::GetDefaultLevel(nsAccessible *aAccessible) +nsAccUtils::GetDefaultLevel(Accessible* aAccessible) { roles::Role role = aAccessible->Role(); if (role == roles::OUTLINEITEM) return 1; if (role == roles::ROW) { - nsAccessible* parent = aAccessible->Parent(); + Accessible* parent = aAccessible->Parent(); // It is a row inside flatten treegrid. Group level is always 1 until it // is overriden by aria-level attribute. if (parent && parent->Role() == roles::TREE_TABLE) return 1; } return 0; } PRInt32 -nsAccUtils::GetARIAOrDefaultLevel(nsAccessible *aAccessible) +nsAccUtils::GetARIAOrDefaultLevel(Accessible* aAccessible) { PRInt32 level = 0; nsCoreUtils::GetUIntAttr(aAccessible->GetContent(), nsGkAtoms::aria_level, &level); if (level != 0) return level; @@ -208,51 +208,51 @@ nsAccUtils::GetARIAToken(dom::Element* a PRInt32 idx = aElement->FindAttrValueIn(kNameSpaceID_None, aAttr, tokens, eCaseMatters); if (idx >= 0) return *(tokens[idx]); return nsnull; } -nsAccessible* -nsAccUtils::GetAncestorWithRole(nsAccessible *aDescendant, PRUint32 aRole) +Accessible* +nsAccUtils::GetAncestorWithRole(Accessible* aDescendant, PRUint32 aRole) { - nsAccessible* document = aDescendant->Document(); - nsAccessible* parent = aDescendant; + Accessible* document = aDescendant->Document(); + Accessible* parent = aDescendant; while ((parent = parent->Parent())) { PRUint32 testRole = parent->Role(); if (testRole == aRole) return parent; if (parent == document) break; } return nsnull; } -nsAccessible* -nsAccUtils::GetSelectableContainer(nsAccessible* aAccessible, PRUint64 aState) +Accessible* +nsAccUtils::GetSelectableContainer(Accessible* aAccessible, PRUint64 aState) { if (!aAccessible) return nsnull; if (!(aState & states::SELECTABLE)) return nsnull; - nsAccessible* parent = aAccessible; + Accessible* parent = aAccessible; while ((parent = parent->Parent()) && !parent->IsSelect()) { if (Role(parent) == nsIAccessibleRole::ROLE_PANE) return nsnull; } return parent; } bool -nsAccUtils::IsARIASelected(nsAccessible *aAccessible) +nsAccUtils::IsARIASelected(Accessible* aAccessible) { return aAccessible->GetContent()-> AttrValueIs(kNameSpaceID_None, nsGkAtoms::aria_selected, nsGkAtoms::_true, eCaseMatters); } nsHyperTextAccessible* nsAccUtils::GetTextAccessibleFromSelection(nsISelection* aSelection) @@ -270,17 +270,17 @@ nsAccUtils::GetTextAccessibleFromSelecti nsCOMPtr<nsINode> focusNode(do_QueryInterface(focusDOMNode)); nsCOMPtr<nsINode> resultNode = nsCoreUtils::GetDOMNodeFromDOMPoint(focusNode, focusOffset); // Get text accessible containing the result node. DocAccessible* doc = GetAccService()->GetDocAccessible(resultNode->OwnerDoc()); - nsAccessible* accessible = doc ? + Accessible* accessible = doc ? doc->GetAccessibleOrContainer(resultNode) : nsnull; if (!accessible) { NS_NOTREACHED("No nsIAccessibleText for selection change event!"); return nsnull; } do { nsHyperTextAccessible* textAcc = accessible->AsHyperText(); @@ -368,17 +368,17 @@ nsAccUtils::GetScreenCoordsForWindow(nsA { return nsCoreUtils::GetScreenCoordsForWindow(aAccessNode->GetNode()); } nsIntPoint nsAccUtils::GetScreenCoordsForParent(nsAccessNode *aAccessNode) { DocAccessible* document = aAccessNode->Document(); - nsAccessible* parent = document->GetContainerAccessible(aAccessNode->GetNode()); + Accessible* parent = document->GetContainerAccessible(aAccessNode->GetNode()); if (!parent) return nsIntPoint(0, 0); nsIFrame *parentFrame = parent->GetFrame(); if (!parentFrame) return nsIntPoint(0, 0); nsIntRect parentRect = parentFrame->GetScreenRectExternal(); @@ -408,27 +408,27 @@ nsAccUtils::GetLiveAttrValue(PRUint32 aR } return false; } #ifdef DEBUG bool -nsAccUtils::IsTextInterfaceSupportCorrect(nsAccessible* aAccessible) +nsAccUtils::IsTextInterfaceSupportCorrect(Accessible* aAccessible) { // Don't test for accessible docs, it makes us create accessibles too // early and fire mutation events before we need to if (aAccessible->IsDoc()) return true; bool foundText = false; PRUint32 childCount = aAccessible->ChildCount(); for (PRUint32 childIdx = 0; childIdx < childCount; childIdx++) { - nsAccessible* child = aAccessible->GetChildAt(childIdx); + Accessible* child = aAccessible->GetChildAt(childIdx); if (IsText(child)) { foundText = true; break; } } if (foundText) { // found text child node @@ -437,17 +437,17 @@ nsAccUtils::IsTextInterfaceSupportCorrec return false; } return true; } #endif PRUint32 -nsAccUtils::TextLength(nsAccessible *aAccessible) +nsAccUtils::TextLength(Accessible* aAccessible) { if (!IsText(aAccessible)) return 1; TextLeafAccessible* textLeaf = aAccessible->AsTextLeaf(); if (textLeaf) return textLeaf->Text().Length(); @@ -456,17 +456,17 @@ nsAccUtils::TextLength(nsAccessible *aAc // XXX In the future, list bullets may have frame and anon content, so // we should be able to remove this at that point nsAutoString text; aAccessible->AppendTextTo(text); // Get all the text return text.Length(); } bool -nsAccUtils::MustPrune(nsAccessible* aAccessible) +nsAccUtils::MustPrune(Accessible* aAccessible) { roles::Role role = aAccessible->Role(); // We don't prune buttons any more however AT don't expect children inside of // button in general, we allow menu buttons to have children to make them // accessible. return role == roles::MENUITEM || role == roles::COMBOBOX_OPTION ||
--- a/accessible/src/base/nsAccUtils.h +++ b/accessible/src/base/nsAccUtils.h @@ -17,17 +17,17 @@ #include "mozilla/dom/Element.h" #include "nsIDocShell.h" #include "nsIDOMNode.h" #include "nsIPersistentProperties2.h" #include "nsIPresShell.h" #include "nsPoint.h" class nsAccessNode; -class nsAccessible; +class Accessible; class nsHyperTextAccessible; class nsHTMLTableAccessible; class DocAccessible; struct nsRoleMapEntry; #ifdef MOZ_XUL class nsXULTreeAccessible; #endif @@ -61,23 +61,23 @@ public: */ static void SetAccGroupAttrs(nsIPersistentProperties *aAttributes, PRInt32 aLevel, PRInt32 aSetSize, PRInt32 aPosInSet); /** * Get default value of the level for the given accessible. */ - static PRInt32 GetDefaultLevel(nsAccessible *aAcc); + static PRInt32 GetDefaultLevel(Accessible* aAcc); /** * Return ARIA level value or the default one if ARIA is missed for the * given accessible. */ - static PRInt32 GetARIAOrDefaultLevel(nsAccessible *aAccessible); + static PRInt32 GetARIAOrDefaultLevel(Accessible* aAccessible); /** * Compute group level for nsIDOMXULContainerItemElement node. */ static PRInt32 GetLevelForXULContainerItem(nsIContent *aContent); /** * Set container-foo live region attributes for the given node. @@ -127,33 +127,33 @@ public: /** * Return ancestor in this document with the given role if it exists. * * @param aDescendant [in] descendant to start search with * @param aRole [in] role to find matching ancestor for * @return the ancestor accessible with the given role, or * nsnull if no match is found */ - static nsAccessible * GetAncestorWithRole(nsAccessible *aDescendant, - PRUint32 aRole); + static Accessible* GetAncestorWithRole(Accessible* aDescendant, + PRUint32 aRole); /** * Return single or multi selectable container for the given item. * * @param aAccessible [in] the item accessible * @param aState [in] the state of the item accessible */ - static nsAccessible* GetSelectableContainer(nsAccessible* aAccessible, - PRUint64 aState); + static Accessible* GetSelectableContainer(Accessible* aAccessible, + PRUint64 aState); /** * Return true if the DOM node of given accessible has aria-selected="true" * attribute. */ - static bool IsARIASelected(nsAccessible *aAccessible); + static bool IsARIASelected(Accessible* aAccessible); /** * Return text accessible containing focus point of the given selection. * Used for normal and misspelling selection changes processing. * * @param aSelection [in] the given selection * @return text accessible */ @@ -237,33 +237,33 @@ public: */ static bool GetLiveAttrValue(PRUint32 aRule, nsAString& aValue); #ifdef DEBUG /** * Detect whether the given accessible object implements nsIAccessibleText, * when it is text or has text child node. */ - static bool IsTextInterfaceSupportCorrect(nsAccessible *aAccessible); + static bool IsTextInterfaceSupportCorrect(Accessible* aAccessible); #endif /** * Return true if the given accessible has text role. */ static bool IsText(nsIAccessible *aAcc) { PRUint32 role = Role(aAcc); return role == nsIAccessibleRole::ROLE_TEXT_LEAF || role == nsIAccessibleRole::ROLE_STATICTEXT; } /** * Return text length of the given accessible, return 0 on failure. */ - static PRUint32 TextLength(nsAccessible *aAccessible); + static PRUint32 TextLength(Accessible* aAccessible); /** * Return true if the given accessible is embedded object. */ static bool IsEmbeddedObject(nsIAccessible *aAcc) { PRUint32 role = Role(aAcc); return role != nsIAccessibleRole::ROLE_TEXT_LEAF && @@ -290,17 +290,17 @@ public: if (aState2) *aState2 = static_cast<PRUint32>(aState64 >> 31); } /** * Return true if the given accessible can't have children. Used when exposing * to platform accessibility APIs, should the children be pruned off? */ - static bool MustPrune(nsAccessible* aAccessible); + static bool MustPrune(Accessible* aAccessible); /** * Search hint enum constants. Used by GetHeaderCellsFor() method. */ enum { // search for row header cells, left direction eRowHeaderCells, // search for column header cells, top direction
--- a/accessible/src/base/nsAccessNode.cpp +++ b/accessible/src/base/nsAccessNode.cpp @@ -30,17 +30,17 @@ using namespace mozilla::a11y; ApplicationAccessible* nsAccessNode::gApplicationAccessible = nsnull; /* * Class nsAccessNode */ //////////////////////////////////////////////////////////////////////////////// -// nsAccessible. nsISupports +// AccessNode. nsISupports NS_IMPL_CYCLE_COLLECTION_1(nsAccessNode, mContent) NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsAccessNode) NS_INTERFACE_MAP_ENTRY(nsAccessNode) NS_INTERFACE_MAP_END NS_IMPL_CYCLE_COLLECTING_ADDREF(nsAccessNode)
--- a/accessible/src/base/nsAccessibilityService.cpp +++ b/accessible/src/base/nsAccessibilityService.cpp @@ -132,25 +132,25 @@ nsAccessibilityService::NotifyOfAnchorJu if (document) document->SetAnchorJump(aTargetNode); } } // nsIAccessibilityService void nsAccessibilityService::FireAccessibleEvent(PRUint32 aEvent, - nsAccessible* aTarget) + Accessible* aTarget) { nsEventShell::FireEvent(aEvent, aTarget); } //////////////////////////////////////////////////////////////////////////////// // nsIAccessibilityService -nsAccessible* +Accessible* nsAccessibilityService::GetRootDocumentAccessible(nsIPresShell* aPresShell, bool aCanCreate) { nsIDocument* documentNode = aPresShell->GetDocument(); if (documentNode) { nsCOMPtr<nsISupports> container = documentNode->GetContainer(); nsCOMPtr<nsIDocShellTreeItem> treeItem(do_QueryInterface(container)); if (treeItem) { @@ -165,148 +165,148 @@ nsAccessibilityService::GetRootDocumentA return aCanCreate ? GetDocAccessible(documentNode) : GetDocAccessibleFromCache(documentNode); } } return nsnull; } -already_AddRefed<nsAccessible> +already_AddRefed<Accessible> nsAccessibilityService::CreateOuterDocAccessible(nsIContent* aContent, nsIPresShell* aPresShell) { - nsAccessible* accessible = + Accessible* accessible = new OuterDocAccessible(aContent, GetDocAccessible(aPresShell)); NS_ADDREF(accessible); return accessible; } -already_AddRefed<nsAccessible> +already_AddRefed<Accessible> nsAccessibilityService::CreateHTMLButtonAccessible(nsIContent* aContent, nsIPresShell* aPresShell) { - nsAccessible* accessible = + Accessible* accessible = new HTMLButtonAccessible(aContent, GetDocAccessible(aPresShell)); NS_ADDREF(accessible); return accessible; } -already_AddRefed<nsAccessible> +already_AddRefed<Accessible> nsAccessibilityService::CreateHTMLLIAccessible(nsIContent* aContent, nsIPresShell* aPresShell) { - nsAccessible* accessible = + Accessible* accessible = new HTMLLIAccessible(aContent, GetDocAccessible(aPresShell)); NS_ADDREF(accessible); return accessible; } -already_AddRefed<nsAccessible> +already_AddRefed<Accessible> nsAccessibilityService::CreateHyperTextAccessible(nsIContent* aContent, nsIPresShell* aPresShell) { - nsAccessible* accessible = + Accessible* accessible = new nsHyperTextAccessibleWrap(aContent, GetDocAccessible(aPresShell)); NS_ADDREF(accessible); return accessible; } -already_AddRefed<nsAccessible> +already_AddRefed<Accessible> nsAccessibilityService::CreateHTMLCheckboxAccessible(nsIContent* aContent, nsIPresShell* aPresShell) { - nsAccessible* accessible = + Accessible* accessible = new HTMLCheckboxAccessible(aContent, GetDocAccessible(aPresShell)); NS_ADDREF(accessible); return accessible; } -already_AddRefed<nsAccessible> +already_AddRefed<Accessible> nsAccessibilityService::CreateHTMLComboboxAccessible(nsIContent* aContent, nsIPresShell* aPresShell) { - nsAccessible* accessible = + Accessible* accessible = new nsHTMLComboboxAccessible(aContent, GetDocAccessible(aPresShell)); NS_ADDREF(accessible); return accessible; } -already_AddRefed<nsAccessible> +already_AddRefed<Accessible> nsAccessibilityService::CreateHTMLCanvasAccessible(nsIContent* aContent, nsIPresShell* aPresShell) { - nsAccessible* accessible = + Accessible* accessible = new nsHTMLCanvasAccessible(aContent, GetDocAccessible(aPresShell)); NS_ADDREF(accessible); return accessible; } -already_AddRefed<nsAccessible> +already_AddRefed<Accessible> nsAccessibilityService::CreateHTMLFileInputAccessible(nsIContent* aContent, nsIPresShell* aPresShell) { - nsAccessible* accessible = + Accessible* accessible = new HTMLFileInputAccessible(aContent, GetDocAccessible(aPresShell)); NS_ADDREF(accessible); return accessible; } -already_AddRefed<nsAccessible> +already_AddRefed<Accessible> nsAccessibilityService::CreateHTMLImageAccessible(nsIContent* aContent, nsIPresShell* aPresShell) { - nsAccessible* accessible = + Accessible* accessible = new nsHTMLImageAccessibleWrap(aContent, GetDocAccessible(aPresShell)); NS_ADDREF(accessible); return accessible; } -already_AddRefed<nsAccessible> +already_AddRefed<Accessible> nsAccessibilityService::CreateHTMLImageMapAccessible(nsIContent* aContent, nsIPresShell* aPresShell) { - nsAccessible* accessible = + Accessible* accessible = new nsHTMLImageMapAccessible(aContent, GetDocAccessible(aPresShell)); NS_ADDREF(accessible); return accessible; } -already_AddRefed<nsAccessible> +already_AddRefed<Accessible> nsAccessibilityService::CreateHTMLGroupboxAccessible(nsIContent* aContent, nsIPresShell* aPresShell) { - nsAccessible* accessible = + Accessible* accessible = new HTMLGroupboxAccessible(aContent, GetDocAccessible(aPresShell)); NS_ADDREF(accessible); return accessible; } -already_AddRefed<nsAccessible> +already_AddRefed<Accessible> nsAccessibilityService::CreateHTMLListboxAccessible(nsIContent* aContent, nsIPresShell* aPresShell) { - nsAccessible* accessible = + Accessible* accessible = new nsHTMLSelectListAccessible(aContent, GetDocAccessible(aPresShell)); NS_ADDREF(accessible); return accessible; } -already_AddRefed<nsAccessible> +already_AddRefed<Accessible> nsAccessibilityService::CreateHTMLMediaAccessible(nsIContent* aContent, nsIPresShell* aPresShell) { - nsAccessible* accessible = + Accessible* accessible = new nsEnumRoleAccessible(aContent, GetDocAccessible(aPresShell), roles::GROUPING); NS_ADDREF(accessible); return accessible; } -already_AddRefed<nsAccessible> +already_AddRefed<Accessible> nsAccessibilityService::CreateHTMLObjectFrameAccessible(nsObjectFrame* aFrame, nsIContent* aContent, nsIPresShell* aPresShell) { // We can have several cases here: // 1) a text or html embedded document where the contentDocument variable in // the object element holds the content; // 2) web content that uses a plugin, which means we will have to go to @@ -332,17 +332,17 @@ nsAccessibilityService::CreateHTMLObject nsRefPtr<nsNPAPIPluginInstance> pluginInstance; if (NS_SUCCEEDED(aFrame->GetPluginInstance(getter_AddRefs(pluginInstance))) && pluginInstance) { #ifdef XP_WIN // Note: pluginPort will be null if windowless. HWND pluginPort = nsnull; aFrame->GetPluginPort(&pluginPort); - nsAccessible* accessible = + Accessible* accessible = new nsHTMLWin32ObjectOwnerAccessible(aContent, GetDocAccessible(aPresShell), pluginPort); NS_ADDREF(accessible); return accessible; #elif MOZ_ACCESSIBILITY_ATK if (!AtkSocketAccessible::gCanEmbed) @@ -364,111 +364,111 @@ nsAccessibilityService::CreateHTMLObject #endif // 3) for images and imagemaps, or anything else with a child frame // we have the object frame, get the image frame nsIFrame* frame = aFrame->GetFirstPrincipalChild(); return frame ? frame->CreateAccessible() : nsnull; } -already_AddRefed<nsAccessible> +already_AddRefed<Accessible> nsAccessibilityService::CreateHTMLRadioButtonAccessible(nsIContent* aContent, nsIPresShell* aPresShell) { - nsAccessible* accessible = + Accessible* accessible = new HTMLRadioButtonAccessible(aContent, GetDocAccessible(aPresShell)); NS_ADDREF(accessible); return accessible; } -already_AddRefed<nsAccessible> +already_AddRefed<Accessible> nsAccessibilityService::CreateHTMLTableAccessible(nsIContent* aContent, nsIPresShell* aPresShell) { - nsAccessible* accessible = + Accessible* accessible = new nsHTMLTableAccessibleWrap(aContent, GetDocAccessible(aPresShell)); NS_ADDREF(accessible); return accessible; } -already_AddRefed<nsAccessible> +already_AddRefed<Accessible> nsAccessibilityService::CreateHTMLTableCellAccessible(nsIContent* aContent, nsIPresShell* aPresShell) { - nsAccessible* accessible = + Accessible* accessible = new nsHTMLTableCellAccessibleWrap(aContent, GetDocAccessible(aPresShell)); NS_ADDREF(accessible); return accessible; } -already_AddRefed<nsAccessible> +already_AddRefed<Accessible> nsAccessibilityService::CreateHTMLTableRowAccessible(nsIContent* aContent, nsIPresShell* aPresShell) { - nsAccessible* accessible = + Accessible* accessible = new nsEnumRoleAccessible(aContent, GetDocAccessible(aPresShell), roles::ROW); NS_ADDREF(accessible); return accessible; } -already_AddRefed<nsAccessible> +already_AddRefed<Accessible> nsAccessibilityService::CreateTextLeafAccessible(nsIContent* aContent, nsIPresShell* aPresShell) { - nsAccessible* accessible = + Accessible* accessible = new TextLeafAccessible(aContent, GetDocAccessible(aPresShell)); NS_ADDREF(accessible); return accessible; } -already_AddRefed<nsAccessible> +already_AddRefed<Accessible> nsAccessibilityService::CreateHTMLTextFieldAccessible(nsIContent* aContent, nsIPresShell* aPresShell) { - nsAccessible* accessible = + Accessible* accessible = new HTMLTextFieldAccessible(aContent, GetDocAccessible(aPresShell)); NS_ADDREF(accessible); return accessible; } -already_AddRefed<nsAccessible> +already_AddRefed<Accessible> nsAccessibilityService::CreateHTMLLabelAccessible(nsIContent* aContent, nsIPresShell* aPresShell) { - nsAccessible* accessible = + Accessible* accessible = new nsHTMLLabelAccessible(aContent, GetDocAccessible(aPresShell)); NS_ADDREF(accessible); return accessible; } -already_AddRefed<nsAccessible> +already_AddRefed<Accessible> nsAccessibilityService::CreateHTMLHRAccessible(nsIContent* aContent, nsIPresShell* aPresShell) { - nsAccessible* accessible = + Accessible* accessible = new nsHTMLHRAccessible(aContent, GetDocAccessible(aPresShell)); NS_ADDREF(accessible); return accessible; } -already_AddRefed<nsAccessible> +already_AddRefed<Accessible> nsAccessibilityService::CreateHTMLBRAccessible(nsIContent* aContent, nsIPresShell* aPresShell) { - nsAccessible* accessible = + Accessible* accessible = new nsHTMLBRAccessible(aContent, GetDocAccessible(aPresShell)); NS_ADDREF(accessible); return accessible; } -already_AddRefed<nsAccessible> +already_AddRefed<Accessible> nsAccessibilityService::CreateHTMLCaptionAccessible(nsIContent* aContent, nsIPresShell* aPresShell) { - nsAccessible* accessible = + Accessible* accessible = new nsHTMLCaptionAccessible(aContent, GetDocAccessible(aPresShell)); NS_ADDREF(accessible); return accessible; } void nsAccessibilityService::ContentRangeInserted(nsIPresShell* aPresShell, nsIContent* aContainer, @@ -549,48 +549,48 @@ nsAccessibilityService::UpdateText(nsIPr void nsAccessibilityService::TreeViewChanged(nsIPresShell* aPresShell, nsIContent* aContent, nsITreeView* aView) { DocAccessible* document = GetDocAccessible(aPresShell); if (document) { - nsAccessible* accessible = document->GetAccessible(aContent); + Accessible* accessible = document->GetAccessible(aContent); if (accessible) { nsXULTreeAccessible* treeAcc = accessible->AsXULTree(); if (treeAcc) treeAcc->TreeViewChanged(aView); } } } void nsAccessibilityService::UpdateListBullet(nsIPresShell* aPresShell, nsIContent* aHTMLListItemContent, bool aHasBullet) { DocAccessible* document = GetDocAccessible(aPresShell); if (document) { - nsAccessible* accessible = document->GetAccessible(aHTMLListItemContent); + Accessible* accessible = document->GetAccessible(aHTMLListItemContent); if (accessible) { HTMLLIAccessible* listItem = accessible->AsHTMLListItem(); if (listItem) listItem->UpdateBullet(aHasBullet); } } } void nsAccessibilityService::UpdateImageMap(nsImageFrame* aImageFrame) { nsIPresShell* presShell = aImageFrame->PresContext()->PresShell(); DocAccessible* document = GetDocAccessible(presShell); if (document) { - nsAccessible* accessible = + Accessible* accessible = document->GetAccessible(aImageFrame->GetContent()); if (accessible) { nsHTMLImageMapAccessible* imageMap = accessible->AsImageMap(); if (imageMap) { imageMap->UpdateChildAreas(); return; } @@ -696,17 +696,17 @@ nsAccessibilityService::GetStringRole(PR #undef ROLE } NS_IMETHODIMP nsAccessibilityService::GetStringStates(PRUint32 aState, PRUint32 aExtraState, nsIDOMDOMStringList **aStringStates) { - nsAccessibleDOMStringList *stringStates = new nsAccessibleDOMStringList(); + nsAccessibleDOMStringList* stringStates = new nsAccessibleDOMStringList(); NS_ENSURE_TRUE(stringStates, NS_ERROR_OUT_OF_MEMORY); PRUint64 state = nsAccUtils::To64State(aState, aExtraState); // states if (state & states::UNAVAILABLE) stringStates->Add(NS_LITERAL_STRING("unavailable")); if (state & states::SELECTED) @@ -859,17 +859,17 @@ nsAccessibilityService::GetAccessibleFro return NS_ERROR_INVALID_ARG; // Search for an accessible in each of our per document accessible object // caches. If we don't find it, and the given node is itself a document, check // our cache of document accessibles (document cache). Note usually shutdown // document accessibles are not stored in the document cache, however an // "unofficially" shutdown document (i.e. not from nsAccDocManager) can still // exist in the document cache. - nsAccessible* accessible = FindAccessibleInCache(node); + Accessible* accessible = FindAccessibleInCache(node); if (!accessible) { nsCOMPtr<nsIDocument> document(do_QueryInterface(node)); if (document) accessible = GetDocAccessibleFromCache(document); } NS_IF_ADDREF(*aAccessible = accessible); return NS_OK; @@ -878,17 +878,17 @@ nsAccessibilityService::GetAccessibleFro NS_IMETHODIMP nsAccessibilityService::CreateAccessiblePivot(nsIAccessible* aRoot, nsIAccessiblePivot** aPivot) { NS_ENSURE_ARG_POINTER(aPivot); NS_ENSURE_ARG(aRoot); *aPivot = nsnull; - nsRefPtr<nsAccessible> accessibleRoot(do_QueryObject(aRoot)); + nsRefPtr<Accessible> accessibleRoot(do_QueryObject(aRoot)); NS_ENSURE_TRUE(accessibleRoot, NS_ERROR_INVALID_ARG); nsAccessiblePivot* pivot = new nsAccessiblePivot(accessibleRoot); NS_ADDREF(*aPivot = pivot); return NS_OK; } @@ -899,17 +899,17 @@ nsAccessibilityService::SetLogging(const logging::Enable(PromiseFlatCString(aModules)); #endif return NS_OK; } //////////////////////////////////////////////////////////////////////////////// // nsAccessibilityService public -nsAccessible* +Accessible* nsAccessibilityService::GetAccessible(nsINode* aNode, nsIPresShell* aPresShell) { NS_PRECONDITION(aNode, "Getting an accessible for null node! Crash."); // XXX handle the presshell DocAccessible* document = GetDocAccessible(aNode->OwnerDoc()); return document ? document->GetAccessible(aNode) : nsnull; } @@ -922,29 +922,29 @@ static bool HasRelatedContent(nsIContent } // If the given ID is referred by relation attribute then create an accessible // for it. Take care of HTML elements only for now. return aContent->IsHTML() && nsAccUtils::GetDocAccessibleFor(aContent)->IsDependentID(id); } -nsAccessible* +Accessible* nsAccessibilityService::GetOrCreateAccessible(nsINode* aNode, DocAccessible* aDoc, bool* aIsSubtreeHidden) { if (!aDoc || !aNode || gIsShutdown) return nsnull; if (aIsSubtreeHidden) *aIsSubtreeHidden = false; // Check to see if we already have an accessible for this node in the cache. - nsAccessible* cachedAccessible = aDoc->GetAccessible(aNode); + Accessible* cachedAccessible = aDoc->GetAccessible(aNode); if (cachedAccessible) return cachedAccessible; // No cache entry, so we must create the accessible. if (aNode->IsNodeOfType(nsINode::eDOCUMENT)) { // If it's document node then ask accessible document loader for // document accessible, otherwise return null. @@ -1007,17 +1007,17 @@ nsAccessibilityService::GetOrCreateAcces DocAccessible* docAcc = GetAccService()->GetDocAccessible(aNode->OwnerDoc()); if (!docAcc) { NS_NOTREACHED("Node has no host document accessible!"); return nsnull; } // Attempt to create an accessible based on what we know. - nsRefPtr<nsAccessible> newAcc; + nsRefPtr<Accessible> newAcc; // Create accessible for visible text frames. if (content->IsNodeOfType(nsINode::eTEXT)) { nsAutoString text; weakFrame->GetRenderedText(&text, nsnull, nsnull, 0, PR_UINT32_MAX); if (text.IsEmpty()) { if (aIsSubtreeHidden) *aIsSubtreeHidden = true; @@ -1085,17 +1085,17 @@ nsAccessibilityService::GetOrCreateAcces // accessibles nsIContent *tableContent = content; while ((tableContent = tableContent->GetParent()) != nsnull) { nsIFrame *tableFrame = tableContent->GetPrimaryFrame(); if (!tableFrame) continue; if (tableFrame->GetType() == nsGkAtoms::tableOuterFrame) { - nsAccessible* tableAccessible = aDoc->GetAccessible(tableContent); + Accessible* tableAccessible = aDoc->GetAccessible(tableContent); if (tableAccessible) { if (!roleMapEntry) { roles::Role role = tableAccessible->Role(); // No ARIA role and not in table: override role. For example, // <table role="label"><td>content</td></table> if (role != roles::TABLE && role != roles::TREE_TABLE) roleMapEntry = &nsARIAMap::gEmptyRoleMap; @@ -1226,17 +1226,17 @@ nsAccessibilityService::GetOrCreateAcces // If it's interesting we need it in the accessibility hierarchy so that events or // other accessibles can point to it, or so that it can hold a state, etc. if (isHTML) { // Interesting HTML container which may have selectable text and/or embedded objects newAcc = new nsHyperTextAccessibleWrap(content, docAcc); } else { // XUL, SVG, MathML etc. // Interesting generic non-HTML container - newAcc = new nsAccessibleWrap(content, docAcc); + newAcc = new AccessibleWrap(content, docAcc); } } return docAcc->BindToDocument(newAcc, roleMapEntry) ? newAcc : nsnull; } //////////////////////////////////////////////////////////////////////////////// // nsAccessibilityService private @@ -1316,36 +1316,36 @@ nsAccessibilityService::HasUniversalAria nsAccUtils::HasDefinedARIAToken(aContent, nsGkAtoms::aria_invalid) || aContent->HasAttr(kNameSpaceID_None, nsGkAtoms::aria_label) || aContent->HasAttr(kNameSpaceID_None, nsGkAtoms::aria_labelledby) || nsAccUtils::HasDefinedARIAToken(aContent, nsGkAtoms::aria_live) || nsAccUtils::HasDefinedARIAToken(aContent, nsGkAtoms::aria_owns) || nsAccUtils::HasDefinedARIAToken(aContent, nsGkAtoms::aria_relevant); } -already_AddRefed<nsAccessible> +already_AddRefed<Accessible> nsAccessibilityService::CreateAccessibleByType(nsIContent* aContent, DocAccessible* aDoc) { nsCOMPtr<nsIAccessibleProvider> accessibleProvider(do_QueryInterface(aContent)); if (!accessibleProvider) return nsnull; PRInt32 type; nsresult rv = accessibleProvider->GetAccessibleType(&type); if (NS_FAILED(rv)) return nsnull; if (type == nsIAccessibleProvider::OuterDoc) { - nsAccessible* accessible = new OuterDocAccessible(aContent, aDoc); + Accessible* accessible = new OuterDocAccessible(aContent, aDoc); NS_IF_ADDREF(accessible); return accessible; } - nsAccessible* accessible = nsnull; + Accessible* accessible = nsnull; switch (type) { #ifdef MOZ_XUL case nsIAccessibleProvider::NoAccessible: return nsnull; // XUL controls case nsIAccessibleProvider::XULAlert: @@ -1399,17 +1399,17 @@ nsAccessibilityService::CreateAccessible accessible = new nsXULListboxAccessibleWrap(aContent, aDoc); break; case nsIAccessibleProvider::XULListCell: accessible = new nsXULListCellAccessibleWrap(aContent, aDoc); break; case nsIAccessibleProvider::XULListHead: - accessible = new nsXULColumnsAccessible(aContent, aDoc); + accessible = new nsXULColumAccessible(aContent, aDoc); break; case nsIAccessibleProvider::XULListHeader: accessible = new nsXULColumnItemAccessible(aContent, aDoc); break; case nsIAccessibleProvider::XULListitem: accessible = new nsXULListitemAccessible(aContent, aDoc); @@ -1425,17 +1425,17 @@ nsAccessibilityService::CreateAccessible case nsIAccessibleProvider::XULMenupopup: { #ifdef MOZ_ACCESSIBILITY_ATK // ATK considers this node to be redundant when within menubars, and it makes menu // navigation with assistive technologies more difficult // XXX In the future we will should this for consistency across the nsIAccessible // implementations on each platform for a consistent scripting environment, but - // then strip out redundant accessibles in the nsAccessibleWrap class for each platform. + // then strip out redundant accessibles in the AccessibleWrap class for each platform. nsIContent *parent = aContent->GetParent(); if (parent && parent->NodeInfo()->Equals(nsGkAtoms::menu, kNameSpaceID_XUL)) return nsnull; #endif accessible = new nsXULMenupopupAccessible(aContent, aDoc); break; @@ -1492,17 +1492,17 @@ nsAccessibilityService::CreateAccessible case nsIAccessibleProvider::XULThumb: accessible = new nsXULThumbAccessible(aContent, aDoc); break; case nsIAccessibleProvider::XULTree: return CreateAccessibleForXULTree(aContent, aDoc); case nsIAccessibleProvider::XULTreeColumns: - accessible = new nsXULTreeColumnsAccessible(aContent, aDoc); + accessible = new nsXULTreeColumAccessible(aContent, aDoc); break; case nsIAccessibleProvider::XULTreeColumnItem: accessible = new nsXULColumnItemAccessible(aContent, aDoc); break; case nsIAccessibleProvider::XULToolbar: accessible = new XULToolbarAccessible(aContent, aDoc); @@ -1602,132 +1602,131 @@ nsAccessibilityService::CreateAccessible default: return nsnull; } NS_IF_ADDREF(accessible); return accessible; } -already_AddRefed<nsAccessible> +already_AddRefed<Accessible> nsAccessibilityService::CreateHTMLAccessibleByMarkup(nsIFrame* aFrame, nsIContent* aContent, DocAccessible* aDoc) { // This method assumes we're in an HTML namespace. nsIAtom* tag = aContent->Tag(); if (tag == nsGkAtoms::figcaption) { - nsAccessible* accessible = new HTMLFigcaptionAccessible(aContent, aDoc); + Accessible* accessible = new HTMLFigcaptionAccessible(aContent, aDoc); NS_IF_ADDREF(accessible); return accessible; } if (tag == nsGkAtoms::figure) { - nsAccessible* accessible = new HTMLFigureAccessible(aContent, aDoc); + Accessible* accessible = new HTMLFigureAccessible(aContent, aDoc); NS_IF_ADDREF(accessible); return accessible; } if (tag == nsGkAtoms::legend) { - nsAccessible* accessible = new HTMLLegendAccessible(aContent, aDoc); + Accessible* accessible = new HTMLLegendAccessible(aContent, aDoc); NS_IF_ADDREF(accessible); return accessible; } if (tag == nsGkAtoms::option) { - nsAccessible* accessible = new nsHTMLSelectOptionAccessible(aContent, aDoc); + Accessible* accessible = new nsHTMLSelectOptionAccessible(aContent, aDoc); NS_IF_ADDREF(accessible); return accessible; } if (tag == nsGkAtoms::optgroup) { - nsAccessible* accessible = new nsHTMLSelectOptGroupAccessible(aContent, - aDoc); + Accessible* accessible = new nsHTMLSelectOptGroupAccessible(aContent, aDoc); NS_IF_ADDREF(accessible); return accessible; } if (tag == nsGkAtoms::ul || tag == nsGkAtoms::ol || tag == nsGkAtoms::dl) { - nsAccessible* accessible = new HTMLListAccessible(aContent, aDoc); + Accessible* accessible = new HTMLListAccessible(aContent, aDoc); NS_IF_ADDREF(accessible); return accessible; } if (tag == nsGkAtoms::a) { // Only some roles truly enjoy life as nsHTMLLinkAccessibles, for details // see closed bug 494807. nsRoleMapEntry* roleMapEntry = aria::GetRoleMap(aContent); if (roleMapEntry && roleMapEntry->role != roles::NOTHING && roleMapEntry->role != roles::LINK) { - nsAccessible* accessible = new nsHyperTextAccessibleWrap(aContent, aDoc); + Accessible* accessible = new nsHyperTextAccessibleWrap(aContent, aDoc); NS_IF_ADDREF(accessible); return accessible; } - nsAccessible* accessible = new nsHTMLLinkAccessible(aContent, aDoc); + Accessible* accessible = new nsHTMLLinkAccessible(aContent, aDoc); NS_IF_ADDREF(accessible); return accessible; } if (tag == nsGkAtoms::dt || (tag == nsGkAtoms::li && aFrame->GetType() != nsGkAtoms::blockFrame)) { // Normally for li, it is created by the list item frame (in nsBlockFrame) // which knows about the bullet frame; however, in this case the list item // must have been styled using display: foo - nsAccessible* accessible = new HTMLLIAccessible(aContent, aDoc); + Accessible* accessible = new HTMLLIAccessible(aContent, aDoc); NS_IF_ADDREF(accessible); return accessible; } if (tag == nsGkAtoms::abbr || tag == nsGkAtoms::acronym || tag == nsGkAtoms::blockquote || tag == nsGkAtoms::dd || tag == nsGkAtoms::form || tag == nsGkAtoms::h1 || tag == nsGkAtoms::h2 || tag == nsGkAtoms::h3 || tag == nsGkAtoms::h4 || tag == nsGkAtoms::h5 || tag == nsGkAtoms::h6 || tag == nsGkAtoms::q) { - nsAccessible* accessible = new nsHyperTextAccessibleWrap(aContent, aDoc); + Accessible* accessible = new nsHyperTextAccessibleWrap(aContent, aDoc); NS_IF_ADDREF(accessible); return accessible; } if (nsCoreUtils::IsHTMLTableHeader(aContent)) { - nsAccessible* accessible = new nsHTMLTableHeaderCellAccessibleWrap(aContent, - aDoc); + Accessible* accessible = new nsHTMLTableHeaderCellAccessibleWrap(aContent, + aDoc); NS_IF_ADDREF(accessible); return accessible; } if (tag == nsGkAtoms::output) { - nsAccessible* accessible = new nsHTMLOutputAccessible(aContent, aDoc); + Accessible* accessible = new nsHTMLOutputAccessible(aContent, aDoc); NS_IF_ADDREF(accessible); return accessible; } if (tag == nsGkAtoms::progress) { - nsAccessible* accessible = + Accessible* accessible = new HTMLProgressMeterAccessible(aContent, aDoc); NS_IF_ADDREF(accessible); return accessible; } return nsnull; } //////////////////////////////////////////////////////////////////////////////// // nsIAccessibilityService (DON'T put methods here) -nsAccessible* +Accessible* nsAccessibilityService::AddNativeRootAccessible(void* aAtkAccessible) { #ifdef MOZ_ACCESSIBILITY_ATK ApplicationAccessible* applicationAcc = nsAccessNode::GetApplicationAccessible(); if (!applicationAcc) return nsnull; @@ -1739,17 +1738,17 @@ nsAccessibilityService::AddNativeRootAcc if (applicationAcc->AppendChild(nativeRootAcc)) return nativeRootAcc; #endif return nsnull; } void -nsAccessibilityService::RemoveNativeRootAccessible(nsAccessible* aAccessible) +nsAccessibilityService::RemoveNativeRootAccessible(Accessible* aAccessible) { #ifdef MOZ_ACCESSIBILITY_ATK ApplicationAccessible* applicationAcc = nsAccessNode::GetApplicationAccessible(); if (applicationAcc) applicationAcc->RemoveChild(aAccessible); #endif @@ -1787,49 +1786,49 @@ NS_GetAccessibilityService(nsIAccessibil NS_ADDREF(*aResult = service); return NS_OK; } //////////////////////////////////////////////////////////////////////////////// // nsAccessibilityService private (DON'T put methods here) -already_AddRefed<nsAccessible> +already_AddRefed<Accessible> nsAccessibilityService::CreateAccessibleForDeckChild(nsIFrame* aFrame, nsIContent* aContent, DocAccessible* aDoc) { if (aFrame->GetType() == nsGkAtoms::boxFrame || aFrame->GetType() == nsGkAtoms::scrollFrame) { nsIFrame* parentFrame = aFrame->GetParent(); if (parentFrame && parentFrame->GetType() == nsGkAtoms::deckFrame) { // If deck frame is for xul:tabpanels element then the given node has // tabpanel accessible. nsCOMPtr<nsIContent> parentContent = parentFrame->GetContent(); #ifdef MOZ_XUL if (parentContent->NodeInfo()->Equals(nsGkAtoms::tabpanels, kNameSpaceID_XUL)) { - nsAccessible* accessible = new nsXULTabpanelAccessible(aContent, aDoc); + Accessible* accessible = new nsXULTabpanelAccessible(aContent, aDoc); NS_IF_ADDREF(accessible); return accessible; } #endif - nsAccessible* accessible = new nsEnumRoleAccessible(aContent, aDoc, - roles::PROPERTYPAGE); + Accessible* accessible = new nsEnumRoleAccessible(aContent, aDoc, + roles::PROPERTYPAGE); NS_IF_ADDREF(accessible); return accessible; } } return nsnull; } #ifdef MOZ_XUL -already_AddRefed<nsAccessible> +already_AddRefed<Accessible> nsAccessibilityService::CreateAccessibleForXULTree(nsIContent* aContent, DocAccessible* aDoc) { nsCOMPtr<nsITreeBoxObject> treeBoxObj = nsCoreUtils::GetTreeBoxObject(aContent); if (!treeBoxObj) return nsnull; nsCOMPtr<nsITreeColumns> treeColumns; @@ -1837,23 +1836,23 @@ nsAccessibilityService::CreateAccessible if (!treeColumns) return nsnull; PRInt32 count = 0; treeColumns->GetCount(&count); // Outline of list accessible. if (count == 1) { - nsAccessible* accessible = new nsXULTreeAccessible(aContent, aDoc); + Accessible* accessible = new nsXULTreeAccessible(aContent, aDoc); NS_IF_ADDREF(accessible); return accessible; } // Table or tree table accessible. - nsAccessible* accessible = new nsXULTreeGridAccessibleWrap(aContent, aDoc); + Accessible* accessible = new nsXULTreeGridAccessibleWrap(aContent, aDoc); NS_IF_ADDREF(accessible); return accessible; } #endif //////////////////////////////////////////////////////////////////////////////// // Services ////////////////////////////////////////////////////////////////////////////////
--- a/accessible/src/base/nsAccessibilityService.h +++ b/accessible/src/base/nsAccessibilityService.h @@ -52,70 +52,70 @@ class nsAccessibilityService : public ns public: virtual ~nsAccessibilityService(); NS_DECL_ISUPPORTS_INHERITED NS_DECL_NSIACCESSIBLERETRIEVAL NS_DECL_NSIOBSERVER // nsIAccessibilityService - virtual nsAccessible* GetRootDocumentAccessible(nsIPresShell* aPresShell, - bool aCanCreate); - already_AddRefed<nsAccessible> + virtual Accessible* GetRootDocumentAccessible(nsIPresShell* aPresShell, + bool aCanCreate); + already_AddRefed<Accessible> CreateHTMLButtonAccessible(nsIContent* aContent, nsIPresShell* aPresShell); - already_AddRefed<nsAccessible> + already_AddRefed<Accessible> CreateHTMLBRAccessible(nsIContent* aContent, nsIPresShell* aPresShell); - already_AddRefed<nsAccessible> + already_AddRefed<Accessible> CreateHTMLCanvasAccessible(nsIContent* aContent, nsIPresShell* aPresShell); - already_AddRefed<nsAccessible> + already_AddRefed<Accessible> CreateHTMLCaptionAccessible(nsIContent* aContent, nsIPresShell* aPresShell); - already_AddRefed<nsAccessible> + already_AddRefed<Accessible> CreateHTMLCheckboxAccessible(nsIContent* aContent, nsIPresShell* aPresShell); - already_AddRefed<nsAccessible> + already_AddRefed<Accessible> CreateHTMLComboboxAccessible(nsIContent* aContent, nsIPresShell* aPresShell); - already_AddRefed<nsAccessible> + already_AddRefed<Accessible> CreateHTMLFileInputAccessible(nsIContent* aContent, nsIPresShell* aPresShell); - already_AddRefed<nsAccessible> + already_AddRefed<Accessible> CreateHTMLGroupboxAccessible(nsIContent* aContent, nsIPresShell* aPresShell); - already_AddRefed<nsAccessible> + already_AddRefed<Accessible> CreateHTMLHRAccessible(nsIContent* aContent, nsIPresShell* aPresShell); - already_AddRefed<nsAccessible> + already_AddRefed<Accessible> CreateHTMLImageAccessible(nsIContent* aContent, nsIPresShell* aPresShell); - already_AddRefed<nsAccessible> + already_AddRefed<Accessible> CreateHTMLImageMapAccessible(nsIContent* aContent, nsIPresShell* aPresShell); - already_AddRefed<nsAccessible> + already_AddRefed<Accessible> CreateHTMLLabelAccessible(nsIContent* aContent, nsIPresShell* aPresShell); - already_AddRefed<nsAccessible> + already_AddRefed<Accessible> CreateHTMLLIAccessible(nsIContent* aContent, nsIPresShell* aPresShell); - already_AddRefed<nsAccessible> + already_AddRefed<Accessible> CreateHTMLListboxAccessible(nsIContent* aContent, nsIPresShell* aPresShell); - already_AddRefed<nsAccessible> + already_AddRefed<Accessible> CreateHTMLMediaAccessible(nsIContent* aContent, nsIPresShell* aPresShell); - already_AddRefed<nsAccessible> + already_AddRefed<Accessible> CreateHTMLObjectFrameAccessible(nsObjectFrame* aFrame, nsIContent* aContent, nsIPresShell* aPresShell); - already_AddRefed<nsAccessible> + already_AddRefed<Accessible> CreateHTMLRadioButtonAccessible(nsIContent* aContent, nsIPresShell* aPresShell); - already_AddRefed<nsAccessible> + already_AddRefed<Accessible> CreateHTMLTableAccessible(nsIContent* aContent, nsIPresShell* aPresShell); - already_AddRefed<nsAccessible> + already_AddRefed<Accessible> CreateHTMLTableCellAccessible(nsIContent* aContent, nsIPresShell* aPresShell); - already_AddRefed<nsAccessible> + already_AddRefed<Accessible> CreateHTMLTableRowAccessible(nsIContent* aContent, nsIPresShell* aPresShell); - already_AddRefed<nsAccessible> + already_AddRefed<Accessible> CreateTextLeafAccessible(nsIContent* aContent, nsIPresShell* aPresShell); - already_AddRefed<nsAccessible> + already_AddRefed<Accessible> CreateHTMLTextFieldAccessible(nsIContent* aContent, nsIPresShell* aPresShell); - already_AddRefed<nsAccessible> + already_AddRefed<Accessible> CreateHyperTextAccessible(nsIContent* aContent, nsIPresShell* aPresShell); - already_AddRefed<nsAccessible> + already_AddRefed<Accessible> CreateOuterDocAccessible(nsIContent* aContent, nsIPresShell* aPresShell); - virtual nsAccessible* AddNativeRootAccessible(void* aAtkAccessible); - virtual void RemoveNativeRootAccessible(nsAccessible* aRootAccessible); + virtual Accessible* AddNativeRootAccessible(void* aAtkAccessible); + virtual void RemoveNativeRootAccessible(Accessible* aRootAccessible); virtual void ContentRangeInserted(nsIPresShell* aPresShell, nsIContent* aContainer, nsIContent* aStartChild, nsIContent* aEndChild); virtual void ContentRemoved(nsIPresShell* aPresShell, nsIContent* aContainer, nsIContent* aChild); @@ -149,17 +149,17 @@ public: */ virtual void PresShellActivated(nsIPresShell* aPresShell); /** * Recreate an accessible for the given content node in the presshell. */ void RecreateAccessible(nsIPresShell* aPresShell, nsIContent* aContent); - virtual void FireAccessibleEvent(PRUint32 aEvent, nsAccessible* aTarget); + virtual void FireAccessibleEvent(PRUint32 aEvent, Accessible* aTarget); // nsAccessibiltiyService /** * Return true if accessibility service has been shutdown. */ static bool IsShutdown() { return gIsShutdown; } @@ -167,24 +167,24 @@ public: * Return an accessible for the given DOM node from the cache or create new * one. * * @param aNode [in] the given node * @param aDoc [in] the doc accessible of the node * @param aIsSubtreeHidden [out, optional] indicates whether the node's * frame and its subtree is hidden */ - nsAccessible* GetOrCreateAccessible(nsINode* aNode, DocAccessible* aDoc, - bool* aIsSubtreeHidden = nsnull); + Accessible* GetOrCreateAccessible(nsINode* aNode, DocAccessible* aDoc, + bool* aIsSubtreeHidden = nsnull); /** * Return an accessible for the given DOM node and eventually a presentation * shell. */ - nsAccessible* GetAccessible(nsINode* aNode, nsIPresShell* aPresShell); + Accessible* GetAccessible(nsINode* aNode, nsIPresShell* aPresShell); private: // nsAccessibilityService creation is controlled by friend // NS_GetAccessibilityService, keep constructors private. nsAccessibilityService(); nsAccessibilityService(const nsAccessibilityService&); nsAccessibilityService& operator =(const nsAccessibilityService&); @@ -198,38 +198,38 @@ private: * Shutdowns accessibility service. */ void Shutdown(); /** * Create accessible for the element implementing nsIAccessibleProvider * interface. */ - already_AddRefed<nsAccessible> + already_AddRefed<Accessible> CreateAccessibleByType(nsIContent* aContent, DocAccessible* aDoc); /** * Create accessible for HTML node by tag name. */ - already_AddRefed<nsAccessible> + already_AddRefed<Accessible> CreateHTMLAccessibleByMarkup(nsIFrame* aFrame, nsIContent* aContent, DocAccessible* aDoc); /** * Create accessible if parent is a deck frame. */ - already_AddRefed<nsAccessible> + already_AddRefed<Accessible> CreateAccessibleForDeckChild(nsIFrame* aFrame, nsIContent* aContent, DocAccessible* aDoc); #ifdef MOZ_XUL /** * Create accessible for XUL tree element. */ - already_AddRefed<nsAccessible> + already_AddRefed<Accessible> CreateAccessibleForXULTree(nsIContent* aContent, DocAccessible* aDoc); #endif /** * Reference for accessibility service instance. */ static nsAccessibilityService* gAccessibilityService;
--- a/accessible/src/base/nsAccessiblePivot.cpp +++ b/accessible/src/base/nsAccessiblePivot.cpp @@ -27,29 +27,29 @@ class RuleCache public: RuleCache(nsIAccessibleTraversalRule* aRule) : mRule(aRule), mAcceptRoles(nsnull) { } ~RuleCache () { if (mAcceptRoles) nsMemory::Free(mAcceptRoles); } - nsresult ApplyFilter(nsAccessible* aAccessible, PRUint16* aResult); + nsresult ApplyFilter(Accessible* aAccessible, PRUint16* aResult); private: nsCOMPtr<nsIAccessibleTraversalRule> mRule; PRUint32* mAcceptRoles; PRUint32 mAcceptRolesLength; PRUint32 mPreFilter; }; //////////////////////////////////////////////////////////////////////////////// // nsAccessiblePivot -nsAccessiblePivot::nsAccessiblePivot(nsAccessible* aRoot) : +nsAccessiblePivot::nsAccessiblePivot(Accessible* aRoot) : mRoot(aRoot), mPosition(nsnull), mStartOffset(-1), mEndOffset(-1) { NS_ASSERTION(aRoot, "A root accessible is required"); } //////////////////////////////////////////////////////////////////////////////// // nsISupports @@ -101,17 +101,17 @@ nsAccessiblePivot::GetPosition(nsIAccess NS_IF_ADDREF(*aPosition = mPosition); return NS_OK; } NS_IMETHODIMP nsAccessiblePivot::SetPosition(nsIAccessible* aPosition) { - nsRefPtr<nsAccessible> secondPosition; + nsRefPtr<Accessible> secondPosition; if (aPosition) { secondPosition = do_QueryObject(aPosition); if (!secondPosition || !IsRootDescendant(secondPosition)) return NS_ERROR_INVALID_ARG; } // Swap old position with new position, saves us an AddRef/Release. @@ -164,17 +164,17 @@ nsAccessiblePivot::SetTextRange(nsIAcces if (aEndOffset > charCount) return NS_ERROR_FAILURE; PRInt32 oldStart = mStartOffset, oldEnd = mEndOffset; mStartOffset = aStartOffset; mEndOffset = aEndOffset; - nsRefPtr<nsAccessible> oldPosition = mPosition.forget(); + nsRefPtr<Accessible> oldPosition = mPosition.forget(); mPosition = newPosition.forget(); NotifyPivotChanged(oldPosition, oldStart, oldEnd); return NS_OK; } // Traversal functions @@ -185,17 +185,17 @@ nsAccessiblePivot::MoveNext(nsIAccessibl NS_ENSURE_ARG(aResult); NS_ENSURE_ARG(aRule); if (mPosition && (mPosition->IsDefunct() || !mPosition->Document()->IsInDocument(mPosition))) return NS_ERROR_NOT_IN_TREE; nsresult rv = NS_OK; - nsAccessible* accessible = SearchForward(mPosition, aRule, false, &rv); + Accessible* accessible = SearchForward(mPosition, aRule, false, &rv); NS_ENSURE_SUCCESS(rv, rv); *aResult = accessible; if (*aResult) MovePivotInternal(accessible); return NS_OK; } @@ -206,17 +206,17 @@ nsAccessiblePivot::MovePrevious(nsIAcces NS_ENSURE_ARG(aResult); NS_ENSURE_ARG(aRule); if (mPosition && (mPosition->IsDefunct() || !mPosition->Document()->IsInDocument(mPosition))) return NS_ERROR_NOT_IN_TREE; nsresult rv = NS_OK; - nsAccessible* accessible = SearchBackward(mPosition, aRule, false, &rv); + Accessible* accessible = SearchBackward(mPosition, aRule, false, &rv); NS_ENSURE_SUCCESS(rv, rv); *aResult = accessible; if (*aResult) MovePivotInternal(accessible); return NS_OK; } @@ -226,17 +226,17 @@ nsAccessiblePivot::MoveFirst(nsIAccessib { NS_ENSURE_ARG(aResult); NS_ENSURE_ARG(aRule); if (mRoot && mRoot->IsDefunct()) return NS_ERROR_NOT_IN_TREE; nsresult rv = NS_OK; - nsAccessible* accessible = SearchForward(mRoot, aRule, true, &rv); + Accessible* accessible = SearchForward(mRoot, aRule, true, &rv); NS_ENSURE_SUCCESS(rv, rv); *aResult = accessible; if (*aResult) MovePivotInternal(accessible); return NS_OK; } @@ -247,18 +247,18 @@ nsAccessiblePivot::MoveLast(nsIAccessibl NS_ENSURE_ARG(aResult); NS_ENSURE_ARG(aRule); if (mRoot && mRoot->IsDefunct()) return NS_ERROR_NOT_IN_TREE; *aResult = false; nsresult rv = NS_OK; - nsAccessible* lastAccessible = mRoot; - nsAccessible* accessible = nsnull; + Accessible* lastAccessible = mRoot; + Accessible* accessible = nsnull; // First got to the last accessible in pre-order while (lastAccessible->HasChildren()) lastAccessible = lastAccessible->LastChild(); // Search backwards from last accessible and find the last occurrence in the doc accessible = SearchBackward(lastAccessible, aRule, true, &rv); NS_ENSURE_SUCCESS(rv, rv); @@ -310,76 +310,76 @@ nsAccessiblePivot::RemoveObserver(nsIAcc NS_ENSURE_ARG(aObserver); return mObservers.RemoveElement(aObserver) ? NS_OK : NS_ERROR_FAILURE; } // Private utility methods bool -nsAccessiblePivot::IsRootDescendant(nsAccessible* aAccessible) +nsAccessiblePivot::IsRootDescendant(Accessible* aAccessible) { if (!mRoot || mRoot->IsDefunct()) return false; - nsAccessible* accessible = aAccessible; + Accessible* accessible = aAccessible; do { if (accessible == mRoot) return true; } while ((accessible = accessible->Parent())); return false; } void -nsAccessiblePivot::MovePivotInternal(nsAccessible* aPosition) +nsAccessiblePivot::MovePivotInternal(Accessible* aPosition) { - nsRefPtr<nsAccessible> oldPosition = mPosition.forget(); + nsRefPtr<Accessible> oldPosition = mPosition.forget(); mPosition = aPosition; PRInt32 oldStart = mStartOffset, oldEnd = mEndOffset; mStartOffset = mEndOffset = -1; NotifyPivotChanged(oldPosition, oldStart, oldEnd); } -nsAccessible* -nsAccessiblePivot::SearchBackward(nsAccessible* aAccessible, +Accessible* +nsAccessiblePivot::SearchBackward(Accessible* aAccessible, nsIAccessibleTraversalRule* aRule, bool aSearchCurrent, nsresult* aResult) { *aResult = NS_OK; // Initial position could be unset, in that case return null. if (!aAccessible) return nsnull; RuleCache cache(aRule); - nsAccessible* accessible = aAccessible; + Accessible* accessible = aAccessible; PRUint16 filtered = nsIAccessibleTraversalRule::FILTER_IGNORE; if (aSearchCurrent) { *aResult = cache.ApplyFilter(accessible, &filtered); NS_ENSURE_SUCCESS(*aResult, nsnull); if (filtered & nsIAccessibleTraversalRule::FILTER_MATCH) return accessible; } while (accessible != mRoot) { - nsAccessible* parent = accessible->Parent(); + Accessible* parent = accessible->Parent(); PRInt32 idxInParent = accessible->IndexInParent(); while (idxInParent > 0) { if (!(accessible = parent->GetChildAt(--idxInParent))) continue; *aResult = cache.ApplyFilter(accessible, &filtered); NS_ENSURE_SUCCESS(*aResult, nsnull); - nsAccessible* lastChild; + Accessible* lastChild = nsnull; while (!(filtered & nsIAccessibleTraversalRule::FILTER_IGNORE_SUBTREE) && (lastChild = accessible->LastChild())) { parent = accessible; accessible = lastChild; idxInParent = accessible->IndexInParent(); *aResult = cache.ApplyFilter(accessible, &filtered); NS_ENSURE_SUCCESS(*aResult, nsnull); } @@ -396,49 +396,49 @@ nsAccessiblePivot::SearchBackward(nsAcce if (filtered & nsIAccessibleTraversalRule::FILTER_MATCH) return accessible; } return nsnull; } -nsAccessible* -nsAccessiblePivot::SearchForward(nsAccessible* aAccessible, +Accessible* +nsAccessiblePivot::SearchForward(Accessible* aAccessible, nsIAccessibleTraversalRule* aRule, bool aSearchCurrent, nsresult* aResult) { *aResult = NS_OK; // Initial position could be not set, in that case begin search from root. - nsAccessible *accessible = (!aAccessible) ? mRoot.get() : aAccessible; + Accessible* accessible = (!aAccessible) ? mRoot.get() : aAccessible; RuleCache cache(aRule); PRUint16 filtered = nsIAccessibleTraversalRule::FILTER_IGNORE; *aResult = cache.ApplyFilter(accessible, &filtered); NS_ENSURE_SUCCESS(*aResult, nsnull); if (aSearchCurrent && (filtered & nsIAccessibleTraversalRule::FILTER_MATCH)) return accessible; while (true) { - nsAccessible* firstChild = nsnull; + Accessible* firstChild = nsnull; while (!(filtered & nsIAccessibleTraversalRule::FILTER_IGNORE_SUBTREE) && (firstChild = accessible->FirstChild())) { accessible = firstChild; *aResult = cache.ApplyFilter(accessible, &filtered); NS_ENSURE_SUCCESS(*aResult, nsnull); if (filtered & nsIAccessibleTraversalRule::FILTER_MATCH) return accessible; } - nsAccessible* sibling = nsnull; - nsAccessible* temp = accessible; + Accessible* sibling = nsnull; + Accessible* temp = accessible; do { if (temp == mRoot) break; sibling = temp->NextSibling(); if (sibling) break; @@ -454,28 +454,28 @@ nsAccessiblePivot::SearchForward(nsAcces if (filtered & nsIAccessibleTraversalRule::FILTER_MATCH) return accessible; } return nsnull; } void -nsAccessiblePivot::NotifyPivotChanged(nsAccessible* aOldPosition, +nsAccessiblePivot::NotifyPivotChanged(Accessible* aOldPosition, PRInt32 aOldStart, PRInt32 aOldEnd) { nsTObserverArray<nsCOMPtr<nsIAccessiblePivotObserver> >::ForwardIterator iter(mObservers); while (iter.HasMore()) { nsIAccessiblePivotObserver* obs = iter.GetNext(); obs->OnPivotChanged(this, aOldPosition, aOldStart, aOldEnd); } } nsresult -RuleCache::ApplyFilter(nsAccessible* aAccessible, PRUint16* aResult) +RuleCache::ApplyFilter(Accessible* aAccessible, PRUint16* aResult) { *aResult = nsIAccessibleTraversalRule::FILTER_IGNORE; if (!mAcceptRoles) { nsresult rv = mRule->GetMatchRoles(&mAcceptRoles, &mAcceptRolesLength); NS_ENSURE_SUCCESS(rv, rv); rv = mRule->GetPreFilter(&mPreFilter); NS_ENSURE_SUCCESS(rv, rv);
--- a/accessible/src/base/nsAccessiblePivot.h +++ b/accessible/src/base/nsAccessiblePivot.h @@ -8,88 +8,88 @@ #define _nsAccessiblePivot_H_ #include "nsIAccessiblePivot.h" #include "nsAutoPtr.h" #include "nsTObserverArray.h" #include "nsCycleCollectionParticipant.h" -class nsAccessible; +class Accessible; class nsIAccessibleTraversalRule; // raised when current pivot's position is needed but it is not in the tree. #define NS_ERROR_NOT_IN_TREE \ NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_GENERAL, 0x26) /** * Class represents an accessible pivot. */ class nsAccessiblePivot: public nsIAccessiblePivot { public: - nsAccessiblePivot(nsAccessible* aRoot); + nsAccessiblePivot(Accessible* aRoot); NS_DECL_CYCLE_COLLECTING_ISUPPORTS NS_DECL_CYCLE_COLLECTION_CLASS_AMBIGUOUS(nsAccessiblePivot, nsIAccessiblePivot) NS_DECL_NSIACCESSIBLEPIVOT /* * A simple getter for the pivot's position. */ - nsAccessible* Position() { return mPosition; } + Accessible* Position() { return mPosition; } private: nsAccessiblePivot() MOZ_DELETE; nsAccessiblePivot(const nsAccessiblePivot&) MOZ_DELETE; void operator = (const nsAccessiblePivot&) MOZ_DELETE; /* * Notify all observers on a pivot change. */ - void NotifyPivotChanged(nsAccessible* aOldAccessible, + void NotifyPivotChanged(Accessible* aOldAccessible, PRInt32 aOldStart, PRInt32 aOldEnd); /* * Check to see that the given accessible is in the pivot's subtree. */ - bool IsRootDescendant(nsAccessible* aAccessible); + bool IsRootDescendant(Accessible* aAccessible); /* * Search in preorder for the first accessible to match the rule. */ - nsAccessible* SearchForward(nsAccessible* aAccessible, - nsIAccessibleTraversalRule* aRule, - bool aSearchCurrent, - nsresult* aResult); + Accessible* SearchForward(Accessible* aAccessible, + nsIAccessibleTraversalRule* aRule, + bool aSearchCurrent, + nsresult* aResult); /* * Reverse search in preorder for the first accessible to match the rule. */ - nsAccessible* SearchBackward(nsAccessible* aAccessible, - nsIAccessibleTraversalRule* aRule, - bool aSearchCurrent, - nsresult* aResult); + Accessible* SearchBackward(Accessible* aAccessible, + nsIAccessibleTraversalRule* aRule, + bool aSearchCurrent, + nsresult* aResult); /* * Update the pivot, and notify observers. */ - void MovePivotInternal(nsAccessible* aPosition); + void MovePivotInternal(Accessible* aPosition); /* * The root accessible. */ - nsRefPtr<nsAccessible> mRoot; + nsRefPtr<Accessible> mRoot; /* * The current pivot position. */ - nsRefPtr<nsAccessible> mPosition; + nsRefPtr<Accessible> mPosition; /* * The text start offset ofthe pivot. */ PRInt32 mStartOffset; /* * The text end offset ofthe pivot.
--- a/accessible/src/base/nsBaseWidgetAccessible.cpp +++ b/accessible/src/base/nsBaseWidgetAccessible.cpp @@ -22,82 +22,82 @@ using namespace mozilla::a11y; //////////////////////////////////////////////////////////////////////////////// // nsLeafAccessible //////////////////////////////////////////////////////////////////////////////// nsLeafAccessible:: nsLeafAccessible(nsIContent* aContent, DocAccessible* aDoc) : - nsAccessibleWrap(aContent, aDoc) + AccessibleWrap(aContent, aDoc) { } -NS_IMPL_ISUPPORTS_INHERITED0(nsLeafAccessible, nsAccessible) +NS_IMPL_ISUPPORTS_INHERITED0(nsLeafAccessible, Accessible) //////////////////////////////////////////////////////////////////////////////// -// nsLeafAccessible: nsAccessible public +// nsLeafAccessible: Accessible public -nsAccessible* +Accessible* nsLeafAccessible::ChildAtPoint(PRInt32 aX, PRInt32 aY, EWhichChildAtPoint aWhichChild) { // Don't walk into leaf accessibles. return this; } //////////////////////////////////////////////////////////////////////////////// -// nsLeafAccessible: nsAccessible private +// nsLeafAccessible: Accessible private void nsLeafAccessible::CacheChildren() { // No children for leaf accessible. } //////////////////////////////////////////////////////////////////////////////// // nsLinkableAccessible //////////////////////////////////////////////////////////////////////////////// nsLinkableAccessible:: nsLinkableAccessible(nsIContent* aContent, DocAccessible* aDoc) : - nsAccessibleWrap(aContent, aDoc), + AccessibleWrap(aContent, aDoc), mActionAcc(nsnull), mIsLink(false), mIsOnclick(false) { } -NS_IMPL_ISUPPORTS_INHERITED0(nsLinkableAccessible, nsAccessibleWrap) +NS_IMPL_ISUPPORTS_INHERITED0(nsLinkableAccessible, AccessibleWrap) //////////////////////////////////////////////////////////////////////////////// // nsLinkableAccessible. nsIAccessible NS_IMETHODIMP nsLinkableAccessible::TakeFocus() { - return mActionAcc ? mActionAcc->TakeFocus() : nsAccessibleWrap::TakeFocus(); + return mActionAcc ? mActionAcc->TakeFocus() : AccessibleWrap::TakeFocus(); } PRUint64 nsLinkableAccessible::NativeLinkState() const { if (mIsLink) return states::LINKED | (mActionAcc->LinkState() & states::TRAVERSED); return 0; } void nsLinkableAccessible::Value(nsString& aValue) { aValue.Truncate(); - nsAccessible::Value(aValue); + Accessible::Value(aValue); if (!aValue.IsEmpty()) return; if (aValue.IsEmpty() && mIsLink) mActionAcc->Value(aValue); } @@ -129,36 +129,36 @@ nsLinkableAccessible::GetActionName(PRUi NS_IMETHODIMP nsLinkableAccessible::DoAction(PRUint8 aIndex) { if (aIndex != eAction_Jump) return NS_ERROR_INVALID_ARG; return mActionAcc ? mActionAcc->DoAction(aIndex) : - nsAccessibleWrap::DoAction(aIndex); + AccessibleWrap::DoAction(aIndex); } KeyBinding nsLinkableAccessible::AccessKey() const { return mActionAcc ? - mActionAcc->AccessKey() : nsAccessible::AccessKey(); + mActionAcc->AccessKey() : Accessible::AccessKey(); } //////////////////////////////////////////////////////////////////////////////// // nsLinkableAccessible. nsAccessNode void nsLinkableAccessible::Shutdown() { mIsLink = false; mIsOnclick = false; mActionAcc = nsnull; - nsAccessibleWrap::Shutdown(); + AccessibleWrap::Shutdown(); } //////////////////////////////////////////////////////////////////////////////// // nsLinkableAccessible: HyperLinkAccessible already_AddRefed<nsIURI> nsLinkableAccessible::AnchorURIAt(PRUint32 aAnchorIndex) { @@ -169,38 +169,38 @@ nsLinkableAccessible::AnchorURIAt(PRUint if (mActionAcc->IsLink()) return mActionAcc->AnchorURIAt(aAnchorIndex); } return nsnull; } //////////////////////////////////////////////////////////////////////////////// -// nsLinkableAccessible: nsAccessible protected +// nsLinkableAccessible: Accessible protected void -nsLinkableAccessible::BindToParent(nsAccessible* aParent, +nsLinkableAccessible::BindToParent(Accessible* aParent, PRUint32 aIndexInParent) { - nsAccessibleWrap::BindToParent(aParent, aIndexInParent); + AccessibleWrap::BindToParent(aParent, aIndexInParent); // Cache action content. mActionAcc = nsnull; mIsLink = false; mIsOnclick = false; if (nsCoreUtils::HasClickListener(mContent)) { mIsOnclick = true; return; } // XXX: The logic looks broken since the click listener may be registered // on non accessible node in parent chain but this node is skipped when tree // is traversed. - nsAccessible* walkUpAcc = this; + Accessible* walkUpAcc = this; while ((walkUpAcc = walkUpAcc->Parent()) && !walkUpAcc->IsDoc()) { if (walkUpAcc->LinkState() & states::LINKED) { mIsLink = true; mActionAcc = walkUpAcc; return; } if (nsCoreUtils::HasClickListener(walkUpAcc->GetContent())) { @@ -213,29 +213,29 @@ nsLinkableAccessible::BindToParent(nsAcc void nsLinkableAccessible::UnbindFromParent() { mActionAcc = nsnull; mIsLink = false; mIsOnclick = false; - nsAccessibleWrap::UnbindFromParent(); + AccessibleWrap::UnbindFromParent(); } //////////////////////////////////////////////////////////////////////////////// // nsEnumRoleAccessible //////////////////////////////////////////////////////////////////////////////// nsEnumRoleAccessible:: nsEnumRoleAccessible(nsIContent* aNode, DocAccessible* aDoc, roles::Role aRole) : - nsAccessibleWrap(aNode, aDoc), mRole(aRole) + AccessibleWrap(aNode, aDoc), mRole(aRole) { } -NS_IMPL_ISUPPORTS_INHERITED0(nsEnumRoleAccessible, nsAccessible) +NS_IMPL_ISUPPORTS_INHERITED0(nsEnumRoleAccessible, Accessible) role nsEnumRoleAccessible::NativeRole() { return mRole; }
--- a/accessible/src/base/nsBaseWidgetAccessible.h +++ b/accessible/src/base/nsBaseWidgetAccessible.h @@ -1,107 +1,107 @@ /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _nsBaseWidgetAccessible_H_ #define _nsBaseWidgetAccessible_H_ -#include "nsAccessibleWrap.h" +#include "AccessibleWrap.h" #include "nsHyperTextAccessibleWrap.h" #include "nsIContent.h" /** * This file contains a number of classes that are used as base * classes for the different accessibility implementations of * the HTML and XUL widget sets. --jgaunt */ /** * Leaf version of DOM Accessible -- has no children */ -class nsLeafAccessible : public nsAccessibleWrap +class nsLeafAccessible : public AccessibleWrap { public: nsLeafAccessible(nsIContent* aContent, DocAccessible* aDoc); // nsISupports NS_DECL_ISUPPORTS_INHERITED - // nsAccessible - virtual nsAccessible* ChildAtPoint(PRInt32 aX, PRInt32 aY, - EWhichChildAtPoint aWhichChild); + // Accessible + virtual Accessible* ChildAtPoint(PRInt32 aX, PRInt32 aY, + EWhichChildAtPoint aWhichChild); protected: - // nsAccessible + // Accessible virtual void CacheChildren(); }; /** * Used for text or image accessible nodes contained by link accessibles or * accessibles for nodes with registered click event handler. It knows how to * report the state of the host link (traveled or not) and can activate (click) * the host accessible programmatically. */ -class nsLinkableAccessible : public nsAccessibleWrap +class nsLinkableAccessible : public AccessibleWrap { public: enum { eAction_Jump = 0 }; nsLinkableAccessible(nsIContent* aContent, DocAccessible* aDoc); NS_DECL_ISUPPORTS_INHERITED // nsIAccessible NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName); NS_IMETHOD DoAction(PRUint8 index); NS_IMETHOD TakeFocus(); // nsAccessNode virtual void Shutdown(); - // nsAccessible + // Accessible virtual void Value(nsString& aValue); virtual PRUint64 NativeLinkState() const; // ActionAccessible virtual PRUint8 ActionCount(); virtual KeyBinding AccessKey() const; // HyperLinkAccessible virtual already_AddRefed<nsIURI> AnchorURIAt(PRUint32 aAnchorIndex); protected: - // nsAccessible - virtual void BindToParent(nsAccessible* aParent, PRUint32 aIndexInParent); + // Accessible + virtual void BindToParent(Accessible* aParent, PRUint32 aIndexInParent); virtual void UnbindFromParent(); /** * Parent accessible that provides an action for this linkable accessible. */ - nsAccessible* mActionAcc; + Accessible* mActionAcc; bool mIsLink; bool mIsOnclick; }; /** * A simple accessible that gets its enumerated role passed into constructor. */ -class nsEnumRoleAccessible : public nsAccessibleWrap +class nsEnumRoleAccessible : public AccessibleWrap { public: nsEnumRoleAccessible(nsIContent* aContent, DocAccessible* aDoc, mozilla::a11y::role aRole); virtual ~nsEnumRoleAccessible() { } NS_DECL_ISUPPORTS_INHERITED - // nsAccessible + // Accessible virtual mozilla::a11y::role NativeRole(); protected: mozilla::a11y::role mRole; }; #endif
--- a/accessible/src/base/nsCoreUtils.cpp +++ b/accessible/src/base/nsCoreUtils.cpp @@ -717,23 +717,23 @@ nsAccessibleDOMStringList::Item(PRUint32 SetDOMStringToNull(aResult); else aResult = mNames.ElementAt(aIndex); return NS_OK; } NS_IMETHODIMP -nsAccessibleDOMStringList::GetLength(PRUint32 *aLength) +nsAccessibleDOMStringList::GetLength(PRUint32* aLength) { *aLength = mNames.Length(); return NS_OK; } NS_IMETHODIMP -nsAccessibleDOMStringList::Contains(const nsAString& aString, bool *aResult) +nsAccessibleDOMStringList::Contains(const nsAString& aString, bool* aResult) { *aResult = mNames.Contains(aString); return NS_OK; }
--- a/accessible/src/base/nsEventShell.cpp +++ b/accessible/src/base/nsEventShell.cpp @@ -12,32 +12,32 @@ //////////////////////////////////////////////////////////////////////////////// void nsEventShell::FireEvent(AccEvent* aEvent) { if (!aEvent) return; - nsAccessible *accessible = aEvent->GetAccessible(); + Accessible* accessible = aEvent->GetAccessible(); NS_ENSURE_TRUE(accessible,); nsINode* node = aEvent->GetNode(); if (node) { sEventTargetNode = node; sEventFromUserInput = aEvent->IsFromUserInput(); } accessible->HandleAccEvent(aEvent); sEventTargetNode = nsnull; } void -nsEventShell::FireEvent(PRUint32 aEventType, nsAccessible *aAccessible, +nsEventShell::FireEvent(PRUint32 aEventType, Accessible* aAccessible, EIsFromUserInput aIsFromUserInput) { NS_ENSURE_TRUE(aAccessible,); nsRefPtr<AccEvent> event = new AccEvent(aEventType, aAccessible, aIsFromUserInput); FireEvent(event);
--- a/accessible/src/base/nsEventShell.h +++ b/accessible/src/base/nsEventShell.h @@ -23,17 +23,17 @@ public: static void FireEvent(AccEvent* aEvent); /** * Fire accessible event of the given type for the given accessible. * * @param aEventType [in] the event type * @param aAccessible [in] the event target */ - static void FireEvent(PRUint32 aEventType, nsAccessible *aAccessible, + static void FireEvent(PRUint32 aEventType, Accessible* aAccessible, EIsFromUserInput aIsFromUserInput = eAutoDetect); /** * Append 'event-from-input' object attribute if the accessible event has * been fired just now for the given node. * * @param aNode [in] the DOM node * @param aAttributes [in, out] the attributes
--- a/accessible/src/base/nsTextEquivUtils.cpp +++ b/accessible/src/base/nsTextEquivUtils.cpp @@ -20,17 +20,17 @@ using namespace mozilla::a11y; #define NS_OK_NO_NAME_CLAUSE_HANDLED \ NS_ERROR_GENERATE_SUCCESS(NS_ERROR_MODULE_GENERAL, 0x24) //////////////////////////////////////////////////////////////////////////////// // nsTextEquivUtils. Public. nsresult -nsTextEquivUtils::GetNameFromSubtree(nsAccessible *aAccessible, +nsTextEquivUtils::GetNameFromSubtree(Accessible* aAccessible, nsAString& aName) { aName.Truncate(); if (gInitiatorAcc) return NS_OK; gInitiatorAcc = aAccessible; @@ -48,17 +48,17 @@ nsTextEquivUtils::GetNameFromSubtree(nsA } gInitiatorAcc = nsnull; return NS_OK; } nsresult -nsTextEquivUtils::GetTextEquivFromIDRefs(nsAccessible *aAccessible, +nsTextEquivUtils::GetTextEquivFromIDRefs(Accessible* aAccessible, nsIAtom *aIDRefsAttr, nsAString& aTextEquiv) { aTextEquiv.Truncate(); nsIContent* content = aAccessible->GetContent(); if (!content) return NS_OK; @@ -73,17 +73,17 @@ nsTextEquivUtils::GetTextEquivFromIDRefs &aTextEquiv); NS_ENSURE_SUCCESS(rv, rv); } return NS_OK; } nsresult -nsTextEquivUtils::AppendTextEquivFromContent(nsAccessible *aInitiatorAcc, +nsTextEquivUtils::AppendTextEquivFromContent(Accessible* aInitiatorAcc, nsIContent *aContent, nsAString *aString) { // Prevent recursion which can cause infinite loops. if (gInitiatorAcc) return NS_OK; gInitiatorAcc = aInitiatorAcc; @@ -93,17 +93,17 @@ nsTextEquivUtils::AppendTextEquivFromCon // calculate the flat string. nsIFrame *frame = aContent->GetPrimaryFrame(); bool isVisible = frame && frame->GetStyleVisibility()->IsVisible(); nsresult rv = NS_ERROR_FAILURE; bool goThroughDOMSubtree = true; if (isVisible) { - nsAccessible* accessible = + Accessible* accessible = gInitiatorAcc->Document()->GetAccessible(aContent); if (accessible) { rv = AppendFromAccessible(accessible, aString); goThroughDOMSubtree = false; } } if (goThroughDOMSubtree) @@ -162,36 +162,36 @@ nsTextEquivUtils::AppendTextEquivFromTex } return NS_OK_NO_NAME_CLAUSE_HANDLED; } //////////////////////////////////////////////////////////////////////////////// // nsTextEquivUtils. Private. -nsRefPtr<nsAccessible> nsTextEquivUtils::gInitiatorAcc; +nsRefPtr<Accessible> nsTextEquivUtils::gInitiatorAcc; nsresult -nsTextEquivUtils::AppendFromAccessibleChildren(nsAccessible *aAccessible, +nsTextEquivUtils::AppendFromAccessibleChildren(Accessible* aAccessible, nsAString *aString) { nsresult rv = NS_OK_NO_NAME_CLAUSE_HANDLED; PRUint32 childCount = aAccessible->ChildCount(); for (PRUint32 childIdx = 0; childIdx < childCount; childIdx++) { - nsAccessible* child = aAccessible->GetChildAt(childIdx); + Accessible* child = aAccessible->GetChildAt(childIdx); rv = AppendFromAccessible(child, aString); NS_ENSURE_SUCCESS(rv, rv); } return rv; } nsresult -nsTextEquivUtils::AppendFromAccessible(nsAccessible *aAccessible, +nsTextEquivUtils::AppendFromAccessible(Accessible* aAccessible, nsAString *aString) { //XXX: is it necessary to care the accessible is not a document? if (aAccessible->IsContent()) { nsresult rv = AppendTextEquivFromTextContent(aAccessible->GetContent(), aString); if (rv != NS_OK_NO_NAME_CLAUSE_HANDLED) return rv; @@ -231,17 +231,17 @@ nsTextEquivUtils::AppendFromAccessible(n AppendString(aString, text); return NS_OK; } return rv; } nsresult -nsTextEquivUtils::AppendFromValue(nsAccessible *aAccessible, +nsTextEquivUtils::AppendFromValue(Accessible* aAccessible, nsAString *aString) { PRUint32 nameRule = gRoleToNameRulesMap[aAccessible->Role()]; if (nameRule != eFromValue) return NS_OK_NO_NAME_CLAUSE_HANDLED; // Implementation of step f. of text equivalent computation. If the given // accessible is not root accessible (the accessible the text equivalent is
--- a/accessible/src/base/nsTextEquivUtils.h +++ b/accessible/src/base/nsTextEquivUtils.h @@ -3,17 +3,17 @@ */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _nsTextEquivUtils_H_ #define _nsTextEquivUtils_H_ -#include "nsAccessible.h" +#include "Accessible.h" #include "nsIContent.h" #include "nsIStringBundle.h" /** * Text equivalent computation rules (see nsTextEquivUtils::gRoleToNameRulesMap) */ enum ETextEquivRule @@ -43,43 +43,43 @@ class nsTextEquivUtils public: /** * Calculates the name from accessible subtree if allowed. * * @param aAccessible [in] the given accessible * @param aName [out] accessible name */ - static nsresult GetNameFromSubtree(nsAccessible *aAccessible, + static nsresult GetNameFromSubtree(Accessible* aAccessible, nsAString& aName); /** * Calculates text equivalent for the given accessible from its IDRefs * attribute (like aria-labelledby or aria-describedby). * * @param aAccessible [in] the accessible text equivalent is computed for * @param aIDRefsAttr [in] IDRefs attribute on DOM node of the accessible * @param aTextEquiv [out] result text equivalent */ - static nsresult GetTextEquivFromIDRefs(nsAccessible *aAccessible, + static nsresult GetTextEquivFromIDRefs(Accessible* aAccessible, nsIAtom *aIDRefsAttr, nsAString& aTextEquiv); /** * Calculates the text equivalent from the given content and its subtree if * allowed and appends it to the given string. * * @param aInitiatorAcc [in] the accessible text equivalent is computed for * in the end (root accessible of text equivalent * calculation recursion) * @param aContent [in] the given content the text equivalent is * computed from * @param aString [in, out] the string */ - static nsresult AppendTextEquivFromContent(nsAccessible *aInitiatorAcc, + static nsresult AppendTextEquivFromContent(Accessible* aInitiatorAcc, nsIContent *aContent, nsAString *aString); /** * Calculates the text equivalent from the given text content (may be text * node or html:br) and appends it to the given string. * * @param aContent [in] the text content @@ -88,30 +88,30 @@ public: static nsresult AppendTextEquivFromTextContent(nsIContent *aContent, nsAString *aString); private: /** * Iterates accessible children and calculates text equivalent from each * child. */ - static nsresult AppendFromAccessibleChildren(nsAccessible *aAccessible, + static nsresult AppendFromAccessibleChildren(Accessible* aAccessible, nsAString *aString); /** * Calculates text equivalent from the given accessible and its subtree if * allowed. */ - static nsresult AppendFromAccessible(nsAccessible *aAccessible, + static nsresult AppendFromAccessible(Accessible* aAccessible, nsAString *aString); /** * Calculates text equivalent from the value of given accessible. */ - static nsresult AppendFromValue(nsAccessible *aAccessible, + static nsresult AppendFromValue(Accessible* aAccessible, nsAString *aString); /** * Iterates DOM children and calculates text equivalent from each child node. */ static nsresult AppendFromDOMChildren(nsIContent *aContent, nsAString *aString); /** @@ -144,12 +144,12 @@ private: */ static PRUint32 gRoleToNameRulesMap[]; /** * The accessible for which we are computing a text equivalent. It is useful * for bailing out during recursive text computation, or for special cases * like step f. of the ARIA implementation guide. */ - static nsRefPtr<nsAccessible> gInitiatorAcc; + static nsRefPtr<Accessible> gInitiatorAcc; }; #endif
--- a/accessible/src/generic/ARIAGridAccessible.cpp +++ b/accessible/src/generic/ARIAGridAccessible.cpp @@ -22,50 +22,50 @@ using namespace mozilla::a11y; //////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// // Constructor ARIAGridAccessible:: ARIAGridAccessible(nsIContent* aContent, DocAccessible* aDoc) : - nsAccessibleWrap(aContent, aDoc), xpcAccessibleTable(this) + AccessibleWrap(aContent, aDoc), xpcAccessibleTable(this) { } //////////////////////////////////////////////////////////////////////////////// // nsISupports NS_IMPL_ISUPPORTS_INHERITED1(ARIAGridAccessible, - nsAccessible, + Accessible, nsIAccessibleTable) //////////////////////////////////////////////////////////////////////////////// //nsAccessNode void ARIAGridAccessible::Shutdown() { mTable = nsnull; - nsAccessibleWrap::Shutdown(); + AccessibleWrap::Shutdown(); } //////////////////////////////////////////////////////////////////////////////// // nsIAccessibleTable PRUint32 ARIAGridAccessible::ColCount() { AccIterator rowIter(this, filters::GetRow); - nsAccessible* row = rowIter.Next(); + Accessible* row = rowIter.Next(); if (!row) return 0; AccIterator cellIter(row, filters::GetCell); - nsAccessible* cell = nsnull; + Accessible* cell = nsnull; PRUint32 colCount = 0; while ((cell = cellIter.Next())) colCount++; return colCount; } @@ -75,20 +75,20 @@ ARIAGridAccessible::RowCount() PRUint32 rowCount = 0; AccIterator rowIter(this, filters::GetRow); while (rowIter.Next()) rowCount++; return rowCount; } -nsAccessible* +Accessible* ARIAGridAccessible::CellAt(PRUint32 aRowIndex, PRUint32 aColumnIndex) { - nsAccessible* row = GetRowAt(aRowIndex); + Accessible* row = GetRowAt(aRowIndex); if (!row) return nsnull; return GetCellInRowAt(row, aColumnIndex); } NS_IMETHODIMP ARIAGridAccessible::GetColumnIndexAt(PRInt32 aCellIndex, @@ -233,23 +233,23 @@ ARIAGridAccessible::IsColumnSelected(PRI *aIsSelected = false; if (IsDefunct()) return NS_ERROR_FAILURE; NS_ENSURE_ARG(IsValidColumn(aColumn)); AccIterator rowIter(this, filters::GetRow); - nsAccessible *row = rowIter.Next(); + Accessible* row = rowIter.Next(); if (!row) return NS_OK; do { if (!nsAccUtils::IsARIASelected(row)) { - nsAccessible *cell = GetCellInRowAt(row, aColumn); + Accessible* cell = GetCellInRowAt(row, aColumn); if (!cell) // Do not fail due to wrong markup return NS_OK; if (!nsAccUtils::IsARIASelected(cell)) return NS_OK; } } while ((row = rowIter.Next())); @@ -261,22 +261,22 @@ NS_IMETHODIMP ARIAGridAccessible::IsRowSelected(PRInt32 aRow, bool* aIsSelected) { NS_ENSURE_ARG_POINTER(aIsSelected); *aIsSelected = false; if (IsDefunct()) return NS_ERROR_FAILURE; - nsAccessible *row = GetRowAt(aRow); + Accessible* row = GetRowAt(aRow); NS_ENSURE_ARG(row); if (!nsAccUtils::IsARIASelected(row)) { AccIterator cellIter(row, filters::GetCell); - nsAccessible *cell = nsnull; + Accessible* cell = nsnull; while ((cell = cellIter.Next())) { if (!nsAccUtils::IsARIASelected(cell)) return NS_OK; } } *aIsSelected = true; return NS_OK; @@ -287,21 +287,21 @@ ARIAGridAccessible::IsCellSelected(PRInt bool* aIsSelected) { NS_ENSURE_ARG_POINTER(aIsSelected); *aIsSelected = false; if (IsDefunct()) return NS_ERROR_FAILURE; - nsAccessible *row = GetRowAt(aRow); + Accessible* row = GetRowAt(aRow); NS_ENSURE_ARG(row); if (!nsAccUtils::IsARIASelected(row)) { - nsAccessible *cell = GetCellInRowAt(row, aColumn); + Accessible* cell = GetCellInRowAt(row, aColumn); NS_ENSURE_ARG(cell); if (!nsAccUtils::IsARIASelected(cell)) return NS_OK; } *aIsSelected = true; return NS_OK; @@ -316,25 +316,25 @@ ARIAGridAccessible::GetSelectedCellCount if (IsDefunct()) return NS_ERROR_FAILURE; PRInt32 colCount = 0; GetColumnCount(&colCount); AccIterator rowIter(this, filters::GetRow); - nsAccessible *row = nsnull; + Accessible* row = nsnull; while ((row = rowIter.Next())) { if (nsAccUtils::IsARIASelected(row)) { (*aCount) += colCount; continue; } AccIterator cellIter(row, filters::GetCell); - nsAccessible *cell = nsnull; + Accessible* cell = nsnull; while ((cell = cellIter.Next())) { if (nsAccUtils::IsARIASelected(cell)) (*aCount)++; } } return NS_OK; @@ -352,25 +352,25 @@ ARIAGridAccessible::GetSelectedRowCount( NS_ENSURE_ARG_POINTER(aCount); *aCount = 0; if (IsDefunct()) return NS_ERROR_FAILURE; AccIterator rowIter(this, filters::GetRow); - nsAccessible *row = nsnull; + Accessible* row = nsnull; while ((row = rowIter.Next())) { if (nsAccUtils::IsARIASelected(row)) { (*aCount)++; continue; } AccIterator cellIter(row, filters::GetCell); - nsAccessible *cell = cellIter.Next(); + Accessible* cell = cellIter.Next(); if (!cell) continue; bool isRowSelected = true; do { if (!nsAccUtils::IsARIASelected(cell)) { isRowSelected = false; break; @@ -395,20 +395,20 @@ ARIAGridAccessible::GetSelectedCells(nsI nsresult rv = NS_OK; nsCOMPtr<nsIMutableArray> selCells = do_CreateInstance(NS_ARRAY_CONTRACTID, &rv); NS_ENSURE_SUCCESS(rv, rv); AccIterator rowIter(this, filters::GetRow); - nsAccessible *row = nsnull; + Accessible* row = nsnull; while ((row = rowIter.Next())) { AccIterator cellIter(row, filters::GetCell); - nsAccessible *cell = nsnull; + Accessible* cell = nsnull; if (nsAccUtils::IsARIASelected(row)) { while ((cell = cellIter.Next())) selCells->AppendElement(static_cast<nsIAccessible *>(cell), false); continue; } @@ -439,27 +439,27 @@ ARIAGridAccessible::GetSelectedCellIndic PRInt32 colCount = 0; GetColumnCount(&colCount); nsTArray<PRInt32> selCells(rowCount * colCount); AccIterator rowIter(this, filters::GetRow); - nsAccessible *row = nsnull; + Accessible* row = nsnull; for (PRInt32 rowIdx = 0; (row = rowIter.Next()); rowIdx++) { if (nsAccUtils::IsARIASelected(row)) { for (PRInt32 colIdx = 0; colIdx < colCount; colIdx++) selCells.AppendElement(rowIdx * colCount + colIdx); continue; } AccIterator cellIter(row, filters::GetCell); - nsAccessible *cell = nsnull; + Accessible* cell = nsnull; for (PRInt32 colIdx = 0; (cell = cellIter.Next()); colIdx++) { if (nsAccUtils::IsARIASelected(cell)) selCells.AppendElement(rowIdx * colCount + colIdx); } } PRUint32 selCellsCount = selCells.Length(); @@ -499,25 +499,25 @@ ARIAGridAccessible::GetSelectedRowIndice GetRowCount(&rowCount); if (!rowCount) return NS_OK; nsTArray<PRInt32> selRows(rowCount); AccIterator rowIter(this, filters::GetRow); - nsAccessible *row = nsnull; + Accessible* row = nsnull; for (PRInt32 rowIdx = 0; (row = rowIter.Next()); rowIdx++) { if (nsAccUtils::IsARIASelected(row)) { selRows.AppendElement(rowIdx); continue; } AccIterator cellIter(row, filters::GetCell); - nsAccessible *cell = cellIter.Next(); + Accessible* cell = cellIter.Next(); if (!cell) continue; bool isRowSelected = true; do { if (!nsAccUtils::IsARIASelected(cell)) { isRowSelected = false; break; @@ -545,17 +545,17 @@ ARIAGridAccessible::SelectRow(PRInt32 aR { NS_ENSURE_ARG(IsValidRow(aRow)); if (IsDefunct()) return NS_ERROR_FAILURE; AccIterator rowIter(this, filters::GetRow); - nsAccessible *row = nsnull; + Accessible* row = nsnull; for (PRInt32 rowIdx = 0; (row = rowIter.Next()); rowIdx++) { nsresult rv = SetARIASelected(row, rowIdx == aRow); NS_ENSURE_SUCCESS(rv, rv); } return NS_OK; } @@ -564,50 +564,50 @@ ARIAGridAccessible::SelectColumn(PRInt32 { NS_ENSURE_ARG(IsValidColumn(aColumn)); if (IsDefunct()) return NS_ERROR_FAILURE; AccIterator rowIter(this, filters::GetRow); - nsAccessible *row = nsnull; + Accessible* row = nsnull; while ((row = rowIter.Next())) { // Unselect all cells in the row. nsresult rv = SetARIASelected(row, false); NS_ENSURE_SUCCESS(rv, rv); // Select cell at the column index. - nsAccessible *cell = GetCellInRowAt(row, aColumn); + Accessible* cell = GetCellInRowAt(row, aColumn); if (cell) { rv = SetARIASelected(cell, true); NS_ENSURE_SUCCESS(rv, rv); } } return NS_OK; } void ARIAGridAccessible::UnselectRow(PRUint32 aRowIdx) { - nsAccessible* row = GetRowAt(aRowIdx); + Accessible* row = GetRowAt(aRowIdx); if (row) SetARIASelected(row, false); } void ARIAGridAccessible::UnselectCol(PRUint32 aColIdx) { AccIterator rowIter(this, filters::GetRow); - nsAccessible* row = nsnull; + Accessible* row = nsnull; while ((row = rowIter.Next())) { - nsAccessible* cell = GetCellInRowAt(row, aColIdx); + Accessible* cell = GetCellInRowAt(row, aColIdx); if (cell) SetARIASelected(cell, false); } } //////////////////////////////////////////////////////////////////////////////// // Protected @@ -644,45 +644,45 @@ ARIAGridAccessible::IsValidRowNColumn(PR if (aRow >= rowCount) return false; PRInt32 colCount = 0; GetColumnCount(&colCount); return aColumn < colCount; } -nsAccessible* +Accessible* ARIAGridAccessible::GetRowAt(PRInt32 aRow) { PRInt32 rowIdx = aRow; AccIterator rowIter(this, filters::GetRow); - nsAccessible *row = rowIter.Next(); + Accessible* row = rowIter.Next(); while (rowIdx != 0 && (row = rowIter.Next())) rowIdx--; return row; } -nsAccessible* -ARIAGridAccessible::GetCellInRowAt(nsAccessible* aRow, PRInt32 aColumn) +Accessible* +ARIAGridAccessible::GetCellInRowAt(Accessible* aRow, PRInt32 aColumn) { PRInt32 colIdx = aColumn; AccIterator cellIter(aRow, filters::GetCell); - nsAccessible *cell = cellIter.Next(); + Accessible* cell = cellIter.Next(); while (colIdx != 0 && (cell = cellIter.Next())) colIdx--; return cell; } nsresult -ARIAGridAccessible::SetARIASelected(nsAccessible* aAccessible, +ARIAGridAccessible::SetARIASelected(Accessible* aAccessible, bool aIsSelected, bool aNotify) { nsIContent *content = aAccessible->GetContent(); NS_ENSURE_STATE(content); nsresult rv = NS_OK; if (aIsSelected) rv = content->SetAttr(kNameSpaceID_None, nsGkAtoms::aria_selected, @@ -704,39 +704,39 @@ ARIAGridAccessible::SetARIASelected(nsAc return NS_OK; roles::Role role = aAccessible->Role(); // If the given accessible is row that was unselected then remove // aria-selected from cell accessible. if (role == roles::ROW) { AccIterator cellIter(aAccessible, filters::GetCell); - nsAccessible *cell = nsnull; + Accessible* cell = nsnull; while ((cell = cellIter.Next())) { rv = SetARIASelected(cell, false, false); NS_ENSURE_SUCCESS(rv, rv); } return NS_OK; } // If the given accessible is cell that was unselected and its row is selected // then remove aria-selected from row and put aria-selected on // siblings cells. if (role == roles::GRID_CELL || role == roles::ROWHEADER || role == roles::COLUMNHEADER) { - nsAccessible* row = aAccessible->Parent(); + Accessible* row = aAccessible->Parent(); if (row && row->Role() == roles::ROW && nsAccUtils::IsARIASelected(row)) { rv = SetARIASelected(row, false, false); NS_ENSURE_SUCCESS(rv, rv); AccIterator cellIter(row, filters::GetCell); - nsAccessible *cell = nsnull; + Accessible* cell = nsnull; while ((cell = cellIter.Next())) { if (cell != aAccessible) { rv = SetARIASelected(cell, true, false); NS_ENSURE_SUCCESS(rv, rv); } } } } @@ -752,17 +752,17 @@ ARIAGridAccessible::GetSelectedColumnsAr *aColumnCount = 0; if (aColumns) *aColumns = nsnull; if (IsDefunct()) return NS_ERROR_FAILURE; AccIterator rowIter(this, filters::GetRow); - nsAccessible *row = rowIter.Next(); + Accessible* row = rowIter.Next(); if (!row) return NS_OK; PRInt32 colCount = 0; GetColumnCount(&colCount); if (!colCount) return NS_OK; @@ -775,17 +775,17 @@ ARIAGridAccessible::GetSelectedColumnsAr do { if (nsAccUtils::IsARIASelected(row)) continue; PRInt32 colIdx = 0; AccIterator cellIter(row, filters::GetCell); - nsAccessible *cell = nsnull; + Accessible* cell = nsnull; for (colIdx = 0; (cell = cellIter.Next()); colIdx++) { if (isColSelArray.SafeElementAt(colIdx, false) && !nsAccUtils::IsARIASelected(cell)) { isColSelArray[colIdx] = false; selColCount--; } } } while ((row = rowIter.Next())); @@ -837,21 +837,21 @@ NS_IMPL_ISUPPORTS_INHERITED1(ARIAGridCel // nsIAccessibleTableCell NS_IMETHODIMP ARIAGridCellAccessible::GetTable(nsIAccessibleTable** aTable) { NS_ENSURE_ARG_POINTER(aTable); *aTable = nsnull; - nsAccessible* thisRow = Parent(); + Accessible* thisRow = Parent(); if (!thisRow || thisRow->Role() != roles::ROW) return NS_OK; - nsAccessible* table = thisRow->Parent(); + Accessible* table = thisRow->Parent(); if (!table) return NS_OK; roles::Role tableRole = table->Role(); if (tableRole != roles::TABLE && tableRole != roles::TREE_TABLE) return NS_OK; CallQueryInterface(table, aTable); @@ -862,25 +862,25 @@ NS_IMETHODIMP ARIAGridCellAccessible::GetColumnIndex(PRInt32* aColumnIndex) { NS_ENSURE_ARG_POINTER(aColumnIndex); *aColumnIndex = -1; if (IsDefunct()) return NS_ERROR_FAILURE; - nsAccessible* row = Parent(); + Accessible* row = Parent(); if (!row) return NS_OK; *aColumnIndex = 0; PRInt32 indexInRow = IndexInParent(); for (PRInt32 idx = 0; idx < indexInRow; idx++) { - nsAccessible* cell = row->GetChildAt(idx); + Accessible* cell = row->GetChildAt(idx); roles::Role role = cell->Role(); if (role == roles::GRID_CELL || role == roles::ROWHEADER || role == roles::COLUMNHEADER) (*aColumnIndex)++; } return NS_OK; } @@ -889,21 +889,21 @@ NS_IMETHODIMP ARIAGridCellAccessible::GetRowIndex(PRInt32* aRowIndex) { NS_ENSURE_ARG_POINTER(aRowIndex); *aRowIndex = -1; if (IsDefunct()) return NS_ERROR_FAILURE; - nsAccessible* row = Parent(); + Accessible* row = Parent(); if (!row) return NS_OK; - nsAccessible* table = row->Parent(); + Accessible* table = row->Parent(); if (!table) return NS_OK; *aRowIndex = 0; PRInt32 indexInTable = row->IndexInParent(); for (PRInt32 idx = 0; idx < indexInTable; idx++) { row = table->GetChildAt(idx); @@ -982,41 +982,41 @@ NS_IMETHODIMP ARIAGridCellAccessible::IsSelected(bool* aIsSelected) { NS_ENSURE_ARG_POINTER(aIsSelected); *aIsSelected = false; if (IsDefunct()) return NS_ERROR_FAILURE; - nsAccessible* row = Parent(); + Accessible* row = Parent(); if (!row || row->Role() != roles::ROW) return NS_OK; if (!nsAccUtils::IsARIASelected(row) && !nsAccUtils::IsARIASelected(this)) return NS_OK; *aIsSelected = true; return NS_OK; } //////////////////////////////////////////////////////////////////////////////// -// nsAccessible +// Accessible void ARIAGridCellAccessible::ApplyARIAState(PRUint64* aState) const { nsHyperTextAccessibleWrap::ApplyARIAState(aState); // Return if the gridcell has aria-selected="true". if (*aState & states::SELECTED) return; // Check aria-selected="true" on the row. - nsAccessible* row = Parent(); + Accessible* row = Parent(); if (!row || row->Role() != roles::ROW) return; nsIContent *rowContent = row->GetContent(); if (nsAccUtils::HasDefinedARIAToken(rowContent, nsGkAtoms::aria_selected) && !rowContent->AttrValueIs(kNameSpaceID_None, nsGkAtoms::aria_selected, @@ -1030,45 +1030,45 @@ ARIAGridCellAccessible::GetAttributesInt if (IsDefunct()) return NS_ERROR_FAILURE; nsresult rv = nsHyperTextAccessibleWrap::GetAttributesInternal(aAttributes); NS_ENSURE_SUCCESS(rv, rv); // Expose "table-cell-index" attribute. - nsAccessible* thisRow = Parent(); + Accessible* thisRow = Parent(); if (!thisRow || thisRow->Role() != roles::ROW) return NS_OK; PRInt32 colIdx = 0, colCount = 0; PRUint32 childCount = thisRow->ChildCount(); for (PRUint32 childIdx = 0; childIdx < childCount; childIdx++) { - nsAccessible* child = thisRow->GetChildAt(childIdx); + Accessible* child = thisRow->GetChildAt(childIdx); if (child == this) colIdx = colCount; roles::Role role = child->Role(); if (role == roles::GRID_CELL || role == roles::ROWHEADER || role == roles::COLUMNHEADER) colCount++; } - nsAccessible* table = thisRow->Parent(); + Accessible* table = thisRow->Parent(); if (!table) return NS_OK; roles::Role tableRole = table->Role(); if (tableRole != roles::TABLE && tableRole != roles::TREE_TABLE) return NS_OK; PRInt32 rowIdx = 0; childCount = table->ChildCount(); for (PRUint32 childIdx = 0; childIdx < childCount; childIdx++) { - nsAccessible* child = table->GetChildAt(childIdx); + Accessible* child = table->GetChildAt(childIdx); if (child == thisRow) break; if (child->Role() == roles::ROW) rowIdx++; } PRInt32 idx = rowIdx * colCount + colIdx;
--- a/accessible/src/generic/ARIAGridAccessible.h +++ b/accessible/src/generic/ARIAGridAccessible.h @@ -13,40 +13,40 @@ #include "xpcAccessibleTable.h" namespace mozilla { namespace a11y { /** * Accessible for ARIA grid and treegrid. */ -class ARIAGridAccessible : public nsAccessibleWrap, +class ARIAGridAccessible : public AccessibleWrap, public xpcAccessibleTable, public nsIAccessibleTable, public TableAccessible { public: ARIAGridAccessible(nsIContent* aContent, DocAccessible* aDoc); // nsISupports NS_DECL_ISUPPORTS_INHERITED // nsIAccessibleTable NS_DECL_OR_FORWARD_NSIACCESSIBLETABLE_WITH_XPCACCESSIBLETABLE - // nsAccessible + // Accessible virtual mozilla::a11y::TableAccessible* AsTable() { return this; } // nsAccessNode virtual void Shutdown(); // TableAccessible virtual PRUint32 ColCount(); virtual PRUint32 RowCount(); - virtual nsAccessible* CellAt(PRUint32 aRowIndex, PRUint32 aColumnIndex); + virtual Accessible* CellAt(PRUint32 aRowIndex, PRUint32 aColumnIndex); virtual void UnselectCol(PRUint32 aColIdx); virtual void UnselectRow(PRUint32 aRowIdx); protected: /** * Return true if the given row index is valid. */ bool IsValidRow(PRInt32 aRow); @@ -59,32 +59,32 @@ protected: /** * Retrun true if given row and column indexes are valid. */ bool IsValidRowNColumn(PRInt32 aRow, PRInt32 aColumn); /** * Return row accessible at the given row index. */ - nsAccessible *GetRowAt(PRInt32 aRow); + Accessible* GetRowAt(PRInt32 aRow); /** * Return cell accessible at the given column index in the row. */ - nsAccessible *GetCellInRowAt(nsAccessible *aRow, PRInt32 aColumn); + Accessible* GetCellInRowAt(Accessible* aRow, PRInt32 aColumn); /** * Set aria-selected attribute value on DOM node of the given accessible. * * @param aAccessible [in] accessible * @param aIsSelected [in] new value of aria-selected attribute * @param aNotify [in, optional] specifies if DOM should be notified * about attribute change (used internally). */ - nsresult SetARIASelected(nsAccessible *aAccessible, bool aIsSelected, + nsresult SetARIASelected(Accessible* aAccessible, bool aIsSelected, bool aNotify = true); /** * Helper method for GetSelectedColumnCount and GetSelectedColumns. */ nsresult GetSelectedColumnsArray(PRUint32 *acolumnCount, PRInt32 **aColumns = nsnull); }; @@ -100,17 +100,17 @@ public: ARIAGridCellAccessible(nsIContent* aContent, DocAccessible* aDoc); // nsISupports NS_DECL_ISUPPORTS_INHERITED // nsIAccessibleTableCell NS_DECL_NSIACCESSIBLETABLECELL - // nsAccessible + // Accessible virtual void ApplyARIAState(PRUint64* aState) const; virtual nsresult GetAttributesInternal(nsIPersistentProperties *aAttributes); }; } // namespace a11y } // namespace mozilla #endif
--- a/accessible/src/generic/Accessible-inl.h +++ b/accessible/src/generic/Accessible-inl.h @@ -2,30 +2,30 @@ /* vim: set ts=2 et sw=2 tw=80: */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef mozilla_a11y_Accessible_inl_h_ #define mozilla_a11y_Accessible_inl_h_ -#include "nsAccessible.h" +#include "Accessible.h" #include "nsARIAMap.h" inline mozilla::a11y::role -nsAccessible::Role() +Accessible::Role() { if (!mRoleMapEntry || mRoleMapEntry->roleRule != kUseMapRole) return ARIATransformRole(NativeRole()); return ARIATransformRole(mRoleMapEntry->role); } inline mozilla::a11y::role -nsAccessible::ARIARole() +Accessible::ARIARole() { if (!mRoleMapEntry || mRoleMapEntry->roleRule != kUseMapRole) return mozilla::a11y::roles::NOTHING; return ARIATransformRole(mRoleMapEntry->role); } #endif
rename from accessible/src/base/nsAccessible.cpp rename to accessible/src/generic/Accessible.cpp --- a/accessible/src/base/nsAccessible.cpp +++ b/accessible/src/generic/Accessible.cpp @@ -75,58 +75,59 @@ #include "mozilla/Preferences.h" #include "mozilla/dom/Element.h" using namespace mozilla; using namespace mozilla::a11y; //////////////////////////////////////////////////////////////////////////////// -// nsAccessible. nsISupports - -NS_IMPL_CYCLE_COLLECTION_CLASS(nsAccessible) - -NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(nsAccessible, nsAccessNode) +// Accessible. nsISupports + +NS_IMPL_CYCLE_COLLECTION_CLASS(Accessible) + +NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(Accessible, nsAccessNode) NS_CYCLE_COLLECTION_NOTE_EDGE_NAME(cb, "mParent"); cb.NoteXPCOMChild(static_cast<nsIAccessible*>(tmp->mParent.get())); PRUint32 i, length = tmp->mChildren.Length(); for (i = 0; i < length; ++i) { NS_CYCLE_COLLECTION_NOTE_EDGE_NAME(cb, "mChildren[i]"); cb.NoteXPCOMChild(static_cast<nsIAccessible*>(tmp->mChildren[i].get())); } NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END -NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(nsAccessible, nsAccessNode) +NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(Accessible, nsAccessNode) NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMPTR(mParent) NS_IMPL_CYCLE_COLLECTION_UNLINK_NSTARRAY(mChildren) NS_IMPL_CYCLE_COLLECTION_UNLINK_END -NS_IMPL_ADDREF_INHERITED(nsAccessible, nsAccessNode) -NS_IMPL_RELEASE_INHERITED(nsAccessible, nsAccessNode) - -nsresult nsAccessible::QueryInterface(REFNSIID aIID, void** aInstancePtr) +NS_IMPL_ADDREF_INHERITED(Accessible, nsAccessNode) +NS_IMPL_RELEASE_INHERITED(Accessible, nsAccessNode) + +nsresult +Accessible::QueryInterface(REFNSIID aIID, void** aInstancePtr) { // Custom-built QueryInterface() knows when we support nsIAccessibleSelectable // based on role attribute and aria-multiselectable *aInstancePtr = nsnull; if (aIID.Equals(NS_GET_IID(nsXPCOMCycleCollectionParticipant))) { - *aInstancePtr = &NS_CYCLE_COLLECTION_NAME(nsAccessible); + *aInstancePtr = &NS_CYCLE_COLLECTION_NAME(Accessible); return NS_OK; } if (aIID.Equals(NS_GET_IID(nsIAccessible))) { *aInstancePtr = static_cast<nsIAccessible*>(this); NS_ADDREF_THIS(); return NS_OK; } - if (aIID.Equals(NS_GET_IID(nsAccessible))) { - *aInstancePtr = static_cast<nsAccessible*>(this); + if (aIID.Equals(NS_GET_IID(Accessible))) { + *aInstancePtr = static_cast<Accessible*>(this); NS_ADDREF_THIS(); return NS_OK; } if (aIID.Equals(NS_GET_IID(nsIAccessibleSelectable))) { if (IsSelect()) { *aInstancePtr = static_cast<nsIAccessibleSelectable*>(this); NS_ADDREF_THIS(); @@ -150,17 +151,17 @@ nsresult nsAccessible::QueryInterface(RE return NS_OK; } return NS_ERROR_NO_INTERFACE; } return nsAccessNodeWrap::QueryInterface(aIID, aInstancePtr); } -nsAccessible::nsAccessible(nsIContent* aContent, DocAccessible* aDoc) : +Accessible::Accessible(nsIContent* aContent, DocAccessible* aDoc) : nsAccessNodeWrap(aContent, aDoc), mParent(nsnull), mIndexInParent(-1), mFlags(eChildrenUninitialized), mIndexOfEmbeddedChild(-1), mRoleMapEntry(nsnull) { #ifdef NS_DEBUG_X { nsCOMPtr<nsIPresShell> shell(do_QueryReferent(aShell)); printf(">>> %p Created Acc - DOM: %p PS: %p", @@ -178,81 +179,81 @@ nsAccessible::nsAccessible(nsIContent* a printf("\n"); } #endif } //----------------------------------------------------- // destruction //----------------------------------------------------- -nsAccessible::~nsAccessible() +Accessible::~Accessible() { } void -nsAccessible::SetRoleMapEntry(nsRoleMapEntry* aRoleMapEntry) +Accessible::SetRoleMapEntry(nsRoleMapEntry* aRoleMapEntry) { mRoleMapEntry = aRoleMapEntry; } NS_IMETHODIMP -nsAccessible::GetDocument(nsIAccessibleDocument **aDocument) +Accessible::GetDocument(nsIAccessibleDocument** aDocument) { NS_ENSURE_ARG_POINTER(aDocument); NS_IF_ADDREF(*aDocument = Document()); return NS_OK; } NS_IMETHODIMP -nsAccessible::GetDOMNode(nsIDOMNode **aDOMNode) +Accessible::GetDOMNode(nsIDOMNode** aDOMNode) { NS_ENSURE_ARG_POINTER(aDOMNode); *aDOMNode = nsnull; nsINode *node = GetNode(); if (node) CallQueryInterface(node, aDOMNode); return NS_OK; } NS_IMETHODIMP -nsAccessible::GetRootDocument(nsIAccessibleDocument **aRootDocument) +Accessible::GetRootDocument(nsIAccessibleDocument** aRootDocument) { NS_ENSURE_ARG_POINTER(aRootDocument); NS_IF_ADDREF(*aRootDocument = RootAccessible()); return NS_OK; } NS_IMETHODIMP -nsAccessible::GetLanguage(nsAString& aLanguage) +Accessible::GetLanguage(nsAString& aLanguage) { Language(aLanguage); return NS_OK; } NS_IMETHODIMP -nsAccessible::GetName(nsAString& aName) +Accessible::GetName(nsAString& aName) { aName.Truncate(); if (IsDefunct()) return NS_ERROR_FAILURE; nsAutoString name; Name(name); aName.Assign(name); return NS_OK; } ENameValueFlag -nsAccessible::Name(nsString& aName) +Accessible::Name(nsString& aName) { aName.Truncate(); GetARIAName(aName); if (!aName.IsEmpty()) return eNameOK; nsCOMPtr<nsIXBLAccessible> xblAccessible(do_QueryInterface(mContent)); @@ -283,30 +284,30 @@ nsAccessible::Name(nsString& aName) if (rv != NS_OK_EMPTY_NAME) aName.SetIsVoid(true); return eNameOK; } NS_IMETHODIMP -nsAccessible::GetDescription(nsAString& aDescription) +Accessible::GetDescription(nsAString& aDescription) { if (IsDefunct()) return NS_ERROR_FAILURE; nsAutoString desc; Description(desc); aDescription.Assign(desc); return NS_OK; } void -nsAccessible::Description(nsString& aDescription) +Accessible::Description(nsString& aDescription) { // There are 4 conditions that make an accessible have no accDescription: // 1. it's a text node; or // 2. It has no DHTML describedby property // 3. it doesn't have an accName; or // 4. its title attribute already equals to its accName nsAutoString name; if (mContent->IsNodeOfType(nsINode::eTEXT)) @@ -316,17 +317,17 @@ nsAccessible::Description(nsString& aDes GetTextEquivFromIDRefs(this, nsGkAtoms::aria_describedby, aDescription); if (aDescription.IsEmpty()) { bool isXUL = mContent->IsXUL(); if (isXUL) { // Try XUL <description control="[id]">description text</description> XULDescriptionIterator iter(Document(), mContent); - nsAccessible* descr = nsnull; + Accessible* descr = nsnull; while ((descr = iter.Next())) nsTextEquivUtils::AppendTextEquivFromContent(this, descr->GetContent(), &aDescription); } if (aDescription.IsEmpty()) { nsIAtom *descAtom = isXUL ? nsGkAtoms::tooltiptext : nsGkAtoms::title; @@ -339,33 +340,33 @@ nsAccessible::Description(nsString& aDes aDescription.Truncate(); } } } aDescription.CompressWhitespace(); } NS_IMETHODIMP -nsAccessible::GetKeyboardShortcut(nsAString& aAccessKey) +Accessible::GetKeyboardShortcut(nsAString& aAccessKey) { aAccessKey.Truncate(); if (IsDefunct()) return NS_ERROR_FAILURE; AccessKey().ToString(aAccessKey); return NS_OK; } KeyBinding -nsAccessible::AccessKey() const +Accessible::AccessKey() const { PRUint32 key = nsCoreUtils::GetAccessKeyFor(mContent); if (!key && mContent->IsElement()) { - nsAccessible* label = nsnull; + Accessible* label = nsnull; // Copy access key from label node. if (mContent->IsHTML()) { // Unless it is labeled via an ancestor <label>, in which case that would // be redundant. HTMLLabelIterator iter(Document(), this, HTMLLabelIterator::eSkipAncestorLabel); label = iter.Next(); @@ -420,115 +421,115 @@ nsAccessible::AccessKey() const rv = Preferences::GetInt("ui.key.contentAccess", &modifierMask); break; } return NS_SUCCEEDED(rv) ? KeyBinding(key, modifierMask) : KeyBinding(); } KeyBinding -nsAccessible::KeyboardShortcut() const +Accessible::KeyboardShortcut() const { return KeyBinding(); } NS_IMETHODIMP -nsAccessible::GetParent(nsIAccessible **aParent) +Accessible::GetParent(nsIAccessible** aParent) { NS_ENSURE_ARG_POINTER(aParent); if (IsDefunct()) return NS_ERROR_FAILURE; NS_IF_ADDREF(*aParent = Parent()); return *aParent ? NS_OK : NS_ERROR_FAILURE; } /* readonly attribute nsIAccessible nextSibling; */ NS_IMETHODIMP -nsAccessible::GetNextSibling(nsIAccessible **aNextSibling) +Accessible::GetNextSibling(nsIAccessible** aNextSibling) { NS_ENSURE_ARG_POINTER(aNextSibling); *aNextSibling = nsnull; if (IsDefunct()) return NS_ERROR_FAILURE; nsresult rv = NS_OK; NS_IF_ADDREF(*aNextSibling = GetSiblingAtOffset(1, &rv)); return rv; } /* readonly attribute nsIAccessible previousSibling; */ NS_IMETHODIMP -nsAccessible::GetPreviousSibling(nsIAccessible * *aPreviousSibling) +Accessible::GetPreviousSibling(nsIAccessible ** aPreviousSibling) { NS_ENSURE_ARG_POINTER(aPreviousSibling); *aPreviousSibling = nsnull; if (IsDefunct()) return NS_ERROR_FAILURE; nsresult rv = NS_OK; NS_IF_ADDREF(*aPreviousSibling = GetSiblingAtOffset(-1, &rv)); return rv; } /* readonly attribute nsIAccessible firstChild; */ NS_IMETHODIMP -nsAccessible::GetFirstChild(nsIAccessible **aFirstChild) +Accessible::GetFirstChild(nsIAccessible** aFirstChild) { NS_ENSURE_ARG_POINTER(aFirstChild); *aFirstChild = nsnull; if (IsDefunct()) return NS_ERROR_FAILURE; NS_IF_ADDREF(*aFirstChild = FirstChild()); return NS_OK; } /* readonly attribute nsIAccessible lastChild; */ NS_IMETHODIMP -nsAccessible::GetLastChild(nsIAccessible **aLastChild) +Accessible::GetLastChild(nsIAccessible** aLastChild) { NS_ENSURE_ARG_POINTER(aLastChild); *aLastChild = nsnull; if (IsDefunct()) return NS_ERROR_FAILURE; NS_IF_ADDREF(*aLastChild = LastChild()); return NS_OK; } NS_IMETHODIMP -nsAccessible::GetChildAt(PRInt32 aChildIndex, nsIAccessible **aChild) +Accessible::GetChildAt(PRInt32 aChildIndex, nsIAccessible** aChild) { NS_ENSURE_ARG_POINTER(aChild); *aChild = nsnull; if (IsDefunct()) return NS_ERROR_FAILURE; // If child index is negative, then return last child. // XXX: do we really need this? if (aChildIndex < 0) aChildIndex = ChildCount() - 1; - nsAccessible* child = GetChildAt(aChildIndex); + Accessible* child = GetChildAt(aChildIndex); if (!child) return NS_ERROR_INVALID_ARG; NS_ADDREF(*aChild = child); return NS_OK; } // readonly attribute nsIArray children; NS_IMETHODIMP -nsAccessible::GetChildren(nsIArray **aOutChildren) +Accessible::GetChildren(nsIArray** aOutChildren) { NS_ENSURE_ARG_POINTER(aOutChildren); *aOutChildren = nsnull; if (IsDefunct()) return NS_ERROR_FAILURE; nsresult rv = NS_OK; @@ -542,46 +543,46 @@ nsAccessible::GetChildren(nsIArray **aOu children->AppendElement(child, false); } NS_ADDREF(*aOutChildren = children); return NS_OK; } bool -nsAccessible::CanHaveAnonChildren() +Accessible::CanHaveAnonChildren() { return true; } /* readonly attribute long childCount; */ NS_IMETHODIMP -nsAccessible::GetChildCount(PRInt32 *aChildCount) +Accessible::GetChildCount(PRInt32* aChildCount) { NS_ENSURE_ARG_POINTER(aChildCount); if (IsDefunct()) return NS_ERROR_FAILURE; *aChildCount = ChildCount(); return NS_OK; } /* readonly attribute long indexInParent; */ NS_IMETHODIMP -nsAccessible::GetIndexInParent(PRInt32 *aIndexInParent) +Accessible::GetIndexInParent(PRInt32* aIndexInParent) { NS_ENSURE_ARG_POINTER(aIndexInParent); *aIndexInParent = IndexInParent(); return *aIndexInParent != -1 ? NS_OK : NS_ERROR_FAILURE; } void -nsAccessible::TranslateString(const nsString& aKey, nsAString& aStringOut) +Accessible::TranslateString(const nsString& aKey, nsAString& aStringOut) { nsCOMPtr<nsIStringBundleService> stringBundleService = services::GetStringBundleService(); if (!stringBundleService) return; nsCOMPtr<nsIStringBundle> stringBundle; stringBundleService->CreateBundle( @@ -592,17 +593,17 @@ nsAccessible::TranslateString(const nsSt nsXPIDLString xsValue; nsresult rv = stringBundle->GetStringFromName(aKey.get(), getter_Copies(xsValue)); if (NS_SUCCEEDED(rv)) aStringOut.Assign(xsValue); } PRUint64 -nsAccessible::VisibilityState() +Accessible::VisibilityState() { PRUint64 vstates = states::INVISIBLE | states::OFFSCREEN; nsIFrame* frame = GetFrame(); if (!frame) return vstates; nsIPresShell* shell(mDoc->PresShell()); @@ -639,17 +640,17 @@ nsAccessible::VisibilityState() if (!frame->IsVisibleConsideringAncestors(nsIFrame::VISIBILITY_CROSS_CHROME_CONTENT_BOUNDARY)) return vstates; // Assume we are visible enough. return vstates &= ~states::INVISIBLE; } PRUint64 -nsAccessible::NativeState() +Accessible::NativeState() { PRUint64 state = 0; DocAccessible* document = Document(); if (!document || !document->IsInDocument(this)) state |= states::STALE; bool disabled = false; @@ -699,58 +700,57 @@ nsAccessible::NativeState() if (!mRoleMapEntry || mRoleMapEntry->roleRule == kUseNativeRole || mRoleMapEntry->role == roles::LINK) state |= NativeLinkState(); return state; } PRUint64 -nsAccessible::NativeLinkState() const +Accessible::NativeLinkState() const { // Expose linked state for simple xlink. return nsCoreUtils::IsXLink(mContent) ? states::LINKED : 0; } /* readonly attribute boolean focusedChild; */ NS_IMETHODIMP -nsAccessible::GetFocusedChild(nsIAccessible** aChild) +Accessible::GetFocusedChild(nsIAccessible** aChild) { NS_ENSURE_ARG_POINTER(aChild); *aChild = nsnull; if (IsDefunct()) return NS_ERROR_FAILURE; NS_IF_ADDREF(*aChild = FocusedChild()); return NS_OK; } -nsAccessible* -nsAccessible::FocusedChild() +Accessible* +Accessible::FocusedChild() { - nsAccessible* focus = FocusMgr()->FocusedAccessible(); + Accessible* focus = FocusMgr()->FocusedAccessible(); if (focus && (focus == this || focus->Parent() == this)) return focus; return nsnull; } -// nsAccessible::ChildAtPoint() -nsAccessible* -nsAccessible::ChildAtPoint(PRInt32 aX, PRInt32 aY, - EWhichChildAtPoint aWhichChild) +Accessible* +Accessible::ChildAtPoint(PRInt32 aX, PRInt32 aY, + EWhichChildAtPoint aWhichChild) { // If we can't find the point in a child, we will return the fallback answer: // we return |this| if the point is within it, otherwise nsnull. PRInt32 x = 0, y = 0, width = 0, height = 0; nsresult rv = GetBounds(&x, &y, &width, &height); NS_ENSURE_SUCCESS(rv, nsnull); - nsAccessible* fallbackAnswer = nsnull; + Accessible* fallbackAnswer = nsnull; if (aX >= x && aX < x + width && aY >= y && aY < y + height) fallbackAnswer = this; if (nsAccUtils::MustPrune(this)) // Do not dig any further return fallbackAnswer; // Search an accessible at the given point starting from accessible document // because containing block (see CSS2) for out of flow element (for example, @@ -782,29 +782,29 @@ nsAccessible::ChildAtPoint(PRInt32 aX, P DocAccessible* contentDocAcc = GetAccService()-> GetDocAccessible(content->OwnerDoc()); // contentDocAcc in some circumstances can be NULL. See bug 729861 NS_ASSERTION(contentDocAcc, "could not get the document accessible"); if (!contentDocAcc) return fallbackAnswer; - nsAccessible* accessible = contentDocAcc->GetAccessibleOrContainer(content); + Accessible* accessible = contentDocAcc->GetAccessibleOrContainer(content); if (!accessible) return fallbackAnswer; if (accessible == this) { // Manually walk through accessible children and see if the are within this // point. Skip offscreen or invisible accessibles. This takes care of cases // where layout won't walk into things for us, such as image map areas and // sub documents (XXX: subdocuments should be handled by methods of // OuterDocAccessibles). PRUint32 childCount = ChildCount(); for (PRUint32 childIdx = 0; childIdx < childCount; childIdx++) { - nsAccessible* child = GetChildAt(childIdx); + Accessible* child = GetChildAt(childIdx); PRInt32 childX, childY, childWidth, childHeight; child->GetBounds(&childX, &childY, &childWidth, &childHeight); if (aX >= childX && aX < childX + childWidth && aY >= childY && aY < childY + childHeight && (child->State() & states::INVISIBLE) == 0) { if (aWhichChild == eDeepestChild) @@ -816,19 +816,19 @@ nsAccessible::ChildAtPoint(PRInt32 aX, P // The point is in this accessible but not in a child. We are allowed to // return |this| as the answer. return accessible; } // Since DOM node of obtained accessible may be out of flow then we should // ensure obtained accessible is a child of this accessible. - nsAccessible* child = accessible; + Accessible* child = accessible; while (true) { - nsAccessible* parent = child->Parent(); + Accessible* parent = child->Parent(); if (!parent) { // Reached the top of the hierarchy. These bounds were inside an // accessible that is not a descendant of this one. return fallbackAnswer; } if (parent == this) return aWhichChild == eDeepestChild ? accessible : child; @@ -836,45 +836,46 @@ nsAccessible::ChildAtPoint(PRInt32 aX, P child = parent; } return nsnull; } // nsIAccessible getChildAtPoint(in long x, in long y) NS_IMETHODIMP -nsAccessible::GetChildAtPoint(PRInt32 aX, PRInt32 aY, - nsIAccessible **aAccessible) +Accessible::GetChildAtPoint(PRInt32 aX, PRInt32 aY, + nsIAccessible** aAccessible) { NS_ENSURE_ARG_POINTER(aAccessible); *aAccessible = nsnull; if (IsDefunct()) return NS_ERROR_FAILURE; NS_IF_ADDREF(*aAccessible = ChildAtPoint(aX, aY, eDirectChild)); return NS_OK; } // nsIAccessible getDeepestChildAtPoint(in long x, in long y) NS_IMETHODIMP -nsAccessible::GetDeepestChildAtPoint(PRInt32 aX, PRInt32 aY, - nsIAccessible **aAccessible) +Accessible::GetDeepestChildAtPoint(PRInt32 aX, PRInt32 aY, + nsIAccessible** aAccessible) { NS_ENSURE_ARG_POINTER(aAccessible); *aAccessible = nsnull; if (IsDefunct()) return NS_ERROR_FAILURE; NS_IF_ADDREF(*aAccessible = ChildAtPoint(aX, aY, eDeepestChild)); return NS_OK; } -void nsAccessible::GetBoundsRect(nsRect& aTotalBounds, nsIFrame** aBoundingFrame) +void +Accessible::GetBoundsRect(nsRect& aTotalBounds, nsIFrame** aBoundingFrame) { /* * This method is used to determine the bounds of a content node. * Because HTML wraps and links are not always rectangular, this * method uses the following algorithm: * * 1) Start with an empty rectangle * 2) Add the rect for the primary frame from for the DOM node. @@ -951,18 +952,18 @@ void nsAccessible::GetBoundsRect(nsRect& if (depth == 0) iterContent = iterFrame->GetContent(); } } /* void getBounds (out long x, out long y, out long width, out long height); */ NS_IMETHODIMP -nsAccessible::GetBounds(PRInt32* aX, PRInt32* aY, - PRInt32* aWidth, PRInt32* aHeight) +Accessible::GetBounds(PRInt32* aX, PRInt32* aY, + PRInt32* aWidth, PRInt32* aHeight) { NS_ENSURE_ARG_POINTER(aX); *aX = 0; NS_ENSURE_ARG_POINTER(aY); *aY = 0; NS_ENSURE_ARG_POINTER(aWidth); *aWidth = 0; NS_ENSURE_ARG_POINTER(aHeight); @@ -994,22 +995,23 @@ nsAccessible::GetBounds(PRInt32* aX, PRI nsIntRect orgRectPixels = boundingFrame->GetScreenRectInAppUnits(). ToNearestPixels(presContext->AppUnitsPerDevPixel()); *aX += orgRectPixels.x; *aY += orgRectPixels.y; return NS_OK; } -NS_IMETHODIMP nsAccessible::SetSelected(bool aSelect) +NS_IMETHODIMP +Accessible::SetSelected(bool aSelect) { if (IsDefunct()) return NS_ERROR_FAILURE; - nsAccessible* select = nsAccUtils::GetSelectableContainer(this, State()); + Accessible* select = nsAccUtils::GetSelectableContainer(this, State()); if (select) { if (select->State() & states::MULTISELECTABLE) { if (mRoleMapEntry) { if (aSelect) { return mContent->SetAttr(kNameSpaceID_None, nsGkAtoms::aria_selected, NS_LITERAL_STRING("true"), true); } @@ -1021,46 +1023,47 @@ NS_IMETHODIMP nsAccessible::SetSelected( } return aSelect ? TakeFocus() : NS_ERROR_FAILURE; } return NS_OK; } -NS_IMETHODIMP nsAccessible::TakeSelection() +NS_IMETHODIMP +Accessible::TakeSelection() { if (IsDefunct()) return NS_ERROR_FAILURE; - nsAccessible* select = nsAccUtils::GetSelectableContainer(this, State()); + Accessible* select = nsAccUtils::GetSelectableContainer(this, State()); if (select) { if (select->State() & states::MULTISELECTABLE) select->ClearSelection(); return SetSelected(true); } return NS_ERROR_FAILURE; } NS_IMETHODIMP -nsAccessible::TakeFocus() +Accessible::TakeFocus() { if (IsDefunct()) return NS_ERROR_FAILURE; nsIFrame *frame = GetFrame(); NS_ENSURE_STATE(frame); nsIContent* focusContent = mContent; // If the accessible focus is managed by container widget then focus the // widget and set the accessible as its current item. if (!frame->IsFocusable()) { - nsAccessible* widget = ContainerWidget(); + Accessible* widget = ContainerWidget(); if (widget && widget->AreItemsOperable()) { nsIContent* widgetElm = widget->GetContent(); nsIFrame* widgetFrame = widgetElm->GetPrimaryFrame(); if (widgetFrame && widgetFrame->IsFocusable()) { focusContent = widgetElm; widget->SetCurrentItem(this); } } @@ -1070,21 +1073,21 @@ nsAccessible::TakeFocus() nsFocusManager* fm = nsFocusManager::GetFocusManager(); if (fm) fm->SetFocus(element, 0); return NS_OK; } nsresult -nsAccessible::GetHTMLName(nsAString& aLabel) +Accessible::GetHTMLName(nsAString& aLabel) { nsAutoString label; - nsAccessible* labelAcc = nsnull; + Accessible* labelAcc = nsnull; HTMLLabelIterator iter(Document(), this); while ((labelAcc = iter.Next())) { nsresult rv = nsTextEquivUtils:: AppendTextEquivFromContent(this, labelAcc->GetContent(), &label); NS_ENSURE_SUCCESS(rv, rv); label.CompressWhitespace(); } @@ -1104,17 +1107,17 @@ nsAccessible::GetHTMLName(nsAString& aLa * 3 - non-child label contains control="controlID" * - label has either value="foo" or children * Once a label is found, the search is discontinued, so a control * that has a label child as well as having a label external to * the control that uses the control="controlID" syntax will use * the child label for its Name. */ nsresult -nsAccessible::GetXULName(nsAString& aLabel) +Accessible::GetXULName(nsAString& aLabel) { // CASE #1 (via label attribute) -- great majority of the cases nsresult rv = NS_OK; nsAutoString label; nsCOMPtr<nsIDOMXULLabeledControlElement> labeledEl(do_QueryInterface(mContent)); if (labeledEl) { rv = labeledEl->GetLabel(label); @@ -1136,17 +1139,17 @@ nsAccessible::GetXULName(nsAString& aLab } } } // CASES #2 and #3 ------ label as a child or <label control="id" ... > </label> if (NS_FAILED(rv) || label.IsEmpty()) { label.Truncate(); - nsAccessible* labelAcc = nsnull; + Accessible* labelAcc = nsnull; XULLabelIterator iter(Document(), mContent); while ((labelAcc = iter.Next())) { nsCOMPtr<nsIDOMXULLabelElement> xulLabel = do_QueryInterface(labelAcc->GetContent()); // Check if label's value attribute is used if (xulLabel && NS_SUCCEEDED(xulLabel->GetValue(label)) && label.IsEmpty()) { // If no value attribute, a non-empty label must contain // children that define its text -- possibly using HTML @@ -1176,17 +1179,17 @@ nsAccessible::GetXULName(nsAString& aLab } parent = parent->GetParent(); } return nsTextEquivUtils::GetNameFromSubtree(this, aLabel); } nsresult -nsAccessible::HandleAccEvent(AccEvent* aEvent) +Accessible::HandleAccEvent(AccEvent* aEvent) { NS_ENSURE_ARG_POINTER(aEvent); nsCOMPtr<nsIObserverService> obsService = mozilla::services::GetObserverService(); NS_ENSURE_TRUE(obsService, NS_ERROR_FAILURE); nsCOMPtr<nsISimpleEnumerator> observers; @@ -1201,30 +1204,30 @@ nsAccessible::HandleAccEvent(AccEvent* a nsRefPtr<nsAccEvent> evnt(aEvent->CreateXPCOMObject()); return obsService->NotifyObservers(evnt, NS_ACCESSIBLE_EVENT_TOPIC, nsnull); } return NS_OK; } NS_IMETHODIMP -nsAccessible::GetRole(PRUint32 *aRole) +Accessible::GetRole(PRUint32 *aRole) { NS_ENSURE_ARG_POINTER(aRole); *aRole = nsIAccessibleRole::ROLE_NOTHING; if (IsDefunct()) return NS_ERROR_FAILURE; *aRole = Role(); return NS_OK; } NS_IMETHODIMP -nsAccessible::GetAttributes(nsIPersistentProperties **aAttributes) +Accessible::GetAttributes(nsIPersistentProperties **aAttributes) { NS_ENSURE_ARG_POINTER(aAttributes); // In/out param. Created if necessary. if (IsDefunct()) return NS_ERROR_FAILURE; nsCOMPtr<nsIPersistentProperties> attributes = *aAttributes; if (!attributes) { @@ -1302,17 +1305,17 @@ nsAccessible::GetAttributes(nsIPersisten nsAccUtils::SetAccAttr(attributes, nsGkAtoms::live, live); } } return NS_OK; } nsresult -nsAccessible::GetAttributesInternal(nsIPersistentProperties *aAttributes) +Accessible::GetAttributesInternal(nsIPersistentProperties *aAttributes) { // If the accessible isn't primary for its node (such as list item bullet or // xul tree item then don't calculate content based attributes. if (!IsPrimaryForNode()) return NS_OK; // Attributes set by this method will not be used to override attributes on a sub-document accessible // when there is a <frame>/<iframe> element that spawned the sub-document @@ -1415,19 +1418,19 @@ nsAccessible::GetAttributesInternal(nsIP // Expose 'margin-bottom' attribute. styleInfo.MarginBottom(value); nsAccUtils::SetAccAttr(aAttributes, nsGkAtoms::marginBottom, value); return NS_OK; } NS_IMETHODIMP -nsAccessible::GroupPosition(PRInt32 *aGroupLevel, - PRInt32 *aSimilarItemsInGroup, - PRInt32 *aPositionInGroup) +Accessible::GroupPosition(PRInt32* aGroupLevel, + PRInt32* aSimilarItemsInGroup, + PRInt32* aPositionInGroup) { NS_ENSURE_ARG_POINTER(aGroupLevel); *aGroupLevel = 0; NS_ENSURE_ARG_POINTER(aSimilarItemsInGroup); *aSimilarItemsInGroup = 0; NS_ENSURE_ARG_POINTER(aPositionInGroup); @@ -1468,26 +1471,26 @@ nsAccessible::GroupPosition(PRInt32 *aGr *aSimilarItemsInGroup = setSize; } } return NS_OK; } NS_IMETHODIMP -nsAccessible::GetState(PRUint32* aState, PRUint32* aExtraState) +Accessible::GetState(PRUint32* aState, PRUint32* aExtraState) { NS_ENSURE_ARG_POINTER(aState); nsAccUtils::To32States(State(), aState, aExtraState); return NS_OK; } PRUint64 -nsAccessible::State() +Accessible::State() { if (IsDefunct()) return states::DEFUNCT; PRUint64 state = NativeState(); // Apply ARIA states to be sure accessible states will be overridden. ApplyARIAState(&state); @@ -1501,25 +1504,25 @@ nsAccessible::State() // Special case for tabs: focused tab or focus inside related tab panel // implies selected state. if (mRoleMapEntry->role == roles::PAGETAB) { if (state & states::FOCUSED) { state |= states::SELECTED; } else { // If focus is in a child of the tab panel surely the tab is selected! Relation rel = RelationByType(nsIAccessibleRelation::RELATION_LABEL_FOR); - nsAccessible* relTarget = nsnull; + Accessible* relTarget = nsnull; while ((relTarget = rel.Next())) { if (relTarget->Role() == roles::PROPERTYPAGE && FocusMgr()->IsFocusWithin(relTarget)) state |= states::SELECTED; } } } else if (state & states::FOCUSED) { - nsAccessible* container = nsAccUtils::GetSelectableContainer(this, state); + Accessible* container = nsAccUtils::GetSelectableContainer(this, state); if (container && !nsAccUtils::HasDefinedARIAToken(container->GetContent(), nsGkAtoms::aria_multiselectable)) { state |= states::SELECTED; } } } @@ -1535,17 +1538,17 @@ nsAccessible::State() if (!(state & states::UNAVAILABLE)) { state |= states::ENABLED | states::SENSITIVE; // If the object is a current item of container widget then mark it as // ACTIVE. This allows screen reader virtual buffer modes to know which // descendant is the current one that would get focus if the user navigates // to the container widget. - nsAccessible* widget = ContainerWidget(); + Accessible* widget = ContainerWidget(); if (widget && widget->CurrentItem() == this) state |= states::ACTIVE; } if ((state & states::COLLAPSED) || (state & states::EXPANDED)) state |= states::EXPANDABLE; // For some reasons DOM node may have not a frame. We tract such accessibles @@ -1570,17 +1573,17 @@ nsAccessible::State() state |= states::HORIZONTAL; } } return state; } void -nsAccessible::ApplyARIAState(PRUint64* aState) const +Accessible::ApplyARIAState(PRUint64* aState) const { if (!mContent->IsElement()) return; dom::Element* element = mContent->AsElement(); // Test for universal states first *aState |= nsARIAMap::UniversalStatesFor(element); @@ -1625,30 +1628,30 @@ nsAccessible::ApplyARIAState(PRUint64* a *aState |= mRoleMapEntry->state; if (aria::MapToState(mRoleMapEntry->attributeMap1, element, aState) && aria::MapToState(mRoleMapEntry->attributeMap2, element, aState)) aria::MapToState(mRoleMapEntry->attributeMap3, element, aState); } NS_IMETHODIMP -nsAccessible::GetValue(nsAString& aValue) +Accessible::GetValue(nsAString& aValue) { if (IsDefunct()) return NS_ERROR_FAILURE; nsAutoString value; Value(value); aValue.Assign(value); return NS_OK; } void -nsAccessible::Value(nsString& aValue) +Accessible::Value(nsString& aValue) { if (mRoleMapEntry) { if (mRoleMapEntry->valueRule == eNoValue) return; // aria-valuenow is a number, and aria-valuetext is the optional text equivalent // For the string value, we will try the optional text equivalent first if (!mContent->GetAttr(kNameSpaceID_None, @@ -1663,45 +1666,45 @@ nsAccessible::Value(nsString& aValue) // Check if it's a simple xlink. if (nsCoreUtils::IsXLink(mContent)) nsContentUtils::GetLinkLocation(mContent->AsElement(), aValue); } // nsIAccessibleValue NS_IMETHODIMP -nsAccessible::GetMaximumValue(double *aMaximumValue) +Accessible::GetMaximumValue(double *aMaximumValue) { return GetAttrValue(nsGkAtoms::aria_valuemax, aMaximumValue); } NS_IMETHODIMP -nsAccessible::GetMinimumValue(double *aMinimumValue) +Accessible::GetMinimumValue(double *aMinimumValue) { return GetAttrValue(nsGkAtoms::aria_valuemin, aMinimumValue); } NS_IMETHODIMP -nsAccessible::GetMinimumIncrement(double *aMinIncrement) +Accessible::GetMinimumIncrement(double *aMinIncrement) { NS_ENSURE_ARG_POINTER(aMinIncrement); *aMinIncrement = 0; // No mimimum increment in dynamic content spec right now return NS_OK_NO_ARIA_VALUE; } NS_IMETHODIMP -nsAccessible::GetCurrentValue(double *aValue) +Accessible::GetCurrentValue(double *aValue) { return GetAttrValue(nsGkAtoms::aria_valuenow, aValue); } NS_IMETHODIMP -nsAccessible::SetCurrentValue(double aValue) +Accessible::SetCurrentValue(double aValue) { if (IsDefunct()) return NS_ERROR_FAILURE; if (!mRoleMapEntry || mRoleMapEntry->valueRule == eNoValue) return NS_OK_NO_ARIA_VALUE; const PRUint32 kValueCannotChange = states::READONLY | states::UNAVAILABLE; @@ -1719,55 +1722,56 @@ nsAccessible::SetCurrentValue(double aVa nsAutoString newValue; newValue.AppendFloat(aValue); return mContent->SetAttr(kNameSpaceID_None, nsGkAtoms::aria_valuenow, newValue, true); } /* void setName (in DOMString name); */ -NS_IMETHODIMP nsAccessible::SetName(const nsAString& name) +NS_IMETHODIMP +Accessible::SetName(const nsAString& aName) { return NS_ERROR_NOT_IMPLEMENTED; } NS_IMETHODIMP -nsAccessible::GetDefaultKeyBinding(nsAString& aKeyBinding) +Accessible::GetDefaultKeyBinding(nsAString& aKeyBinding) { aKeyBinding.Truncate(); if (IsDefunct()) return NS_ERROR_FAILURE; KeyboardShortcut().ToString(aKeyBinding); return NS_OK; } NS_IMETHODIMP -nsAccessible::GetKeyBindings(PRUint8 aActionIndex, - nsIDOMDOMStringList **aKeyBindings) +Accessible::GetKeyBindings(PRUint8 aActionIndex, + nsIDOMDOMStringList** aKeyBindings) { // Currently we support only unique key binding on element for default action. NS_ENSURE_TRUE(aActionIndex == 0, NS_ERROR_INVALID_ARG); - nsAccessibleDOMStringList *keyBindings = new nsAccessibleDOMStringList(); + nsAccessibleDOMStringList* keyBindings = new nsAccessibleDOMStringList(); NS_ENSURE_TRUE(keyBindings, NS_ERROR_OUT_OF_MEMORY); nsAutoString defaultKey; nsresult rv = GetDefaultKeyBinding(defaultKey); NS_ENSURE_SUCCESS(rv, rv); if (!defaultKey.IsEmpty()) keyBindings->Add(defaultKey); NS_ADDREF(*aKeyBindings = keyBindings); return NS_OK; } role -nsAccessible::ARIATransformRole(role aRole) +Accessible::ARIATransformRole(role aRole) { // XXX: these unfortunate exceptions don't fit into the ARIA table. This is // where the accessible role depends on both the role and ARIA state. if (aRole == roles::PUSHBUTTON) { if (nsAccUtils::HasDefinedARIAToken(mContent, nsGkAtoms::aria_pressed)) { // For simplicity, any existing pressed attribute except "" or "undefined" // indicates a toggle. return roles::TOGGLE_BUTTON; @@ -1783,58 +1787,58 @@ nsAccessible::ARIATransformRole(role aRo } else if (aRole == roles::LISTBOX) { // A listbox inside of a combobox needs a special role because of ATK // mapping to menu. if (mParent && mParent->Role() == roles::COMBOBOX) { return roles::COMBOBOX_LIST; Relation rel = RelationByType(nsIAccessibleRelation::RELATION_NODE_CHILD_OF); - nsAccessible* targetAcc = nsnull; + Accessible* targetAcc = nsnull; while ((targetAcc = rel.Next())) if (targetAcc->Role() == roles::COMBOBOX) return roles::COMBOBOX_LIST; } } else if (aRole == roles::OPTION) { if (mParent && mParent->Role() == roles::COMBOBOX_LIST) return roles::COMBOBOX_OPTION; } return aRole; } role -nsAccessible::NativeRole() +Accessible::NativeRole() { return nsCoreUtils::IsXLink(mContent) ? roles::LINK : roles::NOTHING; } // readonly attribute PRUint8 actionCount NS_IMETHODIMP -nsAccessible::GetActionCount(PRUint8* aActionCount) +Accessible::GetActionCount(PRUint8* aActionCount) { NS_ENSURE_ARG_POINTER(aActionCount); *aActionCount = 0; if (IsDefunct()) return NS_ERROR_FAILURE; *aActionCount = ActionCount(); return NS_OK; } PRUint8 -nsAccessible::ActionCount() +Accessible::ActionCount() { return GetActionRule(State()) == eNoAction ? 0 : 1; } /* DOMString getAccActionName (in PRUint8 index); */ NS_IMETHODIMP -nsAccessible::GetActionName(PRUint8 aIndex, nsAString& aName) +Accessible::GetActionName(PRUint8 aIndex, nsAString& aName) { aName.Truncate(); if (aIndex != 0) return NS_ERROR_INVALID_ARG; if (IsDefunct()) return NS_ERROR_FAILURE; @@ -1895,79 +1899,79 @@ nsAccessible::GetActionName(PRUint8 aInd return NS_OK; } return NS_ERROR_INVALID_ARG; } // AString getActionDescription(in PRUint8 index) NS_IMETHODIMP -nsAccessible::GetActionDescription(PRUint8 aIndex, nsAString& aDescription) +Accessible::GetActionDescription(PRUint8 aIndex, nsAString& aDescription) { // default to localized action name. nsAutoString name; nsresult rv = GetActionName(aIndex, name); NS_ENSURE_SUCCESS(rv, rv); TranslateString(name, aDescription); return NS_OK; } // void doAction(in PRUint8 index) NS_IMETHODIMP -nsAccessible::DoAction(PRUint8 aIndex) +Accessible::DoAction(PRUint8 aIndex) { if (aIndex != 0) return NS_ERROR_INVALID_ARG; if (IsDefunct()) return NS_ERROR_FAILURE; if (GetActionRule(State()) != eNoAction) { DoCommand(); return NS_OK; } return NS_ERROR_INVALID_ARG; } /* DOMString getHelp (); */ -NS_IMETHODIMP nsAccessible::GetHelp(nsAString& _retval) +NS_IMETHODIMP Accessible::GetHelp(nsAString& _retval) { return NS_ERROR_NOT_IMPLEMENTED; } nsIContent* -nsAccessible::GetAtomicRegion() const +Accessible::GetAtomicRegion() const { nsIContent *loopContent = mContent; nsAutoString atomic; while (loopContent && !loopContent->GetAttr(kNameSpaceID_None, nsGkAtoms::aria_atomic, atomic)) loopContent = loopContent->GetParent(); return atomic.EqualsLiteral("true") ? loopContent : nsnull; } // nsIAccessible getRelationByType() NS_IMETHODIMP -nsAccessible::GetRelationByType(PRUint32 aType, +Accessible::GetRelationByType(PRUint32 aType, nsIAccessibleRelation** aRelation) { NS_ENSURE_ARG_POINTER(aRelation); *aRelation = nsnull; if (IsDefunct()) return NS_ERROR_FAILURE; Relation rel = RelationByType(aType); NS_ADDREF(*aRelation = new nsAccessibleRelation(aType, &rel)); return *aRelation ? NS_OK : NS_ERROR_FAILURE; } Relation -nsAccessible::RelationByType(PRUint32 aType) +Accessible::RelationByType(PRUint32 aType) { // Relationships are defined on the same content node that the role would be // defined on. switch (aType) { case nsIAccessibleRelation::RELATION_LABEL_FOR: { Relation rel(new RelatedAccIterator(Document(), mContent, nsGkAtoms::aria_labelledby)); if (mContent->Tag() == nsGkAtoms::label) @@ -2113,17 +2117,17 @@ nsAccessible::RelationByType(PRUint32 aT case nsIAccessibleRelation::RELATION_POPUP_FOR: case nsIAccessibleRelation::RELATION_PARENT_WINDOW_OF: default: return Relation(); } } NS_IMETHODIMP -nsAccessible::GetRelations(nsIArray **aRelations) +Accessible::GetRelations(nsIArray **aRelations) { NS_ENSURE_ARG_POINTER(aRelations); *aRelations = nsnull; if (IsDefunct()) return NS_ERROR_FAILURE; nsCOMPtr<nsIMutableArray> relations = do_CreateInstance(NS_ARRAY_CONTRACTID); @@ -2144,38 +2148,38 @@ nsAccessible::GetRelations(nsIArray **aR } } NS_ADDREF(*aRelations = relations); return NS_OK; } /* void extendSelection (); */ -NS_IMETHODIMP nsAccessible::ExtendSelection() +NS_IMETHODIMP Accessible::ExtendSelection() { // XXX Should be implemented, but not high priority return NS_ERROR_NOT_IMPLEMENTED; } /* [noscript] void getNativeInterface(out voidPtr aOutAccessible); */ -NS_IMETHODIMP nsAccessible::GetNativeInterface(void **aOutAccessible) +NS_IMETHODIMP Accessible::GetNativeInterface(void **aOutAccessible) { return NS_ERROR_NOT_IMPLEMENTED; } void -nsAccessible::DoCommand(nsIContent *aContent, PRUint32 aActionIndex) +Accessible::DoCommand(nsIContent *aContent, PRUint32 aActionIndex) { nsIContent* content = aContent ? aContent : mContent.get(); NS_DISPATCH_RUNNABLEMETHOD_ARG2(DispatchClickEvent, this, content, aActionIndex); } void -nsAccessible::DispatchClickEvent(nsIContent *aContent, PRUint32 aActionIndex) +Accessible::DispatchClickEvent(nsIContent *aContent, PRUint32 aActionIndex) { if (IsDefunct()) return; nsIPresShell* presShell = mDoc->PresShell(); // Scroll into view. presShell->ScrollContentIntoView(aContent, @@ -2188,27 +2192,27 @@ nsAccessible::DispatchClickEvent(nsICont aContent); if (!res) return; nsCoreUtils::DispatchMouseEvent(NS_MOUSE_BUTTON_UP, presShell, aContent); } NS_IMETHODIMP -nsAccessible::ScrollTo(PRUint32 aHow) +Accessible::ScrollTo(PRUint32 aHow) { if (IsDefunct()) return NS_ERROR_FAILURE; nsCoreUtils::ScrollTo(mDoc->PresShell(), mContent, aHow); return NS_OK; } NS_IMETHODIMP -nsAccessible::ScrollToPoint(PRUint32 aCoordinateType, PRInt32 aX, PRInt32 aY) +Accessible::ScrollToPoint(PRUint32 aCoordinateType, PRInt32 aX, PRInt32 aY) { nsIFrame *frame = GetFrame(); if (!frame) return NS_ERROR_FAILURE; nsIntPoint coords; nsresult rv = nsAccUtils::ConvertToScreenCoords(aX, aY, aCoordinateType, this, &coords); @@ -2217,17 +2221,18 @@ nsAccessible::ScrollToPoint(PRUint32 aCo nsIFrame *parentFrame = frame; while ((parentFrame = parentFrame->GetParent())) nsCoreUtils::ScrollFrameToPoint(parentFrame, frame, coords); return NS_OK; } // nsIAccessibleSelectable -NS_IMETHODIMP nsAccessible::GetSelectedChildren(nsIArray **aSelectedAccessibles) +NS_IMETHODIMP +Accessible::GetSelectedChildren(nsIArray** aSelectedAccessibles) { NS_ENSURE_ARG_POINTER(aSelectedAccessibles); *aSelectedAccessibles = nsnull; if (IsDefunct() || !IsSelect()) return NS_ERROR_FAILURE; nsCOMPtr<nsIArray> items = SelectedItems(); @@ -2237,17 +2242,18 @@ NS_IMETHODIMP nsAccessible::GetSelectedC if (length) items.swap(*aSelectedAccessibles); } return NS_OK; } // return the nth selected descendant nsIAccessible object -NS_IMETHODIMP nsAccessible::RefSelection(PRInt32 aIndex, nsIAccessible **aSelected) +NS_IMETHODIMP +Accessible::RefSelection(PRInt32 aIndex, nsIAccessible** aSelected) { NS_ENSURE_ARG_POINTER(aSelected); *aSelected = nsnull; if (IsDefunct() || !IsSelect()) return NS_ERROR_FAILURE; if (aIndex < 0) { @@ -2258,72 +2264,73 @@ NS_IMETHODIMP nsAccessible::RefSelection if (*aSelected) { NS_ADDREF(*aSelected); return NS_OK; } return NS_ERROR_INVALID_ARG; } -NS_IMETHODIMP nsAccessible::GetSelectionCount(PRInt32 *aSelectionCount) +NS_IMETHODIMP +Accessible::GetSelectionCount(PRInt32* aSelectionCount) { NS_ENSURE_ARG_POINTER(aSelectionCount); *aSelectionCount = 0; if (IsDefunct() || !IsSelect()) return NS_ERROR_FAILURE; *aSelectionCount = SelectedItemCount(); return NS_OK; } -NS_IMETHODIMP nsAccessible::AddChildToSelection(PRInt32 aIndex) +NS_IMETHODIMP Accessible::AddChildToSelection(PRInt32 aIndex) { if (IsDefunct() || !IsSelect()) return NS_ERROR_FAILURE; return aIndex >= 0 && AddItemToSelection(aIndex) ? NS_OK : NS_ERROR_INVALID_ARG; } -NS_IMETHODIMP nsAccessible::RemoveChildFromSelection(PRInt32 aIndex) +NS_IMETHODIMP Accessible::RemoveChildFromSelection(PRInt32 aIndex) { if (IsDefunct() || !IsSelect()) return NS_ERROR_FAILURE; return aIndex >=0 && RemoveItemFromSelection(aIndex) ? NS_OK : NS_ERROR_INVALID_ARG; } -NS_IMETHODIMP nsAccessible::IsChildSelected(PRInt32 aIndex, bool *aIsSelected) +NS_IMETHODIMP Accessible::IsChildSelected(PRInt32 aIndex, bool *aIsSelected) { NS_ENSURE_ARG_POINTER(aIsSelected); *aIsSelected = false; if (IsDefunct() || !IsSelect()) return NS_ERROR_FAILURE; NS_ENSURE_TRUE(aIndex >= 0, NS_ERROR_FAILURE); *aIsSelected = IsItemSelected(aIndex); return NS_OK; } NS_IMETHODIMP -nsAccessible::ClearSelection() +Accessible::ClearSelection() { if (IsDefunct() || !IsSelect()) return NS_ERROR_FAILURE; UnselectAll(); return NS_OK; } NS_IMETHODIMP -nsAccessible::SelectAllSelection(bool* aIsMultiSelect) +Accessible::SelectAllSelection(bool* aIsMultiSelect) { NS_ENSURE_ARG_POINTER(aIsMultiSelect); *aIsMultiSelect = false; if (IsDefunct() || !IsSelect()) return NS_ERROR_FAILURE; *aIsMultiSelect = SelectAll(); @@ -2332,120 +2339,120 @@ nsAccessible::SelectAllSelection(bool* a // nsIAccessibleHyperLink // Because of new-atk design, any embedded object in text can implement // nsIAccessibleHyperLink, which helps determine where it is located // within containing text // readonly attribute long nsIAccessibleHyperLink::anchorCount NS_IMETHODIMP -nsAccessible::GetAnchorCount(PRInt32 *aAnchorCount) +Accessible::GetAnchorCount(PRInt32 *aAnchorCount) { NS_ENSURE_ARG_POINTER(aAnchorCount); *aAnchorCount = 0; if (IsDefunct()) return NS_ERROR_FAILURE; *aAnchorCount = AnchorCount(); return NS_OK; } // readonly attribute long nsIAccessibleHyperLink::startIndex NS_IMETHODIMP -nsAccessible::GetStartIndex(PRInt32 *aStartIndex) +Accessible::GetStartIndex(PRInt32 *aStartIndex) { NS_ENSURE_ARG_POINTER(aStartIndex); *aStartIndex = 0; if (IsDefunct()) return NS_ERROR_FAILURE; *aStartIndex = StartOffset(); return NS_OK; } // readonly attribute long nsIAccessibleHyperLink::endIndex NS_IMETHODIMP -nsAccessible::GetEndIndex(PRInt32 *aEndIndex) +Accessible::GetEndIndex(PRInt32 *aEndIndex) { NS_ENSURE_ARG_POINTER(aEndIndex); *aEndIndex = 0; if (IsDefunct()) return NS_ERROR_FAILURE; *aEndIndex = EndOffset(); return NS_OK; } NS_IMETHODIMP -nsAccessible::GetURI(PRInt32 aIndex, nsIURI **aURI) +Accessible::GetURI(PRInt32 aIndex, nsIURI **aURI) { NS_ENSURE_ARG_POINTER(aURI); if (IsDefunct()) return NS_ERROR_FAILURE; if (aIndex < 0 || aIndex >= static_cast<PRInt32>(AnchorCount())) return NS_ERROR_INVALID_ARG; nsRefPtr<nsIURI>(AnchorURIAt(aIndex)).forget(aURI); return NS_OK; } NS_IMETHODIMP -nsAccessible::GetAnchor(PRInt32 aIndex, nsIAccessible** aAccessible) +Accessible::GetAnchor(PRInt32 aIndex, nsIAccessible** aAccessible) { NS_ENSURE_ARG_POINTER(aAccessible); *aAccessible = nsnull; if (IsDefunct()) return NS_ERROR_FAILURE; if (aIndex < 0 || aIndex >= static_cast<PRInt32>(AnchorCount())) return NS_ERROR_INVALID_ARG; NS_IF_ADDREF(*aAccessible = AnchorAt(aIndex)); return NS_OK; } // readonly attribute boolean nsIAccessibleHyperLink::valid NS_IMETHODIMP -nsAccessible::GetValid(bool *aValid) +Accessible::GetValid(bool *aValid) { NS_ENSURE_ARG_POINTER(aValid); *aValid = false; if (IsDefunct()) return NS_ERROR_FAILURE; *aValid = IsLinkValid(); return NS_OK; } // readonly attribute boolean nsIAccessibleHyperLink::selected NS_IMETHODIMP -nsAccessible::GetSelected(bool *aSelected) +Accessible::GetSelected(bool *aSelected) { NS_ENSURE_ARG_POINTER(aSelected); *aSelected = false; if (IsDefunct()) return NS_ERROR_FAILURE; *aSelected = IsLinkSelected(); return NS_OK; } void -nsAccessible::AppendTextTo(nsAString& aText, PRUint32 aStartOffset, - PRUint32 aLength) +Accessible::AppendTextTo(nsAString& aText, PRUint32 aStartOffset, + PRUint32 aLength) { // Return text representation of non-text accessible within hypertext // accessible. Text accessible overrides this method to return enclosed text. if (aStartOffset != 0 || aLength == 0) return; nsIFrame *frame = GetFrame(); if (!frame) @@ -2462,34 +2469,34 @@ nsAccessible::AppendTextTo(nsAString& aT aText += kEmbeddedObjectChar; } } //////////////////////////////////////////////////////////////////////////////// // nsAccessNode public methods void -nsAccessible::Shutdown() +Accessible::Shutdown() { // Mark the accessible as defunct, invalidate the child count and pointers to // other accessibles, also make sure none of its children point to this parent mFlags |= eIsDefunct; InvalidateChildren(); if (mParent) mParent->RemoveChild(this); nsAccessNodeWrap::Shutdown(); } //////////////////////////////////////////////////////////////////////////////// -// nsAccessible public methods +// Accessible public methods nsresult -nsAccessible::GetARIAName(nsAString& aName) +Accessible::GetARIAName(nsAString& aName) { nsAutoString label; // aria-labelledby now takes precedence over aria-label nsresult rv = nsTextEquivUtils:: GetTextEquivFromIDRefs(this, nsGkAtoms::aria_labelledby, label); if (NS_SUCCEEDED(rv)) { label.CompressWhitespace(); @@ -2502,30 +2509,30 @@ nsAccessible::GetARIAName(nsAString& aNa label.CompressWhitespace(); aName = label; } return NS_OK; } nsresult -nsAccessible::GetNameInternal(nsAString& aName) +Accessible::GetNameInternal(nsAString& aName) { if (mContent->IsHTML()) return GetHTMLName(aName); if (mContent->IsXUL()) return GetXULName(aName); return NS_OK; } -// nsAccessible protected +// Accessible protected void -nsAccessible::BindToParent(nsAccessible* aParent, PRUint32 aIndexInParent) +Accessible::BindToParent(Accessible* aParent, PRUint32 aIndexInParent) { NS_PRECONDITION(aParent, "This method isn't used to set null parent!"); if (mParent) { if (mParent != aParent) { NS_ERROR("Adopting child!"); mParent->RemoveChild(this); } else { @@ -2534,56 +2541,56 @@ nsAccessible::BindToParent(nsAccessible* } } mParent = aParent; mIndexInParent = aIndexInParent; } void -nsAccessible::UnbindFromParent() +Accessible::UnbindFromParent() { mParent = nsnull; mIndexInParent = -1; mIndexOfEmbeddedChild = -1; mGroupInfo = nsnull; } void -nsAccessible::InvalidateChildren() +Accessible::InvalidateChildren() { PRInt32 childCount = mChildren.Length(); for (PRInt32 childIdx = 0; childIdx < childCount; childIdx++) { - nsAccessible* child = mChildren.ElementAt(childIdx); + Accessible* child = mChildren.ElementAt(childIdx); child->UnbindFromParent(); } mEmbeddedObjCollector = nsnull; mChildren.Clear(); SetChildrenFlag(eChildrenUninitialized); } bool -nsAccessible::AppendChild(nsAccessible* aChild) +Accessible::AppendChild(Accessible* aChild) { if (!aChild) return false; if (!mChildren.AppendElement(aChild)) return false; if (!nsAccUtils::IsEmbeddedObject(aChild)) SetChildrenFlag(eMixedChildren); aChild->BindToParent(this, mChildren.Length() - 1); return true; } bool -nsAccessible::InsertChildAt(PRUint32 aIndex, nsAccessible* aChild) +Accessible::InsertChildAt(PRUint32 aIndex, Accessible* aChild) { if (!aChild) return false; if (!mChildren.InsertElementAt(aIndex, aChild)) return false; for (PRUint32 idx = aIndex + 1; idx < mChildren.Length(); idx++) { @@ -2596,17 +2603,17 @@ nsAccessible::InsertChildAt(PRUint32 aIn mEmbeddedObjCollector = nsnull; aChild->BindToParent(this, aIndex); return true; } bool -nsAccessible::RemoveChild(nsAccessible* aChild) +Accessible::RemoveChild(Accessible* aChild) { if (!aChild) return false; if (aChild->mParent != this || aChild->mIndexInParent == -1) return false; PRUint32 index = static_cast<PRUint32>(aChild->mIndexInParent); @@ -2623,141 +2630,141 @@ nsAccessible::RemoveChild(nsAccessible* aChild->UnbindFromParent(); mChildren.RemoveElementAt(index); mEmbeddedObjCollector = nsnull; return true; } -nsAccessible* -nsAccessible::GetChildAt(PRUint32 aIndex) +Accessible* +Accessible::GetChildAt(PRUint32 aIndex) { - nsAccessible *child = mChildren.SafeElementAt(aIndex, nsnull); + Accessible* child = mChildren.SafeElementAt(aIndex, nsnull); if (!child) return nsnull; #ifdef DEBUG - nsAccessible* realParent = child->mParent; + Accessible* realParent = child->mParent; NS_ASSERTION(!realParent || realParent == this, "Two accessibles have the same first child accessible!"); #endif return child; } PRUint32 -nsAccessible::ChildCount() const +Accessible::ChildCount() const { return mChildren.Length(); } PRInt32 -nsAccessible::GetIndexOf(nsAccessible* aChild) +Accessible::GetIndexOf(Accessible* aChild) { return (aChild->mParent != this) ? -1 : aChild->IndexInParent(); } PRInt32 -nsAccessible::IndexInParent() const +Accessible::IndexInParent() const { return mIndexInParent; } PRUint32 -nsAccessible::EmbeddedChildCount() +Accessible::EmbeddedChildCount() { if (IsChildrenFlag(eMixedChildren)) { if (!mEmbeddedObjCollector) mEmbeddedObjCollector = new EmbeddedObjCollector(this); return mEmbeddedObjCollector->Count(); } return ChildCount(); } -nsAccessible* -nsAccessible::GetEmbeddedChildAt(PRUint32 aIndex) +Accessible* +Accessible::GetEmbeddedChildAt(PRUint32 aIndex) { if (IsChildrenFlag(eMixedChildren)) { if (!mEmbeddedObjCollector) mEmbeddedObjCollector = new EmbeddedObjCollector(this); return mEmbeddedObjCollector ? mEmbeddedObjCollector->GetAccessibleAt(aIndex) : nsnull; } return GetChildAt(aIndex); } PRInt32 -nsAccessible::GetIndexOfEmbeddedChild(nsAccessible* aChild) +Accessible::GetIndexOfEmbeddedChild(Accessible* aChild) { if (IsChildrenFlag(eMixedChildren)) { if (!mEmbeddedObjCollector) mEmbeddedObjCollector = new EmbeddedObjCollector(this); return mEmbeddedObjCollector ? mEmbeddedObjCollector->GetIndexAt(aChild) : -1; } return GetIndexOf(aChild); } //////////////////////////////////////////////////////////////////////////////// // HyperLinkAccessible methods bool -nsAccessible::IsLink() +Accessible::IsLink() { // Every embedded accessible within hypertext accessible implements // hyperlink interface. return mParent && mParent->IsHyperText() && nsAccUtils::IsEmbeddedObject(this); } PRUint32 -nsAccessible::StartOffset() +Accessible::StartOffset() { NS_PRECONDITION(IsLink(), "StartOffset is called not on hyper link!"); nsHyperTextAccessible* hyperText = mParent ? mParent->AsHyperText() : nsnull; return hyperText ? hyperText->GetChildOffset(this) : 0; } PRUint32 -nsAccessible::EndOffset() +Accessible::EndOffset() { NS_PRECONDITION(IsLink(), "EndOffset is called on not hyper link!"); nsHyperTextAccessible* hyperText = mParent ? mParent->AsHyperText() : nsnull; return hyperText ? (hyperText->GetChildOffset(this) + 1) : 0; } bool -nsAccessible::IsLinkSelected() +Accessible::IsLinkSelected() { NS_PRECONDITION(IsLink(), "IsLinkSelected() called on something that is not a hyper link!"); return FocusMgr()->IsFocused(this); } PRUint32 -nsAccessible::AnchorCount() +Accessible::AnchorCount() { NS_PRECONDITION(IsLink(), "AnchorCount is called on not hyper link!"); return 1; } -nsAccessible* -nsAccessible::AnchorAt(PRUint32 aAnchorIndex) +Accessible* +Accessible::AnchorAt(PRUint32 aAnchorIndex) { NS_PRECONDITION(IsLink(), "GetAnchor is called on not hyper link!"); return aAnchorIndex == 0 ? this : nsnull; } already_AddRefed<nsIURI> -nsAccessible::AnchorURIAt(PRUint32 aAnchorIndex) +Accessible::AnchorURIAt(PRUint32 aAnchorIndex) { NS_PRECONDITION(IsLink(), "AnchorURIAt is called on not hyper link!"); if (aAnchorIndex != 0) return nsnull; // Check if it's a simple xlink. if (nsCoreUtils::IsXLink(mContent)) { @@ -2776,165 +2783,165 @@ nsAccessible::AnchorURIAt(PRUint32 aAnch return nsnull; } //////////////////////////////////////////////////////////////////////////////// // SelectAccessible bool -nsAccessible::IsSelect() +Accessible::IsSelect() { // If we have an ARIA role attribute present and the role allows multi // selectable state, then we need to support SelectAccessible interface. If // either attribute (role or multiselectable) change, then we'll destroy this // accessible so that we can follow COM identity rules. return mRoleMapEntry && (mRoleMapEntry->attributeMap1 == aria::eARIAMultiSelectable || mRoleMapEntry->attributeMap2 == aria::eARIAMultiSelectable || mRoleMapEntry->attributeMap3 == aria::eARIAMultiSelectable); } already_AddRefed<nsIArray> -nsAccessible::SelectedItems() +Accessible::SelectedItems() { nsCOMPtr<nsIMutableArray> selectedItems = do_CreateInstance(NS_ARRAY_CONTRACTID); if (!selectedItems) return nsnull; AccIterator iter(this, filters::GetSelected, AccIterator::eTreeNav); nsIAccessible* selected = nsnull; while ((selected = iter.Next())) selectedItems->AppendElement(selected, false); nsIMutableArray* items = nsnull; selectedItems.forget(&items); return items; } PRUint32 -nsAccessible::SelectedItemCount() +Accessible::SelectedItemCount() { PRUint32 count = 0; AccIterator iter(this, filters::GetSelected, AccIterator::eTreeNav); - nsAccessible* selected = nsnull; + Accessible* selected = nsnull; while ((selected = iter.Next())) ++count; return count; } -nsAccessible* -nsAccessible::GetSelectedItem(PRUint32 aIndex) +Accessible* +Accessible::GetSelectedItem(PRUint32 aIndex) { AccIterator iter(this, filters::GetSelected, AccIterator::eTreeNav); - nsAccessible* selected = nsnull; + Accessible* selected = nsnull; PRUint32 index = 0; while ((selected = iter.Next()) && index < aIndex) index++; return selected; } bool -nsAccessible::IsItemSelected(PRUint32 aIndex) +Accessible::IsItemSelected(PRUint32 aIndex) { PRUint32 index = 0; AccIterator iter(this, filters::GetSelectable, AccIterator::eTreeNav); - nsAccessible* selected = nsnull; + Accessible* selected = nsnull; while ((selected = iter.Next()) && index < aIndex) index++; return selected && selected->State() & states::SELECTED; } bool -nsAccessible::AddItemToSelection(PRUint32 aIndex) +Accessible::AddItemToSelection(PRUint32 aIndex) { PRUint32 index = 0; AccIterator iter(this, filters::GetSelectable, AccIterator::eTreeNav); - nsAccessible* selected = nsnull; + Accessible* selected = nsnull; while ((selected = iter.Next()) && index < aIndex) index++; if (selected) selected->SetSelected(true); return static_cast<bool>(selected); } bool -nsAccessible::RemoveItemFromSelection(PRUint32 aIndex) +Accessible::RemoveItemFromSelection(PRUint32 aIndex) { PRUint32 index = 0; AccIterator iter(this, filters::GetSelectable, AccIterator::eTreeNav); - nsAccessible* selected = nsnull; + Accessible* selected = nsnull; while ((selected = iter.Next()) && index < aIndex) index++; if (selected) selected->SetSelected(false); return static_cast<bool>(selected); } bool -nsAccessible::SelectAll() +Accessible::SelectAll() { bool success = false; - nsAccessible* selectable = nsnull; + Accessible* selectable = nsnull; AccIterator iter(this, filters::GetSelectable, AccIterator::eTreeNav); while((selectable = iter.Next())) { success = true; selectable->SetSelected(true); } return success; } bool -nsAccessible::UnselectAll() +Accessible::UnselectAll() { bool success = false; - nsAccessible* selected = nsnull; + Accessible* selected = nsnull; AccIterator iter(this, filters::GetSelected, AccIterator::eTreeNav); while ((selected = iter.Next())) { success = true; selected->SetSelected(false); } return success; } //////////////////////////////////////////////////////////////////////////////// // Widgets bool -nsAccessible::IsWidget() const +Accessible::IsWidget() const { return false; } bool -nsAccessible::IsActiveWidget() const +Accessible::IsActiveWidget() const { return FocusMgr()->IsFocused(this); } bool -nsAccessible::AreItemsOperable() const +Accessible::AreItemsOperable() const { return mContent->HasAttr(kNameSpaceID_None, nsGkAtoms::aria_activedescendant); } -nsAccessible* -nsAccessible::CurrentItem() +Accessible* +Accessible::CurrentItem() { // Check for aria-activedescendant, which changes which element has focus. // For activedescendant, the ARIA spec does not require that the user agent // checks whether pointed node is actually a DOM descendant of the element // with the aria-activedescendant attribute. nsAutoString id; if (mContent->GetAttr(kNameSpaceID_None, nsGkAtoms::aria_activedescendant, id)) { @@ -2945,131 +2952,131 @@ nsAccessible::CurrentItem() if (document) return document->GetAccessible(activeDescendantElm); } } return nsnull; } void -nsAccessible::SetCurrentItem(nsAccessible* aItem) +Accessible::SetCurrentItem(Accessible* aItem) { nsIAtom* id = aItem->GetContent()->GetID(); if (id) { nsAutoString idStr; id->ToString(idStr); mContent->SetAttr(kNameSpaceID_None, nsGkAtoms::aria_activedescendant, idStr, true); } } -nsAccessible* -nsAccessible::ContainerWidget() const +Accessible* +Accessible::ContainerWidget() const { if (HasARIARole() && mContent->HasID()) { - for (nsAccessible* parent = Parent(); parent; parent = parent->Parent()) { + for (Accessible* parent = Parent(); parent; parent = parent->Parent()) { nsIContent* parentContent = parent->GetContent(); if (parentContent && parentContent->HasAttr(kNameSpaceID_None, nsGkAtoms::aria_activedescendant)) { return parent; } // Don't cross DOM document boundaries. if (parent->IsDocumentNode()) break; } } return nsnull; } //////////////////////////////////////////////////////////////////////////////// -// nsAccessible protected methods +// Accessible protected methods void -nsAccessible::CacheChildren() +Accessible::CacheChildren() { DocAccessible* doc = Document(); NS_ENSURE_TRUE(doc,); nsAccTreeWalker walker(doc, mContent, CanHaveAnonChildren()); - nsAccessible* child = nsnull; + Accessible* child = nsnull; while ((child = walker.NextChild()) && AppendChild(child)); } void -nsAccessible::TestChildCache(nsAccessible* aCachedChild) const +Accessible::TestChildCache(Accessible* aCachedChild) const { #ifdef DEBUG PRInt32 childCount = mChildren.Length(); if (childCount == 0) { NS_ASSERTION(IsChildrenFlag(eChildrenUninitialized), "No children but initialized!"); return; } - nsAccessible *child = nsnull; + Accessible* child = nsnull; for (PRInt32 childIdx = 0; childIdx < childCount; childIdx++) { child = mChildren[childIdx]; if (child == aCachedChild) break; } NS_ASSERTION(child == aCachedChild, "[TestChildCache] cached accessible wasn't found. Wrong accessible tree!"); #endif } -// nsAccessible public +// Accessible public bool -nsAccessible::EnsureChildren() +Accessible::EnsureChildren() { if (IsDefunct()) { SetChildrenFlag(eChildrenUninitialized); return true; } if (!IsChildrenFlag(eChildrenUninitialized)) return false; // State is embedded children until text leaf accessible is appended. SetChildrenFlag(eEmbeddedChildren); // Prevent reentry CacheChildren(); return false; } -nsAccessible* -nsAccessible::GetSiblingAtOffset(PRInt32 aOffset, nsresult* aError) const +Accessible* +Accessible::GetSiblingAtOffset(PRInt32 aOffset, nsresult* aError) const { if (!mParent || mIndexInParent == -1) { if (aError) *aError = NS_ERROR_UNEXPECTED; return nsnull; } if (aError && mIndexInParent + aOffset >= static_cast<PRInt32>(mParent->ChildCount())) { *aError = NS_OK; // fail peacefully return nsnull; } - nsAccessible* child = mParent->GetChildAt(mIndexInParent + aOffset); + Accessible* child = mParent->GetChildAt(mIndexInParent + aOffset); if (aError && !child) *aError = NS_ERROR_UNEXPECTED; return child; } -nsAccessible * -nsAccessible::GetFirstAvailableAccessible(nsINode *aStartNode) const +Accessible* +Accessible::GetFirstAvailableAccessible(nsINode *aStartNode) const { - nsAccessible* accessible = mDoc->GetAccessible(aStartNode); + Accessible* accessible = mDoc->GetAccessible(aStartNode); if (accessible) return accessible; nsCOMPtr<nsIDOMDocument> domDoc = do_QueryInterface(aStartNode->OwnerDoc()); NS_ENSURE_TRUE(domDoc, nsnull); nsCOMPtr<nsIDOMNode> currentNode = do_QueryInterface(aStartNode); nsCOMPtr<nsIDOMNode> rootNode = do_QueryInterface(GetNode()); @@ -3081,26 +3088,26 @@ nsAccessible::GetFirstAvailableAccessibl walker->SetCurrentNode(currentNode); while (true) { walker->NextNode(getter_AddRefs(currentNode)); if (!currentNode) return nsnull; nsCOMPtr<nsINode> node(do_QueryInterface(currentNode)); - nsAccessible* accessible = mDoc->GetAccessible(node); + Accessible* accessible = mDoc->GetAccessible(node); if (accessible) return accessible; } return nsnull; } nsresult -nsAccessible::GetAttrValue(nsIAtom *aProperty, double *aValue) +Accessible::GetAttrValue(nsIAtom *aProperty, double *aValue) { NS_ENSURE_ARG_POINTER(aValue); *aValue = 0; if (IsDefunct()) return NS_ERROR_FAILURE; // Node already shut down if (!mRoleMapEntry || mRoleMapEntry->valueRule == eNoValue) @@ -3117,17 +3124,17 @@ nsAccessible::GetAttrValue(nsIAtom *aPro double value = attrValue.ToDouble(&error); if (NS_SUCCEEDED(error)) *aValue = value; return NS_OK; } PRUint32 -nsAccessible::GetActionRule(PRUint64 aStates) +Accessible::GetActionRule(PRUint64 aStates) { if (aStates & states::UNAVAILABLE) return eNoAction; // Check if it's simple xlink. if (nsCoreUtils::IsXLink(mContent)) return eJumpAction; @@ -3151,51 +3158,51 @@ nsAccessible::GetActionRule(PRUint64 aSt if (nsAccUtils::HasDefinedARIAToken(mContent, nsGkAtoms::aria_expanded)) return eExpandAction; return eNoAction; } AccGroupInfo* -nsAccessible::GetGroupInfo() +Accessible::GetGroupInfo() { if (mGroupInfo) return mGroupInfo; mGroupInfo = AccGroupInfo::CreateGroupInfo(this); return mGroupInfo; } void -nsAccessible::GetPositionAndSizeInternal(PRInt32 *aPosInSet, PRInt32 *aSetSize) +Accessible::GetPositionAndSizeInternal(PRInt32 *aPosInSet, PRInt32 *aSetSize) { AccGroupInfo* groupInfo = GetGroupInfo(); if (groupInfo) { *aPosInSet = groupInfo->PosInSet(); *aSetSize = groupInfo->SetSize(); } } PRInt32 -nsAccessible::GetLevelInternal() +Accessible::GetLevelInternal() { PRInt32 level = nsAccUtils::GetDefaultLevel(this); if (!IsBoundToParent()) return level; roles::Role role = Role(); if (role == roles::OUTLINEITEM) { // Always expose 'level' attribute for 'outlineitem' accessible. The number // of nested 'grouping' accessibles containing 'outlineitem' accessible is // its level. level = 1; - nsAccessible* parent = this; + Accessible* parent = this; while ((parent = parent->Parent())) { roles::Role parentRole = parent->Role(); if (parentRole == roles::OUTLINE) break; if (parentRole == roles::GROUPING) ++ level; @@ -3204,36 +3211,36 @@ nsAccessible::GetLevelInternal() } else if (role == roles::LISTITEM) { // Expose 'level' attribute on nested lists. We assume nested list is a last // child of listitem of parent list. We don't handle the case when nested // lists have more complex structure, for example when there are accessibles // between parent listitem and nested list. // Calculate 'level' attribute based on number of parent listitems. level = 0; - nsAccessible* parent = this; + Accessible* parent = this; while ((parent = parent->Parent())) { roles::Role parentRole = parent->Role(); if (parentRole == roles::LISTITEM) ++ level; else if (parentRole != roles::LIST) break; } if (level == 0) { // If this listitem is on top of nested lists then expose 'level' // attribute. parent = Parent(); PRUint32 siblingCount = parent->ChildCount(); for (PRUint32 siblingIdx = 0; siblingIdx < siblingCount; siblingIdx++) { - nsAccessible* sibling = parent->GetChildAt(siblingIdx); - - nsAccessible* siblingChild = sibling->LastChild(); + Accessible* sibling = parent->GetChildAt(siblingIdx); + + Accessible* siblingChild = sibling->LastChild(); if (siblingChild && siblingChild->Role() == roles::LIST) return 1; } } else { ++ level; // level is 1-index based } }
rename from accessible/src/base/nsAccessible.h rename to accessible/src/generic/Accessible.h --- a/accessible/src/base/nsAccessible.h +++ b/accessible/src/generic/Accessible.h @@ -1,15 +1,15 @@ /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#ifndef _nsAccessible_H_ -#define _nsAccessible_H_ +#ifndef _Accessible_H_ +#define _Accessible_H_ #include "mozilla/a11y/Role.h" #include "mozilla/a11y/States.h" #include "nsAccessNodeWrap.h" #include "nsIAccessible.h" #include "nsIAccessibleHyperLink.h" #include "nsIAccessibleSelectable.h" @@ -20,17 +20,17 @@ #include "nsStringGlue.h" #include "nsTArray.h" #include "nsRefPtrHashtable.h" class AccEvent; class AccGroupInfo; class EmbeddedObjCollector; class KeyBinding; -class nsAccessible; +class Accessible; class nsHyperTextAccessible; class nsHTMLImageAccessible; class nsHTMLImageMapAccessible; struct nsRoleMapEntry; class Relation; namespace mozilla { namespace a11y { @@ -48,63 +48,63 @@ enum ENameValueFlag { * a) present (not empty): !name.IsEmpty() * b) no name (was missed): name.IsVoid() * c) was left empty by the author on demand: name.IsEmpty() && !name.IsVoid() */ eNameOK, eNameFromTooltip // Tooltip was used as a name }; -} -} +} // namespace a11y +} // namespace mozilla class nsXULTreeAccessible; struct nsRect; class nsIContent; class nsIFrame; class nsIAtom; class nsIView; -typedef nsRefPtrHashtable<nsPtrHashKey<const void>, nsAccessible> - nsAccessibleHashtable; +typedef nsRefPtrHashtable<nsPtrHashKey<const void>, Accessible> + AccessibleHashtable; -// see nsAccessible::GetAttrValue +// see Accessible::GetAttrValue #define NS_OK_NO_ARIA_VALUE \ NS_ERROR_GENERATE_SUCCESS(NS_ERROR_MODULE_GENERAL, 0x21) -// see nsAccessible::GetNameInternal +// see Accessible::GetNameInternal #define NS_OK_EMPTY_NAME \ NS_ERROR_GENERATE_SUCCESS(NS_ERROR_MODULE_GENERAL, 0x23) -// see nsAccessible::GetNameInternal +// see Accessible::GetNameInternal #define NS_OK_NAME_FROM_TOOLTIP \ NS_ERROR_GENERATE_SUCCESS(NS_ERROR_MODULE_GENERAL, 0x25) #define NS_ACCESSIBLE_IMPL_IID \ { /* 133c8bf4-4913-4355-bd50-426bd1d6e1ad */ \ 0x133c8bf4, \ 0x4913, \ 0x4355, \ { 0xbd, 0x50, 0x42, 0x6b, 0xd1, 0xd6, 0xe1, 0xad } \ } -class nsAccessible : public nsAccessNodeWrap, - public nsIAccessible, - public nsIAccessibleHyperLink, - public nsIAccessibleSelectable, - public nsIAccessibleValue +class Accessible : public nsAccessNodeWrap, + public nsIAccessible, + public nsIAccessibleHyperLink, + public nsIAccessibleSelectable, + public nsIAccessibleValue { public: - nsAccessible(nsIContent* aContent, DocAccessible* aDoc); - virtual ~nsAccessible(); + Accessible(nsIContent* aContent, DocAccessible* aDoc); + virtual ~Accessible(); NS_DECL_ISUPPORTS_INHERITED - NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(nsAccessible, nsAccessNode) + NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(Accessible, nsAccessNode) NS_DECL_NSIACCESSIBLE NS_DECL_NSIACCESSIBLEHYPERLINK NS_DECL_NSIACCESSIBLESELECTABLE NS_DECL_NSIACCESSIBLEVALUE NS_DECLARE_STATIC_IID_ACCESSOR(NS_ACCESSIBLE_IMPL_IID) ////////////////////////////////////////////////////////////////////////////// @@ -238,23 +238,23 @@ public: /** * Return direct or deepest child at the given point. * * @param aX [in] x coordinate relative screen * @param aY [in] y coordinate relative screen * @param aWhichChild [in] flag points if deepest or direct child * should be returned */ - virtual nsAccessible* ChildAtPoint(PRInt32 aX, PRInt32 aY, - EWhichChildAtPoint aWhichChild); + virtual Accessible* ChildAtPoint(PRInt32 aX, PRInt32 aY, + EWhichChildAtPoint aWhichChild); /** * Return the focused child if any. */ - virtual nsAccessible* FocusedChild(); + virtual Accessible* FocusedChild(); /** * Return calculated group level based on accessible hierarchy. */ virtual PRInt32 GetLevelInternal(); /** * Calculate position in group and group size ('posinset' and 'setsize') based @@ -303,91 +303,91 @@ public: * transformed. Note, if accessible cares about its parent relation chain * itself should override this method to do nothing. */ virtual void InvalidateChildren(); /** * Append/insert/remove a child. Return true if operation was successful. */ - virtual bool AppendChild(nsAccessible* aChild); - virtual bool InsertChildAt(PRUint32 aIndex, nsAccessible* aChild); - virtual bool RemoveChild(nsAccessible* aChild); + virtual bool AppendChild(Accessible* aChild); + virtual bool InsertChildAt(PRUint32 aIndex, Accessible* aChild); + virtual bool RemoveChild(Accessible* aChild); ////////////////////////////////////////////////////////////////////////////// // Accessible tree traverse methods /** * Return parent accessible. */ - nsAccessible* Parent() const { return mParent; } + Accessible* Parent() const { return mParent; } /** * Return child accessible at the given index. */ - virtual nsAccessible* GetChildAt(PRUint32 aIndex); + virtual Accessible* GetChildAt(PRUint32 aIndex); /** * Return child accessible count. */ virtual PRUint32 ChildCount() const; /** * Return index of the given child accessible. */ - virtual PRInt32 GetIndexOf(nsAccessible* aChild); + virtual PRInt32 GetIndexOf(Accessible* aChild); /** * Return index in parent accessible. */ virtual PRInt32 IndexInParent() const; /** * Return true if accessible has children; */ bool HasChildren() { return !!GetChildAt(0); } /** * Return first/last/next/previous sibling of the accessible. */ - inline nsAccessible* NextSibling() const + inline Accessible* NextSibling() const { return GetSiblingAtOffset(1); } - inline nsAccessible* PrevSibling() const + inline Accessible* PrevSibling() const { return GetSiblingAtOffset(-1); } - inline nsAccessible* FirstChild() + inline Accessible* FirstChild() { return GetChildAt(0); } - inline nsAccessible* LastChild() + inline Accessible* LastChild() { PRUint32 childCount = ChildCount(); return childCount != 0 ? GetChildAt(childCount - 1) : nsnull; } /** * Return embedded accessible children count. */ PRUint32 EmbeddedChildCount();