API revisions: tweaks to key event API, added some reserved slots for
[platform/core/uifw/at-spi2-atk.git] / atk-bridge / bridge.c
index d506e33..53c3d87 100644 (file)
@@ -352,10 +352,12 @@ spi_init_keystroke_from_atk_key_event (Accessibility_DeviceEvent  *keystroke,
   if (event->string)
     {
       keystroke->event_string = CORBA_string_dup (event->string);
+      keystroke->is_text = CORBA_TRUE;
     }
   else
     {
       keystroke->event_string = CORBA_string_dup ("");
+      keystroke->is_text = CORBA_FALSE;
     }
   switch (event->type)
     {
@@ -369,6 +371,12 @@ spi_init_keystroke_from_atk_key_event (Accessibility_DeviceEvent  *keystroke,
       keystroke->type = 0;
       break;
     }
+#if 0  
+  g_print ("key_event type %d; val=%d code=%d modifiers=%x name=%s is_text=%d, time=%lx\n",
+          (int) keystroke->type, (int) keystroke->id, (int) keystroke->hw_code,
+          (int) keystroke->modifiers,
+          keystroke->event_string, (int) keystroke->is_text, (unsigned long) keystroke->timestamp);
+#endif
 }
 
 static gint
@@ -381,6 +389,7 @@ spi_atk_bridge_key_listener (AtkKeyEventStruct *event, gpointer data)
 
   if (BONOBO_EX (&ev))
     {
+      g_warning ("failure: no deviceeventcontroller found\n");
       CORBA_exception_free (&ev);
       result = FALSE;
     }
@@ -407,6 +416,7 @@ spi_atk_bridge_signal_listener (GSignalInvocationHint *signal_hint,
   GObject *gobject;
   GSignalQuery signal_query;
   const gchar *name;
+  gint detail1 = 0, detail2 = 0;
 #ifdef SPI_BRIDGE_DEBUG
   gchar *s, *s2;
 #endif
@@ -423,8 +433,12 @@ spi_atk_bridge_signal_listener (GSignalInvocationHint *signal_hint,
 #endif
 
   gobject = g_value_get_object (param_values + 0);
-
-  spi_atk_emit_eventv (gobject, 0, 0, "object:%s", name);
+  if (G_VALUE_TYPE (param_values + 1) == G_TYPE_INT)
+    detail1 = g_value_get_int (param_values + 1);
+  if (G_VALUE_TYPE (param_values + 2) == G_TYPE_INT)
+    detail2 = g_value_get_int (param_values + 2);
+  
+  spi_atk_emit_eventv (gobject, detail1, detail2, "object:%s", name);
 
   return TRUE;
 }