4 #include <atk/atkobject.h>
7 #include "accessible.h"
8 #include "atksimpleobject.h"
9 #include "application.h"
12 main(int argc, char **argv)
20 Accessibility_Registry registry;
21 Accessibility_Event e;
22 Accessible *accessible;
25 CORBA_exception_init(&ev);
27 if (!bonobo_init (&argc, argv))
29 g_error ("Could not initialize Bonobo");
32 /* Create the accesssible application server object */
33 /* TODO: get app name and pid */
34 sprintf(sbuf, "application-%s", argv[1]);
35 app = application_new(sbuf, "test application for accessibility SPI", "0001");
37 /* Create the Accessible 'source' for the event */
38 atko = atk_simple_object_new ();
39 atk_object_set_name (atko, "dummy");
40 accessible = accessible_new (atko);
41 fprintf(stderr, "accessible created.\n");
43 /* FIXME: this type of event struct will leak, needs to be redefined */
44 e.target = bonobo_object_corba_objref ( bonobo_object (accessible));
45 e.type = CORBA_string_dup ("test");
47 obj_id = "OAFIID:Accessibility_Registry:proto0.1";
49 oclient = oaf_activate_from_id (obj_id, 0, NULL, &ev);
50 if (ev._major != CORBA_NO_EXCEPTION) {
52 ("Accessibility app error: exception during registry activation from id: %s\n"),
53 CORBA_exception_id(&ev));
54 CORBA_exception_free(&ev);
58 if (CORBA_Object_is_nil (oclient, &ev))
60 g_error ("Could not locate registry");
63 registry = (Accessibility_Registry) oclient;
65 Accessibility_Registry_registerApplication (registry,
66 bonobo_object_corba_objref (bonobo_object (app)),
68 fprintf(stderr, "registerApplication has been called.\n");
70 Accessibility_Registry_notifyEvent (registry, &e, &ev);
71 fprintf (stderr, "notify event has been called.\n");
73 bonobo_main (); /* needed when app becomes a server ? */