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.
23 /* accessibleeventlistener.c: implementation of SpiListener.idl */
29 #include <libspi/eventlistener.h>
31 /* Our parent Gtk object type */
32 #define PARENT_TYPE SPI_LISTENER_TYPE
38 static guint signals [LAST_SIGNAL];
41 * CORBA Accessibility::Listener::notifyEvent method implementation
44 impl_accessible_event_notify_event (PortableServer_Servant servant,
45 const Accessibility_Event *e,
46 CORBA_Environment *ev)
48 SpiEventListener *listener = SPI_EVENT_LISTENER (
49 bonobo_object_from_servant (servant));
51 g_signal_emit (G_OBJECT (listener), signals [EVENT], 0, e);
53 if (e->source != CORBA_OBJECT_NIL)
55 Accessibility_Accessible_unref (e->source, ev);
60 spi_event_listener_class_init (SpiEventListenerClass *klass)
62 SpiListenerClass *spi_listener_class = (SpiListenerClass *) klass;
63 POA_Accessibility_EventListener__epv *epv = &spi_listener_class->epv;
65 signals [EVENT] = g_signal_new (
67 G_TYPE_FROM_CLASS (klass),
69 G_STRUCT_OFFSET (SpiEventListenerClass, event),
71 g_cclosure_marshal_VOID__POINTER,
72 G_TYPE_NONE, 1, G_TYPE_POINTER);
74 epv->notifyEvent = impl_accessible_event_notify_event;
78 spi_event_listener_init (SpiEventListener *listener)
82 BONOBO_TYPE_FUNC (SpiEventListener,
87 spi_event_listener_new ()
89 SpiEventListener *retval = g_object_new (
90 SPI_EVENT_LISTENER_TYPE, NULL);