michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* vim: set ts=2 et sw=2 tw=80: */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #include "InterfaceInitFuncs.h" michael@0: michael@0: #include "nsMaiHyperlink.h" michael@0: #include "mozilla/Likely.h" michael@0: michael@0: using namespace mozilla::a11y; michael@0: michael@0: extern "C" { michael@0: static AtkHyperlink* michael@0: getHyperlinkCB(AtkHyperlinkImpl* aImpl) michael@0: { michael@0: AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aImpl)); michael@0: if (!accWrap) michael@0: return nullptr; michael@0: michael@0: NS_ENSURE_TRUE(accWrap->IsLink(), nullptr); michael@0: michael@0: MaiHyperlink* maiHyperlink = accWrap->GetMaiHyperlink(); michael@0: NS_ENSURE_TRUE(maiHyperlink, nullptr); michael@0: return maiHyperlink->GetAtkHyperlink(); michael@0: } michael@0: } michael@0: michael@0: void michael@0: hyperlinkImplInterfaceInitCB(AtkHyperlinkImplIface *aIface) michael@0: { michael@0: NS_ASSERTION(aIface, "no interface!"); michael@0: if (MOZ_UNLIKELY(!aIface)) michael@0: return; michael@0: michael@0: aIface->get_hyperlink = getHyperlinkCB; michael@0: }