2008-07-21 Mark Doffman <mark.doffman@codethink.co.uk>
[platform/core/uifw/at-spi2-atk.git] / atk-adaptor / bridge.c
index 5620f16..4476c6d 100644 (file)
@@ -685,7 +685,11 @@ static void emit(AtkObject *object, const char *name, const char *detail, dbus_i
     type_as_string = "o";
     if (!val) val = "";
   }
-  else if (type == DBUS_TYPE_STRING) type_as_string = "s";
+  else if (type == DBUS_TYPE_STRING)
+  {
+    type_as_string = "s";
+    if (!val) val = "";
+  }
   else if (type == DBUS_TYPE_INT32) type_as_string = "i";
   else if (type == DBUS_TYPE_UINT32) type_as_string = "u";
   else if (type == DBUS_TYPE_INVALID)
@@ -698,7 +702,7 @@ static void emit(AtkObject *object, const char *name, const char *detail, dbus_i
   {
     g_warning("Unknown type %d in property change signal", type);
   }
-  sig = dbus_message_new_signal(path, "org.freedesktop.atspi.Accessible", name);
+  sig = dbus_message_new_signal(path, SPI_DBUS_INTERFACE_ACCESSIBLE, name);
   dbus_message_iter_init_append(sig, &iter);
   if (!detail) detail = "";
   dbus_message_iter_append_basic(&iter, DBUS_TYPE_STRING, &detail);
@@ -707,7 +711,6 @@ static void emit(AtkObject *object, const char *name, const char *detail, dbus_i
   dbus_message_iter_open_container(&iter, DBUS_TYPE_VARIANT, type_as_string, &sub);
   dbus_message_iter_append_basic(&sub, type, &val);
   dbus_message_iter_close_container(&iter, &sub);
-printf("emit: %s %s\n", name, detail);
   dbus_connection_send(this_app->droute.bus, sig, NULL);
   g_free(path);
   dbus_message_unref(sig);
@@ -732,7 +735,7 @@ static void emit_rect(AtkObject *object, const char *name, const char *detail, A
   y = rect->y;
   width = rect->width;
   height = rect->height;
-  sig = dbus_message_new_signal(path, "org.freedesktop.atspi.Accessible", name);
+  sig = dbus_message_new_signal(path, SPI_DBUS_INTERFACE_ACCESSIBLE, name);
   if (!detail) detail = "";
   if (sig)
     {
@@ -950,7 +953,7 @@ spi_init_keystroke_from_atk_key_event (Accessibility_DeviceEvent  *keystroke,
 
 static gboolean Accessibility_DeviceEventController_notifyListenersSync(const Accessibility_DeviceEvent *key_event)
 {
-  DBusMessage *message = dbus_message_new_method_call(SPI_DBUS_NAME_REGISTRY, SPI_DBUS_PATH_REGISTRY, "org.freedesktop.atspi.DeviceEventController", "notifyListenersSync");
+  DBusMessage *message = dbus_message_new_method_call(SPI_DBUS_NAME_REGISTRY, SPI_DBUS_PATH_REGISTRY, SPI_DBUS_INTERFACE_DEC, "notifyListenersSync");
   DBusError error;
   dbus_bool_t consumed = FALSE;
 
@@ -1189,11 +1192,11 @@ spi_atk_tidy_windows (void)
       name = atk_object_get_name (child);
       if (atk_state_set_contains_state (stateset, ATK_STATE_ACTIVE))
         {
-         emit(child, "window:deactivate", NULL, 0, 0, DBUS_TYPE_STRING, name);
+         emit(child, "window_deactivate", NULL, 0, 0, DBUS_TYPE_STRING, name);
         }
       g_object_unref (stateset);
 
-      emit(child, "window:destroy", NULL, 0, 0, DBUS_TYPE_STRING, name);
+      emit(child, "window_destroy", NULL, 0, 0, DBUS_TYPE_STRING, name);
       g_object_unref (child);
     }
 }