[gtk+] widget: Add _gtk_widget_peek_accessible()
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] widget: Add _gtk_widget_peek_accessible()
- Date: Wed, 16 Nov 2011 03:42:04 +0000 (UTC)
commit 0b716e77eab99c7d6fe0174e3ad039a96a824e7c
Author: Benjamin Otte <otte redhat com>
Date: Sat Nov 12 03:38:40 2011 +0100
widget: Add _gtk_widget_peek_accessible()
This function returns the accessible if it already exists. This way we
can call functions on the accessible from the widget itself instead of
having to rely on signals.
gtk/gtkwidget.c | 19 +++++++++++++++++++
gtk/gtkwidgetprivate.h | 2 ++
2 files changed, 21 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index c624af6..667569b 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -11290,6 +11290,25 @@ gtk_widget_class_set_accessible_role (GtkWidgetClass *widget_class,
}
/**
+ * _gtk_widget_peek_accessible:
+ * @widget: a #GtkWidget
+ *
+ * Gets the accessible for @widget, if it has been created yet.
+ * Otherwise, this function returns %NULL. If the @widget's implementation
+ * does not use the default way to create accessibles, %NULL will always be
+ * returned.
+ *
+ * Returns: the accessible for @widget or %NULL if none has been
+ * created yet.
+ **/
+AtkObject *
+_gtk_widget_peek_accessible (GtkWidget *widget)
+{
+ return g_object_get_qdata (G_OBJECT (widget),
+ quark_accessible_object);
+}
+
+/**
* gtk_widget_get_accessible:
* @widget: a #GtkWidget
*
diff --git a/gtk/gtkwidgetprivate.h b/gtk/gtkwidgetprivate.h
index 03f25c76..35f99b9 100644
--- a/gtk/gtkwidgetprivate.h
+++ b/gtk/gtkwidgetprivate.h
@@ -118,6 +118,8 @@ void _gtk_widget_free_cached_sizes (GtkWidget *widget);
const gchar* _gtk_widget_get_accel_path (GtkWidget *widget,
gboolean *locked);
+AtkObject * _gtk_widget_peek_accessible (GtkWidget *widget);
+
GdkEventExpose * _gtk_cairo_get_event (cairo_t *cr);
void _gtk_widget_draw_internal (GtkWidget *widget,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]