mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
bug 1146518 - allow MaiHyperlink to store references to proxies r=surkov
This commit is contained in:
parent
9d2eb81fdd
commit
93badee7c8
@ -123,10 +123,6 @@ static const GInterfaceInfo atk_if_infos[] = {
|
||||
(GInterfaceFinalizeFunc) nullptr, nullptr}
|
||||
};
|
||||
|
||||
// This is or'd with the pointer in MaiAtkObject::accWrap if the wrap-ee is a
|
||||
// proxy.
|
||||
static const uintptr_t IS_PROXY = 1;
|
||||
|
||||
static GQuark quark_mai_hyperlink = 0;
|
||||
|
||||
AtkHyperlink*
|
||||
@ -136,7 +132,7 @@ MaiAtkObject::GetAtkHyperlink()
|
||||
MaiHyperlink* maiHyperlink =
|
||||
(MaiHyperlink*)g_object_get_qdata(G_OBJECT(this), quark_mai_hyperlink);
|
||||
if (!maiHyperlink) {
|
||||
maiHyperlink = new MaiHyperlink(reinterpret_cast<Accessible*>(accWrap));
|
||||
maiHyperlink = new MaiHyperlink(accWrap);
|
||||
g_object_set_qdata(G_OBJECT(this), quark_mai_hyperlink, maiHyperlink);
|
||||
}
|
||||
|
||||
|
@ -51,6 +51,10 @@ IsAtkVersionAtLeast(int aMajor, int aMinor)
|
||||
(aMajor == atkMajorVersion && aMinor <= atkMinorVersion);
|
||||
}
|
||||
|
||||
// This is or'd with the pointer in MaiAtkObject::accWrap if the wrap-ee is a
|
||||
// proxy.
|
||||
static const uintptr_t IS_PROXY = 1;
|
||||
|
||||
/**
|
||||
* This MaiAtkObject is a thin wrapper, in the MAI namespace, for AtkObject
|
||||
*/
|
||||
|
@ -90,7 +90,7 @@ mai_atk_hyperlink_get_type(void)
|
||||
return type;
|
||||
}
|
||||
|
||||
MaiHyperlink::MaiHyperlink(Accessible* aHyperLink) :
|
||||
MaiHyperlink::MaiHyperlink(uintptr_t aHyperLink) :
|
||||
mHyperlink(aHyperLink),
|
||||
mMaiAtkHyperlink(nullptr)
|
||||
{
|
||||
|
@ -23,16 +23,23 @@ namespace a11y {
|
||||
class MaiHyperlink
|
||||
{
|
||||
public:
|
||||
explicit MaiHyperlink(Accessible* aHyperLink);
|
||||
explicit MaiHyperlink(uintptr_t aHyperLink);
|
||||
~MaiHyperlink();
|
||||
|
||||
public:
|
||||
AtkHyperlink* GetAtkHyperlink() const { return mMaiAtkHyperlink; }
|
||||
Accessible* GetAccHyperlink()
|
||||
{ return mHyperlink && mHyperlink->IsLink() ? mHyperlink : nullptr; }
|
||||
{
|
||||
if (!mHyperlink || mHyperlink & IS_PROXY)
|
||||
return nullptr;
|
||||
|
||||
Accessible* link = reinterpret_cast<Accessible*>(mHyperlink);
|
||||
NS_ASSERTION(link->IsLink(), "Why isn't it a link!");
|
||||
return link;
|
||||
}
|
||||
|
||||
protected:
|
||||
Accessible* mHyperlink;
|
||||
uintptr_t mHyperlink;
|
||||
AtkHyperlink* mMaiAtkHyperlink;
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user