[18421] | 1 | /* |
---|
| 2 | * AT-SPI - Assistive Technology Service Provider Interface |
---|
| 3 | * (Gnome Accessibility Project; http://developer.gnome.org/projects/gap) |
---|
| 4 | * |
---|
[18687] | 5 | * Copyright 2001, 2002 Sun Microsystems Inc., |
---|
| 6 | * Copyright 2001, 2002 Ximian, Inc. |
---|
[18421] | 7 | * |
---|
| 8 | * This library is free software; you can redistribute it and/or |
---|
| 9 | * modify it under the terms of the GNU Library General Public |
---|
| 10 | * License as published by the Free Software Foundation; either |
---|
| 11 | * version 2 of the License, or (at your option) any later version. |
---|
| 12 | * |
---|
| 13 | * This library is distributed in the hope that it will be useful, |
---|
| 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
| 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
---|
| 16 | * Library General Public License for more details. |
---|
| 17 | * |
---|
| 18 | * You should have received a copy of the GNU Library General Public |
---|
| 19 | * License along with this library; if not, write to the |
---|
| 20 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
---|
| 21 | * Boston, MA 02111-1307, USA. |
---|
| 22 | */ |
---|
| 23 | |
---|
| 24 | /* accessibleeventlistener.c: implementation of SpiListener.idl */ |
---|
| 25 | |
---|
| 26 | #include <config.h> |
---|
| 27 | #ifdef SPI_DEBUG |
---|
| 28 | #include <stdio.h> |
---|
| 29 | #endif |
---|
| 30 | #include <libspi/eventlistener.h> |
---|
| 31 | |
---|
| 32 | /* Our parent Gtk object type */ |
---|
| 33 | #define PARENT_TYPE SPI_LISTENER_TYPE |
---|
| 34 | |
---|
| 35 | enum { |
---|
| 36 | EVENT, |
---|
| 37 | LAST_SIGNAL |
---|
| 38 | }; |
---|
| 39 | static guint signals [LAST_SIGNAL]; |
---|
| 40 | |
---|
| 41 | /* |
---|
| 42 | * CORBA Accessibility::Listener::notifyEvent method implementation |
---|
| 43 | */ |
---|
| 44 | static void |
---|
| 45 | impl_accessible_event_notify_event (PortableServer_Servant servant, |
---|
| 46 | const Accessibility_Event *e, |
---|
| 47 | CORBA_Environment *ev) |
---|
| 48 | { |
---|
| 49 | SpiEventListener *listener = SPI_EVENT_LISTENER ( |
---|
| 50 | bonobo_object_from_servant (servant)); |
---|
| 51 | |
---|
| 52 | g_signal_emit (G_OBJECT (listener), signals [EVENT], 0, e); |
---|
| 53 | |
---|
| 54 | } |
---|
| 55 | |
---|
| 56 | static void |
---|
| 57 | spi_event_listener_class_init (SpiEventListenerClass *klass) |
---|
| 58 | { |
---|
| 59 | SpiListenerClass *spi_listener_class = (SpiListenerClass *) klass; |
---|
| 60 | POA_Accessibility_EventListener__epv *epv = &spi_listener_class->epv; |
---|
| 61 | |
---|
| 62 | signals [EVENT] = g_signal_new ( |
---|
| 63 | "event", |
---|
| 64 | G_TYPE_FROM_CLASS (klass), |
---|
| 65 | G_SIGNAL_RUN_LAST, |
---|
| 66 | G_STRUCT_OFFSET (SpiEventListenerClass, event), |
---|
| 67 | NULL, NULL, |
---|
| 68 | g_cclosure_marshal_VOID__POINTER, |
---|
| 69 | G_TYPE_NONE, 1, G_TYPE_POINTER); |
---|
| 70 | |
---|
| 71 | epv->notifyEvent = impl_accessible_event_notify_event; |
---|
| 72 | } |
---|
| 73 | |
---|
| 74 | static void |
---|
| 75 | spi_event_listener_init (SpiEventListener *listener) |
---|
| 76 | { |
---|
| 77 | } |
---|
| 78 | |
---|
| 79 | BONOBO_TYPE_FUNC (SpiEventListener, |
---|
| 80 | PARENT_TYPE, |
---|
| 81 | spi_event_listener); |
---|
| 82 | |
---|
| 83 | SpiEventListener * |
---|
| 84 | spi_event_listener_new () |
---|
| 85 | { |
---|
| 86 | SpiEventListener *retval = g_object_new ( |
---|
| 87 | SPI_EVENT_LISTENER_TYPE, NULL); |
---|
| 88 | return retval; |
---|
| 89 | } |
---|