mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-02 10:00:54 +00:00
Bug 205772, Use GetNativeInterface in nsIAccessible to return Native AtkObject for the Accessible
r=aaronl. Accessibility Gtk2 Bug, is not for Mozilla Default Build
This commit is contained in:
parent
e1c24882db
commit
f869a4b186
@ -196,22 +196,32 @@ nsAccessibleWrap::~nsAccessibleWrap()
|
||||
delete mInterfaces[index];
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsAccessibleWrap::GetNativeInterface(void **aOutAccessible)
|
||||
{
|
||||
*aOutAccessible = nsnull;
|
||||
|
||||
if (!mMaiAtkObject) {
|
||||
CreateMaiInterfaces();
|
||||
mMaiAtkObject =
|
||||
NS_REINTERPRET_CAST(AtkObject *,
|
||||
g_object_new(GetMaiAtkType(), NULL));
|
||||
NS_ENSURE_TRUE(mMaiAtkObject, NS_ERROR_OUT_OF_MEMORY);
|
||||
|
||||
atk_object_initialize(mMaiAtkObject, this);
|
||||
mMaiAtkObject->role = ATK_ROLE_INVALID;
|
||||
mMaiAtkObject->layer = ATK_LAYER_INVALID;
|
||||
}
|
||||
|
||||
*aOutAccessible = mMaiAtkObject;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
AtkObject *
|
||||
nsAccessibleWrap::GetAtkObject(void)
|
||||
{
|
||||
if (mMaiAtkObject)
|
||||
return mMaiAtkObject;
|
||||
|
||||
CreateMaiInterfaces();
|
||||
mMaiAtkObject =
|
||||
NS_REINTERPRET_CAST(AtkObject *,
|
||||
g_object_new(GetMaiAtkType(), NULL));
|
||||
NS_ENSURE_TRUE(mMaiAtkObject, nsnull);
|
||||
|
||||
atk_object_initialize(mMaiAtkObject, this);
|
||||
mMaiAtkObject->role = ATK_ROLE_INVALID;
|
||||
mMaiAtkObject->layer = ATK_LAYER_INVALID;
|
||||
return mMaiAtkObject;
|
||||
void *atkObj = nsnull;
|
||||
GetNativeInterface(&atkObj);
|
||||
return NS_STATIC_CAST(AtkObject *, atkObj);
|
||||
}
|
||||
|
||||
/* private */
|
||||
|
@ -74,7 +74,10 @@ public:
|
||||
#endif
|
||||
|
||||
public:
|
||||
virtual AtkObject *GetAtkObject(void);
|
||||
// return the atk object for this nsAccessibleWrap
|
||||
NS_IMETHOD GetNativeInterface(void **aOutAccessible);
|
||||
|
||||
AtkObject * GetAtkObject(void);
|
||||
MaiInterface *GetMaiInterface(PRInt16 aIfaceType);
|
||||
|
||||
static void TranslateStates(PRUint32 aAccState,
|
||||
|
@ -656,21 +656,23 @@ NS_IMETHODIMP nsAppRootAccessible::GetAccPreviousSibling(nsIAccessible * *aAccPr
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
AtkObject *
|
||||
nsAppRootAccessible::GetAtkObject(void)
|
||||
NS_IMETHODIMP nsAppRootAccessible::GetNativeInterface(void **aOutAccessible)
|
||||
{
|
||||
if (mMaiAtkObject)
|
||||
return mMaiAtkObject;
|
||||
*aOutAccessible = nsnull;
|
||||
|
||||
mMaiAtkObject =
|
||||
NS_REINTERPRET_CAST(AtkObject *,
|
||||
g_object_new(MAI_TYPE_ATK_OBJECT, NULL));
|
||||
NS_ENSURE_TRUE(mMaiAtkObject, nsnull);
|
||||
if (!mMaiAtkObject) {
|
||||
mMaiAtkObject =
|
||||
NS_REINTERPRET_CAST(AtkObject *,
|
||||
g_object_new(MAI_TYPE_ATK_OBJECT, NULL));
|
||||
NS_ENSURE_TRUE(mMaiAtkObject, NS_ERROR_OUT_OF_MEMORY);
|
||||
|
||||
atk_object_initialize(mMaiAtkObject, this);
|
||||
mMaiAtkObject->role = ATK_ROLE_INVALID;
|
||||
mMaiAtkObject->layer = ATK_LAYER_INVALID;
|
||||
return mMaiAtkObject;
|
||||
atk_object_initialize(mMaiAtkObject, this);
|
||||
mMaiAtkObject->role = ATK_ROLE_INVALID;
|
||||
mMaiAtkObject->layer = ATK_LAYER_INVALID;
|
||||
}
|
||||
|
||||
*aOutAccessible = mMaiAtkObject;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsresult
|
||||
|
@ -88,7 +88,9 @@ public:
|
||||
NS_IMETHOD GetAccFirstChild(nsIAccessible * *aAccFirstChild);
|
||||
NS_IMETHOD GetAccChildCount(PRInt32 *aAccChildCount);
|
||||
|
||||
virtual AtkObject *GetAtkObject(void);
|
||||
// return the atk object for app root accessible
|
||||
NS_IMETHOD GetNativeInterface(void **aOutAccessible);
|
||||
|
||||
nsresult AddRootAccessible(nsRootAccessibleWrap *aRootAccWrap);
|
||||
nsresult RemoveRootAccessible(nsRootAccessibleWrap *aRootAccWrap);
|
||||
private:
|
||||
|
Loading…
Reference in New Issue
Block a user