Bug #356688, patch from Neo Liu. Connect atk-bridge to AtkDocument
authorbillh <billh@e2bd861d-eb25-0410-b326-f6ed22b6b98c>
Wed, 20 Sep 2006 15:33:23 +0000 (15:33 +0000)
committerbillh <billh@e2bd861d-eb25-0410-b326-f6ed22b6b98c>
Wed, 20 Sep 2006 15:33:23 +0000 (15:33 +0000)
signals and export as AT-SPI Document signals.

git-svn-id: http://svn.gnome.org/svn/at-spi/trunk@857 e2bd861d-eb25-0410-b326-f6ed22b6b98c

ChangeLog
atk-bridge/bridge.c

index 1a6cc675cafcb5389d3f7c3cfe9939b5cfee210e..8ec59309f0ebc94d50a6bed594a35e9bf4e3e587 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2006-09-20  Bill Haneman <bill.haneman@sun.com>
+
+       Patch from Neo Liu <nian.liu@sun.com>,
+       bug #356688.
+
+       * atk-bridge/bridge.c:
+       (spi_atk_bridge_document_event_listener): New, for 
+       AtkDocument signals.
+
 2006-08-30  Bill Haneman <bill.haneman@sun.com>
 
        * idl/*.idl:
index 80f0ab59899a90fe6057fa02c0fddedbab25848a..328e6bd600d178b44a24785f719a9c390427f955 100644 (file)
@@ -107,6 +107,11 @@ spi_atk_bridge_window_event_listener (GSignalInvocationHint *signal_hint,
                                const GValue *param_values,
                                gpointer data);
 static gboolean
+spi_atk_bridge_document_event_listener (GSignalInvocationHint *signal_hint,
+                                guint n_param_values,
+                                const GValue *param_values,
+                                gpointer data);
+static gboolean
 spi_atk_bridge_state_event_listener (GSignalInvocationHint *signal_hint,
                                     guint n_param_values,
                                     const GValue *param_values,
@@ -453,6 +458,15 @@ spi_atk_register_event_listeners (void)
   id = atk_add_global_event_listener (spi_atk_bridge_window_event_listener,
                                      "window:deactivate");
   g_array_append_val (listener_ids, id);
+  id = atk_add_global_event_listener (spi_atk_bridge_document_event_listener,
+                                     "Gtk:AtkDocument:load-complete");
+  g_array_append_val (listener_ids, id);
+  id = atk_add_global_event_listener (spi_atk_bridge_document_event_listener,
+                                     "Gtk:AtkDocument:reload");
+  g_array_append_val (listener_ids, id);
+  id = atk_add_global_event_listener (spi_atk_bridge_document_event_listener,
+                                     "Gtk:AtkDocument:load-stopped");
+  g_array_append_val (listener_ids, id);
   id = atk_add_global_event_listener (spi_atk_bridge_state_event_listener,
                                      "Gtk:AtkObject:state-change");
   g_array_append_val (listener_ids, id);
@@ -1127,6 +1141,41 @@ spi_atk_bridge_window_event_listener (GSignalInvocationHint *signal_hint,
   return TRUE;
 }
 
+static gboolean
+spi_atk_bridge_document_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;
+#ifdef SPI_BRIDGE_DEBUG
+  const gchar *s2;
+#endif
+
+  g_signal_query (signal_hint->signal_id, &signal_query);
+
+  name = signal_query.signal_name;
+
+#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 from object %s (gail %s)\n",
+           g_type_name (signal_query.itype), name, s ? s : "<NULL>" , s2);
+#endif
+
+  gobject = g_value_get_object (param_values + 0);
+
+  s = atk_object_get_name (ATK_OBJECT (gobject));
+  spi_atk_bridge_init_string (&any, ATK_OBJECT (gobject), (gchar **) &s);
+
+  spi_atk_emit_eventv (gobject, 0, 0, &any,
+                       "document:%s", name);
+  return TRUE;
+}
+
 static void
 spi_atk_tidy_windows (void)
 {