summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gtk/gtkaccessible.c20
-rw-r--r--gtk/gtkaccessible.h4
2 files changed, 22 insertions, 2 deletions
diff --git a/gtk/gtkaccessible.c b/gtk/gtkaccessible.c
index eb318e1cc1..e999b092d7 100644
--- a/gtk/gtkaccessible.c
+++ b/gtk/gtkaccessible.c
@@ -104,11 +104,23 @@ gtk_accessible_init (GtkAccessible *accessible)
}
static void
+gtk_accessible_real_widget_set (GtkAccessible *accessible)
+{
+}
+
+static void
+gtk_accessible_real_widget_unset (GtkAccessible *accessible)
+{
+}
+
+static void
gtk_accessible_class_init (GtkAccessibleClass *klass)
{
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
klass->connect_widget_destroyed = gtk_accessible_real_connect_widget_destroyed;
+ klass->widget_set = gtk_accessible_real_widget_set;
+ klass->widget_unset = gtk_accessible_real_widget_unset;
gobject_class->get_property = gtk_accessible_get_property;
gobject_class->set_property = gtk_accessible_set_property;
@@ -142,16 +154,24 @@ gtk_accessible_set_widget (GtkAccessible *accessible,
GtkWidget *widget)
{
GtkAccessiblePrivate *priv;
+ GtkAccessibleClass *klass;
g_return_if_fail (GTK_IS_ACCESSIBLE (accessible));
priv = accessible->priv;
+ klass = GTK_ACCESSIBLE_GET_CLASS (accessible);
if (priv->widget == widget)
return;
+ if (priv->widget)
+ klass->widget_unset (accessible);
+
priv->widget = widget;
+ if (widget);
+ klass->widget_set (accessible);
+
g_object_notify (G_OBJECT (accessible), "widget");
}
diff --git a/gtk/gtkaccessible.h b/gtk/gtkaccessible.h
index 04d213a3a3..296186ca2b 100644
--- a/gtk/gtkaccessible.h
+++ b/gtk/gtkaccessible.h
@@ -54,9 +54,9 @@ struct _GtkAccessibleClass
void (*connect_widget_destroyed) (GtkAccessible *accessible);
+ void (*widget_set) (GtkAccessible *accessible);
+ void (*widget_unset) (GtkAccessible *accessible);
/* Padding for future expansion */
- void (*_gtk_reserved1) (void);
- void (*_gtk_reserved2) (void);
void (*_gtk_reserved3) (void);
void (*_gtk_reserved4) (void);
};