mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
bug 1155829 - move AccessibleWrap::GetMaiHyperlink to MaiAtkObject::GetAtkHyperlink r=surkov
This commit is contained in:
parent
c05b5f732a
commit
54c82431b4
@ -129,6 +129,20 @@ static const uintptr_t IS_PROXY = 1;
|
|||||||
|
|
||||||
static GQuark quark_mai_hyperlink = 0;
|
static GQuark quark_mai_hyperlink = 0;
|
||||||
|
|
||||||
|
AtkHyperlink*
|
||||||
|
MaiAtkObject::GetAtkHyperlink()
|
||||||
|
{
|
||||||
|
NS_ASSERTION(quark_mai_hyperlink, "quark_mai_hyperlink not initialized");
|
||||||
|
MaiHyperlink* maiHyperlink =
|
||||||
|
(MaiHyperlink*)g_object_get_qdata(G_OBJECT(this), quark_mai_hyperlink);
|
||||||
|
if (!maiHyperlink) {
|
||||||
|
maiHyperlink = new MaiHyperlink(reinterpret_cast<Accessible*>(accWrap));
|
||||||
|
g_object_set_qdata(G_OBJECT(this), quark_mai_hyperlink, maiHyperlink);
|
||||||
|
}
|
||||||
|
|
||||||
|
return maiHyperlink->GetAtkHyperlink();
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
MaiAtkObject::Shutdown()
|
MaiAtkObject::Shutdown()
|
||||||
{
|
{
|
||||||
@ -267,27 +281,6 @@ AccessibleWrap::Shutdown()
|
|||||||
Accessible::Shutdown();
|
Accessible::Shutdown();
|
||||||
}
|
}
|
||||||
|
|
||||||
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 = nullptr;
|
|
||||||
if (quark_mai_hyperlink && IS_MAI_OBJECT(mAtkObject)) {
|
|
||||||
maiHyperlink = (MaiHyperlink*)g_object_get_qdata(G_OBJECT(mAtkObject),
|
|
||||||
quark_mai_hyperlink);
|
|
||||||
if (!maiHyperlink && aCreate) {
|
|
||||||
maiHyperlink = new MaiHyperlink(this);
|
|
||||||
g_object_set_qdata(G_OBJECT(mAtkObject), quark_mai_hyperlink,
|
|
||||||
maiHyperlink);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return maiHyperlink;
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
AccessibleWrap::GetNativeInterface(void** aOutAccessible)
|
AccessibleWrap::GetNativeInterface(void** aOutAccessible)
|
||||||
{
|
{
|
||||||
|
@ -63,9 +63,6 @@ public:
|
|||||||
|
|
||||||
bool IsValidObject();
|
bool IsValidObject();
|
||||||
|
|
||||||
// get the MaiHyperlink object for this AccessibleWrap
|
|
||||||
MaiHyperlink* GetMaiHyperlink(bool aCreate = true);
|
|
||||||
|
|
||||||
static const char * ReturnString(nsAString &aString) {
|
static const char * ReturnString(nsAString &aString) {
|
||||||
static nsCString returnedString;
|
static nsCString returnedString;
|
||||||
returnedString = NS_ConvertUTF16toUTF8(aString);
|
returnedString = NS_ConvertUTF16toUTF8(aString);
|
||||||
|
@ -63,6 +63,11 @@ struct MaiAtkObject
|
|||||||
*/
|
*/
|
||||||
uintptr_t accWrap;
|
uintptr_t accWrap;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Get the AtkHyperlink for this atk object.
|
||||||
|
*/
|
||||||
|
AtkHyperlink* GetAtkHyperlink();
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Shutdown this AtkObject.
|
* Shutdown this AtkObject.
|
||||||
*/
|
*/
|
||||||
|
@ -21,9 +21,7 @@ getHyperlinkCB(AtkHyperlinkImpl* aImpl)
|
|||||||
|
|
||||||
NS_ENSURE_TRUE(accWrap->IsLink(), nullptr);
|
NS_ENSURE_TRUE(accWrap->IsLink(), nullptr);
|
||||||
|
|
||||||
MaiHyperlink* maiHyperlink = accWrap->GetMaiHyperlink();
|
return MAI_ATK_OBJECT(aImpl)->GetAtkHyperlink();
|
||||||
NS_ENSURE_TRUE(maiHyperlink, nullptr);
|
|
||||||
return maiHyperlink->GetAtkHyperlink();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -32,12 +32,9 @@ getLinkCB(AtkHypertext *aText, gint aLinkIndex)
|
|||||||
}
|
}
|
||||||
|
|
||||||
AtkObject* hyperLinkAtkObj = AccessibleWrap::GetAtkObject(hyperLink);
|
AtkObject* hyperLinkAtkObj = AccessibleWrap::GetAtkObject(hyperLink);
|
||||||
AccessibleWrap* accChild = GetAccessibleWrap(hyperLinkAtkObj);
|
NS_ENSURE_TRUE(IS_MAI_OBJECT(hyperLinkAtkObj), nullptr);
|
||||||
NS_ENSURE_TRUE(accChild, nullptr);
|
|
||||||
|
|
||||||
MaiHyperlink* maiHyperlink = accChild->GetMaiHyperlink();
|
return MAI_ATK_OBJECT(hyperLinkAtkObj)->GetAtkHyperlink();
|
||||||
NS_ENSURE_TRUE(maiHyperlink, nullptr);
|
|
||||||
return maiHyperlink->GetAtkHyperlink();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aText))) {
|
if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aText))) {
|
||||||
|
Loading…
Reference in New Issue
Block a user