mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
bug 1087485 - teach atk to get parents from proxies r=surkov
This commit is contained in:
parent
d5b8458420
commit
1f8554035f
@ -784,19 +784,21 @@ GetLocaleCB(AtkObject* aAtkObj)
|
||||
AtkObject *
|
||||
getParentCB(AtkObject *aAtkObj)
|
||||
{
|
||||
if (!aAtkObj->accessible_parent) {
|
||||
AccessibleWrap* accWrap = GetAccessibleWrap(aAtkObj);
|
||||
if (!accWrap)
|
||||
return nullptr;
|
||||
if (aAtkObj->accessible_parent)
|
||||
return aAtkObj->accessible_parent;
|
||||
|
||||
Accessible* accParent = accWrap->Parent();
|
||||
if (!accParent)
|
||||
return nullptr;
|
||||
|
||||
AtkObject* parent = AccessibleWrap::GetAtkObject(accParent);
|
||||
if (parent)
|
||||
atk_object_set_parent(aAtkObj, parent);
|
||||
AtkObject* atkParent = nullptr;
|
||||
if (AccessibleWrap* wrapper = GetAccessibleWrap(aAtkObj)) {
|
||||
Accessible* parent = wrapper->Parent();
|
||||
atkParent = parent ? AccessibleWrap::GetAtkObject(parent) : nullptr;
|
||||
} else if (ProxyAccessible* proxy = GetProxy(aAtkObj)) {
|
||||
ProxyAccessible* parent = proxy->Parent();
|
||||
atkParent = parent ? GetWrapperFor(parent) : nullptr;
|
||||
}
|
||||
|
||||
if (atkParent)
|
||||
atk_object_set_parent(aAtkObj, atkParent);
|
||||
|
||||
return aAtkObj->accessible_parent;
|
||||
}
|
||||
|
||||
@ -984,6 +986,12 @@ GetProxy(AtkObject* aObj)
|
||||
& ~IS_PROXY);
|
||||
}
|
||||
|
||||
AtkObject*
|
||||
GetWrapperFor(ProxyAccessible* aProxy)
|
||||
{
|
||||
return reinterpret_cast<AtkObject*>(aProxy->GetWrapper() & ~IS_PROXY);
|
||||
}
|
||||
|
||||
static uint16_t
|
||||
GetInterfacesForProxy(ProxyAccessible* aProxy)
|
||||
{
|
||||
|
@ -36,6 +36,7 @@ GType mai_atk_object_get_type(void);
|
||||
GType mai_util_get_type();
|
||||
mozilla::a11y::AccessibleWrap* GetAccessibleWrap(AtkObject* aAtkObj);
|
||||
mozilla::a11y::ProxyAccessible* GetProxy(AtkObject* aAtkObj);
|
||||
AtkObject* GetWrapperFor(mozilla::a11y::ProxyAccessible* aProxy);
|
||||
|
||||
extern int atkMajorVersion, atkMinorVersion;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user