2011-04-27 06:42:27 -07:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2011-05-27 15:37:24 -07:00
|
|
|
/* vim: set ts=2 et sw=2 tw=80: */
|
2012-05-21 04:12:37 -07:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2012-03-19 21:02:50 -07:00
|
|
|
#include "InterfaceInitFuncs.h"
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2012-03-19 21:02:50 -07:00
|
|
|
#include "nsMaiHyperlink.h"
|
2012-10-26 06:32:10 -07:00
|
|
|
#include "mozilla/Likely.h"
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2012-11-17 18:01:44 -08:00
|
|
|
using namespace mozilla::a11y;
|
|
|
|
|
2012-03-19 21:02:50 -07:00
|
|
|
extern "C" {
|
|
|
|
static AtkHyperlink*
|
2011-06-23 21:29:43 -07:00
|
|
|
getHyperlinkCB(AtkHyperlinkImpl* aImpl)
|
2007-03-22 10:30:00 -07:00
|
|
|
{
|
2012-05-28 18:18:45 -07:00
|
|
|
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aImpl));
|
2011-06-23 21:29:43 -07:00
|
|
|
if (!accWrap)
|
2012-07-30 07:20:58 -07:00
|
|
|
return nullptr;
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2012-07-30 07:20:58 -07:00
|
|
|
NS_ENSURE_TRUE(accWrap->IsLink(), nullptr);
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2015-04-17 12:21:36 -07:00
|
|
|
return MAI_ATK_OBJECT(aImpl)->GetAtkHyperlink();
|
2007-03-22 10:30:00 -07:00
|
|
|
}
|
2012-03-19 21:02:50 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
hyperlinkImplInterfaceInitCB(AtkHyperlinkImplIface *aIface)
|
|
|
|
{
|
|
|
|
NS_ASSERTION(aIface, "no interface!");
|
2012-10-26 06:32:10 -07:00
|
|
|
if (MOZ_UNLIKELY(!aIface))
|
2012-03-19 21:02:50 -07:00
|
|
|
return;
|
|
|
|
|
|
|
|
aIface->get_hyperlink = getHyperlinkCB;
|
|
|
|
}
|