2 * AT-SPI - Assistive Technology Service Provider Interface
3 * (Gnome Accessibility Project; http://developer.gnome.org/projects/gap)
5 * Copyright 2001 Sun Microsystems Inc.
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Library General Public License for more details.
17 * You should have received a copy of the GNU Library General Public
18 * License along with this library; if not, write to the
19 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
20 * Boston, MA 02111-1307, USA.
25 #include <libbonobo.h>
26 #include <orbit/orbit.h>
28 #include <atk/atkobject.h>
29 #include <libspi/Accessibility.h>
30 #include "accessible.h"
31 #include "application.h"
33 typedef struct _ArgStruct ArgStruct;
40 static gboolean bridge_register_app (gpointer p);
43 gtk_module_init(gint argc, char* argv[])
45 ArgStruct *args = (ArgStruct *) g_new0(ArgStruct, 1);
48 g_idle_add (bridge_register_app, args);
52 bridge_register_app (gpointer gp)
59 ArgStruct *args = (ArgStruct *)gp;
61 Accessibility_Registry registry;
64 CORBA_exception_init(&ev);
66 if (!bonobo_init (&args->c, &args->v))
68 g_error ("Could not initialize Bonobo");
71 /* Create the accesssible application server object */
72 app = application_new(atk_get_root ());
74 obj_id = "OAFIID:Accessibility_Registry:proto0.1";
76 oclient = bonobo_activation_activate_from_id (obj_id, 0, NULL, &ev);
77 if (ev._major != CORBA_NO_EXCEPTION) {
79 ("Accessibility app error: exception during registry activation from id: %s\n"),
80 CORBA_exception_id(&ev));
81 CORBA_exception_free(&ev);
85 if (CORBA_Object_is_nil (oclient, &ev))
87 g_error ("Could not locate registry");
90 registry = (Accessibility_Registry) oclient;
92 fprintf(stderr, "About to register application\n");
94 Accessibility_Registry_registerApplication (registry,
95 bonobo_object_corba_objref (bonobo_object (app)),
98 bonobo_main (); /* because app is also a server */