- {"atspi-dbus-name", 0, 0, G_OPTION_ARG_STRING, &atspi_dbus_name, "D-Bus bus name to register as", NULL},
- {"atspi-no-register", 0, 0, G_OPTION_ARG_NONE, &atspi_no_register, "Do not register with Registry Daemon", NULL},
+ AtkObject *accessible = ATK_OBJECT(socket);
+ gchar *plug_name, *plug_path;
+
+ /* Force registration */
+ gchar *path = spi_register_object_to_path (spi_global_register, G_OBJECT (accessible));
+ /* Let the plug know that it has been embedded */
+ plug_name = g_strdup (plug_id);
+ if (!plug_name)
+ {
+ g_free (path);
+ return;
+ }
+ plug_path = g_utf8_strchr (plug_name + 1, -1, ':');
+ if (plug_path)
+ {
+ DBusMessage *message;
+ *(plug_path++) = '\0';
+ message = dbus_message_new_method_call (plug_name, plug_path, "org.freedesktop.atspi.Accessible", "Embedded");
+ dbus_message_append_args (message, DBUS_TYPE_STRING, &path, DBUS_TYPE_INVALID);
+ dbus_connection_send (spi_global_app_data->bus, message, NULL);
+ }
+ g_free (plug_name);
+ g_free (path);
+}
+
+static void
+install_plug_hooks ()
+{
+ gpointer data;
+
+ data = g_type_class_ref (ATK_TYPE_PLUG);
+ plug_class = ATK_PLUG_CLASS (data);
+ data = g_type_class_ref (ATK_TYPE_SOCKET);
+ socket_class = ATK_SOCKET_CLASS (data);
+ plug_class->get_object_id = get_plug_id;
+ socket_class->embed = socket_embed_hook;
+}
+
+gchar *atspi_dbus_name = NULL;
+static gboolean atspi_no_register = FALSE;
+
+static GOptionEntry atspi_option_entries[] = {
+ {"atspi-dbus-name", 0, 0, G_OPTION_ARG_STRING, &atspi_dbus_name,
+ "D-Bus bus name to register as", NULL},
+ {"atspi-no-register", 0, 0, G_OPTION_ARG_NONE, &atspi_no_register,
+ "Do not register with Registry Daemon", NULL},