#include <dlfcn.h>
#include <dbus/dbus.h>
-#include <dbus/dbus-glib.h>
#include "paths.h"
#include "registry.h"
#include "deviceeventcontroller.h"
-#include "atspi/atspi-misc.h"
-
-#define CORBA_GCONF_KEY "/desktop/gnome/interface/at-spi-corba"
-
-static gboolean need_to_quit ();
+#include "atspi/atspi.h"
static GMainLoop *mainloop;
static gchar *dbus_name = NULL;
reason = "";
ret = g_dbus_proxy_call_sync (client_proxy, "EndSessionResponse",
- g_variant_new ("(us)", is_okay, reason),
+ g_variant_new ("(bs)", is_okay, reason),
0, 1000, NULL, &error);
if (!ret) {
DBusError error;
int ret;
- if (need_to_quit ())
- return 0;
-
g_type_init();
/*Parse command options*/
}
mainloop = g_main_loop_new (NULL, FALSE);
- dbus_connection_setup_with_g_main(bus, NULL);
+ atspi_dbus_connection_setup_with_g_main(bus, NULL);
ret = dbus_bus_request_name(bus, dbus_name, DBUS_NAME_FLAG_DO_NOT_QUEUE, &error);
if (ret == DBUS_REQUEST_NAME_REPLY_EXISTS)
g_main_loop_run (mainloop);
return 0;
}
-
-static gboolean
-need_to_quit ()
-{
- void *gconf = NULL;
- gconf_client_get_default_t gconf_client_get_default = NULL;
- gconf_client_get_bool_t gconf_client_get_bool = NULL;
- GObject *gconf_client; /* really a GConfClient */
- gboolean ret;
-
- g_type_init ();
-
- gconf = dlopen ("libgconf-2.so", RTLD_LAZY);
- if (gconf)
- {
- gconf_client_get_default = dlsym (gconf, "gconf_client_get_default");
- gconf_client_get_bool = dlsym (gconf, "gconf_client_get_bool");
- }
-
- if (!gconf_client_get_default || !gconf_client_get_bool)
- {
- if (gconf)
- dlclose (gconf);
- return FALSE;
- }
-
- /* If we've been relocated, we will exit if the at-spi-corba gconf key
- * has been set. If we have not been relocated, we will only run if the
- * at-spi-dbus gconf key has been set.
- */
- gconf_client = gconf_client_get_default ();
- ret = gconf_client_get_bool (gconf_client, CORBA_GCONF_KEY, NULL);
- g_object_unref (gconf_client);
-
- return ret;
-}