<2001-09-30 Bill Haneman <bill.haneman@sun.com>
-
+
+ * libspi/keystrokelistener.h:
+ * libspi/keystrokelistener.c:
+ Began (no-op) implementations of KeystrokeListener
+ (see below).
+ * libspi/deviceeventcontroller.c:
+ * libspi/deviceeventcontroller.h:
+ Began creating implementations of DeviceEventController,
+ to handle keystroke and mouse event listening and
+ synthesis.
* libspi/accessible.c:
Stubbed-in the implementations for
Accessibility_Accessible_getState and
table.h\
text.h\
value.h\
- listener.h \
+ listener.h \
+ keystrokelistener.h \
accessibleeventlistener.h \
+ deviceeventcontroller.h \
registry.h \
Accessibility.h
component.h \
desktop.c \
desktop.h \
+ deviceeventcontroller.c \
+ deviceeventcontroller.h \
editabletext.c\
editabletext.h\
hyperlink.c\
hypertext.h\
image.c\
image.h\
+ keystrokelistener.c\
+ keystrokelistener.h\
selection.c\
selection.h\
table.c\
--- /dev/null
+/*
+ * AT-SPI - Assistive Technology Service Provider Interface
+ * (Gnome Accessibility Project; http://developer.gnome.org/projects/gap)
+ *
+ * Copyright 2001 Sun Microsystems Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+/*
+ * listener.c: test for accessibility implementation
+ *
+ */
+
+#ifdef SPI_DEBUG
+#include <stdio.h>
+#endif
+
+#include <config.h>
+#include <bonobo/Bonobo.h>
+#include <libspi/Accessibility.h>
+
+/*
+ * This pulls the definition for the BonoboObject (GType)
+ */
+#include "deviceeventcontroller.h"
+
+/*
+ * Our parent Gtk object type
+ */
+#define PARENT_TYPE BONOBO_OBJECT_TYPE
+
+/*
+ * A pointer to our parent object class
+ */
+static GObjectClass *device_event_controller_parent_class;
+
+/*
+ * Implemented GObject::finalize
+ */
+static void
+device_event_controller_object_finalize (GObject *object)
+{
+
+#ifdef SPI_DEBUG
+ fprintf(stderr, "device_event_controller_object_finalize called\n");
+#endif
+ device_event_controller_parent_class->finalize (object);
+}
+
+/*
+ * CORBA Accessibility::DeviceEventController::registerKeystrokeListener
+ * method implementation
+ */
+static void
+impl_register_keystroke_listener (PortableServer_Servant servant,
+ const Accessibility_KeystrokeListener l,
+ CORBA_Environment *ev)
+{
+#ifdef SPI_DEBUG
+ fprintf (stderr, "registering keystroke listener %p\n", l);
+#endif
+}
+/*
+ * CORBA Accessibility::DeviceEventController::registerMouseListener
+ * method implementation
+ */
+/*
+static void
+impl_register_mouse_listener (PortableServer_Servant servant,
+ const Accessibility_MouseListener *l,
+ CORBA_Environment *ev)
+{
+#ifdef SPI_DEBUG
+ fprintf (stderr, "registering mouse listener %p\n", l);
+#endif
+}
+*/
+
+/*
+ * CORBA Accessibility::DeviceEventController::registerKeystrokeListener
+ * method implementation
+ */
+static void
+impl_generate_key_event (PortableServer_Servant servant,
+ const CORBA_long keyEventID,
+ CORBA_Environment *ev)
+{
+#ifdef SPI_DEBUG
+ fprintf (stderr, "synthesizing keystroke %ld\n", keyEventID);
+#endif
+}
+
+/*
+ * CORBA Accessibility::DeviceEventController::generateMouseEvent
+ * method implementation
+ */
+static void
+impl_generate_mouse_event (PortableServer_Servant servant,
+ const CORBA_long x,
+ const CORBA_long y,
+ const CORBA_char * eventName,
+ CORBA_Environment *ev)
+{
+#ifdef SPI_DEBUG
+ fprintf (stderr, "generating mouse %s event at %ld, %ld\n", eventName, x, y);
+#endif
+}
+
+static void
+device_event_controller_class_init (DeviceEventControllerClass *klass)
+{
+ GObjectClass * object_class = (GObjectClass *) klass;
+ POA_Accessibility_DeviceEventController__epv *epv = &klass->epv;
+ device_event_controller_parent_class = g_type_class_ref (BONOBO_OBJECT_TYPE);
+
+ object_class->finalize = device_event_controller_object_finalize;
+
+ epv->registerKeystrokeListener = impl_register_keystroke_listener;
+/* epv->registerMouseListener = impl_register_mouse_listener; */
+ epv->generateKeyEvent = impl_generate_key_event;
+ epv->generateMouseEvent = impl_generate_mouse_event;
+}
+
+static void
+device_event_controller_init (DeviceEventController *device_event_controller)
+{
+}
+
+GType
+device_event_controller_get_type (void)
+{
+ static GType type = 0;
+
+ if (!type) {
+ static const GTypeInfo tinfo = {
+ sizeof (DeviceEventControllerClass),
+ (GBaseInitFunc) NULL,
+ (GBaseFinalizeFunc) NULL,
+ (GClassInitFunc) device_event_controller_class_init,
+ (GClassFinalizeFunc) NULL,
+ NULL, /* class data */
+ sizeof (DeviceEventController),
+ 0, /* n preallocs */
+ (GInstanceInitFunc) device_event_controller_init,
+ NULL /* value table */
+ };
+ /*
+ * Here we use bonobo_type_unique instead of
+ * gtk_type_unique, this auto-generates a load of
+ * CORBA structures for us. All derived types must
+ * use bonobo_type_unique.
+ */
+ type = bonobo_type_unique (
+ PARENT_TYPE,
+ POA_Accessibility_DeviceEventController__init,
+ NULL,
+ G_STRUCT_OFFSET (DeviceEventControllerClass, epv),
+ &tinfo,
+ "DeviceEventController");
+ }
+
+ return type;
+}
+
--- /dev/null
+/*
+ * AT-SPI - Assistive Technology Service Provider Interface
+ * (Gnome Accessibility Project; http://developer.gnome.org/projects/gap)
+ *
+ * Copyright 2001 Sun Microsystems Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#ifndef DEVICE_EVENT_CONTROLLER_H_
+#define DEVICE_EVENT_CONTROLLER_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+#include <bonobo/bonobo-object.h>
+#include <libspi/Accessibility.h>
+
+#define DEVICE_EVENT_CONTROLLER_TYPE (device_event_controller_get_type ())
+#define DEVICE_EVENT_CONTROLLER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), DEVICE_EVENT_CONTROLLER_TYPE, DeviceEventController))
+#define DEVICE_EVENT_CONTROLLER_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), DEVICE_EVENT_CONTROLLER_TYPE, DeviceEventControllerClass))
+#define IS_DEVICE_EVENT_CONTROLLER(o) (G_TYPE_CHECK__INSTANCE_TYPE ((o), DEVICE_EVENT_CONTROLLER_TYPE))
+#define IS_DEVICE_EVENT_CONTROLLER_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), DEVICE_EVENT_CONTROLLER_TYPE))
+
+typedef struct {
+ BonoboObject parent;
+} DeviceEventController;
+
+typedef struct {
+ BonoboObjectClass parent_class;
+ POA_Accessibility_DeviceEventController__epv epv;
+} DeviceEventControllerClass;
+
+GType device_event_controller_get_type (void);
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* DEVICEEVENTCONTROLLER_H_ */
--- /dev/null
+/*
+ * AT-SPI - Assistive Technology Service Provider Interface
+ * (Gnome Accessibility Project; http://developer.gnome.org/projects/gap)
+ *
+ * Copyright 2001 Sun Microsystems Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+/*
+ * listener.c: test for accessibility implementation
+ *
+ */
+
+#ifdef SPI_DEBUG
+#include <stdio.h>
+#endif
+
+#include <config.h>
+#include <bonobo/Bonobo.h>
+#include <libspi/Accessibility.h>
+
+/*
+ * This pulls the definition for the BonoboObject (GType)
+ */
+#include "keystrokelistener.h"
+
+/*
+ * Our parent Gtk object type
+ */
+#define PARENT_TYPE BONOBO_OBJECT_TYPE
+
+/*
+ * A pointer to our parent object class
+ */
+static GObjectClass *keystroke_listener_parent_class;
+
+/*
+ * Implemented GObject::finalize
+ */
+static void
+keystroke_listener_object_finalize (GObject *object)
+{
+/* KeystrokeListener *keystroke_listener = KEYSTROKE_LISTENER (object); */
+
+#ifdef SPI_DEBUG
+ fprintf(stderr, "keystroke_listener_object_finalize called\n");
+#endif
+ keystroke_listener_parent_class->finalize (object);
+}
+
+/*
+ * CORBA Accessibility::KeystrokeListener::keyEvent method implementation
+ */
+
+static void
+impl_key_event (PortableServer_Servant servant,
+ const Accessibility_KeyStroke *key,
+ CORBA_Environment *ev)
+{
+#ifdef SPI_DEBUG
+ if (ev->_major != CORBA_NO_EXCEPTION) {
+ fprintf(stderr,
+ ("Accessibility app error: exception during keystroke notification: %s\n"),
+ CORBA_exception_id(ev));
+ exit(-1);
+ }
+#endif
+}
+
+static void
+keystroke_listener_class_init (KeystrokeListenerClass *klass)
+{
+ GObjectClass * object_class = (GObjectClass *) klass;
+ POA_Accessibility_KeystrokeListener__epv *epv = &klass->epv;
+ keystroke_listener_parent_class = g_type_class_ref (BONOBO_OBJECT_TYPE);
+
+ object_class->finalize = keystroke_listener_object_finalize;
+
+ epv->keyEvent = impl_key_event;
+}
+
+static void
+keystroke_listener_init (KeystrokeListener *keystroke_listener)
+{
+}
+
+GType
+keystroke_listener_get_type (void)
+{
+ static GType type = 0;
+
+ if (!type) {
+ static const GTypeInfo tinfo = {
+ sizeof (KeystrokeListenerClass),
+ (GBaseInitFunc) NULL,
+ (GBaseFinalizeFunc) NULL,
+ (GClassInitFunc) keystroke_listener_class_init,
+ (GClassFinalizeFunc) NULL,
+ NULL, /* class data */
+ sizeof (KeystrokeListener),
+ 0, /* n preallocs */
+ (GInstanceInitFunc) keystroke_listener_init,
+ NULL /* value table */
+ };
+ /*
+ * Here we use bonobo_type_unique instead of
+ * gtk_type_unique, this auto-generates a load of
+ * CORBA structures for us. All derived types must
+ * use bonobo_type_unique.
+ */
+ type = bonobo_type_unique (
+ PARENT_TYPE,
+ POA_Accessibility_KeystrokeListener__init,
+ NULL,
+ G_STRUCT_OFFSET (KeystrokeListenerClass, epv),
+ &tinfo,
+ "KeystrokeListener");
+ }
+
+ return type;
+}
+
+KeystrokeListener *
+keystroke_listener_new (void)
+{
+ KeystrokeListener *retval =
+ KEYSTROKE_LISTENER (g_object_new (keystroke_listener_get_type (), NULL));
+ return retval;
+}
--- /dev/null
+/*
+ * AT-SPI - Assistive Technology Service Provider Interface
+ * (Gnome Accessibility Project; http://developer.gnome.org/projects/gap)
+ *
+ * Copyright 2001 Sun Microsystems Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#ifndef KEYSTROKE_LISTENER_H_
+#define KEYSTROKE_LISTENER_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+#include <bonobo/bonobo-object.h>
+#include <atk/atkobject.h>
+#include <libspi/Accessibility.h>
+
+#define KEYSTROKE_LISTENER_TYPE (keystroke_listener_get_type ())
+#define KEYSTROKE_LISTENER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), KEYSTROKE_LISTENER_TYPE, KeystrokeListener))
+#define KEYSTROKE_LISTENER_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), KEYSTROKE_LISTENER_TYPE, KeystrokeListenerClass))
+#define IS_KEYSTROKE_LISTENER(o) (G_TYPE_CHECK__INSTANCE_TYPE ((o), KEYSTROKE_LISTENER_TYPE))
+#define IS_KEYSTROKE_LISTENER_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), KEYSTROKE_LISTENER_TYPE))
+
+typedef struct {
+ BonoboObject parent;
+} KeystrokeListener;
+
+typedef struct {
+ BonoboObjectClass parent_class;
+ POA_Accessibility_KeystrokeListener__epv epv;
+} KeystrokeListenerClass;
+
+GType keystroke_listener_get_type (void);
+KeystrokeListener *keystroke_listener_new (void);
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* KEYSTROKE_LISTENER_H_ */
--- /dev/null
+/*
+ * AT-SPI - Assistive Technology Service Provider Interface
+ * (Gnome Accessibility Project; http://developer.gnome.org/projects/gap)
+ *
+ * Copyright 2001 Sun Microsystems Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+/*
+ * listener.c: test for accessibility implementation
+ *
+ */
+
+#ifdef SPI_DEBUG
+#include <stdio.h>
+#endif
+
+#include <config.h>
+#include <bonobo/Bonobo.h>
+#include <libspi/Accessibility.h>
+
+/*
+ * This pulls the definition for the BonoboObject (GType)
+ */
+#include "deviceeventcontroller.h"
+
+/*
+ * Our parent Gtk object type
+ */
+#define PARENT_TYPE BONOBO_OBJECT_TYPE
+
+/*
+ * A pointer to our parent object class
+ */
+static GObjectClass *device_event_controller_parent_class;
+
+/*
+ * Implemented GObject::finalize
+ */
+static void
+device_event_controller_object_finalize (GObject *object)
+{
+
+#ifdef SPI_DEBUG
+ fprintf(stderr, "device_event_controller_object_finalize called\n");
+#endif
+ device_event_controller_parent_class->finalize (object);
+}
+
+/*
+ * CORBA Accessibility::DeviceEventController::registerKeystrokeListener
+ * method implementation
+ */
+static void
+impl_register_keystroke_listener (PortableServer_Servant servant,
+ const Accessibility_KeystrokeListener l,
+ CORBA_Environment *ev)
+{
+#ifdef SPI_DEBUG
+ fprintf (stderr, "registering keystroke listener %p\n", l);
+#endif
+}
+/*
+ * CORBA Accessibility::DeviceEventController::registerMouseListener
+ * method implementation
+ */
+/*
+static void
+impl_register_mouse_listener (PortableServer_Servant servant,
+ const Accessibility_MouseListener *l,
+ CORBA_Environment *ev)
+{
+#ifdef SPI_DEBUG
+ fprintf (stderr, "registering mouse listener %p\n", l);
+#endif
+}
+*/
+
+/*
+ * CORBA Accessibility::DeviceEventController::registerKeystrokeListener
+ * method implementation
+ */
+static void
+impl_generate_key_event (PortableServer_Servant servant,
+ const CORBA_long keyEventID,
+ CORBA_Environment *ev)
+{
+#ifdef SPI_DEBUG
+ fprintf (stderr, "synthesizing keystroke %ld\n", keyEventID);
+#endif
+}
+
+/*
+ * CORBA Accessibility::DeviceEventController::generateMouseEvent
+ * method implementation
+ */
+static void
+impl_generate_mouse_event (PortableServer_Servant servant,
+ const CORBA_long x,
+ const CORBA_long y,
+ const CORBA_char * eventName,
+ CORBA_Environment *ev)
+{
+#ifdef SPI_DEBUG
+ fprintf (stderr, "generating mouse %s event at %ld, %ld\n", eventName, x, y);
+#endif
+}
+
+static void
+device_event_controller_class_init (DeviceEventControllerClass *klass)
+{
+ GObjectClass * object_class = (GObjectClass *) klass;
+ POA_Accessibility_DeviceEventController__epv *epv = &klass->epv;
+ device_event_controller_parent_class = g_type_class_ref (BONOBO_OBJECT_TYPE);
+
+ object_class->finalize = device_event_controller_object_finalize;
+
+ epv->registerKeystrokeListener = impl_register_keystroke_listener;
+/* epv->registerMouseListener = impl_register_mouse_listener; */
+ epv->generateKeyEvent = impl_generate_key_event;
+ epv->generateMouseEvent = impl_generate_mouse_event;
+}
+
+static void
+device_event_controller_init (DeviceEventController *device_event_controller)
+{
+}
+
+GType
+device_event_controller_get_type (void)
+{
+ static GType type = 0;
+
+ if (!type) {
+ static const GTypeInfo tinfo = {
+ sizeof (DeviceEventControllerClass),
+ (GBaseInitFunc) NULL,
+ (GBaseFinalizeFunc) NULL,
+ (GClassInitFunc) device_event_controller_class_init,
+ (GClassFinalizeFunc) NULL,
+ NULL, /* class data */
+ sizeof (DeviceEventController),
+ 0, /* n preallocs */
+ (GInstanceInitFunc) device_event_controller_init,
+ NULL /* value table */
+ };
+ /*
+ * Here we use bonobo_type_unique instead of
+ * gtk_type_unique, this auto-generates a load of
+ * CORBA structures for us. All derived types must
+ * use bonobo_type_unique.
+ */
+ type = bonobo_type_unique (
+ PARENT_TYPE,
+ POA_Accessibility_DeviceEventController__init,
+ NULL,
+ G_STRUCT_OFFSET (DeviceEventControllerClass, epv),
+ &tinfo,
+ "DeviceEventController");
+ }
+
+ return type;
+}
+
--- /dev/null
+/*
+ * AT-SPI - Assistive Technology Service Provider Interface
+ * (Gnome Accessibility Project; http://developer.gnome.org/projects/gap)
+ *
+ * Copyright 2001 Sun Microsystems Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#ifndef DEVICE_EVENT_CONTROLLER_H_
+#define DEVICE_EVENT_CONTROLLER_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+#include <bonobo/bonobo-object.h>
+#include <libspi/Accessibility.h>
+
+#define DEVICE_EVENT_CONTROLLER_TYPE (device_event_controller_get_type ())
+#define DEVICE_EVENT_CONTROLLER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), DEVICE_EVENT_CONTROLLER_TYPE, DeviceEventController))
+#define DEVICE_EVENT_CONTROLLER_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), DEVICE_EVENT_CONTROLLER_TYPE, DeviceEventControllerClass))
+#define IS_DEVICE_EVENT_CONTROLLER(o) (G_TYPE_CHECK__INSTANCE_TYPE ((o), DEVICE_EVENT_CONTROLLER_TYPE))
+#define IS_DEVICE_EVENT_CONTROLLER_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), DEVICE_EVENT_CONTROLLER_TYPE))
+
+typedef struct {
+ BonoboObject parent;
+} DeviceEventController;
+
+typedef struct {
+ BonoboObjectClass parent_class;
+ POA_Accessibility_DeviceEventController__epv epv;
+} DeviceEventControllerClass;
+
+GType device_event_controller_get_type (void);
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* DEVICEEVENTCONTROLLER_H_ */