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.
24 * listener.c: test for accessibility implementation
33 #include <bonobo/Bonobo.h>
34 #include <Accessible.h>
37 * This pulls the definition for the BonoboObject (GType)
42 * Our parent Gtk object type
44 #define PARENT_TYPE BONOBO_X_OBJECT_TYPE
47 * A pointer to our parent object class
49 static GObjectClass *listener_parent_class;
52 * Implemented GObject::finalize
55 listener_object_finalize (GObject *object)
57 /* Listener *listener = LISTENER (object); */
60 fprintf(stderr, "listener_object_finalize called\n");
62 listener_parent_class->finalize (object);
66 * CORBA Accessibility::Listener::notifyEvent method implementation
70 impl_notify_event (PortableServer_Servant servant,
71 const Accessibility_Event *e,
72 CORBA_Environment *ev)
75 fprintf (stderr, "notify...\n");
76 fprintf (stderr, "source name: '%s'\n",
77 Accessibility_Accessible__get_name(e->target, ev));
82 listener_class_init (ListenerClass *klass)
84 GObjectClass * object_class = (GObjectClass *) klass;
85 POA_Accessibility_EventListener__epv *epv = &klass->epv;
86 listener_parent_class = g_type_class_ref (BONOBO_X_OBJECT_TYPE);
88 object_class->finalize = listener_object_finalize;
90 epv->notifyEvent = impl_notify_event;
94 listener_init (Listener *listener)
99 listener_get_type (void)
101 static GType type = 0;
104 static const GTypeInfo tinfo = {
105 sizeof (ListenerClass),
106 (GBaseInitFunc) NULL,
107 (GBaseFinalizeFunc) NULL,
108 (GClassInitFunc) listener_class_init,
109 (GClassFinalizeFunc) NULL,
110 NULL, /* class data */
113 (GInstanceInitFunc) listener_init,
114 NULL /* value table */
117 * Here we use bonobo_x_type_unique instead of
118 * gtk_type_unique, this auto-generates a load of
119 * CORBA structures for us. All derived types must
120 * use bonobo_x_type_unique.
122 type = bonobo_x_type_unique (
124 POA_Accessibility_EventListener__init,
126 G_STRUCT_OFFSET (ListenerClass, epv),
138 LISTENER (g_object_new (listener_get_type (), NULL));