2001-11-13 Michael Meeks <michael@ximian.com>
[platform/core/uifw/at-spi2-atk.git] / cspi / spi_main.c
index 027fa23..08a145f 100644 (file)
@@ -26,7 +26,7 @@ SPI_init (void)
       g_error ("Could not initialize Bonobo");
     }
 
-  obj_id = "OAFIID:Accessibility_Registry:proto0.1";
+  obj_id = "OAFIID:Accessibility_SpiRegistry:proto0.1";
 
   oclient = bonobo_activation_activate_from_id (obj_id, 0, NULL, &ev);
   if (ev._major != CORBA_NO_EXCEPTION) {
@@ -43,7 +43,7 @@ SPI_init (void)
       exit(-1);
     }
 
-  registry = (Accessibility_Registry) oclient;
+  registry = (Accessibility_SpiRegistry) oclient;
 
   bonobo_activate ();
 
@@ -64,8 +64,15 @@ SPI_init (void)
 void
 SPI_event_main (boolean isGNOMEApp)
 {
-  if (isGNOMEApp) bonobo_main();
-  else CORBA_ORB_run (bonobo_orb(), &ev);
+  if (isGNOMEApp) {      
+    g_atexit(SPI_exit);
+    bonobo_main();
+  }
+  else {
+    /* TODO: install signal handlers to do cleanup */
+    CORBA_ORB_run (bonobo_orb(), &ev);
+    fprintf (stderr, "orb loop exited...\n");
+  }
 }
 
 /**
@@ -92,10 +99,10 @@ SPI_eventIsReady ()
  * Used by clients that don't wish to use SPI_event_main().
  * Not Yet Implemented.
  *
- * Returns: the next #AccessibleEvent in the SPI event queue.
+ * Returns: the next #SpiAccessibleEvent in the SPI event queue.
  *
  **/
-AccessibleEvent *
+SpiAccessibleEvent *
 SPI_nextEvent (boolean waitForEvent)
 {
   return NULL;
@@ -104,13 +111,14 @@ SPI_nextEvent (boolean waitForEvent)
 /**
  * SPI_exit:
  *
- * Disconnects from the Accessibility Registry and releases resources.
+ * Disconnects from the Accessibility SpiRegistry and releases resources.
  * Not Yet Implemented.
  *
  **/
 void
 SPI_exit (void)
 {
+  fprintf (stderr, "bye-bye!\n");      
   exit(0);
 }