+2006-11-07 Bill Haneman <bill.haneman@sun.com>
+
+ * configure.in: Uprev/release 1.7.13 for gnome 2.17.2.
+ Don't require gtk+ and gail for building most of at-spi
+ including libspi.
+
+ * registryd/registry-main.c:
+ (main): Call registry_set_ior.
+ (registry_set_ior): New, puts the registry's stringified IOR
+ on the root property as an XAtom, for discovery by all interested
+ X clients. See bug #163132.
+
+ * registryd/registry.h: Remove unneeded #include of gdk.
+
+ * atk-bridge/bridge.c:
+ (spi_atk_bridge_get_registry_ior): New, use this to
+ obtain the registry's IOR instead of using bonobo-activation.
+
+2006-10-01 Bill Haneman <bill.haneman@sun.com>
+
+ * configure.in: Uprev/release 1.7.12 for gnome 2.16.1.
+
2006-09-25 Bill Haneman <bill.haneman@sun.com>
* registryd/registry.c:
#include "config.h"
+#include <X11/Xlib.h>
+#include <X11/Xatom.h>
#include <string.h>
#include <stdio.h>
#include <unistd.h>
static guint atk_signal_bounds_changed;
static Accessibility_Registry spi_atk_bridge_get_registry (void);
-static void spi_atk_bridge_do_registration (void);
+static gboolean spi_atk_bridge_do_registration (void);
static void spi_atk_bridge_toplevel_added (AtkObject *object,
guint index,
AtkObject *child);
static void spi_atk_bridge_exit_func (void);
static void spi_atk_register_event_listeners (void);
static void spi_atk_bridge_focus_tracker (AtkObject *object);
+static gchar *spi_atk_bridge_get_registry_ior (void);
static void spi_atk_bridge_register_application (Accessibility_Registry registry);
static gboolean spi_atk_bridge_property_event_listener (GSignalInvocationHint *signal_hint,
guint n_param_values,
{
const char *debug_env_string = g_getenv ("AT_SPI_DEBUG");
gchar *fname;
+ gboolean success = FALSE;
if (atk_bridge_initialized)
{
}
else
{
- spi_atk_bridge_do_registration ();
+ success = spi_atk_bridge_do_registration ();
+ }
+ if (success)
+ {
+ spi_atk_register_event_listeners ();
+ spi_atk_bridge_init_event_type_consts ();
+ }
+ else
+ {
+ atk_bridge_initialized = FALSE;
}
- spi_atk_register_event_listeners ();
- spi_atk_bridge_init_event_type_consts ();
-
return 0;
}
-static void
+static gboolean
spi_atk_bridge_do_registration (void)
{
CORBA_Environment ev;
if (spi_atk_bridge_get_registry () == CORBA_OBJECT_NIL)
{
g_error ("Could not locate registry");
+ return FALSE;
}
bonobo_activate ();
g_atexit (spi_atk_bridge_exit_func);
DBG (1, g_message ("Application registered & listening\n"));
-
+ return TRUE;
}
static void
return canonical_display_name;
}
+static Display *bridge_display = NULL;
+
+static gchar *
+spi_atk_bridge_get_registry_ior (void)
+{
+
+ Atom AT_SPI_IOR;
+ Atom actual_type;
+ int actual_format;
+ unsigned char *data = NULL;
+ unsigned long nitems;
+ unsigned long leftover;
+ if (!bridge_display)
+ bridge_display = XOpenDisplay (spi_display_name ());
+
+ AT_SPI_IOR = XInternAtom (bridge_display, "AT_SPI_IOR", False);
+ XGetWindowProperty(bridge_display,
+ XDefaultRootWindow (bridge_display),
+ AT_SPI_IOR, 0L,
+ (long)BUFSIZ, False,
+ (Atom) 31, &actual_type, &actual_format,
+ &nitems, &leftover, &data);
+ if (data == NULL)
+ g_critical (_("AT_SPI_REGISTRY was not started at session startup."));
+
+ return (gchar *) data;
+
+}
+
+
static Accessibility_Registry
spi_atk_bridge_get_registry (void)
{
CORBA_Environment ev;
+ char *ior = NULL;
if (registry_died || (registry == CORBA_OBJECT_NIL)) {
CORBA_exception_init (&ev);
else
DBG (1, g_warning ("registry died! restarting..."));
}
- bonobo_activation_set_activation_env_value ("AT_SPI_DISPLAY", spi_display_name ());
- registry = bonobo_activation_activate_from_id (
- "OAFIID:Accessibility_Registry:1.0", 0, NULL, &ev);
+ /* XXX: This presumes that the registry has successfully restarted itself already...*/
+ ior = (char *) spi_atk_bridge_get_registry_ior ();
+
+ if (ior != NULL)
+ registry = CORBA_ORB_string_to_object (bonobo_activation_orb_get (),
+ ior, &ev);
+ else {
+ g_warning ("IOR not set.");
+ registry = CORBA_OBJECT_NIL;
+ }
if (ev._major != CORBA_NO_EXCEPTION)
{
{
g_assert (!bonobo_debug_shutdown ());
}
+ if (bridge_display)
+ XCloseDisplay (bridge_display);
}
void
}
listener_ids = NULL;
- atk_remove_focus_tracker (atk_bridge_focus_tracker_id);
+ if (atk_bridge_focus_tracker_id)
+ atk_remove_focus_tracker (atk_bridge_focus_tracker_id);
for (i = 0; ids && i < ids->len; i++)
{
atk_remove_global_event_listener (g_array_index (ids, guint, i));
}
- atk_remove_key_event_listener (atk_bridge_key_event_listener_id);
+ if (atk_bridge_key_event_listener_id)
+ atk_remove_key_event_listener (atk_bridge_key_event_listener_id);
deregister_application (app);
}
AT_SPI_MAJOR_VERSION=1
AT_SPI_MINOR_VERSION=7
-AT_SPI_MICRO_VERSION=12
+AT_SPI_MICRO_VERSION=13
AT_SPI_INTERFACE_AGE=0
AT_SPI_BINARY_AGE=0
AT_SPI_VERSION="$AT_SPI_MAJOR_VERSION.$AT_SPI_MINOR_VERSION.$AT_SPI_MICRO_VERSION"
dnl required versions of other tools.
m4_define([req_ver_atk], [1.12.0])
+m4_define([req_ver_gtk], [2.10.0])
+m4_define([req_ver_gail], [1.9.0])
m4_define([req_ver_libbonobo], [1.107.0])
-m4_define([req_ver_gail], [1.3.0])
-m4_define([req_ver_gtk], [2.0.0])
dnl Specify a header configuration file
AM_CONFIG_HEADER(config.h)
PKG_CHECK_MODULES(LIBSPI, [
libbonobo-2.0 >= req_ver_libbonobo
atk >= req_ver_atk
- gtk+-2.0 >= req_ver_gtk
- gail >= req_ver_gail
])
AC_SUBST(LIBSPI_LIBS)
AC_SUBST(LIBSPI_CFLAGS)
PKG_CHECK_MODULES(ATK_BRIDGE, [
libbonobo-2.0 >= req_ver_libbonobo
atk >= req_ver_atk
-])
+])
AC_SUBST(ATK_BRIDGE_LIBS)
AC_SUBST(ATK_BRIDGE_CFLAGS)
#include <config.h>
#include <string.h>
-#include <gdk/gdk.h>
+#include <gdk/gdkx.h>
#include <libbonobo.h>
#include <glib/gmain.h>
#include "registry.h"
+#define spi_get_display() GDK_DISPLAY()
+
+static void registry_set_ior (SpiRegistry *registry);
+
int
main (int argc, char **argv)
{
const char *display_name;
char *cp, *dp;
SpiRegistry *registry;
- GSList *reg_env = NULL;
if (!bonobo_init (&argc, argv))
{
display_name = g_getenv ("AT_SPI_DISPLAY");
if (!display_name)
{
- display_name = g_strdup (gdk_display_get_name (gdk_display_get_default ()));
+ display_name = g_getenv ("DISPLAY");
cp = strrchr (display_name, '.');
dp = strrchr (display_name, ':');
if (cp && dp && (cp > dp)) *cp = '\0';
}
- reg_env = bonobo_activation_registration_env_set ( reg_env, "AT_SPI_DISPLAY",
- display_name);
ret = bonobo_activation_register_active_server (
obj_id,
bonobo_object_corba_objref (bonobo_object (registry)),
- reg_env);
- bonobo_activation_registration_env_free (reg_env);
+ NULL);
+
+ registry_set_ior (registry);
if (ret != Bonobo_ACTIVATION_REG_SUCCESS)
{
return 0;
}
+static void
+registry_set_ior (SpiRegistry *registry){
+ CORBA_Environment ev;
+ Atom AT_SPI_IOR = XInternAtom (spi_get_display (), "AT_SPI_IOR", FALSE);
+ char *iorstring = NULL;
+
+ CORBA_exception_init (&ev);
+
+ iorstring = CORBA_ORB_object_to_string (bonobo_activation_orb_get (),
+ bonobo_object_corba_objref (bonobo_object (registry)),
+ &ev);
+
+ XChangeProperty (spi_get_display(),
+ XDefaultRootWindow (spi_get_display ()),
+ AT_SPI_IOR, (Atom) 31, 8,
+ PropModeReplace,
+ (unsigned char *) iorstring,
+ iorstring ? strlen (iorstring) : 0);
+
+ if (ev._major != CORBA_NO_EXCEPTION)
+ {
+ g_error ("Error setting IOR %s",
+ CORBA_exception_id (&ev));
+ CORBA_exception_free (&ev);
+ }
+
+ CORBA_exception_free (&ev);
+
+}
#define SPI_REGISTRY_H_
#include <glib/gmain.h>
-#include <gdk/gdk.h>
#include <libspi/listener.h>
typedef struct _SpiRegistry SpiRegistry;