2 * listener.c: test for accessibility implementation
5 #define DEBUG_PRINTSTUFF
6 #ifdef DEBUG_PRINTSTUFF
10 #include <bonobo/Bonobo.h>
11 #include <Accessible.h>
14 * This pulls the definition for the BonoboObject (GType)
19 * Our parent Gtk object type
21 #define PARENT_TYPE BONOBO_X_OBJECT_TYPE
24 * A pointer to our parent object class
26 static GObjectClass *listener_parent_class;
29 * Implemented GObject::finalize
32 listener_object_finalize (GObject *object)
34 /* Listener *listener = LISTENER (object); */
36 printf("listener_object_finalize called\n");
38 listener_parent_class->finalize (object);
42 * CORBA Accessibility::Listener::notifyEvent method implementation
46 impl_notify_event (PortableServer_Servant servant,
47 const Accessibility_Event *e,
48 CORBA_Environment *ev)
50 fprintf (stderr, "notify...\n");
51 fprintf (stderr, "source name: '%s'\n",
52 Accessibility_Accessible__get_name(e->target, ev));
56 listener_class_init (ListenerClass *klass)
58 GObjectClass * object_class = (GObjectClass *) klass;
59 POA_Accessibility_EventListener__epv *epv = &klass->epv;
60 listener_parent_class = g_type_class_ref (BONOBO_X_OBJECT_TYPE);
62 object_class->finalize = listener_object_finalize;
64 epv->notifyEvent = impl_notify_event;
68 listener_init (Listener *listener)
73 listener_get_type (void)
75 static GType type = 0;
78 static const GTypeInfo tinfo = {
79 sizeof (ListenerClass),
81 (GBaseFinalizeFunc) NULL,
82 (GClassInitFunc) listener_class_init,
83 (GClassFinalizeFunc) NULL,
84 NULL, /* class data */
87 (GInstanceInitFunc) listener_init,
88 NULL /* value table */
91 * Here we use bonobo_x_type_unique instead of
92 * gtk_type_unique, this auto-generates a load of
93 * CORBA structures for us. All derived types must
94 * use bonobo_x_type_unique.
96 type = bonobo_x_type_unique (
98 POA_Accessibility_EventListener__init,
100 G_STRUCT_OFFSET (ListenerClass, epv),
112 LISTENER (g_object_new (listener_get_type (), NULL));