+ SpiAccessible *s_ao = NULL;
+#ifdef SPI_BRIDGE_DEBUG
+ const gchar *s, *s2;
+#endif
+
+ g_signal_query (signal_hint->signal_id, &signal_query);
+
+ name = signal_query.signal_name;
+ if (signal_hint->detail)
+ detail = g_quark_to_string (signal_hint->detail);
+ else
+ detail = NULL;
+
+#ifdef SPI_BRIDGE_DEBUG
+ s2 = g_type_name (G_OBJECT_TYPE (g_value_get_object (param_values + 0)));
+ s = atk_object_get_name (ATK_OBJECT (g_value_get_object (param_values + 0)));
+ fprintf (stderr, "Received signal %s:%s detail: %s from object %s (gail %s)\n",
+ g_type_name (signal_query.itype), name,
+ detail ? detail : "<NULL>", s ? s : "<NULL>" , s2);
+#endif
+
+ gobject = g_value_get_object (param_values + 0);
+
+ if (signal_query.signal_id == atk_signal_active_descendant_changed)
+ {
+ gpointer child = g_value_get_pointer (param_values + 1);
+
+ g_return_val_if_fail (ATK_IS_OBJECT (child), TRUE);
+
+ ao = ATK_OBJECT (child);
+
+ detail1 = atk_object_get_index_in_parent (ao);
+ s_ao = spi_accessible_new (ao);
+ c_obj = BONOBO_OBJREF (s_ao);
+ spi_atk_bridge_init_object (&any, ATK_OBJECT (gobject), &c_obj);
+ }
+ else if (signal_query.signal_id == atk_signal_link_selected)
+ {
+ if (G_VALUE_TYPE (param_values + 1) == G_TYPE_INT)
+ detail1 = g_value_get_int (param_values + 1);
+ spi_atk_bridge_init_nil (&any, ATK_OBJECT (gobject));
+ }
+ else if (signal_query.signal_id == atk_signal_bounds_changed)
+ {
+ AtkRectangle *atk_rect = NULL;
+
+ if (G_VALUE_HOLDS_BOXED (param_values + 1))
+ atk_rect = g_value_get_boxed (param_values + 1);
+ spi_atk_bridge_init_rect (&any, ATK_OBJECT (gobject), atk_rect);
+ }
+ else if ((signal_query.signal_id == atk_signal_children_changed) && gobject)
+ {
+ detail1 = g_value_get_uint (param_values + 1);
+ ao = atk_object_ref_accessible_child (ATK_OBJECT (gobject),
+ detail1);
+ if (ao)
+ {
+ s_ao = spi_accessible_new (ao);
+ c_obj = BONOBO_OBJREF (s_ao);
+ spi_atk_bridge_init_object (&any, ATK_OBJECT (gobject), &c_obj);
+ g_object_unref (ao);
+ }
+ else
+ {
+ spi_atk_bridge_init_nil (&any, ATK_OBJECT (gobject));
+ }
+ }
+ else
+ {
+ if (n_param_values >= 2)
+ {
+ if (G_VALUE_TYPE (param_values + 1) == G_TYPE_INT)
+ detail1 = g_value_get_int (param_values + 1);
+ if (n_param_values >= 3)
+ {
+ if (G_VALUE_TYPE (param_values + 2) == G_TYPE_INT)
+ detail2 = g_value_get_int (param_values + 2);
+ }
+ }
+
+ if (signal_query.signal_id == atk_signal_text_changed)
+ {
+ sp = atk_text_get_text (ATK_TEXT (gobject),
+ detail1,
+ detail1+detail2);
+ spi_atk_bridge_init_string (&any, ATK_OBJECT (gobject),
+ (gchar **) &sp);
+ }
+ else if (signal_query.signal_id == atk_signal_text_selection_changed)
+ {
+ /* Return NULL as the selected string */
+ spi_atk_bridge_init_nil (&any, ATK_OBJECT (gobject));
+ }
+ else
+ {
+ spi_atk_bridge_init_nil (&any, ATK_OBJECT (gobject));
+ }
+ }
+
+ if (detail)
+ spi_atk_emit_eventv (gobject, detail1, detail2, &any,
+ "object:%s:%s", name, detail);
+ else
+ spi_atk_emit_eventv (gobject, detail1, detail2, &any,
+ "object:%s", name);
+
+ if (sp)
+ g_free (sp);
+
+ return TRUE;
+}
+
+static gboolean
+spi_atk_bridge_window_event_listener (GSignalInvocationHint *signal_hint,
+ guint n_param_values,
+ const GValue *param_values,
+ gpointer data)
+{
+ GObject *gobject;
+ GSignalQuery signal_query;
+ CORBA_any any;
+ const gchar *name, *s;