зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1768785: Remove AtkSocketAccessible and related code. r=eeejay
This was only used for NPAPI plugins. NPAPI plugin support was removed some time ago. Differential Revision: https://phabricator.services.mozilla.com/D178005
This commit is contained in:
Родитель
6624b2bb88
Коммит
71a4555fa3
|
@ -892,24 +892,15 @@ AtkRelationSet* refRelationSetCB(AtkObject* aAtkObj) {
|
|||
// Check if aAtkObj is a valid MaiAtkObject, and return the AccessibleWrap
|
||||
// for it.
|
||||
AccessibleWrap* GetAccessibleWrap(AtkObject* aAtkObj) {
|
||||
bool isMAIObject = IS_MAI_OBJECT(aAtkObj);
|
||||
NS_ENSURE_TRUE(isMAIObject || MAI_IS_ATK_SOCKET(aAtkObj), nullptr);
|
||||
NS_ENSURE_TRUE(IS_MAI_OBJECT(aAtkObj), nullptr);
|
||||
|
||||
AccessibleWrap* accWrap = nullptr;
|
||||
if (isMAIObject) {
|
||||
// If we're working with an ATK object, we need to convert the Accessible
|
||||
// back to an AccessibleWrap:
|
||||
Accessible* storedAcc = MAI_ATK_OBJECT(aAtkObj)->acc;
|
||||
if (!storedAcc) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
accWrap = static_cast<AccessibleWrap*>(storedAcc->AsLocal());
|
||||
} else {
|
||||
// The ATK socket stores an AccessibleWrap directly, so we can get the value
|
||||
// with no casting.
|
||||
accWrap = MAI_ATK_SOCKET(aAtkObj)->accWrap;
|
||||
// If we're working with an ATK object, we need to convert the Accessible
|
||||
// back to an AccessibleWrap:
|
||||
Accessible* storedAcc = MAI_ATK_OBJECT(aAtkObj)->acc;
|
||||
if (!storedAcc) {
|
||||
return nullptr;
|
||||
}
|
||||
auto* accWrap = static_cast<AccessibleWrap*>(storedAcc->AsLocal());
|
||||
|
||||
// Check if the accessible was deconstructed.
|
||||
if (!accWrap) return nullptr;
|
||||
|
|
|
@ -1,106 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* vim: set ts=2 et sw=2 tw=80: */
|
||||
/* 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/. */
|
||||
|
||||
#include <atk/atk.h>
|
||||
#include "AtkSocketAccessible.h"
|
||||
|
||||
#include "InterfaceInitFuncs.h"
|
||||
#include "nsMai.h"
|
||||
#include "mozilla/Likely.h"
|
||||
|
||||
using namespace mozilla::a11y;
|
||||
|
||||
AtkSocketEmbedType AtkSocketAccessible::g_atk_socket_embed = nullptr;
|
||||
GType AtkSocketAccessible::g_atk_socket_type = G_TYPE_INVALID;
|
||||
const char* AtkSocketAccessible::sATKSocketEmbedSymbol = "atk_socket_embed";
|
||||
const char* AtkSocketAccessible::sATKSocketGetTypeSymbol =
|
||||
"atk_socket_get_type";
|
||||
|
||||
bool AtkSocketAccessible::gCanEmbed = FALSE;
|
||||
|
||||
extern "C" void mai_atk_component_iface_init(AtkComponentIface* aIface);
|
||||
|
||||
G_DEFINE_TYPE_EXTENDED(MaiAtkSocket, mai_atk_socket,
|
||||
AtkSocketAccessible::g_atk_socket_type, 0,
|
||||
G_IMPLEMENT_INTERFACE(ATK_TYPE_COMPONENT,
|
||||
mai_atk_component_iface_init))
|
||||
|
||||
void mai_atk_socket_class_init(MaiAtkSocketClass* aAcc) {}
|
||||
|
||||
void mai_atk_socket_init(MaiAtkSocket* aAcc) {}
|
||||
|
||||
static AtkObject* mai_atk_socket_new(AccessibleWrap* aAccWrap) {
|
||||
NS_ENSURE_TRUE(aAccWrap, nullptr);
|
||||
|
||||
MaiAtkSocket* acc = nullptr;
|
||||
acc = static_cast<MaiAtkSocket*>(g_object_new(MAI_TYPE_ATK_SOCKET, nullptr));
|
||||
NS_ENSURE_TRUE(acc, nullptr);
|
||||
|
||||
acc->accWrap = aAccWrap;
|
||||
return ATK_OBJECT(acc);
|
||||
}
|
||||
|
||||
extern "C" {
|
||||
static AtkObject* RefAccessibleAtPoint(AtkComponent* aComponent, gint aX,
|
||||
gint aY, AtkCoordType aCoordType) {
|
||||
NS_ENSURE_TRUE(MAI_IS_ATK_SOCKET(aComponent), nullptr);
|
||||
|
||||
return refAccessibleAtPointHelper(ATK_OBJECT(MAI_ATK_SOCKET(aComponent)), aX,
|
||||
aY, aCoordType);
|
||||
}
|
||||
|
||||
static void GetExtents(AtkComponent* aComponent, gint* aX, gint* aY,
|
||||
gint* aWidth, gint* aHeight, AtkCoordType aCoordType) {
|
||||
*aX = *aY = *aWidth = *aHeight = -1;
|
||||
|
||||
if (!MAI_IS_ATK_SOCKET(aComponent)) return;
|
||||
|
||||
getExtentsHelper(ATK_OBJECT(MAI_ATK_SOCKET(aComponent)), aX, aY, aWidth,
|
||||
aHeight, aCoordType);
|
||||
}
|
||||
}
|
||||
|
||||
void mai_atk_component_iface_init(AtkComponentIface* aIface) {
|
||||
NS_ASSERTION(aIface, "Invalid Interface");
|
||||
if (MOZ_UNLIKELY(!aIface)) return;
|
||||
|
||||
aIface->ref_accessible_at_point = RefAccessibleAtPoint;
|
||||
aIface->get_extents = GetExtents;
|
||||
}
|
||||
|
||||
AtkSocketAccessible::AtkSocketAccessible(nsIContent* aContent,
|
||||
DocAccessible* aDoc,
|
||||
const nsCString& aPlugId)
|
||||
: AccessibleWrap(aContent, aDoc) {
|
||||
mAtkObject = mai_atk_socket_new(this);
|
||||
if (!mAtkObject) return;
|
||||
|
||||
// Embeds the children of an AtkPlug, specified by plugId, as the children of
|
||||
// this socket.
|
||||
// Using G_TYPE macros instead of ATK_SOCKET macros to avoid undefined
|
||||
// symbols.
|
||||
if (gCanEmbed && G_TYPE_CHECK_INSTANCE_TYPE(mAtkObject, g_atk_socket_type) &&
|
||||
!aPlugId.IsVoid()) {
|
||||
AtkSocket* accSocket =
|
||||
G_TYPE_CHECK_INSTANCE_CAST(mAtkObject, g_atk_socket_type, AtkSocket);
|
||||
g_atk_socket_embed(accSocket, (gchar*)aPlugId.get());
|
||||
}
|
||||
}
|
||||
|
||||
void AtkSocketAccessible::GetNativeInterface(void** aOutAccessible) {
|
||||
*aOutAccessible = mAtkObject;
|
||||
}
|
||||
|
||||
void AtkSocketAccessible::Shutdown() {
|
||||
if (mAtkObject) {
|
||||
if (MAI_IS_ATK_SOCKET(mAtkObject)) {
|
||||
MAI_ATK_SOCKET(mAtkObject)->accWrap = nullptr;
|
||||
}
|
||||
g_object_unref(mAtkObject);
|
||||
mAtkObject = nullptr;
|
||||
}
|
||||
AccessibleWrap::Shutdown();
|
||||
}
|
|
@ -1,54 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* vim: set ts=2 et sw=2 tw=80: */
|
||||
/* 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/. */
|
||||
|
||||
#ifndef _AtkSocketAccessible_H_
|
||||
#define _AtkSocketAccessible_H_
|
||||
|
||||
#include "AccessibleWrap.h"
|
||||
|
||||
// This file gets included by nsAccessibilityService.cpp, which can't include
|
||||
// atk.h (or glib.h), so we can't rely on it being included.
|
||||
#ifdef __ATK_H__
|
||||
extern "C" typedef void (*AtkSocketEmbedType)(AtkSocket*, gchar*);
|
||||
#else
|
||||
extern "C" typedef void (*AtkSocketEmbedType)(void*, void*);
|
||||
#endif
|
||||
|
||||
namespace mozilla {
|
||||
namespace a11y {
|
||||
|
||||
/**
|
||||
* Provides a AccessibleWrap wrapper around AtkSocket for out-of-process
|
||||
* accessibles.
|
||||
*/
|
||||
class AtkSocketAccessible : public AccessibleWrap {
|
||||
public:
|
||||
// Soft references to AtkSocket
|
||||
static AtkSocketEmbedType g_atk_socket_embed;
|
||||
#ifdef __ATK_H__
|
||||
static GType g_atk_socket_type;
|
||||
#endif
|
||||
static const char* sATKSocketEmbedSymbol;
|
||||
static const char* sATKSocketGetTypeSymbol;
|
||||
|
||||
/*
|
||||
* True if the current Atk version supports AtkSocket and it was correctly
|
||||
* loaded.
|
||||
*/
|
||||
static bool gCanEmbed;
|
||||
|
||||
AtkSocketAccessible(nsIContent* aContent, DocAccessible* aDoc,
|
||||
const nsCString& aPlugId);
|
||||
|
||||
virtual void Shutdown() override;
|
||||
|
||||
virtual void GetNativeInterface(void** aOutAccessible) override;
|
||||
};
|
||||
|
||||
} // namespace a11y
|
||||
} // namespace mozilla
|
||||
|
||||
#endif
|
|
@ -10,7 +10,6 @@
|
|||
#include "nsIGSettingsService.h"
|
||||
#include "nsMai.h"
|
||||
#include "nsServiceManagerUtils.h"
|
||||
#include "AtkSocketAccessible.h"
|
||||
#include "prenv.h"
|
||||
#include "prlink.h"
|
||||
|
||||
|
@ -85,19 +84,6 @@ void a11y::PlatformInit() {
|
|||
g_atk_hyperlink_impl_type = pfn_atk_hyperlink_impl_get_type();
|
||||
}
|
||||
|
||||
AtkGetTypeType pfn_atk_socket_get_type =
|
||||
(AtkGetTypeType)PR_FindFunctionSymbol(
|
||||
sATKLib, AtkSocketAccessible::sATKSocketGetTypeSymbol);
|
||||
if (pfn_atk_socket_get_type) {
|
||||
AtkSocketAccessible::g_atk_socket_type = pfn_atk_socket_get_type();
|
||||
AtkSocketAccessible::g_atk_socket_embed =
|
||||
(AtkSocketEmbedType)PR_FindFunctionSymbol(
|
||||
sATKLib, AtkSocketAccessible ::sATKSocketEmbedSymbol);
|
||||
AtkSocketAccessible::gCanEmbed =
|
||||
AtkSocketAccessible::g_atk_socket_type != G_TYPE_INVALID &&
|
||||
AtkSocketAccessible::g_atk_socket_embed;
|
||||
}
|
||||
|
||||
gAtkTableCellGetTypeFunc =
|
||||
(GType(*)())PR_FindFunctionSymbol(sATKLib, "atk_table_cell_get_type");
|
||||
|
||||
|
|
|
@ -12,7 +12,6 @@ EXPORTS.mozilla.a11y += [
|
|||
SOURCES += [
|
||||
"AccessibleWrap.cpp",
|
||||
"ApplicationAccessibleWrap.cpp",
|
||||
"AtkSocketAccessible.cpp",
|
||||
"DocAccessibleWrap.cpp",
|
||||
"DOMtoATK.cpp",
|
||||
"nsMaiHyperlink.cpp",
|
||||
|
|
|
@ -33,31 +33,6 @@ class Accessible;
|
|||
(G_TYPE_INSTANCE_GET_CLASS((obj), MAI_TYPE_ATK_OBJECT, MaiAtkObjectClass))
|
||||
GType mai_atk_object_get_type(void);
|
||||
GType mai_util_get_type();
|
||||
extern "C" GType mai_atk_socket_get_type(void);
|
||||
|
||||
/* MaiAtkSocket */
|
||||
|
||||
#define MAI_TYPE_ATK_SOCKET (mai_atk_socket_get_type())
|
||||
#define MAI_ATK_SOCKET(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_CAST((obj), MAI_TYPE_ATK_SOCKET, MaiAtkSocket))
|
||||
#define MAI_IS_ATK_SOCKET(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_TYPE((obj), MAI_TYPE_ATK_SOCKET))
|
||||
#define MAI_ATK_SOCKET_CLASS(klass) \
|
||||
(G_TYPE_CHECK_CLASS_CAST((klass), MAI_TYPE_ATK_SOCKET, MaiAtkSocketClass))
|
||||
#define MAI_IS_ATK_SOCKET_CLASS(klass) \
|
||||
(G_TYPE_CHECK_CLASS_TYPE((klass), MAI_TYPE_ATK_SOCKET))
|
||||
#define MAI_ATK_SOCKET_GET_CLASS(obj) \
|
||||
(G_TYPE_INSTANCE_GET_CLASS((obj), MAI_TYPE_ATK_SOCKET, MaiAtkSocketClass))
|
||||
|
||||
typedef struct _MaiAtkSocket {
|
||||
AtkSocket parent;
|
||||
|
||||
mozilla::a11y::AccessibleWrap* accWrap;
|
||||
} MaiAtkSocket;
|
||||
|
||||
typedef struct _MaiAtkSocketClass {
|
||||
AtkSocketClass parent_class;
|
||||
} MaiAtkSocketClass;
|
||||
|
||||
// This is a pointer to the atk_table_cell_get_type function if we are using
|
||||
// a version of atk that defines that.
|
||||
|
|
|
@ -77,14 +77,7 @@ static gboolean scrollToPointCB(AtkComponent* aComponent, AtkCoordType coords,
|
|||
AtkObject* refAccessibleAtPointHelper(AtkObject* aAtkObj, gint aX, gint aY,
|
||||
AtkCoordType aCoordType) {
|
||||
Accessible* acc = GetInternalObj(aAtkObj);
|
||||
if (!acc) {
|
||||
// This might be an ATK Socket.
|
||||
acc = GetAccessibleWrap(aAtkObj);
|
||||
if (!acc) {
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
if (acc->IsLocal() && acc->AsLocal()->IsDefunct()) {
|
||||
if (!acc || (acc->IsLocal() && acc->AsLocal()->IsDefunct())) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
|
|
@ -43,10 +43,6 @@
|
|||
#include "TreeWalker.h"
|
||||
#include "xpcAccessibleApplication.h"
|
||||
|
||||
#ifdef MOZ_ACCESSIBILITY_ATK
|
||||
# include "AtkSocketAccessible.h"
|
||||
#endif
|
||||
|
||||
#ifdef XP_WIN
|
||||
# include "mozilla/a11y/Compatibility.h"
|
||||
# include "mozilla/dom/ContentChild.h"
|
||||
|
|
Загрузка…
Ссылка в новой задаче