Diff
Modified: trunk/Source/WebCore/ChangeLog (105723 => 105724)
--- trunk/Source/WebCore/ChangeLog 2012-01-24 11:49:47 UTC (rev 105723)
+++ trunk/Source/WebCore/ChangeLog 2012-01-24 11:55:18 UTC (rev 105724)
@@ -5,6 +5,29 @@
Reviewed by Martin Robinson.
+ New files for the implementation of the AtkHyperlinkImpl interface,
+ containing the related code from WebKitAccessibleWrapperAtk.cpp.
+
+ * accessibility/gtk/WebKitAccessibleInterfaceHyperlinkImpl.cpp: Added.
+ (webkitAccessibleHyperlinkImplInterfaceInit):
+ (webkitAccessibleHyperlinkImplGetHyperlink):
+ * accessibility/gtk/WebKitAccessibleInterfaceHyperlinkImpl.h: Added.
+ * accessibility/gtk/WebKitAccessibleWrapperAtk.cpp: Remove code
+ related to the implementation of the AtkHyperlinkImpl interface.
+ (webkit_accessible_class_init):
+
+ Add new files to build files.
+
+ * GNUmakefile.list.am: Add WebKitAccessibleInterfaceHyperlinkImpl.[h|cpp].
+ * WebCore.gypi: Ditto.
+
+2012-01-24 Mario Sanchez Prada <[email protected]>
+
+ [GTK] Refactor GTK's accessibilitity code to be more modular
+ https://bugs.webkit.org/show_bug.cgi?id=76783
+
+ Reviewed by Martin Robinson.
+
New files for the implementation of the AtkEditableText interface,
containing the related code from WebKitAccessibleWrapperAtk.cpp.
Modified: trunk/Source/WebCore/GNUmakefile.list.am (105723 => 105724)
--- trunk/Source/WebCore/GNUmakefile.list.am 2012-01-24 11:49:47 UTC (rev 105723)
+++ trunk/Source/WebCore/GNUmakefile.list.am 2012-01-24 11:55:18 UTC (rev 105724)
@@ -4429,6 +4429,8 @@
Source/WebCore/accessibility/gtk/WebKitAccessibleInterfaceDocument.h \
Source/WebCore/accessibility/gtk/WebKitAccessibleInterfaceEditableText.cpp \
Source/WebCore/accessibility/gtk/WebKitAccessibleInterfaceEditableText.h \
+ Source/WebCore/accessibility/gtk/WebKitAccessibleInterfaceHyperlinkImpl.cpp \
+ Source/WebCore/accessibility/gtk/WebKitAccessibleInterfaceHyperlinkImpl.h \
Source/WebCore/accessibility/gtk/WebKitAccessibleUtil.cpp \
Source/WebCore/accessibility/gtk/WebKitAccessibleUtil.h \
Source/WebCore/accessibility/gtk/WebKitAccessibleWrapperAtk.cpp \
Modified: trunk/Source/WebCore/WebCore.gypi (105723 => 105724)
--- trunk/Source/WebCore/WebCore.gypi 2012-01-24 11:49:47 UTC (rev 105723)
+++ trunk/Source/WebCore/WebCore.gypi 2012-01-24 11:55:18 UTC (rev 105724)
@@ -1353,6 +1353,8 @@
'accessibility/gtk/WebKitAccessibleInterfaceDocument.h',
'accessibility/gtk/WebKitAccessibleInterfaceEditableText.cpp',
'accessibility/gtk/WebKitAccessibleInterfaceEditableText.h',
+ 'accessibility/gtk/WebKitAccessibleInterfaceHyperlinkImpl.cpp',
+ 'accessibility/gtk/WebKitAccessibleInterfaceHyperlinkImpl.h',
'accessibility/gtk/WebKitAccessibleUtil.cpp',
'accessibility/gtk/WebKitAccessibleUtil.h',
'accessibility/gtk/WebKitAccessibleWrapperAtk.cpp',
Added: trunk/Source/WebCore/accessibility/gtk/WebKitAccessibleInterfaceHyperlinkImpl.cpp (0 => 105724)
--- trunk/Source/WebCore/accessibility/gtk/WebKitAccessibleInterfaceHyperlinkImpl.cpp (rev 0)
+++ trunk/Source/WebCore/accessibility/gtk/WebKitAccessibleInterfaceHyperlinkImpl.cpp 2012-01-24 11:55:18 UTC (rev 105724)
@@ -0,0 +1,43 @@
+/*
+ * Copyright (C) 2010, 2011, 2012 Igalia S.L.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include "config.h"
+#include "WebKitAccessibleInterfaceHyperlinkImpl.h"
+
+#include "WebKitAccessibleHyperlink.h"
+
+using namespace WebCore;
+
+static GQuark hyperlinkObjectQuark = 0;
+
+void webkitAccessibleHyperlinkImplInterfaceInit(AtkHyperlinkImplIface* iface)
+{
+ iface->get_hyperlink = webkitAccessibleHyperlinkImplGetHyperlink;
+ hyperlinkObjectQuark = g_quark_from_static_string("webkit-accessible-hyperlink-object");
+}
+
+AtkHyperlink* webkitAccessibleHyperlinkImplGetHyperlink(AtkHyperlinkImpl* hyperlink)
+{
+ AtkHyperlink* hyperlinkObject = ATK_HYPERLINK(g_object_get_qdata(G_OBJECT(hyperlink), hyperlinkObjectQuark));
+ if (!hyperlinkObject) {
+ hyperlinkObject = ATK_HYPERLINK(webkitAccessibleHyperlinkNew(hyperlink));
+ g_object_set_qdata(G_OBJECT(hyperlink), hyperlinkObjectQuark, hyperlinkObject);
+ }
+ return hyperlinkObject;
+}
Added: trunk/Source/WebCore/accessibility/gtk/WebKitAccessibleInterfaceHyperlinkImpl.h (0 => 105724)
--- trunk/Source/WebCore/accessibility/gtk/WebKitAccessibleInterfaceHyperlinkImpl.h (rev 0)
+++ trunk/Source/WebCore/accessibility/gtk/WebKitAccessibleInterfaceHyperlinkImpl.h 2012-01-24 11:55:18 UTC (rev 105724)
@@ -0,0 +1,28 @@
+/*
+ * Copyright (C) 2010, 2011, 2012 Igalia S.L.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef WebKitAccessibleInterfaceHyperlinkImpl_h
+#define WebKitAccessibleInterfaceHyperlinkImpl_h
+
+#include <atk/atk.h>
+
+void webkitAccessibleHyperlinkImplInterfaceInit(AtkHyperlinkImplIface*);
+AtkHyperlink* webkitAccessibleHyperlinkImplGetHyperlink(AtkHyperlinkImpl*);
+
+#endif // WebKitAccessibleInterfaceHyperlinkImpl_h
Modified: trunk/Source/WebCore/accessibility/gtk/WebKitAccessibleWrapperAtk.cpp (105723 => 105724)
--- trunk/Source/WebCore/accessibility/gtk/WebKitAccessibleWrapperAtk.cpp 2012-01-24 11:49:47 UTC (rev 105723)
+++ trunk/Source/WebCore/accessibility/gtk/WebKitAccessibleWrapperAtk.cpp 2012-01-24 11:55:18 UTC (rev 105724)
@@ -67,6 +67,7 @@
#include "WebKitAccessibleInterfaceComponent.h"
#include "WebKitAccessibleInterfaceDocument.h"
#include "WebKitAccessibleInterfaceEditableText.h"
+#include "WebKitAccessibleInterfaceHyperlinkImpl.h"
#include "WebKitAccessibleUtil.h"
#include "htmlediting.h"
#include "visible_units.h"
@@ -81,8 +82,6 @@
using namespace WebCore;
-static GQuark hyperlinkObjectQuark = 0;
-
static AccessibilityObject* fallbackObject()
{
// FIXME: An AXObjectCache with a Document is meaningless.
@@ -811,8 +810,6 @@
klass->get_index_in_parent = webkit_accessible_get_index_in_parent;
klass->get_attributes = webkit_accessible_get_attributes;
klass->ref_relation_set = webkit_accessible_ref_relation_set;
-
- hyperlinkObjectQuark = g_quark_from_static_string("webkit-accessible-hyperlink-object");
}
GType
@@ -2140,21 +2137,6 @@
iface->get_link_index = webkitAccessibleHypertextGetLinkIndex;
}
-static AtkHyperlink* webkitAccessibleHyperlinkImplGetHyperlink(AtkHyperlinkImpl* hyperlink)
-{
- AtkHyperlink* hyperlinkObject = ATK_HYPERLINK(g_object_get_qdata(G_OBJECT(hyperlink), hyperlinkObjectQuark));
- if (!hyperlinkObject) {
- hyperlinkObject = ATK_HYPERLINK(webkitAccessibleHyperlinkNew(hyperlink));
- g_object_set_qdata(G_OBJECT(hyperlink), hyperlinkObjectQuark, hyperlinkObject);
- }
- return hyperlinkObject;
-}
-
-static void atkHyperlinkImplInterfaceInit(AtkHyperlinkImplIface* iface)
-{
- iface->get_hyperlink = webkitAccessibleHyperlinkImplGetHyperlink;
-}
-
static void webkitAccessibleValueGetCurrentValue(AtkValue* value, GValue* gValue)
{
memset(gValue, 0, sizeof(GValue));
@@ -2225,8 +2207,7 @@
(GInterfaceFinalizeFunc) 0, 0},
{(GInterfaceInitFunc)atkHypertextInterfaceInit,
(GInterfaceFinalizeFunc) 0, 0},
- {(GInterfaceInitFunc)atkHyperlinkImplInterfaceInit,
- (GInterfaceFinalizeFunc) 0, 0},
+ {reinterpret_cast<GInterfaceInitFunc>(webkitAccessibleHyperlinkImplInterfaceInit), 0, 0},
{reinterpret_cast<GInterfaceInitFunc>(webkitAccessibleDocumentInterfaceInit), 0, 0},
{(GInterfaceInitFunc)atkValueInterfaceInit,
(GInterfaceFinalizeFunc) 0, 0}