2002-04-18 Marc Mulcahy <marc.mulcahy@sun.com>
authormarcm <marcm@e2bd861d-eb25-0410-b326-f6ed22b6b98c>
Thu, 18 Apr 2002 02:45:27 +0000 (02:45 +0000)
committermarcm <marcm@e2bd861d-eb25-0410-b326-f6ed22b6b98c>
Thu, 18 Apr 2002 02:45:27 +0000 (02:45 +0000)
        * atk-bridge/bridge.c: Added window event support.

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

ChangeLog
atk-bridge/bridge.c

index 21936d0..0bef5c1 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2002-04-18  Marc Mulcahy  <marc.mulcahy@sun.com>
+
+        * atk-bridge/bridge.c: Added window event support.
+
 2002-04-18  Michael Meeks  <michael@ximian.com>
 
        * libspi/relation.c (impl_getNTargets): impl.
index 9ebf8c8..f752e84 100644 (file)
@@ -48,6 +48,11 @@ static gboolean spi_atk_bridge_property_event_listener (GSignalInvocationHint *s
                                                        guint                  n_param_values,
                                                        const GValue          *param_values,
                                                        gpointer               data);
+static gboolean
+spi_atk_bridge_window_event_listener (GSignalInvocationHint *signal_hint,
+                               guint n_param_values,
+                               const GValue *param_values,
+                               gpointer data);
 static gboolean spi_atk_bridge_signal_listener         (GSignalInvocationHint *signal_hint,
                                                        guint                  n_param_values,
                                                        const GValue          *param_values,
@@ -183,6 +188,21 @@ spi_atk_register_event_listeners (void)
   id = atk_add_global_event_listener (spi_atk_bridge_property_event_listener,
                                      "Gtk:AtkObject:property-change");
   g_array_append_val (listener_ids, id);
+  id = atk_add_global_event_listener (spi_atk_bridge_window_event_listener,
+                                     "window:create");
+  g_array_append_val (listener_ids, id);
+  id = atk_add_global_event_listener (spi_atk_bridge_window_event_listener,
+                                     "window:destroy");
+  g_array_append_val (listener_ids, id);
+  id = atk_add_global_event_listener (spi_atk_bridge_window_event_listener,
+                                     "window:minimize");
+  g_array_append_val (listener_ids, id);
+  id = atk_add_global_event_listener (spi_atk_bridge_window_event_listener,
+                                     "window:maximize");
+  g_array_append_val (listener_ids, id);
+  id = atk_add_global_event_listener (spi_atk_bridge_window_event_listener,
+                                     "window:restore");
+  g_array_append_val (listener_ids, id);
 
   add_signal_listener ("Gtk:AtkObject:state-change");
   add_signal_listener ("Gtk:AtkObject:children-changed");
@@ -556,3 +576,35 @@ spi_atk_bridge_signal_listener (GSignalInvocationHint *signal_hint,
 
   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;
+  const gchar *name;
+#ifdef SPI_BRIDGE_DEBUG
+  gchar *s, *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, s2);
+#endif
+
+  gobject = g_value_get_object (param_values + 0);
+  spi_atk_emit_eventv (gobject, 0, 0, "window:%s", name);
+
+  return TRUE;
+}