summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2013-01-13 17:55:38 +0100
committerBenjamin Otte <otte@redhat.com>2013-01-13 23:47:40 +0100
commitb0e2fd453c22a08462be395b2287fc426f658b67 (patch)
tree03308bf01e145c616877eaa47c61021ce306ca31
parent6088f59b5e031fbec1a7bb38a78b1c365cea9103 (diff)
downloadgtk+-b0e2fd453c22a08462be395b2287fc426f658b67.tar.gz
a11y: Notify linkbutton directly instead of using signals
-rw-r--r--gtk/a11y/Makefile.am1
-rw-r--r--gtk/a11y/gtklinkbuttonaccessible.c29
-rw-r--r--gtk/a11y/gtklinkbuttonaccessibleprivate.h29
-rw-r--r--gtk/gtklinkbutton.c4
4 files changed, 49 insertions, 14 deletions
diff --git a/gtk/a11y/Makefile.am b/gtk/a11y/Makefile.am
index 6e93b3e540..8962129f83 100644
--- a/gtk/a11y/Makefile.am
+++ b/gtk/a11y/Makefile.am
@@ -105,6 +105,7 @@ gtka11y_private_h_sources = \
gtkcolorswatchaccessibleprivate.h \
gtkcontaineraccessibleprivate.h \
gtkiconviewaccessibleprivate.h \
+ gtklinkbuttonaccessibleprivate.h \
gtklockbuttonaccessibleprivate.h \
gtkrangeaccessibleprivate.h \
gtkstatusbaraccessibleprivate.h \
diff --git a/gtk/a11y/gtklinkbuttonaccessible.c b/gtk/a11y/gtklinkbuttonaccessible.c
index b76f237f67..9c70a375c8 100644
--- a/gtk/a11y/gtklinkbuttonaccessible.c
+++ b/gtk/a11y/gtklinkbuttonaccessible.c
@@ -17,8 +17,8 @@
#include "config.h"
-#include <gtk/gtk.h>
-#include "gtklinkbuttonaccessible.h"
+#include "gtklinkbuttonaccessibleprivate.h"
+#include "gtkwidgetprivate.h"
typedef struct _GtkLinkButtonAccessibleLink GtkLinkButtonAccessibleLink;
typedef struct _GtkLinkButtonAccessibleLinkClass GtkLinkButtonAccessibleLinkClass;
@@ -171,15 +171,6 @@ atk_action_interface_init (AtkActionIface *iface)
iface->get_name = gtk_link_button_accessible_link_get_name;
}
-static gboolean
-activate_link (GtkLinkButton *button,
- AtkHyperlink *atk_link)
-{
- g_signal_emit_by_name (atk_link, "link-activated");
-
- return FALSE;
-}
-
static AtkHyperlink *
gtk_link_button_accessible_get_hyperlink (AtkHyperlinkImpl *impl)
{
@@ -188,8 +179,6 @@ gtk_link_button_accessible_get_hyperlink (AtkHyperlinkImpl *impl)
if (!button->priv->link)
{
button->priv->link = gtk_link_button_accessible_link_new (button);
- g_signal_connect (gtk_accessible_get_widget (GTK_ACCESSIBLE (button)),
- "activate-link", G_CALLBACK (activate_link), button->priv->link);
}
return g_object_ref (button->priv->link);
@@ -232,3 +221,17 @@ atk_hypertext_impl_interface_init (AtkHyperlinkImplIface *iface)
{
iface->get_hyperlink = gtk_link_button_accessible_get_hyperlink;
}
+
+void
+_gtk_link_button_accessible_activate_link (GtkLinkButton *link_button)
+{
+ GtkLinkButtonAccessible *accessible;
+
+ accessible = GTK_LINK_BUTTON_ACCESSIBLE (_gtk_widget_peek_accessible (GTK_WIDGET (link_button)));
+ if (accessible == NULL)
+ return;
+
+ if (accessible->priv->link)
+ g_signal_emit_by_name (accessible->priv->link, "link-activated");
+}
+
diff --git a/gtk/a11y/gtklinkbuttonaccessibleprivate.h b/gtk/a11y/gtklinkbuttonaccessibleprivate.h
new file mode 100644
index 0000000000..749e40aed8
--- /dev/null
+++ b/gtk/a11y/gtklinkbuttonaccessibleprivate.h
@@ -0,0 +1,29 @@
+/* GTK+ - accessibility implementations
+ * Copyright (C) 2013 Benjamin Otte <otte@gnome.org>
+ *
+ * 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. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef __GTK_LINK_BUTTON_ACCESSIBLE_PRIVATE_H__
+#define __GTK_LINK_BUTTON_ACCESSIBLE_PRIVATE_H__
+
+#include <gtk/a11y/gtklinkbuttonaccessible.h>
+
+G_BEGIN_DECLS
+
+void _gtk_link_button_accessible_activate_link (GtkLinkButton *link_button);
+
+G_END_DECLS
+
+#endif /* __GTK_LINK_BUTTON_ACCESSIBLE_PRIVATE_H__ */
diff --git a/gtk/gtklinkbutton.c b/gtk/gtklinkbutton.c
index b5981c741f..3f4b3b123a 100644
--- a/gtk/gtklinkbutton.c
+++ b/gtk/gtklinkbutton.c
@@ -65,7 +65,7 @@
#include "gtkprivate.h"
#include "gtkintl.h"
-#include "a11y/gtklinkbuttonaccessible.h"
+#include "a11y/gtklinkbuttonaccessibleprivate.h"
struct _GtkLinkButtonPrivate
{
@@ -548,6 +548,8 @@ gtk_link_button_activate_link (GtkLinkButton *link_button)
GdkScreen *screen;
GError *error;
+ _gtk_link_button_accessible_activate_link (link_button);
+
if (gtk_widget_has_screen (GTK_WIDGET (link_button)))
screen = gtk_widget_get_screen (GTK_WIDGET (link_button));
else