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 <libspi/Accessibility.h>
37 * This pulls the definition for the BonoboObject (GType)
39 #include "deviceeventcontroller.h"
42 * Our parent Gtk object type
44 #define PARENT_TYPE BONOBO_OBJECT_TYPE
47 * A pointer to our parent object class
49 static GObjectClass *device_event_controller_parent_class;
52 * Implemented GObject::finalize
55 device_event_controller_object_finalize (GObject *object)
59 fprintf(stderr, "device_event_controller_object_finalize called\n");
61 device_event_controller_parent_class->finalize (object);
65 * CORBA Accessibility::DeviceEventController::registerKeystrokeListener
66 * method implementation
69 impl_register_keystroke_listener (PortableServer_Servant servant,
70 const Accessibility_KeystrokeListener l,
71 CORBA_Environment *ev)
74 fprintf (stderr, "registering keystroke listener %p\n", l);
78 * CORBA Accessibility::DeviceEventController::registerMouseListener
79 * method implementation
83 impl_register_mouse_listener (PortableServer_Servant servant,
84 const Accessibility_MouseListener *l,
85 CORBA_Environment *ev)
88 fprintf (stderr, "registering mouse listener %p\n", l);
94 * CORBA Accessibility::DeviceEventController::registerKeystrokeListener
95 * method implementation
98 impl_generate_key_event (PortableServer_Servant servant,
99 const CORBA_long keyEventID,
100 CORBA_Environment *ev)
103 fprintf (stderr, "synthesizing keystroke %ld\n", keyEventID);
108 * CORBA Accessibility::DeviceEventController::generateMouseEvent
109 * method implementation
112 impl_generate_mouse_event (PortableServer_Servant servant,
115 const CORBA_char * eventName,
116 CORBA_Environment *ev)
119 fprintf (stderr, "generating mouse %s event at %ld, %ld\n", eventName, x, y);
124 device_event_controller_class_init (DeviceEventControllerClass *klass)
126 GObjectClass * object_class = (GObjectClass *) klass;
127 POA_Accessibility_DeviceEventController__epv *epv = &klass->epv;
128 device_event_controller_parent_class = g_type_class_ref (BONOBO_OBJECT_TYPE);
130 object_class->finalize = device_event_controller_object_finalize;
132 epv->registerKeystrokeListener = impl_register_keystroke_listener;
133 /* epv->registerMouseListener = impl_register_mouse_listener; */
134 epv->generateKeyEvent = impl_generate_key_event;
135 epv->generateMouseEvent = impl_generate_mouse_event;
139 device_event_controller_init (DeviceEventController *device_event_controller)
144 device_event_controller_get_type (void)
146 static GType type = 0;
149 static const GTypeInfo tinfo = {
150 sizeof (DeviceEventControllerClass),
151 (GBaseInitFunc) NULL,
152 (GBaseFinalizeFunc) NULL,
153 (GClassInitFunc) device_event_controller_class_init,
154 (GClassFinalizeFunc) NULL,
155 NULL, /* class data */
156 sizeof (DeviceEventController),
158 (GInstanceInitFunc) device_event_controller_init,
159 NULL /* value table */
162 * Here we use bonobo_type_unique instead of
163 * gtk_type_unique, this auto-generates a load of
164 * CORBA structures for us. All derived types must
165 * use bonobo_type_unique.
167 type = bonobo_type_unique (
169 POA_Accessibility_DeviceEventController__init,
171 G_STRUCT_OFFSET (DeviceEventControllerClass, epv),
173 "DeviceEventController");