*** at-spi-858/ChangeLog	2007-02-27 07:37:38.000000000 -0800
--- at-spi-861/ChangeLog	2007-02-27 07:38:05.000000000 -0800
***************
*** 1,3 ****
--- 1,25 ----
+ 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:
*** at-spi-858/NEWS	2007-02-27 07:37:38.000000000 -0800
--- at-spi-861/NEWS	2007-02-27 07:38:05.000000000 -0800
***************
*** 1,3 ****
--- 1,11 ----
+ What's new in at-spi-1.7.12:
+ 
+ * Modified parameter names in some IDL to avoid class name collisions
+   (Gary Cramblitt).  This is a bincompat change which improves portability
+   of the IDL.
+ 
+ * Bugfixes: #353226, #356688 (Neo Liu), #350552 (Ginn Chen), #350958.
+ 
  What's new in at-spi-1.7.11:
  
  * Docs fixes.
*** at-spi-858/atk-bridge/bridge.c	2007-02-27 07:37:38.000000000 -0800
--- at-spi-861/atk-bridge/bridge.c	2007-02-27 07:38:05.000000000 -0800
***************
*** 23,28 ****
--- 23,30 ----
  
  #include "config.h"
  
+ #include <X11/Xlib.h>
+ #include <X11/Xatom.h>
  #include <string.h>
  #include <stdio.h>
  #include <unistd.h>
***************
*** 72,78 ****
  static guint atk_signal_bounds_changed;
  
  static Accessibility_Registry spi_atk_bridge_get_registry (void);
! static void     spi_atk_bridge_do_registration         (void);
  static void     spi_atk_bridge_toplevel_added          (AtkObject             *object,
                                                          guint                 index,
                                                          AtkObject             *child);
--- 74,80 ----
  static guint atk_signal_bounds_changed;
  
  static Accessibility_Registry spi_atk_bridge_get_registry (void);
! static gboolean spi_atk_bridge_do_registration         (void);
  static void     spi_atk_bridge_toplevel_added          (AtkObject             *object,
                                                          guint                 index,
                                                          AtkObject             *child);
***************
*** 83,88 ****
--- 85,91 ----
  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,
***************
*** 172,177 ****
--- 175,181 ----
  {
    const char *debug_env_string = g_getenv ("AT_SPI_DEBUG");
    gchar *fname;
+   gboolean success = FALSE;
  
    if (atk_bridge_initialized)
      {
***************
*** 219,234 ****
      }
    else
      {
!       spi_atk_bridge_do_registration ();
      }
-   spi_atk_register_event_listeners ();
-   spi_atk_bridge_init_event_type_consts ();
-  
    return 0;
  }
  
  
! static void
  spi_atk_bridge_do_registration (void)
  {
    CORBA_Environment ev;
--- 223,244 ----
      }
    else
      {
!       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;
      }
    return 0;
  }
  
  
! static gboolean
  spi_atk_bridge_do_registration (void)
  {
    CORBA_Environment ev;
***************
*** 238,243 ****
--- 248,254 ----
    if (spi_atk_bridge_get_registry () == CORBA_OBJECT_NIL)
      {
        g_error ("Could not locate registry");
+       return FALSE;
      }
  
    bonobo_activate ();
***************
*** 253,259 ****
    g_atexit (spi_atk_bridge_exit_func);
  
    DBG (1, g_message ("Application registered & listening\n"));
! 
  }
  
  static void
--- 264,270 ----
    g_atexit (spi_atk_bridge_exit_func);
  
    DBG (1, g_message ("Application registered & listening\n"));
!   return TRUE;
  }
  
  static void
***************
*** 332,341 ****
--- 343,383 ----
      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);
***************
*** 346,355 ****
                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);
  	  
  	  if (ev._major != CORBA_NO_EXCEPTION)
  	  {
--- 388,404 ----
                else
  	        DBG (1, g_warning ("registry died! restarting..."));
              }
  
