+2002-05-09 Bill Haneman <bill.haneman@sun.com>
+
+ * test/event-listener-test.c:
+ * test/Makefile.am:
+ Added new test, "event-listener-test";
+ this code does two things; it benchmarks traversal time
+ for the accessible hierarchy for the first running accessible
+ app, and it connects listeners for all supported event types.
+ It is thus useful as an example event listener and for
+ diagnostics/debugging of event generation.
+
+2002-05-08 Bill Haneman <bill.haneman@sun.com>
+
+ * configure.in:
+ Removed util/Makefile from targets.
+
+ * Makefile.am:
+ Removed util subdir from SUBDIRS (temporarily,
+ pending removal of magnifier-only code
+ from UTIL).
+
+ * test/simple-at.c:
+ #ifdef-ed out magnifier dependencies, since
+ magnifier IDL, headers, and binary now live in
+ module gnome-mag and we don't want at-spi to depend
+ on gnome-mag. A magnifier demo which can run alongside
+ simple-at is forthcoming in the gnome-mag module.
+
+ NOTE: Split magnifier binary, IDL, and magnification
+ activation code from at-spi into module gnome-mag.
+
+2002-05-03 Bill Haneman <bill.haneman@sun.com>
+
+ * configure.in:
+ Revved to version 0.13.0
+
+ * idl/Accessibility_Registry.idl:
+ Changed definition of KeySet from sequence of longs to sequence of
+ KeyDefinitions, and added KeyDefinition struct.
+ Required for fix to bug 80616.
+
+ * cspi/spi_registry.c: SPI_registerAccessibleKeystrokeListener():
+ Changed AccessibleKeySet to Accessibility_KeySet marshalling code
+ to use new definition (see above).
+
+ * registryd/deviceeventcontroller.c: handle_keygrab(),
+ spi_keyset_contains_key():
+ Changed to make use of new struct; this allows matching based on
+ string key-name, for instance "Tab". This also allows matching of
+ composed characters, non-alphanumeric characters in a way that
+ doesn't involve dependencies on X keysym codes directly, etc.
+
+ * test/key-listener-test.c:
+ Added test for Alt-Tab key using "string" specification of keyset,
+ and modified one of the tests to use a keycode-based keyset.
+ Thus this test both tests and demonstrates the creation and use of
+ keysets of three forms: specified via keycode array,
+ keysym array, and string array. (The string case only contains a
+ single string, i.e. a string array of length 1).
+
+ * test/simple-at.c:
+ Turned on PRINT_TREE option by default. Also fixed a
+ string-freeing bug in the PRINT_TREE code.
+ Added a listener to window:minimize events.
+
2002-05-08 Padraig O'Briain <padraig.obriain@sun.com>
* atk-bridge/bridge.c:
-SUBDIRS = docs idl libspi registryd atk-bridge cspi util test
+SUBDIRS = docs idl libspi registryd atk-bridge cspi test
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = libspi-1.0.pc cspi-1.0.pc
AC_INIT(idl/Accessibility.idl)
AT_SPI_MAJOR_VERSION=0
-AT_SPI_MINOR_VERSION=12
-AT_SPI_MICRO_VERSION=1
+AT_SPI_MINOR_VERSION=13
+AT_SPI_MICRO_VERSION=0
AT_SPI_INTERFACE_AGE=0
AT_SPI_BINARY_AGE=0
AT_SPI_VERSION="$AT_SPI_MAJOR_VERSION.$AT_SPI_MINOR_VERSION.$AT_SPI_MICRO_VERSION"
AC_SUBST(TESTS_LIBS)
AC_SUBST(TESTS_CFLAGS)
-PKG_CHECK_MODULES(UTILS, \
- libbonobo-2.0 >= 1.107.0 \
- gtk+-2.0 >= 2.0.0 \
- gdk-pixbuf-2.0 >= 2.0.0
- gdk-pixbuf-xlib-2.0 >= 2.0.0)
-AC_SUBST(UTILS_LIBS)
-AC_SUBST(UTILS_CFLAGS)
-
PKG_CHECK_MODULES(ATK_BRIDGE, \
libbonobo-2.0 >= 1.107.0 \
atk >= 0.10)
test/Makefile
cspi/Makefile
cspi/bonobo/Makefile
-util/Makefile
-util/Accessibility_Util.server
])
echo "AT-SPI setup:
* window:reparent
* window:desktop-create
* window:desktop-destroy
- * window:focus-in
- * window:focus-out
+ * window:activate
+ * window:deactivate
* window:raise
* window:lower
* window:move
key_set._buffer = Accessibility_KeySet_allocbuf (keys->len);
for (i = 0; i < key_set._length; ++i)
{
- /* we overload the keyset long w/keycodes, the - bit acts as a flag */
- key_set._buffer[i] = (keys->keysyms[i]) ? keys->keysyms[i] :
- - keys->keycodes[i];
- /* fprintf (stderr, "key-set %d = %d\n", i, (int) key_set->_buffer[i]); */
+ key_set._buffer[i].keycode = keys->keycodes[i];
+ key_set._buffer[i].keysym = keys->keysyms[i];
+ key_set._buffer[i].keystring = (keys->keystrings[i] != NULL) ?
+ keys->keystrings[i] : CORBA_string_dup("");
}
}
else
boolean is_text;
};
- typedef sequence< long > KeySet;
+ struct KeyDefinition {
+ long keycode;
+ long keysym;
+ string keystring;
+ long unused;
+ };
+
+ typedef sequence< KeyDefinition > KeySet;
typedef sequence< KeyEventType > KeyEventTypeSeq;
interface DeviceEventListener : Bonobo::Unknown {
#include <config.h>
-#define SPI_DEBUG
+#undef SPI_DEBUG
+#define SPI_KEYEVENT_DEBUG
#include <string.h>
#include <ctype.h>
for (i = 0; i < key_listener->keys->_length; ++i)
{
- long int key_val = key_listener->keys->_buffer[i];
+ Accessibility_KeyDefinition keydef = key_listener->keys->_buffer[i];
+ long int key_val = keydef.keysym;
/* X Grabs require keycodes, not keysyms */
- if (key_val >= 0)
+ if (keydef.keystring)
+ {
+ key_val = XStringToKeysym(keydef.keystring);
+ }
+ if (key_val > 0)
{
key_val = XKeysymToKeycode (spi_get_display (), (KeySym) key_val);
}
+ else
+ {
+ key_val = keydef.keycode;
+ }
grab_mask.key_val = key_val;
process_cb (controller, &grab_mask);
{
#ifdef SPI_KEYEVENT_DEBUG
g_print ("key_set[%d] = %d; key_event %d, code %d\n",
- i, (int) key_set->_buffer[i],
+ i, (int) key_set->_buffer[i].keycode,
(int) key_event->id, (int) key_event->hw_code);
#endif
- if (key_set->_buffer[i] == (CORBA_long) key_event->id)
+ if (key_set->_buffer[i].keysym == (CORBA_long) key_event->id)
{
return TRUE;
}
- if (key_set->_buffer[i] == (CORBA_long) -key_event->hw_code)
+ if (key_set->_buffer[i].keycode == (CORBA_long) key_event->hw_code)
+ {
+ return TRUE;
+ }
+ if (key_event->event_string && key_event->event_string[0] && !strcmp
+ (key_set->_buffer[i].keystring, key_event->event_string))
{
return TRUE;
}
#ifdef SPI_KEYEVENT_DEBUG
if (!notify)
{
- g_print ("no match for listener %d\n", i);
+ g_print ("no match for event\n");
}
#endif
key_event.event_string = CORBA_string_dup ("space");
break;
case XK_Tab:
+#ifdef SPI_KEYEVENT_DEBUG
+ fprintf(stderr, "Tab\n");
+#endif
key_event.event_string = CORBA_string_dup ("Tab");
break;
case XK_BackSpace:
ls = (*list)->data;
#ifdef SPI_LISTENER_DEBUG
- fprintf (stderr, "event quarks: %lx %lx %lx\n", ls->event_type_quark, etype.major, etype.minor);
- fprintf (stderr, "event name: %s\n", etype.event_name);
+ fprintf (stderr, "event quarks: %lx %lx %lx\n", ls->event_type_quark, ctx->etype.major, ctx->etype.minor);
+ fprintf (stderr, "event name: %s\n", ctx->etype.event_name);
#endif
if ((ls->event_type_quark == ctx->etype.major) ||
NULL=
-noinst_PROGRAMS = test-simple at app simple-at keysynth-demo accessx-gui key-listener-test
+noinst_PROGRAMS = test-simple at app simple-at keysynth-demo accessx-gui key-listener-test event-listener-test
key_listener_test_SOURCES = key-listener-test.c
+event_listener_test_SOURCES = event-listener-test.c
+
at_SOURCES = at.c
app_SOURCES = app.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.
+ */
+
+#include <stdlib.h>
+#include "../cspi/spi-private.h" /* A hack for now */
+
+static void traverse_accessible_tree (Accessible *accessible);
+
+static void report_event (const AccessibleEvent *event, void *user_data);
+static void report_detail_event (const AccessibleEvent *event, void *user_data);
+
+static AccessibleEventListener *generic_listener;
+static AccessibleEventListener *specific_listener;
+static gint n_elements_traversed = 0;
+
+int
+main (int argc, char **argv)
+{
+ int i, j;
+ int n_desktops;
+ int n_apps;
+ char *s;
+ GTimer *timer;
+ gdouble elapsed_time;
+ Accessible *desktop;
+ Accessible *application;
+ const char *modules;
+
+ SPI_init ();
+
+ generic_listener = SPI_createAccessibleEventListener (
+ report_event, NULL);
+ specific_listener = SPI_createAccessibleEventListener (
+ report_detail_event, NULL);
+
+ SPI_registerGlobalEventListener (generic_listener,
+ "focus:");
+ SPI_registerGlobalEventListener (generic_listener,
+ "object:property-change");
+ SPI_registerGlobalEventListener (specific_listener,
+ "object:property-change:accessible-name");
+ SPI_registerGlobalEventListener (generic_listener,
+ "object:state-changed");
+ SPI_registerGlobalEventListener (generic_listener,
+ "object:selection-changed");
+ SPI_registerGlobalEventListener (generic_listener,
+ "object:children-changed");
+ SPI_registerGlobalEventListener (specific_listener,
+ "object:children-changed:add");
+ SPI_registerGlobalEventListener (generic_listener,
+ "object:visible-data-changed");
+ SPI_registerGlobalEventListener (generic_listener,
+ "object:text-selection-changed");
+ SPI_registerGlobalEventListener (generic_listener,
+ "object:text-caret-moved");
+ SPI_registerGlobalEventListener (generic_listener,
+ "object:text-changed");
+ SPI_registerGlobalEventListener (generic_listener,
+ "object:column-inserted");
+ SPI_registerGlobalEventListener (generic_listener,
+ "object:row-inserted");
+ SPI_registerGlobalEventListener (generic_listener,
+ "object:column-reordered");
+ SPI_registerGlobalEventListener (generic_listener,
+ "object:row-reordered");
+ SPI_registerGlobalEventListener (generic_listener,
+ "object:column-deleted");
+ SPI_registerGlobalEventListener (generic_listener,
+ "object:row-deleted");
+ SPI_registerGlobalEventListener (generic_listener,
+ "object:model-changed");
+ SPI_registerGlobalEventListener (generic_listener,
+ "window:minimize");
+ SPI_registerGlobalEventListener (generic_listener,
+ "window:maximize");
+ SPI_registerGlobalEventListener (generic_listener,
+ "window:restore");
+ SPI_registerGlobalEventListener (generic_listener,
+ "window:activate");
+ SPI_registerGlobalEventListener (generic_listener,
+ "window:deactivate");
+ SPI_registerGlobalEventListener (generic_listener,
+ "window:close");
+#ifdef NOT_YET_IMPLEMENTED
+ SPI_registerGlobalEventListener (generic_listener,
+ "window:lower");
+ SPI_registerGlobalEventListener (generic_listener,
+ "window:raise");
+ SPI_registerGlobalEventListener (generic_listener,
+ "window:resize");
+ SPI_registerGlobalEventListener (generic_listener,
+ "window:shade");
+ SPI_registerGlobalEventListener (generic_listener,
+ "window:unshade");
+ /* event below possibly should just be property change? */
+ SPI_registerGlobalEventListener (generic_listener,
+ "window:restyle");
+ SPI_registerGlobalEventListener (generic_listener,
+ "window:desktop-create");
+ SPI_registerGlobalEventListener (generic_listener,
+ "window:desktop-destroy");
+#endif
+
+ timer = g_timer_new ();
+ traverse_accessible_tree (SPI_getDesktop (0));
+ g_print ("Time for first traversal of %d elements: %lf\n",
+ n_elements_traversed,
+ g_timer_elapsed (timer, NULL));
+ g_timer_start (timer);
+ traverse_accessible_tree (SPI_getDesktop (0));
+ g_timer_stop (timer);
+ g_print ("Time for subsequent traversal %f\n", g_timer_elapsed (timer, NULL));
+ g_print ("[%f elements/sec, %f SPI calls/sec]\n",
+ n_elements_traversed/g_timer_elapsed(timer, NULL),
+ (n_elements_traversed*8+1)/g_timer_elapsed(timer, NULL));
+
+ SPI_event_main ();
+
+ putenv ("AT_BRIDGE_SHUTDOWN=1");
+
+ /*
+ * TODO: Add a key event listener that calls test_exit, to
+ * deregister and cleanup appropriately.
+ */
+
+ return SPI_exit ();
+}
+
+static void
+traverse_accessible_tree (Accessible *accessible)
+{
+ int n_children;
+ int i;
+ char *name;
+ char *role_name;
+ Accessible *child;
+
+ n_elements_traversed++;
+ name = Accessible_getName (accessible);
+ role_name = Accessible_getRoleName (accessible);
+#ifdef VERBOSE
+ fprintf (stdout, "[%s] \"%s\"\n",
+ role_name, name);
+#endif
+ SPI_freeString (name);
+ SPI_freeString (role_name);
+ n_children = Accessible_getChildCount (accessible);
+ if (!Accessible_isTable (accessible))
+ {
+ for (i = 0; i < n_children; ++i)
+ {
+ child = Accessible_getChildAtIndex (accessible, i);
+ traverse_accessible_tree (child);
+ Accessible_unref (child);
+ }
+ }
+}
+
+void
+report_event (const AccessibleEvent *event, void *user_data)
+{
+ fprintf (stderr, "%s\n", event->type);
+}
+
+void
+report_detail_event (const AccessibleEvent *event, void *user_data)
+{
+ fprintf (stderr, "%s\n", event->type);
+}
+
+void
+test_exit ()
+{
+ SPI_deregisterGlobalEventListenerAll (generic_listener);
+ AccessibleEventListener_unref (generic_listener);
+ SPI_deregisterGlobalEventListenerAll (specific_listener);
+ AccessibleEventListener_unref (specific_listener);
+}
static SPIBoolean report_command_key_event (const AccessibleKeystroke *stroke, void *user_data);
static SPIBoolean report_ordinary_key_event (const AccessibleKeystroke *stroke, void *user_data);
static SPIBoolean report_synchronous_key_event (const AccessibleKeystroke *stroke, void *user_data);
+static SPIBoolean report_tab_key_event (const AccessibleKeystroke *stroke, void *user_data);
+static SPIBoolean report_all_key_event (const AccessibleKeystroke *stroke, void *user_data);
static AccessibleKeystrokeListener *command_key_listener;
static AccessibleKeystrokeListener *ordinary_key_listener;
static AccessibleKeystrokeListener *synchronous_key_listener;
+static AccessibleKeystrokeListener *tab_key_listener;
+static AccessibleKeystrokeListener *all_key_listener;
static AccessibleKeySet *command_keyset;
static AccessibleKeySet *async_keyset;
static AccessibleKeySet *sync_keyset;
+static AccessibleKeySet *tab_keyset;
int
main (int argc, char **argv)
{
-
+ char *tab_strings[1];
+ short keycodes[] = {65, 64, 23};
+
SPI_init ();
/* prepare the keyboard snoopers */
command_key_listener = SPI_createAccessibleKeystrokeListener (report_command_key_event, NULL);
ordinary_key_listener = SPI_createAccessibleKeystrokeListener (report_ordinary_key_event, NULL);
synchronous_key_listener = SPI_createAccessibleKeystrokeListener (report_synchronous_key_event, NULL);
-
- command_keyset = SPI_createAccessibleKeySet (11, "q", NULL, NULL);
- async_keyset = SPI_createAccessibleKeySet (11, "abc", NULL, NULL);
- sync_keyset = SPI_createAccessibleKeySet (11, "def", NULL, NULL);
+ tab_key_listener = SPI_createAccessibleKeystrokeListener (report_tab_key_event, NULL);
+ all_key_listener = SPI_createAccessibleKeystrokeListener (report_all_key_event, NULL);
+ command_keyset = SPI_createAccessibleKeySet (1, "q", NULL, NULL);
+ async_keyset = SPI_createAccessibleKeySet (3, NULL, keycodes, NULL);
+ sync_keyset = SPI_createAccessibleKeySet (3, "def", NULL, NULL);
+ tab_strings[0] = "Tab";
+ tab_keyset = SPI_createAccessibleKeySet (1, NULL, NULL, tab_strings);
SPI_registerAccessibleKeystrokeListener(command_key_listener,
command_keyset,
SPI_KEYMASK_ALT | SPI_KEYMASK_CONTROL,
(unsigned long) ( SPI_KEY_PRESSED | SPI_KEY_RELEASED ),
SPI_KEYLISTENER_CANCONSUME);
+ SPI_registerAccessibleKeystrokeListener(tab_key_listener,
+ tab_keyset,
+ SPI_KEYMASK_ALT,
+ (unsigned long) ( SPI_KEY_PRESSED | SPI_KEY_RELEASED ),
+ SPI_KEYLISTENER_ALL_WINDOWS);
+
+ SPI_registerAccessibleKeystrokeListener(all_key_listener,
+ SPI_KEYSET_ALL_KEYS,
+ SPI_KEYMASK_UNMODIFIED,
+ (unsigned long) ( SPI_KEY_PRESSED | SPI_KEY_RELEASED ),
+ SPI_KEYLISTENER_CANCONSUME);
+
SPI_event_main ();
putenv ("AT_BRIDGE_SHUTDOWN=1");
AccessibleKeystrokeListener_unref (command_key_listener);
SPI_freeAccessibleKeySet (command_keyset);
- SPI_deregisterAccessibleKeystrokeListener (ordinary_key_listener, SPI_KEYMASK_ALT | SPI_KEYMASK_CONTROL);
+/*
+ SPI_deregisterAccessibleKeystrokeListener (ordinary_key_listener, SPI_KEYMASK_ALT | SPI_KEYMASK_CONTROL); */
AccessibleKeystrokeListener_unref (ordinary_key_listener);
SPI_freeAccessibleKeySet (async_keyset);
- SPI_deregisterAccessibleKeystrokeListener (synchronous_key_listener, SPI_KEYMASK_ALT | SPI_KEYMASK_CONTROL);
+/* SPI_deregisterAccessibleKeystrokeListener (synchronous_key_listener, SPI_KEYMASK_ALT | SPI_KEYMASK_CONTROL); */
AccessibleKeystrokeListener_unref (synchronous_key_listener);
SPI_freeAccessibleKeySet (sync_keyset);
+ SPI_deregisterAccessibleKeystrokeListener (tab_key_listener, SPI_KEYMASK_ALT | SPI_KEYMASK_CONTROL);
+ AccessibleKeystrokeListener_unref (tab_key_listener);
+ SPI_freeAccessibleKeySet (tab_keyset);
+
SPI_event_quit ();
}
return ( key->keyID == 'd' ) ? TRUE : FALSE;
}
+static SPIBoolean
+report_tab_key_event (const AccessibleKeystroke *key, void *user_data)
+{
+ print_key_event (key, "[TAB]");
+ return FALSE;
+}
+
+static SPIBoolean
+report_all_key_event (const AccessibleKeystroke *key, void *user_data)
+{
+ g_print("(%d)", key->keyID);
+ return FALSE;
+}
+
#include <sys/socket.h>
#include <netinet/in.h>
#include <sys/un.h>
-#include "../util/mag_client.h"
+#undef MAGNIFIER_ENABLED
#include "../cspi/spi-private.h" /* A hack for now */
-#undef PRINT_TREE
+#define PRINT_TREE
static void report_focus_event (const AccessibleEvent *event, void *user_data);
static void report_generic_event (const AccessibleEvent *event, void *user_data);
static void print_accessible_tree (Accessible *accessible, char *prefix);
#endif
+#ifdef MAGNIFIER_ENABLED
static SPIBoolean use_magnifier = FALSE;
+#endif
+
static SPIBoolean use_festival = FALSE;
static SPIBoolean festival_chatty = FALSE;
static SPIBoolean name_changed = FALSE;
SPI_registerGlobalEventListener (generic_listener, "object:visible-data-changed");
SPI_registerGlobalEventListener (generic_listener, "object:text-selection-changed");
SPI_registerGlobalEventListener (text_listener, "object:text-caret-moved");
- SPI_registerGlobalEventListener (generic_listener, "object:text-changed");
+ SPI_registerGlobalEventListener (text_listener, "object:text-changed");
SPI_registerGlobalEventListener (button_listener, "Gtk:GtkWidget:button-press-event");
- SPI_registerGlobalEventListener (window_listener, "Gtk:GtkWidget:window-state-event");
+ SPI_registerGlobalEventListener (window_listener, "window:minimize");
n_desktops = SPI_getDesktopCount ();
for (i=0; i<n_desktops; ++i)
festival_chatty = TRUE;
}
}
+#ifdef MAGNIFIER_ENABLED
if (g_getenv ("MAGNIFIER"))
{
fprintf (stderr, "Using magnifier\n");
{
fprintf (stderr, "Not using magnifier\n");
}
+#endif
if (!use_festival)
{
int i;
char *name;
char *role_name;
- char *parent_name;
- char *parent_role;
+ char *parent_name = NULL;
+ char *parent_role = NULL;
char child_prefix[100];
Accessible *child;
Accessible *parent;
{
parent_name = Accessible_getName (parent);
parent_role = Accessible_getRoleName (parent);
+ Accessible_unref (parent);
}
- Accessible_unref (parent);
name = Accessible_getName (accessible);
role_name = Accessible_getRoleName (accessible);
- fprintf (stdout, "%sAccessible [%s] \"%s\"; parent [%s] %s\n",
+ fprintf (stdout, "%sAccessible [%s] \"%s\"; parent [%s] %s.\n",
prefix, role_name, name, parent_role, parent_name);
SPI_freeString (name);
SPI_freeString (role_name);
SPI_freeString (parent_name);
+ SPI_freeString (parent_role);
n_children = Accessible_getChildCount (accessible);
for (i = 0; i < n_children; ++i)
{
x, y, x+width, y+height);
}
}
+#ifdef MAGNIFIER_ENABLED
if (use_magnifier) {
magnifier_set_roi ((short) 0, x, y, width, height);
}
+#endif
}
+
if (Accessible_isValue (obj))
{
AccessibleValue *value = Accessible_getValue (obj);
{
AccessibleText *text = Accessible_getText (event->source);
fprintf (stderr, "%s event received\n", event->type);
+#ifdef MAGNIFIER_ENABLED
if (use_magnifier && strcmp (event->type, "object:text-changed"))
{
long offset = AccessibleText_getCaretOffset (text);
fprintf (stderr, "new roi %d %d %d %d\n", (int) x, (int) y, (int) w, (int) h);
magnifier_set_roi ((short) 0, x, y, w, h);
}
+#endif
if (!strcmp (event->type, "object:text-changed"))
{
long start, end;
- char *new_text = AccessibleText_getTextAtOffset (text, (long) 0, SPI_TEXT_BOUNDARY_SENTENCE_START, &start, &end);
+ char *new_text = AccessibleText_getTextAtOffset (text, (long) event->detail1, SPI_TEXT_BOUNDARY_WORD_START, &start, &end);
_festival_say (new_text, "voice_kal_diphone", FALSE);
+ fprintf (stderr, "text changed: %s", new_text ? new_text : "");
SPI_freeString (new_text);
}
+ else
+ {
+ long start, end;
+ char *word_text = AccessibleText_getTextAtOffset (text, (long) event->detail1, SPI_TEXT_BOUNDARY_WORD_START, &start, &end);
+ char *sentence_text = AccessibleText_getTextAtOffset (text, (long) event->detail1, SPI_TEXT_BOUNDARY_SENTENCE_START, &start, &end);
+ fprintf (stderr, "text changed: word %s; sentence %s at %d",
+ (word_text ? word_text : ""),
+ (sentence_text ? sentence_text : ""),
+ event->detail1);
+ if (word_text) SPI_freeString (word_text);
+ if (sentence_text) SPI_freeString (sentence_text);
+ }
}
void
case 'q':
simple_at_exit();
return TRUE; /* not reached */
+#ifdef MAGNIFIER_ENABLED
case 'M':
case 'm':
use_magnifier = ! use_magnifier;
fprintf (stderr, "%ssing magnifier\n", use_magnifier ? "U" : "Not u");
return TRUE;
+#endif
case 'F':
case 'f':
use_festival = ! use_festival;