-}
-
-#ifdef USE_A_HASH_IN_FUTURE
-static gint
-compare_corba_objects (gconstpointer p1, gconstpointer p2)
-{
- CORBA_Environment ev;
- gint retval;
-
-#ifdef SPI_DEBUG
- fprintf (stderr, "comparing %p to %p\n",
- p1, p2);
-#endif
-
- retval = !CORBA_Object_is_equivalent ((CORBA_Object) p1, (CORBA_Object) p2, &ev);
- return retval;
-}
-#endif
-
-static void
-register_with_toolkits (SpiRegistry *spi_registry_bonobo_object, EventTypeStruct *etype, CORBA_Environment *ev)
-{
- gint n_desktops;
- gint n_apps;
- gint i, j;
- Accessibility_Desktop desktop;
- Accessibility_Application app;
- Accessibility_Registry registry;
- registry = BONOBO_OBJREF (spi_registry_bonobo_object);
-
- /* for each app in each desktop, call ...Application_registerToolkitEventListener */
-
- n_desktops = Accessibility_Registry_getDesktopCount (registry, ev);
-
- for (i=0; i<n_desktops; ++i)
- {
- desktop = Accessibility_Registry_getDesktop (registry, i, ev);
- n_apps = Accessibility_Desktop__get_childCount (desktop, ev);
- for (j=0; j<n_apps; ++j)
- {
- app = (Accessibility_Application) Accessibility_Desktop_getChildAtIndex (desktop,
- j,
- ev);
- Accessibility_Application_registerToolkitEventListener (app,
- registry,
- CORBA_string_dup (etype->event_name),
- ev);
- }
- }
-}
-
-#ifdef USE_A_HASH_IN_FUTURE
-
-static gint
-compare_listener_quarks (gconstpointer p1, gconstpointer p2)
-{
- return (((SpiListenerStruct *)p2)->event_type_quark !=
- ((SpiListenerStruct *)p1)->event_type_quark);
-}
-
-static gint
-compare_listener_corbaref (gconstpointer p1, gconstpointer p2)
-{
- return compare_corba_objects (((SpiListenerStruct *)p2)->listener,
- ((SpiListenerStruct *)p1)->listener);
-}
-#endif
-
-static void
-parse_event_type (EventTypeStruct *etype, const char *event_name)
-{
- gchar **split_string;
- gchar *s;
-
- split_string = g_strsplit (event_name, ":", 4);
- etype->event_name = g_strdup (event_name);
-
- if (!g_ascii_strncasecmp (event_name, "focus:", 6))
- {
- etype->type_cat = ETYPE_FOCUS;
- }
- else if (!g_ascii_strncasecmp (event_name, "object:", 7))
- {
- etype->type_cat = ETYPE_OBJECT;
- }
- else if (!g_ascii_strncasecmp (event_name, "window:", 7))
- {
- etype->type_cat = ETYPE_WINDOW;
- }
- else
- {
- etype->type_cat = ETYPE_TOOLKIT;
- }
-
- if (split_string[1])
- {
- if (split_string[2])
- {
- etype->minor = g_quark_from_string (s = g_strconcat (split_string[1], split_string[2], NULL));
- g_free (s);
- if (split_string[3])
- {
- etype->detail = g_quark_from_string (split_string[3]);
- s = g_strconcat (split_string[1], split_string[2], split_string[3], NULL);
- etype->major = g_quark_from_string (s);
- g_free (s);
- }
- else
- {
- etype->detail = g_quark_from_static_string ("");
- s = g_strconcat (split_string[1], split_string[2], NULL);
- etype->major = g_quark_from_string (s);
- g_free (s);
- }
- }
- else
- {
- etype->major = g_quark_from_string (split_string[1]);
- etype->minor = etype->major;
- etype->detail = etype->major;
- }
- }
- else
- {
- etype->major = g_quark_from_static_string ("");
- etype->minor = etype->major;
- etype->detail = etype->major;
- }
-
- g_strfreev (split_string);