! 	  /* 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)
  	  {
***************
*** 555,560 ****
--- 604,611 ----
      {
        g_assert (!bonobo_debug_shutdown ());
      }
+   if (bridge_display)
+     XCloseDisplay (bridge_display);
  }
  
  void
***************
*** 588,601 ****
      }
  
    listener_ids = NULL;
!   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);
  
    deregister_application (app);
  }
--- 639,654 ----
      }
  
    listener_ids = NULL;
!   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));
    }
    
!   if (atk_bridge_key_event_listener_id)
!           atk_remove_key_event_listener (atk_bridge_key_event_listener_id);
  
    deregister_application (app);
  }
*** at-spi-858/configure.in	2007-02-27 07:37:38.000000000 -0800
--- at-spi-861/configure.in	2007-02-27 07:38:05.000000000 -0800
***************
*** 2,8 ****
  
  AT_SPI_MAJOR_VERSION=1
  AT_SPI_MINOR_VERSION=7
! AT_SPI_MICRO_VERSION=11
  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"
--- 2,8 ----
  
  AT_SPI_MAJOR_VERSION=1
  AT_SPI_MINOR_VERSION=7
! 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"
***************
*** 27,35 ****
  
  dnl required versions of other tools.
  m4_define([req_ver_atk],	[1.12.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)
--- 27,35 ----
  
  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])
  
  dnl Specify a header configuration file
  AM_CONFIG_HEADER(config.h)
***************
*** 84,91 ****
  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)
--- 84,89 ----
***************
*** 110,116 ****
  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)
  
--- 108,114 ----
  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)
  
*** at-spi-858/registryd/registry-main.c	2007-02-27 07:37:38.000000000 -0800
--- at-spi-861/registryd/registry-main.c	2007-02-27 07:38:05.000000000 -0800
***************
*** 27,37 ****
  
  #include <config.h>
  #include <string.h>
! #include <gdk/gdk.h>
  #include <libbonobo.h>
  #include <glib/gmain.h>
  #include "registry.h"
  
  int
  main (int argc, char **argv)
  {
--- 27,41 ----
  
  #include <config.h>
  #include <string.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)
  {
***************
*** 40,46 ****
    const char  *display_name;
    char        *cp, *dp;
    SpiRegistry *registry;
-   GSList      *reg_env = NULL;
  
    if (!bonobo_init (&argc, argv))
      {
--- 44,49 ----
***************
*** 54,72 ****
    display_name = g_getenv ("AT_SPI_DISPLAY");
    if (!display_name)
    {
!       display_name = g_strdup (gdk_display_get_name (gdk_display_get_default ()));
        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);
  
    if (ret != Bonobo_ACTIVATION_REG_SUCCESS)
      {
--- 57,74 ----
    display_name = g_getenv ("AT_SPI_DISPLAY");
    if (!display_name)
    {
!       display_name = g_getenv ("DISPLAY");
        cp = strrchr (display_name, '.');
        dp = strrchr (display_name, ':');
        if (cp && dp && (cp > dp)) *cp = '\0';
    }
  
    ret = bonobo_activation_register_active_server (
  	  obj_id,
  	  bonobo_object_corba_objref (bonobo_object (registry)),
! 	  NULL);
! 
!   registry_set_ior (registry);
  
    if (ret != Bonobo_ACTIVATION_REG_SUCCESS)
      {
***************
*** 85,87 ****
--- 87,118 ----
    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);
+ 
+ }
*** at-spi-858/registryd/registry.h	2007-02-27 07:37:38.000000000 -0800
--- at-spi-861/registryd/registry.h	2007-02-27 07:38:05.000000000 -0800
***************
*** 25,31 ****
  #define SPI_REGISTRY_H_
  
  #include <glib/gmain.h>
- #include <gdk/gdk.h>
  #include <libspi/listener.h>
  
  typedef struct _SpiRegistry SpiRegistry;
--- 25,30 ----
