* Boston, MA 02111-1307, USA.
*/
+#ifdef AT_SPI_DEBUG
#include <stdlib.h>
+#endif
+
#include <libbonobo.h>
+#include <glib/gmain.h>
#include "registry.h"
int
-main (int argc,
- char **argv)
+main (int argc, char **argv)
{
- Registry *registry;
- char *obj_id;
-
- if (!bonobo_init (&argc, argv))
- {
- g_error ("Could not initialize oaf / Bonobo");
- }
+ int ret;
+ char *obj_id;
+ SpiRegistry *registry;
- obj_id = "OAFIID:Accessibility_Registry:proto0.1";
+ free (malloc (8)); /* -lefence */
- registry = registry_new ();
+ if (!bonobo_init (&argc, argv))
+ {
+ g_error ("Could not initialize oaf / Bonobo");
+ }
- oaf_active_server_register (
- obj_id,
- bonobo_object_corba_objref (bonobo_object (registry)));
+ obj_id = "OAFIID:Accessibility_Registry:1.0";
- fprintf (stderr, "Registry Message: Registry daemon is running.\n");
- bonobo_main ();
+ registry = spi_registry_new ();
- return 0;
-}
+ ret = bonobo_activation_active_server_register (
+ obj_id,
+ bonobo_object_corba_objref (bonobo_object (registry)));
+ if (ret != Bonobo_ACTIVATION_REG_SUCCESS)
+ {
+#ifdef AT_SPI_DEBUG
+ fprintf (stderr, "SpiRegistry Message: SpiRegistry daemon was already running.\n");
+#endif
+ }
+ else
+ {
+#ifdef AT_SPI_DEBUG
+ fprintf (stderr, "SpiRegistry Message: SpiRegistry daemon is running.\n");
+#endif
+ g_timeout_add_full (G_PRIORITY_HIGH_IDLE, 200, registry->kbd_event_hook, registry, NULL);
+ bonobo_main ();
+ }
+ return 0;
+}