+2002-01-01 Bill Haneman <bill.haneman@sun.com>
+
+ API tweaks for today's API 'freeze'.
+
+ * idl/*:
+ Added placeholder functions to allow future compatible expansion
+ of the IDL interfaces.
+
+ * idl/Accessibility_Registry.idl:
+ Changed generateKeyEvent to generateKeyboardEvent. Changed
+ signature of this method to accept an optional keystring in
+ parameter (for complex text input synthesis) and changed use of
+ simple 'boolean' parameter in registerKeystrokeListener to a
+ struct, EventListenerMode.
+
+ * cspi/spi_accessible.c:
+ * cspi/spi.h:
+ * cspi/spi_streamablecontent.c:
+ Added references to AccessibleStreamableContent interface, and
+ definition and implementation of AccessibleStreamableContent
+ C bindings.
+
+ * cspi/spi_registry.c:
+ * cspi/spi.h:
+ Changed generateKeyEvent API to generateKeyboardEvent,
+ taking a new (optional) keystring parameter to support complex
+ text input.
+
+ * at-bridge/*:
+ * atk-bridge/*:
+ Renamed directory (to better reflect its actual purpose, bridging
+ from at-spi to ATK). The .so module is also now named
+ libatk-bridge.so.
+
+ * idl/Accessibility_Hypertext.idl:
+ * libspi/accessible.c:
+ * libspi/hypertext.h:
+ * libspi/hypertext.c:
+ Changed Accessibility_Hypertext to *not* derive from
+ Accessibility_Text.
+
+ * cspi/spi_registry.c:
+ Added list of legal event type names for 'window' events, which
+ completes the registry event API.
+
2001-12-22 Marc Mulcahy <marc.mulcahy@sun.com>
* at-bridge/bridge.c: Added registration for separate
-SUBDIRS = docs idl libspi registryd at-bridge cspi util test
+SUBDIRS = docs idl libspi registryd atk-bridge cspi util test
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = libspi-1.0.pc cspi-1.0.pc
+++ /dev/null
-.deps
-.libs
-Makefile.in
-Makefile
+++ /dev/null
-lib_LTLIBRARIES = libat-bridge.la
-
-libat_bridge_la_SOURCES = \
- bridge.c
-
-libat_bridge_la_DEPENDENCIES = \
- $(top_srcdir)/libspi/application.h
-
-INCLUDES = -I $(top_srcdir) \
- -I $(top_builddir) \
- -I $(top_srcdir)/libspi \
- -I $(top_builddir)/libspi \
- -I $(top_builddir)/at-bridge \
- $(AT_BRIDGE_CFLAGS)
-
-DEPS = \
- $(libatk) \
- $(libbonobo-2) \
- $(liboaf-2) \
- $(libORBit-2) \
- $(libat-spi)
-
-
-LDFLAGS += -no-undefined
-
-libat_bridge_la_LIBADD = $(AT_BRIDGE_LIBS) ../libspi/libspi.la
-
-CFLAGS += $(AT_BRIDGE_CFLAGS)
+++ /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.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <stdarg.h>
-#include <libbonobo.h>
-#include <orbit/orbit.h>
-#include <atk/atk.h>
-#include <atk/atkobject.h>
-#include <atk/atknoopobject.h>
-#include <libspi/Accessibility.h>
-#include "accessible.h"
-#include "application.h"
-
-#undef SPI_BRIDGE_DEBUG
-
-static CORBA_Environment ev;
-static Accessibility_Registry registry;
-static SpiApplication *this_app = NULL;
-
-static gboolean spi_atk_bridge_idle_init (gpointer user_data);
-static void spi_atk_bridge_focus_tracker (AtkObject *object);
-static void spi_atk_bridge_exit_func (void);
-static void spi_atk_register_event_listeners (void);
-static gboolean spi_atk_bridge_property_event_listener (GSignalInvocationHint *signal_hint,
- guint n_param_values,
- const GValue *param_values,
- gpointer data);
-static gboolean spi_atk_bridge_state_event_listener (GSignalInvocationHint *signal_hint,
- guint n_param_values,
- const GValue *param_values,
- gpointer data);
-static gboolean spi_atk_bridge_signal_listener (GSignalInvocationHint *signal_hint,
- guint n_param_values,
- const GValue *param_values,
- gpointer data);
-static gint spi_atk_bridge_key_listener (AtkKeyEventStruct *event,
- gpointer data);
-
-int
-gtk_module_init (gint *argc, gchar **argv[])
-{
- CORBA_Environment ev;
-
- if (!bonobo_init (argc, *argv))
- {
- g_error ("Could not initialize Bonobo");
- }
-
- CORBA_exception_init(&ev);
-
- registry = bonobo_activation_activate_from_id (
- "OAFIID:Accessibility_Registry:proto0.1", 0, NULL, &ev);
-
- if (ev._major != CORBA_NO_EXCEPTION)
- {
- g_error ("Accessibility app error: exception during "
- "registry activation from id: %s\n",
- CORBA_exception_id (&ev));
- CORBA_exception_free (&ev);
- }
-
- if (CORBA_Object_is_nil (registry, &ev))
- {
- g_error ("Could not locate registry");
- }
-
- bonobo_activate ();
-
- /* Create the accessible application server object */
-
- this_app = spi_application_new (atk_get_root ());
-
- fprintf (stderr, "About to register application\n");
-
- Accessibility_Registry_registerApplication (registry,
- BONOBO_OBJREF (this_app),
- &ev);
-
- g_atexit (spi_atk_bridge_exit_func);
-
- g_idle_add (spi_atk_bridge_idle_init, NULL);
-
- return 0;
-}
-
-static gboolean
-spi_atk_bridge_idle_init (gpointer user_data)
-{
- spi_atk_register_event_listeners ();
-
- fprintf (stderr, "Application registered & listening\n");
-
- return FALSE;
-}
-
-static void
-spi_atk_register_event_listeners (void)
-{
- /*
- * kludge to make sure the Atk interface types are registered, otherwise
- * the AtkText signal handlers below won't get registered
- */
- GObject *ao = g_object_new (ATK_TYPE_OBJECT, NULL);
- AtkObject *bo = atk_no_op_object_new (ao);
-
- /* Register for focus event notifications, and register app with central registry */
-
- atk_add_focus_tracker (spi_atk_bridge_focus_tracker);
- atk_add_global_event_listener (spi_atk_bridge_property_event_listener, "Gtk:AtkObject:property-change");
- atk_add_global_event_listener (spi_atk_bridge_signal_listener, "Gtk:AtkObject:children-changed");
- atk_add_global_event_listener (spi_atk_bridge_signal_listener, "Gtk:AtkObject:visible-data-changed");
- atk_add_global_event_listener (spi_atk_bridge_signal_listener, "Gtk:AtkSelection:selection-changed");
- atk_add_global_event_listener (spi_atk_bridge_signal_listener, "Gtk:AtkText:text-selection-changed");
- atk_add_global_event_listener (spi_atk_bridge_signal_listener, "Gtk:AtkText:text-changed");
- atk_add_global_event_listener (spi_atk_bridge_signal_listener, "Gtk:AtkText:text-caret-moved");
- atk_add_global_event_listener (spi_atk_bridge_signal_listener, "Gtk:AtkTable:row-inserted");
- atk_add_global_event_listener (spi_atk_bridge_signal_listener, "Gtk:AtkTable:row-reordered");
- atk_add_global_event_listener (spi_atk_bridge_signal_listener, "Gtk:AtkTable:row-deleted");
- atk_add_global_event_listener (spi_atk_bridge_signal_listener, "Gtk:AtkTable:column-inserted");
- atk_add_global_event_listener (spi_atk_bridge_signal_listener, "Gtk:AtkTable:column-reordered");
- atk_add_global_event_listener (spi_atk_bridge_signal_listener, "Gtk:AtkTable:column-deleted");
- atk_add_global_event_listener (spi_atk_bridge_signal_listener, "Gtk:AtkTable:model-changed");
-/*
- * May add the following listeners to implement preemptive key listening for GTK+
- *
- * atk_add_global_event_listener (spi_atk_bridge_widgetkey_listener, "Gtk:GtkWidget:key-press-event");
- * atk_add_global_event_listener (spi_atk_bridge_widgetkey_listener, "Gtk:GtkWidget:key-release-event");
- */
- atk_add_key_event_listener (spi_atk_bridge_key_listener, NULL);
-
- g_object_unref (G_OBJECT (bo));
- g_object_unref (ao);
-}
-
-static void
-spi_atk_bridge_exit_func (void)
-{
- BonoboObject *app = (BonoboObject *) this_app;
-
- fprintf (stderr, "exiting bridge\n");
-
- if (!app)
- {
- return;
- }
- this_app = NULL;
-
- /*
- * FIXME: this may be incorrect for apps that do their own bonobo
- * shutdown, until we can explicitly shutdown to get the ordering
- * right.
- */
- if (!bonobo_is_initialized ())
- {
- fprintf (stderr, "Re-initializing bonobo\n");
- g_assert (bonobo_init (0, NULL));
- g_assert (bonobo_activate ());
- }
-
- Accessibility_Registry_deregisterApplication (
- registry, BONOBO_OBJREF (app), &ev);
-
- bonobo_object_release_unref (registry, &ev);
-
- bonobo_object_unref (app);
-
- fprintf (stderr, "bridge exit func complete.\n");
-
- if (g_getenv ("AT_BRIDGE_SHUTDOWN"))
- {
- g_assert (!bonobo_debug_shutdown ());
- }
-}
-
-static void
-spi_atk_bridge_focus_tracker (AtkObject *object)
-{
- SpiAccessible *source;
- Accessibility_Event e;
-
- source = spi_accessible_new (object);
-
- e.type = "focus:";
- e.source = BONOBO_OBJREF (source);
- e.detail1 = 0;
- e.detail2 = 0;
-
- Accessibility_Registry_notifyEvent (registry, &e, &ev);
-
- CORBA_exception_free (&ev);
-}
-
-static void
-spi_atk_emit_eventv (GObject *gobject,
- unsigned long detail1,
- unsigned long detail2,
- const char *format, ...)
-{
- va_list args;
- Accessibility_Event e;
- SpiAccessible *source;
- AtkObject *aobject;
-#ifdef SPI_BRIDGE_DEBUG
- CORBA_string s;
-#endif
-
- va_start (args, format);
-
- if (ATK_IS_IMPLEMENTOR (gobject))
- {
- aobject = atk_implementor_ref_accessible (ATK_IMPLEMENTOR (gobject));
- source = spi_accessible_new (aobject);
- g_object_unref (G_OBJECT (aobject));
- }
- else if (ATK_IS_OBJECT (gobject))
- {
- aobject = ATK_OBJECT (gobject);
- source = spi_accessible_new (aobject);
- }
- else
- {
- aobject = NULL;
- source = NULL;
- g_error ("received property-change event from non-AtkImplementor");
- }
-
- if (source != NULL)
- {
- e.type = g_strdup_vprintf (format, args);
- e.source = BONOBO_OBJREF (source);
- e.detail1 = detail1;
- e.detail2 = detail2;
-
-#ifdef SPI_BRIDGE_DEBUG
- s = Accessibility_Accessible__get_name (BONOBO_OBJREF (source), &ev);
- g_warning ("Emitting event '%s' (%lu, %lu) on %s",
- e.type, e.detail1, e.detail2, s);
- CORBA_free (s);
-#endif
-
- Accessibility_Registry_notifyEvent (registry, &e, &ev);
-
- CORBA_exception_free (&ev);
-
- g_free (e.type);
- }
-
- va_end (args);
-}
-
-static gboolean
-spi_atk_bridge_property_event_listener (GSignalInvocationHint *signal_hint,
- guint n_param_values,
- const GValue *param_values,
- gpointer data)
-{
- AtkPropertyValues *values;
- GObject *gobject;
-
-#ifdef SPI_BRIDGE_DEBUG
- GSignalQuery signal_query;
- const gchar *name;
- gchar *s, *s2;
-
- g_signal_query (signal_hint->signal_id, &signal_query);
- name = signal_query.signal_name;
-
- s2 = g_type_name (G_OBJECT_TYPE (g_value_get_object (param_values + 0)));
- s = atk_object_get_name (ATK_OBJECT (g_value_get_object (param_values + 0)));
- fprintf (stderr, "Received (property) signal %s:%s from object %s (gail %s)\n",
- g_type_name (signal_query.itype), name, s, s2);
-#endif
-
- gobject = g_value_get_object (param_values + 0);
- values = (AtkPropertyValues*) g_value_get_pointer (param_values + 1);
-
- spi_atk_emit_eventv (gobject, 0, 0, "object:property-change:%s", values->property_name);
-
- return TRUE;
-}
-
-static gboolean
-spi_atk_bridge_state_event_listener (GSignalInvocationHint *signal_hint,
- guint n_param_values,
- const GValue *param_values,
- gpointer data)
-{
- GObject *gobject;
- AtkPropertyValues *values;
-#ifdef SPI_BRIDGE_DEBUG
- GSignalQuery signal_query;
- const gchar *name;
-
- g_signal_query (signal_hint->signal_id, &signal_query);
- name = signal_query.signal_name;
- fprintf (stderr, "Received (state) signal %s:%s\n",
- g_type_name (signal_query.itype), name);
-#endif
-
- gobject = g_value_get_object (param_values + 0);
- values = (AtkPropertyValues*) g_value_get_pointer (param_values + 1);
-
- spi_atk_emit_eventv (gobject,
- (unsigned long) values->old_value.data[0].v_ulong,
- (unsigned long) values->new_value.data[0].v_ulong,
- "object:%s:?", values->property_name);
-
- return TRUE;
-}
-
-static void
-spi_init_keystroke_from_atk_key_event (Accessibility_DeviceEvent *keystroke,
- AtkKeyEventStruct *event)
-{
-#ifdef SPI_DEBUG
- if (event)
- {
- g_print ("event %c (%d)\n", (int) event->keyval, (int) event->keycode);
- }
- else
-#endif
- if (!event)
- {
- g_print ("WARNING: NULL key event!");
- }
-
- keystroke->id = (CORBA_long) event->keyval;
- keystroke->hw_code = (CORBA_short) event->keycode;
- keystroke->timestamp = (CORBA_unsigned_long) event->timestamp;
- keystroke->modifiers = (CORBA_unsigned_short) (event->state & 0xFFFF);
- if (event->string)
- {
- keystroke->event_string = CORBA_string_dup (event->string);
- keystroke->is_text = CORBA_TRUE;
- }
- else
- {
- keystroke->event_string = CORBA_string_dup ("");
- keystroke->is_text = CORBA_FALSE;
- }
- switch (event->type)
- {
- case (ATK_KEY_EVENT_PRESS):
- keystroke->type = Accessibility_KEY_PRESSED;
- break;
- case (ATK_KEY_EVENT_RELEASE):
- keystroke->type = Accessibility_KEY_RELEASED;
- break;
- default:
- keystroke->type = 0;
- break;
- }
-#if 0
- g_print ("key_event type %d; val=%d code=%d modifiers=%x name=%s is_text=%d, time=%lx\n",
- (int) keystroke->type, (int) keystroke->id, (int) keystroke->hw_code,
- (int) keystroke->modifiers,
- keystroke->event_string, (int) keystroke->is_text, (unsigned long) keystroke->timestamp);
-#endif
-}
-
-static gint
-spi_atk_bridge_key_listener (AtkKeyEventStruct *event, gpointer data)
-{
- CORBA_boolean result;
- Accessibility_DeviceEvent key_event;
- Accessibility_DeviceEventController controller =
- Accessibility_Registry_getDeviceEventController (registry, &ev);
-
- if (BONOBO_EX (&ev))
- {
- g_warning ("failure: no deviceeventcontroller found\n");
- CORBA_exception_free (&ev);
- result = FALSE;
- }
- else
- {
-
- spi_init_keystroke_from_atk_key_event (&key_event, event);
-
- result = Accessibility_DeviceEventController_notifyListenersSync (
- controller, &key_event, &ev);
-
- CORBA_exception_free (&ev);
- }
-
- return result;
-}
-
-static gboolean
-spi_atk_bridge_signal_listener (GSignalInvocationHint *signal_hint,
- guint n_param_values,
- const GValue *param_values,
- gpointer data)
-{
- GObject *gobject;
- GSignalQuery signal_query;
- const gchar *name;
- gint detail1 = 0, detail2 = 0;
-#ifdef SPI_BRIDGE_DEBUG
- gchar *s, *s2;
-#endif
-
- g_signal_query (signal_hint->signal_id, &signal_query);
-
- name = signal_query.signal_name;
-
-#ifdef SPI_BRIDGE_DEBUG
- s2 = g_type_name (G_OBJECT_TYPE (g_value_get_object (param_values + 0)));
- s = atk_object_get_name (ATK_OBJECT (g_value_get_object (param_values + 0)));
- fprintf (stderr, "Received signal %s:%s from object %s (gail %s)\n",
- g_type_name (signal_query.itype), name, s, s2);
-#endif
-
- gobject = g_value_get_object (param_values + 0);
- if (G_VALUE_TYPE (param_values + 1) == G_TYPE_INT)
- detail1 = g_value_get_int (param_values + 1);
- if (G_VALUE_TYPE (param_values + 2) == G_TYPE_INT)
- detail2 = g_value_get_int (param_values + 2);
-
- spi_atk_emit_eventv (gobject, detail1, detail2, "object:%s", name);
-
- return TRUE;
-}
-
-
-
-
-
-
-
-lib_LTLIBRARIES = libat-bridge.la
+lib_LTLIBRARIES = libatk-bridge.la
-libat_bridge_la_SOURCES = \
+libatk_bridge_la_SOURCES = \
bridge.c
-libat_bridge_la_DEPENDENCIES = \
+libatk_bridge_la_DEPENDENCIES = \
$(top_srcdir)/libspi/application.h
INCLUDES = -I $(top_srcdir) \
-I $(top_builddir) \
-I $(top_srcdir)/libspi \
-I $(top_builddir)/libspi \
- -I $(top_builddir)/at-bridge \
- $(AT_BRIDGE_CFLAGS)
+ -I $(top_builddir)/atk-bridge \
+ $(ATK_BRIDGE_CFLAGS)
DEPS = \
$(libatk) \
LDFLAGS += -no-undefined
-libat_bridge_la_LIBADD = $(AT_BRIDGE_LIBS) ../libspi/libspi.la
+libatk_bridge_la_LIBADD = $(ATK_BRIDGE_LIBS) ../libspi/libspi.la
-CFLAGS += $(AT_BRIDGE_CFLAGS)
+CFLAGS += $(ATK_BRIDGE_CFLAGS)
GObject *gobject;
GSignalQuery signal_query;
const gchar *name;
+ gint detail1 = 0, detail2 = 0;
#ifdef SPI_BRIDGE_DEBUG
gchar *s, *s2;
#endif
#endif
gobject = g_value_get_object (param_values + 0);
-
- spi_atk_emit_eventv (gobject, 0, 0, "object:%s", name);
+ if (G_VALUE_TYPE (param_values + 1) == G_TYPE_INT)
+ detail1 = g_value_get_int (param_values + 1);
+ if (G_VALUE_TYPE (param_values + 2) == G_TYPE_INT)
+ detail2 = g_value_get_int (param_values + 2);
+
+ spi_atk_emit_eventv (gobject, detail1, detail2, "object:%s", name);
return TRUE;
}
AC_SUBST(UTILS_LIBS)
AC_SUBST(UTILS_CFLAGS)
-PKG_CHECK_MODULES(AT_BRIDGE, \
+PKG_CHECK_MODULES(ATK_BRIDGE, \
libbonobo-2.0 >= 1.107.0 \
atk >= 0.2)
-AC_SUBST(AT_BRIDGE_LIBS)
-AC_SUBST(AT_BRIDGE_CFLAGS)
+AC_SUBST(ATK_BRIDGE_LIBS)
+AC_SUBST(ATK_BRIDGE_CFLAGS)
PKG_CHECK_MODULES(LIBCSPI, \
libbonobo-2.0 >= 1.107.0 \
libspi/Makefile
registryd/Makefile
registryd/Accessibility_Registry.server
-at-bridge/Makefile
+atk-bridge/Makefile
test/Makefile
cspi/Makefile
cspi/bonobo/Makefile
typedef Accessible AccessibleRelation;
typedef Accessible AccessibleSelection;
typedef Accessible AccessibleStateSet;
+typedef Accessible AccessibleStreamableContent;
typedef Accessible AccessibleTable;
typedef Accessible AccessibleText;
typedef Accessible AccessibleValue;
SPI_KEY_PRESS,
SPI_KEY_RELEASE,
SPI_KEY_PRESSRELEASE,
- SPI_KEY_SYM
+ SPI_KEY_SYM,
+ SPI_KEY_STRING
} AccessibleKeySynthType;
typedef enum {
Accessible *SPI_getDesktop (int i);
int SPI_getDesktopList (Accessible **list);
-SPIBoolean SPI_generateKeyEvent (long int keyval,
+SPIBoolean SPI_generateKeyboardEvent (long int keyval,
+ char *keystring,
AccessibleKeySynthType synth_type);
+
SPIBoolean SPI_generateMouseEvent (long int x, long int y, char *name);
/* Accessible function prototypes */
/* Interface query methods */
-SPIBoolean Accessible_isAction (Accessible *obj);
-SPIBoolean Accessible_isApplication (Accessible *obj);
-SPIBoolean Accessible_isComponent (Accessible *obj);
-SPIBoolean Accessible_isEditableText (Accessible *obj);
-SPIBoolean Accessible_isHypertext (Accessible *obj);
-SPIBoolean Accessible_isImage (Accessible *obj);
-SPIBoolean Accessible_isSelection (Accessible *obj);
-SPIBoolean Accessible_isTable (Accessible *obj);
-SPIBoolean Accessible_isText (Accessible *obj);
-SPIBoolean Accessible_isValue (Accessible *obj);
-
-AccessibleAction * Accessible_getAction (Accessible *obj);
-AccessibleApplication * Accessible_getApplication (Accessible *obj);
-AccessibleComponent * Accessible_getComponent (Accessible *obj);
-AccessibleEditableText * Accessible_getEditableText (Accessible *obj);
-AccessibleHypertext * Accessible_getHypertext (Accessible *obj);
-AccessibleImage * Accessible_getImage (Accessible *obj);
-AccessibleSelection * Accessible_getSelection (Accessible *obj);
-AccessibleTable * Accessible_getTable (Accessible *obj);
-AccessibleText * Accessible_getText (Accessible *obj);
-AccessibleValue * Accessible_getValue (Accessible *obj);
-AccessibleUnknown * Accessible_queryInterface (Accessible *obj,
- const char *interface_name);
+SPIBoolean Accessible_isAction (Accessible *obj);
+SPIBoolean Accessible_isApplication (Accessible *obj);
+SPIBoolean Accessible_isComponent (Accessible *obj);
+SPIBoolean Accessible_isEditableText (Accessible *obj);
+SPIBoolean Accessible_isHypertext (Accessible *obj);
+SPIBoolean Accessible_isImage (Accessible *obj);
+SPIBoolean Accessible_isSelection (Accessible *obj);
+SPIBoolean Accessible_isStreamableContent (Accessible *obj);
+SPIBoolean Accessible_isTable (Accessible *obj);
+SPIBoolean Accessible_isText (Accessible *obj);
+SPIBoolean Accessible_isValue (Accessible *obj);
+
+AccessibleAction * Accessible_getAction (Accessible *obj);
+AccessibleApplication * Accessible_getApplication (Accessible *obj);
+AccessibleComponent * Accessible_getComponent (Accessible *obj);
+AccessibleEditableText * Accessible_getEditableText (Accessible *obj);
+AccessibleHypertext * Accessible_getHypertext (Accessible *obj);
+AccessibleImage * Accessible_getImage (Accessible *obj);
+AccessibleSelection * Accessible_getSelection (Accessible *obj);
+AccessibleStreamableContent * Accessible_getStreamableContent (Accessible *obj);
+AccessibleTable * Accessible_getTable (Accessible *obj);
+AccessibleText * Accessible_getText (Accessible *obj);
+AccessibleValue * Accessible_getValue (Accessible *obj);
+AccessibleUnknown * Accessible_queryInterface (Accessible *obj,
+ const char *interface_name);
/* AccessibleAction function prototypes */
SPIBoolean
AccessibleStateSet_isEmpty (AccessibleStateSet *obj);
-
+void
+AccessibleStreamableContent_ref (AccessibleStreamableContent *obj);
+void
+AccessibleStreamableContent_unref (AccessibleStreamableContent *obj);
+char **
+AccessibleStreamableContent_getContentTypes (AccessibleStreamableContent *obj);
+SPIBoolean
+AccessibleStreamableContent_open (AccessibleStreamableContent *obj,
+ const char *content_type);
+SPIBoolean
+AccessibleStreamableContent_seek (AccessibleStreamableContent *obj,
+ long int offset);
+SPIBoolean
+AccessibleStreamableContent_read (AccessibleStreamableContent *obj,
+ void *buff,
+ long int nbytes,
+ unsigned int read_type);
/*
*
* AccessibleTable function prototypes
}
/**
+ * Accessible_isStreamableContent:
+ * @obj: a pointer to the #Accessible instance to query.
+ *
+ * Query whether the specified #Accessible implements
+ * #AccessibleStreamableContent.
+ *
+ * Returns: #TRUE if @obj implements the #AccessibleStreamableContent interface,
+ * #FALSE otherwise.
+**/
+SPIBoolean
+Accessible_isStreamableContent (Accessible *obj)
+{
+ return cspi_accessible_is_a (obj,
+ "IDL:Accessibility/StreamableContent:1.0");
+}
+
+/**
* Accessible_isText:
* @obj: a pointer to the #Accessible instance to query.
*
/**
+ * Accessible_getStreamableContent:
+ * @obj: a pointer to the #Accessible instance to query.
+ *
+ * Get the #AccessibleStreamableContent interface for an #Accessible.
+ *
+ * Returns: a pointer to an #AccessibleStreamableContent interface instance, or
+ * NULL if @obj does not implement #AccessibleStreamableContent.
+ **/
+AccessibleStreamableContent *
+Accessible_getStreamableContent (Accessible *obj)
+{
+ return (AccessibleStreamableContent *) Accessible_queryInterface (
+ obj, "IDL:Accessibility/StreamableContent:1.0");
+}
+
+/**
* Accessible_getTable:
* @obj: a pointer to the #Accessible instance to query.
*
* object:column-deleted
* object:model-changed
*
+ * (window events)
+ *
+ * window:minimize
+ * window:maximize
+ * window:restore
+ * window:close
+ * window:create
+ * window:reparent
+ * window:desktop-create
+ * window:desktop-destroy
+ * window:focus-in
+ * window:focus-out
+ * window:raise
+ * window:lower
+ * window:move
+ * window:resize
+ * window:shade
+ * window:unshade
+ * window:restyle
+ *
* NOTE: this string may be UTF-8, but should not contain byte value 56
* (ascii ':'), except as a delimiter, since non-UTF-8 string
* delimiting functions are used internally.
Accessibility_KeyEventTypeSeq key_events;
Accessibility_ControllerEventMask controller_event_mask;
Accessibility_DeviceEventController device_event_controller;
+ Accessibility_EventListenerMode listener_mode;
if (!listener)
{
controller_event_mask = (CORBA_unsigned_long) modmask;
+ listener_mode.synchronous =
+ (CORBA_boolean) ((sync_type & SPI_KEYLISTENER_SYNCHRONOUS)!=0);
+ listener_mode.preemptive =
+ (CORBA_boolean) ((sync_type & SPI_KEYLISTENER_CANCONSUME)!=0);
+ listener_mode.global =
+ (CORBA_boolean) ((sync_type & SPI_KEYLISTENER_ALL_WINDOWS)!=0);
+
Accessibility_DeviceEventController_registerKeystrokeListener (
device_event_controller,
cspi_event_listener_get_corba (listener),
&key_set,
controller_event_mask,
&key_events,
- ((sync_type & SPI_KEYLISTENER_ALL_WINDOWS)!=0) ? CORBA_TRUE : CORBA_FALSE,
+ &listener_mode,
cspi_ev ());
cspi_return_val_if_ev ("registering keystroke listener", FALSE);
&key_set,
controller_event_mask,
&key_events,
- (CORBA_boolean) TRUE,
cspi_ev ());
cspi_release_unref (device_event_controller);
}
/**
- * SPI_generateKeyEvent:
+ * SPI_generateKeyboardEvent:
* @keyval: a long integer indicating the keycode or keysym of the key event
* being synthesized.
* @synth_type: a #AccessibleKeySynthType flag indicating whether @keyval
* Returns: #TRUE if successful, otherwise #FALSE.
**/
SPIBoolean
-SPI_generateKeyEvent (long int keyval, AccessibleKeySynthType synth_type)
+SPI_generateKeyboardEvent (long int keyval,
+ char *keystring,
+ AccessibleKeySynthType synth_type)
{
/* TODO: check current modifier status and
* send keycode to alter, if necessary
*/
+
+ /* TODO: implement keystring use case */
+ Accessibility_KeySynthType keysynth_type;
Accessibility_DeviceEventController device_event_controller =
Accessibility_Registry_getDeviceEventController (cspi_registry (), cspi_ev ());
- g_print ("keyval %d\n", (int) keyval);
- cspi_return_val_if_ev ("getting event controller", FALSE);
+ cspi_return_val_if_ev ("getting event controller for key event gen", FALSE);
+
+ switch (synth_type)
+ {
+ case SPI_KEY_PRESS:
+ keysynth_type = Accessibility_KEY_PRESS;
+ break;
+ case SPI_KEY_RELEASE:
+ keysynth_type = Accessibility_KEY_RELEASE;
+ break;
+ case SPI_KEY_PRESSRELEASE:
+ keysynth_type = Accessibility_KEY_PRESSRELEASE;
+ break;
+ case SPI_KEY_SYM:
+ keysynth_type = Accessibility_KEY_SYM;
+ break;
+ case SPI_KEY_STRING:
+ keysynth_type = Accessibility_KEY_STRING;
+ break;
+ }
+
+ Accessibility_DeviceEventController_generateKeyboardEvent (device_event_controller,
+ keyval,
+ "",
+ keysynth_type,
+ cspi_ev ());
- Accessibility_DeviceEventController_generateKeyEvent (device_event_controller,
- keyval,
- (unsigned long) synth_type,
- cspi_ev ());
+ cspi_return_val_if_ev ("generating keyboard event", FALSE);
cspi_release_unref (device_event_controller);
--- /dev/null
+#include <cspi/spi-private.h>
+
+/**
+ * AccessibleStreamableContent_ref:
+ * @obj: a pointer to the #AccessibleStreamableContent implementor on which to
+ * operate.
+ *
+ * Increment the reference count for an #AccessibleStreamableContent object.
+ *
+ **/
+void
+AccessibleStreamableContent_ref (AccessibleStreamableContent *obj)
+{
+ cspi_object_ref (obj);
+}
+
+/**
+ * AccessibleStreamableContent_unref:
+ * @obj: a pointer to the #AccessibleStreamableContent implementor
+ * on which to operate.
+ *
+ * Decrement the reference count for an #AccessibleStreamableContent object.
+ *
+ **/
+void
+AccessibleStreamableContent_unref (AccessibleStreamableContent *obj)
+{
+ cspi_object_unref (obj);
+}
+
+/**
+ * AccessibleStreamableContent_getContentTypes:
+ * @obj: a pointer to the #AccessibleStreamableContent implementor on which to operate.
+ *
+ * Get a list of strings containing the content mimetypes available from an
+ * #AccessibleStreamableContent implementor.
+ *
+ * Returns: an array of strings, terminated by a NULL string, specifying the
+ * mimetypes for which the streamed content is available.
+ *
+ **/
+char **
+AccessibleStreamableContent_getContentTypes (AccessibleStreamableContent *obj)
+{
+ char **content_types = malloc (sizeof (char *));
+ content_types [0] = NULL;
+
+ /* TODO: connect this to the correct libspi implementation code */
+ return content_types;
+}
+
+/**
+ * AccessibleStreamableContent_open:
+ * @obj: a pointer to the #AccessibleStreamableContent implementor on which to operate.
+ * @content_type: a string specifying the content type to retrieve (should match one
+ * of the return strings from #AccessibleStreamableContent_getContentTypes ()).
+ * @fp: a pointer to a FILE pointer into which is placed a file handle suitable for
+ * reading the content, if possible. Not all content types support file-handle
+ * interaction, so check this parameter for NULL before use.
+ *
+ * Open a streaming connection to an AccessibleStreamableContent implementor,
+ * of a particular content type
+ *
+ * Returns: #TRUE if successful, #FALSE if unsuccessful.
+ *
+ **/
+SPIBoolean
+AccessibleStreamableContent_open (AccessibleStreamableContent *obj,
+ const char *content_type)
+{
+ /* TODO: connect this to the correct libspi implementation code */
+ return FALSE;
+}
+
+/**
+ * AccessibleStreamableContent_seek:
+ * @obj: a pointer to the #AccessibleStreamableContent implementor on which to operate.
+ * @offset: a long int specifying the offset into the stream.
+ * @seek_type: an enum indicating the seek offset type, may be SEEK_SET,
+ * SEEK_CUR, SEEK_END (as in the lseek() libc command).
+ *
+ * Cause the current streamable content connection (obtained via
+ * #AccessibleStreamableContent_open()) to seek to a particular offset in the
+ * stream.
+ *
+ * Returns: #TRUE if successful, #FALSE if unsuccessful.
+ *
+ **/
+SPIBoolean
+AccessibleStreamableContent_seek (AccessibleStreamableContent *obj,
+ long int offset)
+{
+ /* TODO: connect this to the correct libspi implementation code */
+ return FALSE;
+}
+
+/**
+ * AccessibleStreamableContent_read:
+ * @obj: a pointer to the #AccessibleStreamableContent implementor on which to operate.
+ * @buff: a pointer to a buffer into which the resulting bytes read from the stream
+ * are to be written.
+ * @nbytes: a long integer indicating the number of bytes to read/write.
+ * @read_type: currently unused, specifies behavior of reads for streamed content
+ * if blocking is not allowed, etc.
+ *
+ * Copy (read) bytes from the currently open streamable content connection
+ * to a buffer.
+ *
+ * Returns: an integer indicating the number of bytes read, or -1 on error.
+ *
+ **/
+SPIBoolean
+AccessibleStreamableContent_read (AccessibleStreamableContent *obj,
+ void *buff,
+ long int nbytes,
+ unsigned int read_type)
+{
+ /* TODO: connect this to the correct libspi implementation code */
+ return -1;
+}
+
* "" if none exists.
**/
string getKeyBinding (in long index);
+
+ /**
+ * unImplemented:
+ *
+ * placeholders for future expansion.
+ */
+ void unImplemented ();
+ void unImplemented2 ();
};
};
void grabFocus ();
void registerFocusHandler (in EventListener handler);
void deregisterFocusHandler (in EventListener handler);
- };
+
+ /**
+ * unImplemented:
+ *
+ * placeholders for future expansion.
+ */
+ void unImplemented ();
+ void unImplemented2 ();
+ };
};
* At the moment this is only a marker interface, it acts just like
* any other Accessible.
**/
+ /**
+ * unImplemented:
+ *
+ * placeholders for future expansion.
+ */
+ void unImplemented ();
+ void unImplemented2 ();
};
};
void cutText (in long startPos, in long endPos);
void deleteText (in long startPos, in long endPos);
void pasteText (in long position);
+ /**
+ * unImplemented5:
+ *
+ * placeholders for future expansion. Note that these are named
+ * 'unimplemented5 and unimplemented6' to avoid conflict with
+ * placeholders from Accessibility::Text.
+ */
+ void unImplemented5 ();
+ void unImplemented6 ();
};
};
interface EventListener : Bonobo::Unknown {
oneway void notifyEvent (in Event e);
};
-
};
#endif
Accessible getObject (in long i);
string getURI (in long i);
boolean isValid ();
+ /**
+ * unImplemented:
+ *
+ * placeholders for future expansion.
+ */
+ void unImplemented ();
+ void unImplemented2 ();
};
};
module Accessibility {
- interface Hypertext : Text {
+ interface Hypertext : Bonobo::Unknown {
long getNLinks ();
Hyperlink getLink (in long linkIndex);
long getLinkIndex (in long characterIndex);
BoundingBox getImageExtents (in short coordType);
void getImagePosition (out long x, out long y, in short coordType);
void getImageSize (out long width, out long height);
+ /**
+ * unImplemented:
+ *
+ * placeholders for future expansion.
+ */
+ void unImplemented ();
+ void unImplemented2 ();
};
};
**/
DeviceEventController getDeviceEventController ();
+ /**
+ * unImplemented:
+ *
+ * placeholders for future expansion.
+ */
+ void unImplemented ();
+ void unImplemented2 ();
};
enum KeyEventType {
KEY_PRESS,
KEY_RELEASE,
KEY_PRESSRELEASE,
- KEY_SYM
+ KEY_SYM,
+ KEY_STRING
};
enum ModifierType {
MODIFIER_NUMLOCK
};
+ struct EventListenerMode {
+ boolean synchronous;
+ boolean preemptive;
+ boolean global;
+ };
+
typedef unsigned long ControllerEventMask;
struct DeviceEvent {
in KeySet keys,
in ControllerEventMask mask,
in KeyEventTypeSeq type,
- in boolean is_synchronous);
+ in EventListenerMode mode);
/**
* deregisterKeystrokeListener:
* @keys: a @KeySet indicating which keys to intercept, or KEYSET_ALL_KEYS.
* @mask: a @ControllerEventMask filtering the intercepted key events.
* @type: an @EventType mask that may created by ORing event types together.
- * @is_synchronous: a @boolean indicating whether the listener should
- * receive the events synchronously, potentially consuming them,
- * or just be notified asynchronously of those events that have
- * been generated.
+ *
* Returns: void
*
* De-register a previously registered keyboard eventlistener.
void deregisterKeystrokeListener (in DeviceEventListener listener,
in KeySet keys,
in ControllerEventMask mask,
- in KeyEventTypeSeq type,
- in boolean is_synchronous);
+ in KeyEventTypeSeq type);
boolean notifyListenersSync (in DeviceEvent event);
oneway void notifyListenersAsync (in DeviceEvent event);
/**
- * generateKeyEvent:
+ * generateKeyboardEvent:
* @keycode: a long integer indicating the keycode of
* the keypress to be synthesized.
+ * @keystring: an optional UTF-8 string indicating a complex
+ * keyboard input event.
+ * @type: a #KeySynthType indicating the type of event(s) to be
+ * synthesized: a key press, release, press-release pair,
+ * or a complex input string (for instance from an
+ * internationalized or complex text input method, or
+ * a composed character).
*
- * Note that this long may be truncated before being
+ * Note that @keycode may be truncated before being
* processed, as keycode length may be platform-dependent
* and keycode ranges are generally much smaller than
* CORBA_long.
+ * One or the other of @keycode or @keystring are generally NULL,
+ * (but not both), depending on the value of @type.
*
* Returns: void
*
- * Synthesize a keypress event.
+ * Synthesize a keyboard event.
*
**/
- void generateKeyEvent (in long keycode, in KeySynthType type);
+ void generateKeyboardEvent (in long keycode,
+ in string keystring,
+ in KeySynthType type);
/**
* generateMouseEvent:
*
**/
void generateMouseEvent (in long x, in long y, in string eventName);
+
+ /**
+ * unImplemented:
+ *
+ * placeholders for future expansion.
+ */
+ void unImplemented ();
+ void unImplemented2 ();
};
};
RelationType getRelationType ();
short getNTargets ();
Object getTarget (in short index);
+ /* placeholders for future expansion */
+ void unImplemented ();
+ void unImplemented2 ();
};
};
boolean isChildSelected (in long childIndex);
void selectAll ();
void clearSelection ();
+
+ /**
+ * unImplemented:
+ *
+ * placeholders for future expansion.
+ */
+ void unImplemented ();
+ void unImplemented2 ();
};
};
/* returns a 'difference set' */
StateSet compare (in StateSet compareState);
boolean isEmpty ();
+
+ /**
+ * unImplemented:
+ *
+ * placeholders for future expansion.
+ */
+ void unImplemented ();
+ void unImplemented2 ();
};
};
typedef sequence<string> StringSeq;
- typedef sequence<octet> OctetSeq;
-
- enum SeekType {
- SEEK_START,
- SEEK_END,
- SEEK_CURRENT
- };
-
interface StreamableContent {
StringSeq getContentTypes ();
Bonobo::Stream getContent (in string contentType);
/* methods used from Bonobo::Stream : seek, read. Others unsupported. */
+
+ /**
+ * unImplemented:
+ *
+ * placeholders for future expansion.
+ */
+ void unImplemented ();
+ void unImplemented2 ();
+ void unImplemented3 ();
+ void unImplemented4 ();
};
};
boolean isRowSelected (in long row);
boolean isColumnSelected (in long column);
boolean isSelected (in long row, in long column);
- };
+ /**
+ * unImplemented:
+ *
+ * placeholders for future expansion.
+ */
+ void unImplemented ();
+ void unImplemented2 ();
+ void unImplemented3 ();
+ void unImplemented4 ();
+ };
};
unsigned long getCharacterAtOffset (in long offset); /* long instead of wchar,
* to allow unicode chars > 16 bits
*/
- /* void getRowColAtOffset (in long offset, out long row, out long column); */
string getAttributes (in long offset,
out long startOffset, out long endOffset);
void getCharacterExtents (in long offset, out long x, out long y, out long length, out long width, in short coordType);
boolean addSelection (in long startOffset, in long endOffset);
boolean removeSelection (in long selectionNum);
boolean setSelection (in long selectionNum, in long startOffset, in long endOffset);
+ /**
+ * unImplemented:
+ *
+ * placeholders for future expansion.
+ */
+ void unImplemented ();
+ void unImplemented2 ();
+ void unImplemented3 ();
+ void unImplemented4 ();
};
};
readonly attribute double maximumValue;
readonly attribute double minimumIncrement;
attribute double currentValue;
+
+ /**
+ * unImplemented:
+ *
+ * placeholders for future expansion.
+ */
+ void unImplemented ();
+ void unImplemented2 ();
};
};
BONOBO_OBJECT(spi_editable_text_interface_new (o)));
}
- else if (ATK_IS_HYPERTEXT (o))
+ else if (ATK_IS_TEXT (o))
{
bonobo_object_add_interface (bonobo_object (retval),
- BONOBO_OBJECT (spi_hypertext_interface_new (o)));
+ BONOBO_OBJECT (spi_text_interface_new (o)));
}
- else if (ATK_IS_TEXT (o))
+ if (ATK_IS_HYPERTEXT (o))
{
bonobo_object_add_interface (bonobo_object (retval),
- BONOBO_OBJECT (spi_text_interface_new (o)));
+ BONOBO_OBJECT (spi_hypertext_interface_new (o)));
}
if (ATK_IS_IMAGE (o))
typedef struct _SpiHypertextClass SpiHypertextClass;
struct _SpiHypertext {
- SpiText parent;
+ SpiBase parent;
};
struct _SpiHypertextClass {
- SpiTextClass parent_class;
+ SpiBaseClass parent_class;
POA_Accessibility_Hypertext__epv epv;
};
Accessibility_KeySet *keys;
Accessibility_ControllerEventMask mask;
Accessibility_KeyEventTypeSeq *typeseq;
- gboolean is_system_global;
+ Accessibility_EventListenerMode *mode;
};
typedef struct _DEControllerKeyListener DEControllerKeyListener;
const Accessibility_KeySet *keys,
const Accessibility_ControllerEventMask mask,
const Accessibility_KeyEventTypeSeq *typeseq,
- const CORBA_boolean is_system_global,
+ const Accessibility_EventListenerMode *mode,
CORBA_Environment *ev)
{
DEControllerKeyListener *key_listener = g_new0 (DEControllerKeyListener, 1);
key_listener->keys = ORBit_copy_value (keys, TC_Accessibility_KeySet);
key_listener->mask = mask;
key_listener->typeseq = ORBit_copy_value (typeseq, TC_Accessibility_KeyEventTypeSeq);
- key_listener->is_system_global = is_system_global;
+ if (mode)
+ key_listener->mode = ORBit_copy_value (mode, TC_Accessibility_EventListenerMode);
+ else
+ key_listener->mode = NULL;
#ifdef SPI_DEBUG
g_print ("new listener, with mask %x, is_global %d, keys %p\n",
(unsigned int) key_listener->mask,
- (int) key_listener->is_system_global,
+ (int) mode->global,
(void *) key_listener->keys);
#endif
return key_listener;
case SPI_DEVICE_TYPE_KBD:
key_listener = (DEControllerKeyListener *) listener;
controller->key_listeners = g_list_prepend (controller->key_listeners, key_listener);
- if (key_listener->is_system_global)
+ if (key_listener->mode->global)
{
spi_controller_register_global_keygrabs (controller, key_listener);
}
if ((key_event->modifiers == (CORBA_unsigned_short) (listener->mask & 0xFFFF)) &&
spi_key_set_contains_key (listener->keys, key_event) &&
spi_key_eventtype_seq_contains_event (listener->typeseq, key_event) &&
- (is_system_global == listener->is_system_global))
+ (is_system_global == listener->mode->global))
{
return TRUE;
}
const Accessibility_KeySet *keys,
const Accessibility_ControllerEventMask mask,
const Accessibility_KeyEventTypeSeq *type,
- const CORBA_boolean is_system_global,
+ const Accessibility_EventListenerMode *mode,
CORBA_Environment *ev)
{
SpiDeviceEventController *controller = SPI_DEVICE_EVENT_CONTROLLER (
fprintf (stderr, "registering keystroke listener %p with maskVal %lu\n",
(void *) l, (unsigned long) mask);
#endif
- dec_listener = spi_dec_key_listener_new (l, keys, mask, type,
- is_system_global, ev);
-
- spi_controller_register_device_listener (controller,
- (DEControllerListener *) dec_listener,
- ev);
+ dec_listener = spi_dec_key_listener_new (l, keys, mask, type, mode, ev);
+ spi_controller_register_device_listener (controller, (DEControllerListener *) dec_listener, ev);
}
/*
const Accessibility_KeySet *keys,
const Accessibility_ControllerEventMask mask,
const Accessibility_KeyEventTypeSeq *type,
- const CORBA_boolean is_system_global,
CORBA_Environment *ev)
{
SpiDeviceEventController *controller = SPI_DEVICE_EVENT_CONTROLLER (
keys,
mask,
type,
- is_system_global,
+ NULL,
ev);
#ifdef SPI_DEREGISTER_DEBUG
fprintf (stderr, "deregistering keystroke listener %p with maskVal %lu\n",
return XKeysymToKeycode (spi_get_display (), (KeySym) keysym);
}
+#define SPI_DEBUG
+
/*
* CORBA Accessibility::DeviceEventController::registerKeystrokeListener
* method implementation
*/
static void
-impl_generate_key_event (PortableServer_Servant servant,
- const CORBA_long keycode,
- const Accessibility_KeySynthType synth_type,
- CORBA_Environment *ev)
+impl_generate_keyboard_event (PortableServer_Servant servant,
+ const CORBA_long keycode,
+ const CORBA_char *keystring,
+ const Accessibility_KeySynthType synth_type,
+ CORBA_Environment *ev)
{
- long key_synth_code;
+ long key_synth_code;
#ifdef SPI_DEBUG
- fprintf (stderr, "synthesizing keystroke %ld, type %d\n", (long) keycode, (int) synth_type);
+ fprintf (stderr, "synthesizing keystroke %ld, type %d\n", (long) keycode, (int) synth_type);
#endif
- /* TODO: hide/wrap/remove X dependency */
+ /* TODO: hide/wrap/remove X dependency */
- /* TODO: be accessX-savvy so that keyrelease occurs after sufficient timeout */
+ /* TODO: be accessX-savvy so that keyrelease occurs after sufficient timeout */
- /*
- * TODO: when initializing, query for XTest extension before using,
- * and fall back to XSendEvent() if XTest is not available.
- */
+ /*
+ * TODO: when initializing, query for XTest extension before using,
+ * and fall back to XSendEvent() if XTest is not available.
+ */
+
+ /* TODO: implement keystring mode also */
- switch (synth_type)
- {
- case Accessibility_KEY_PRESS:
- XTestFakeKeyEvent (spi_get_display (), (unsigned int) keycode, True, CurrentTime);
- break;
- case Accessibility_KEY_PRESSRELEASE:
- XTestFakeKeyEvent (spi_get_display (), (unsigned int) keycode, True, CurrentTime);
- case Accessibility_KEY_RELEASE:
- XTestFakeKeyEvent (spi_get_display (), (unsigned int) keycode, False, CurrentTime);
- break;
- case Accessibility_KEY_SYM:
- key_synth_code = keycode_for_keysym (keycode);
- XTestFakeKeyEvent (spi_get_display (), (unsigned int) key_synth_code, True, CurrentTime);
- XTestFakeKeyEvent (spi_get_display (), (unsigned int) key_synth_code, False, CurrentTime);
- break;
- }
+ switch (synth_type)
+ {
+ case Accessibility_KEY_PRESS:
+ XTestFakeKeyEvent (spi_get_display (), (unsigned int) keycode, True, CurrentTime);
+ break;
+ case Accessibility_KEY_PRESSRELEASE:
+ XTestFakeKeyEvent (spi_get_display (), (unsigned int) keycode, True, CurrentTime);
+ case Accessibility_KEY_RELEASE:
+ XTestFakeKeyEvent (spi_get_display (), (unsigned int) keycode, False, CurrentTime);
+ break;
+ case Accessibility_KEY_SYM:
+ key_synth_code = keycode_for_keysym (keycode);
+ XTestFakeKeyEvent (spi_get_display (), (unsigned int) key_synth_code, True, CurrentTime);
+ XTestFakeKeyEvent (spi_get_display (), (unsigned int) key_synth_code, False, CurrentTime);
+ break;
+ }
}
/* Accessibility::DeviceEventController::generateMouseEvent */
epv->registerKeystrokeListener = impl_register_keystroke_listener;
epv->deregisterKeystrokeListener = impl_deregister_keystroke_listener;
/* epv->registerMouseListener = impl_register_mouse_listener; */
- epv->generateKeyEvent = impl_generate_key_event;
+ epv->generateKeyboardEvent = impl_generate_keyboard_event;
epv->generateMouseEvent = impl_generate_mouse_event;
epv->notifyListenersSync = impl_notify_listeners_sync;
epv->notifyListenersAsync = impl_notify_listeners_async;
static KeyCode shift_keycode = 0;
if (!shift_keycode) shift_keycode = XKeysymToKeycode(GDK_DISPLAY(), (KeySym) 0xFFE1);
/* Note: in a real onscreen keyboard shift keycode should not be hard-coded! */
+
if (*keycode)
{
if (*keycode == CAPSLOCK_KEYCODE)
label_buttons (caps_lock || shift_latched);
}
if (shift_latched)
- SPI_generateKeyEvent (shift_keycode, SPI_KEY_PRESS);
-
- SPI_generateKeyEvent ((long) *keycode, SPI_KEY_PRESSRELEASE);
+ SPI_generateKeyboardEvent (shift_keycode, NULL, SPI_KEY_PRESS);
+
+ g_print ("generating key %d\n", (int) *keycode);
+ SPI_generateKeyboardEvent ((long) *keycode, NULL, SPI_KEY_PRESSRELEASE);
if (shift_latched)
{
- SPI_generateKeyEvent (shift_keycode, SPI_KEY_RELEASE);
+ SPI_generateKeyboardEvent (shift_keycode, NULL, SPI_KEY_RELEASE);
toggle_shift_latch (button);
}
}
&switch_set,
SPI_KEYMASK_UNMODIFIED,
(unsigned long) ( SPI_KEY_PRESSED | SPI_KEY_RELEASED ),
- SPI_KEYLISTENER_CANCONSUME);
+ SPI_KEYLISTENER_NOSYNC);
SPI_event_main ();