#include <atk/atk.h>
#include <droute/droute.h>
-#include <gmodule.h>
#include <atspi/atspi.h>
+#include <atk-bridge.h>
#include "bridge.h"
#include "event.h"
SpiBridge *spi_global_app_data = NULL;
-/*static Display *bridge_display = NULL;*/
-
-/*---------------------------------------------------------------------------*/
-
-/*
- * Returns a 'canonicalized' value for DISPLAY,
- * with the screen number stripped off if present.
- *
- */
-static const gchar *
-spi_display_name (void)
-{
- static const char *canonical_display_name = NULL;
- if (!canonical_display_name)
- {
- const gchar *display_env = g_getenv ("AT_SPI_DISPLAY");
- if (!display_env)
- {
- display_env = g_getenv ("DISPLAY");
- if (!display_env || !display_env[0])
- canonical_display_name = ":0";
- else
- {
- gchar *display_p, *screen_p;
- canonical_display_name = g_strdup (display_env);
- display_p = strrchr (canonical_display_name, ':');
- screen_p = strrchr (canonical_display_name, '.');
- if (screen_p && display_p && (screen_p > display_p))
- {
- *screen_p = '\0';
- }
- }
- }
- else
- {
- canonical_display_name = display_env;
- }
- }
- return canonical_display_name;
-}
-
-/*---------------------------------------------------------------------------*/
-
-static void
-set_reply (DBusPendingCall *pending, void *user_data)
-{
- void **replyptr = (void **)user_data;
-
- *replyptr = dbus_pending_call_steal_reply (pending);
- dbus_pending_call_unref (pending);
-}
-
/*---------------------------------------------------------------------------*/
static void
{
event_data *evdata;
gchar **data;
- GList *new_list;
spi_atk_add_client (bus_name);
evdata = (event_data *) g_malloc (sizeof (*evdata));
}
evdata->bus_name = g_strdup (bus_name);
evdata->data = data;
- new_list = g_list_append (spi_global_app_data->events, evdata);
- if (new_list)
- spi_global_app_data->events = new_list;
+ spi_global_app_data->events = g_list_append (spi_global_app_data->events, evdata);
}
static GSList *clients = NULL;
{
DBusMessage *reply;
SpiBridge *app = user_data;
- DBusMessage *message;
reply = dbus_pending_call_steal_reply (pending);
dbus_pending_call_unref (pending);
static gboolean
register_application (SpiBridge * app)
{
- DBusMessage *message, *reply;
+ DBusMessage *message;
DBusMessageIter iter;
DBusError error;
DBusPendingCall *pending;
static void
new_connection_cb (DBusServer *server, DBusConnection *con, void *data)
{
- GList *new_list;
-
dbus_connection_set_unix_user_function (con, user_check, NULL, NULL);
dbus_connection_ref(con);
atspi_dbus_connection_setup_with_g_main(con, NULL);
static void
remove_events (const char *bus_name, const char *event)
{
- event_data *evdata;
gchar **remove_data;
GList *list;
handle_event_listener_deregistered (DBusConnection *bus, DBusMessage *message,
void *user_data)
{
- const char *orig_name;
gchar *name;
char *sender;
* - Application registration with the AT-SPI registry.
*
*/
-static int
+int
adaptor_init (gint * argc, gchar ** argv[])
{
GOptionContext *opt;
GError *err = NULL;
DBusError error;
AtkObject *root;
- gchar *introspection_directory;
static gboolean inited = FALSE;
if (inited)
return 0;
}
-/*---------------------------------------------------------------------------*/
-
-int
-gtk_module_init (gint * argc, gchar ** argv[])
-{
- const gchar *load_bridge = g_getenv ("NO_AT_BRIDGE");
-
- if (!load_bridge || g_ascii_strtod (load_bridge, NULL) == 0)
- {
- return adaptor_init (argc, argv);
- }
- return 0;
-}
-
-gchar*
-g_module_check_init (GModule *module)
-{
- g_module_make_resident (module);
-
- return NULL;
-}
-
void
-gnome_accessibility_module_init (void)
-{
- const gchar *load_bridge = g_getenv ("NO_AT_BRIDGE");
-
- if (!load_bridge || g_ascii_strtod (load_bridge, NULL) == 0)
- {
- adaptor_init (NULL, NULL);
-
- if (g_getenv ("AT_SPI_DEBUG"))
- {
- g_print ("Atk Accessibility bridge initialized\n");
- }
- }
-}
-
-void
-gnome_accessibility_module_shutdown (void)
+adaptor_cleanup (void)
{
GList *l;
GSList *ls;
g_free (spi_global_app_data);
spi_global_app_data = NULL;
-
- /* Not currently creating an XDisplay */
-#if 0
- if (bridge_display)
- XCloseDisplay (bridge_display);
-#endif
}
+/*---------------------------------------------------------------------------*/
+
static gchar *name_match_tmpl =
"type='signal', interface='org.freedesktop.DBus', member='NameOwnerChanged', arg0='%s'";