3 * Basic SPI initialization and event loop function prototypes
8 #include <cspi/spi-private.h>
10 static CORBA_Environment ev = { 0 };
11 static AccessibilityRegistry registry = CORBA_OBJECT_NIL;
16 /* This method is an ugly hack */
23 /* This method is an ugly hack */
34 CORBA_exception_free (&ev);
46 spi_object_add (Accessible corba_object)
48 /* TODO: keep list of live object refs */
49 Accessible *oref = NULL;
51 if (corba_object != CORBA_OBJECT_NIL)
53 oref = g_malloc (sizeof (Accessible));
63 * Connects to the accessibility registry and initializes the SPI.
65 * Returns: 0 on success, otherwise an integer error code.
73 static gboolean inited = FALSE;
82 CORBA_exception_init (&ev);
84 if (!bonobo_init (&argc, NULL))
86 g_error ("Could not initialize Bonobo");
89 obj_id = "OAFIID:Accessibility_Registry:proto0.1";
91 oclient = bonobo_activation_activate_from_id (
92 obj_id, 0, NULL, spi_ev ());
94 if (ev._major != CORBA_NO_EXCEPTION)
96 g_error ("AT-SPI error: during registry activation: %s\n",
97 bonobo_exception_get_text (spi_ev ()));
100 if (CORBA_Object_is_nil (oclient, spi_ev ()))
102 g_error ("Could not locate registry");
105 registry = (Accessibility_Registry) oclient;
114 * @isGNOMEApp: a #boolean indicating whether the client of the SPI
115 * will use the Gnome event loop or not. Clients that have
116 * their own GUIS will usually specify #TRUE here, and must
117 * do so if they use Gnome GUI components.
119 * Starts/enters the main event loop for the SPI services.
121 * (NOTE: This method does not return control, it is exited via a call to exit()
122 * from within an event handler).
126 SPI_event_main (boolean isGNOMEApp)
135 /* TODO: install signal handlers to do cleanup */
136 CORBA_ORB_run (bonobo_orb(), spi_ev ());
137 fprintf (stderr, "orb loop exited...\n");
144 * Checks to see if an SPI event is waiting in the event queue.
145 * Used by clients that don't wish to use SPI_event_main().
147 * Not Yet Implemented.
149 * Returns: #TRUE if an event is waiting, otherwise #FALSE.
160 * @waitForEvent: a #boolean indicating whether to block or not.
162 * Gets the next event in the SPI event queue; blocks if no event
163 * is pending and @waitForEvent is #TRUE.
164 * Used by clients that don't wish to use SPI_event_main().
166 * Not Yet Implemented.
168 * Returns: the next #AccessibleEvent in the SPI event queue.
172 SPI_nextEvent (boolean waitForEvent)
180 * Disconnects from the Accessibility Registry and releases resources.
186 fprintf (stderr, "bye-bye!\n");