// Check if aAtkObj is a valid MaiAtkObject, and return the AccessibleWrap // for it. AccessibleWrap* GetAccessibleWrap(AtkObject* aAtkObj) { NS_ENSURE_TRUE(IS_MAI_OBJECT(aAtkObj), nsnull); AccessibleWrap* accWrap = MAI_ATK_OBJECT(aAtkObj)->accWrap; // Check if the accessible was deconstructed. if (!accWrap) return nsnull; NS_ENSURE_TRUE(accWrap->GetAtkObject() == aAtkObj, nsnull); AccessibleWrap* appAccWrap = nsAccessNode::GetApplicationAccessible(); if (appAccWrap != accWrap && !accWrap->IsValidObject()) return nsnull; return accWrap; }
// Check if aAtkObj is a valid MaiAtkObject, and return the AccessibleWrap // for it. AccessibleWrap* GetAccessibleWrap(AtkObject* aAtkObj) { NS_ENSURE_TRUE(IS_MAI_OBJECT(aAtkObj), nullptr); // Make sure its native is an AccessibleWrap not a proxy. if (MAI_ATK_OBJECT(aAtkObj)->accWrap & IS_PROXY) return nullptr; AccessibleWrap* accWrap = reinterpret_cast<AccessibleWrap*>(MAI_ATK_OBJECT(aAtkObj)->accWrap); // Check if the accessible was deconstructed. if (!accWrap) return nullptr; NS_ENSURE_TRUE(accWrap->GetAtkObject() == aAtkObj, nullptr); AccessibleWrap* appAccWrap = ApplicationAcc(); if (appAccWrap != accWrap && !accWrap->IsValidObject()) return nullptr; return accWrap; }