1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #include "InterfaceInitFuncs.h"
9 #include "nsMaiHyperlink.h"
10 #include "mozilla/Likely.h"
12 using namespace mozilla::a11y
;
15 static AtkHyperlink
* getHyperlinkCB(AtkHyperlinkImpl
* aImpl
) {
16 AccessibleWrap
* accWrap
= GetAccessibleWrap(ATK_OBJECT(aImpl
));
17 if (!accWrap
&& !GetProxy(ATK_OBJECT(aImpl
))) return nullptr;
19 if (accWrap
) NS_ASSERTION(accWrap
->IsLink(), "why isn't it a link!");
21 return MAI_ATK_OBJECT(aImpl
)->GetAtkHyperlink();
25 void hyperlinkImplInterfaceInitCB(AtkHyperlinkImplIface
* aIface
) {
26 NS_ASSERTION(aIface
, "no interface!");
27 if (MOZ_UNLIKELY(!aIface
)) return;
29 aIface
->get_hyperlink
= getHyperlinkCB
;