idl:
+ audit IDL for conformance with bonobo/doc/FAQ's [Java]
naming practice [Michael]
- + possibly change Value.idl interface to return a value
- union. [Bill] *DONE*
- + rename all IDL prepending Accessibility_ to each IDL filename
cspi:
- + API change required if above IDL change is made. [Bill]
+ ensure spi-listener-impl's list notification methods don't
have a re-enterancy hazard. [Michael]
- + namespace all methods missing a prepending Acessible
+ + namespace all methods missing a prepending Accessible
or SPI_ prefix.
+ Put LGPL headers everywhere.
registry:
+ move code into here from libspi [Michael]
- + kill the getDeviceWhatnot - and use queryInterface,
- don't inherit from the Listener interface - use aggregation
+ fire an event on dead application & re-factor the listen for
broken code.
+ + consider use of GHashTable instead of GList for listeners [Bill]
bridge:
+ move code into here from libspi
+ remove redundant casts throughout
+ determine if there are other headers we don't need to install
+ consider moving the non-impl. parts into registryd/ bridge/ etc.
- + change the weird string-hash event matching to something sane,
- using GQuark. [Bill]
+ merge the DeviceEvent and KeyEvent structs to avoid the
bogus casting of these back and forth.
+ complete implementation of support for RelationSet and
test:
+ update test-simple to do complete API tests
- + Add tests for AtkTable, and add table elements to the test window.
+ + Expand tests for AtkTable
+ remove comment from test_value; ensure that it works.
/* registry.c: the main accessibility service registry implementation */
+#undef SPI_LISTENER_DEBUG
+
#include <config.h>
#ifdef SPI_DEBUG
# include <stdio.h>
typedef struct {
char *event_name;
EventTypeCategory type_cat;
- char * major;
- char * minor;
- char * detail;
- guint hash;
+ GQuark major; /* from string segment[1] */
+ GQuark minor; /* from string segment[1]+segment[2] */
+ GQuark detail; /* from string segment[3] (not concatenated) */
} EventTypeStruct;
typedef struct {
Accessibility_EventListener listener;
- guint event_type_hash;
+ GQuark event_type_quark;
EventTypeCategory event_type_cat;
} SpiListenerStruct;
}
static gint
-compare_listener_hash (gconstpointer p1, gconstpointer p2)
+compare_listener_quarks (gconstpointer p1, gconstpointer p2)
{
- return (((SpiListenerStruct *)p2)->event_type_hash - ((SpiListenerStruct *)p1)->event_type_hash);
+ return (!((SpiListenerStruct *)p2)->event_type_quark == ((SpiListenerStruct *)p1)->event_type_quark);
}
static gint
if (split_string[1])
{
- etype->major = g_strdup (split_string[1]);
if (split_string[2])
{
- etype->minor = g_strdup (split_string[2]);
+ etype->minor = g_quark_from_string (s = g_strconcat (split_string[1], split_string[2], NULL));
+ g_free (s);
if (split_string[3])
{
- etype->detail = g_strdup (split_string[3]);
+ etype->detail = g_quark_from_string (split_string[3]);
s = g_strconcat (split_string[1], split_string[2], split_string[3], NULL);
- etype->hash = g_str_hash (s);
+ etype->major = g_quark_from_string (s);
g_free (s);
}
else
{
- etype->detail = g_strdup ("");
+ etype->detail = g_quark_from_static_string ("");
s = g_strconcat (split_string[1], split_string[2], NULL);
- etype->hash = g_str_hash (s);
+ etype->major = g_quark_from_string (s);
g_free (s);
}
}
else
{
- etype->minor = g_strdup ("");
- etype->hash = g_str_hash ( split_string[1]);
+ etype->major = g_quark_from_string (split_string[1]);
+ etype->minor = etype->major;
+ etype->detail = etype->major;
}
}
else
{
- etype->major = g_strdup ("");
- etype->minor = g_strdup ("");
- etype->detail = g_strdup ("");
- etype->hash = g_str_hash ("");
+ etype->major = g_quark_from_static_string ("");
+ etype->minor = etype->major;
+ etype->detail = etype->major;
}
g_strfreev (split_string);
/* parse, check major event type and add listener accordingly */
parse_event_type (&etype, (char*) event_name);
- ls->event_type_hash = etype.hash;
+ ls->event_type_quark = etype.major;
ls->event_type_cat = etype.type_cat;
switch (etype.type_cat)
if (!listeners)
return;
- ls.event_type_hash = etype.hash;
- list = g_list_find_custom (*listeners, &ls, compare_listener_hash);
+ ls.event_type_quark = etype.major;
+ list = g_list_find_custom (*listeners, &ls, compare_listener_quarks);
while (list)
{
spi_listener_struct_free ((SpiListenerStruct *) list->data, ev);
*listeners = g_list_delete_link (*listeners, list);
- list = g_list_find_custom (*listeners, &ls, compare_listener_hash);
+ list = g_list_find_custom (*listeners, &ls, compare_listener_quarks);
}
}
Accessibility_Event e_out;
SpiListenerStruct *ls;
EventTypeStruct etype;
- guint minor_hash;
+#ifdef SPI_DEBUG
CORBA_string s;
+#endif
e_out = *e_in;
parse_event_type (&etype, e_in->type);
- s = g_strconcat (etype.major, etype.minor, NULL);
- minor_hash = g_str_hash (s);
- g_free (s);
-
for (l = listeners; l; l = l->next)
{
ls = (SpiListenerStruct *) l->data;
-#ifdef SPI_SPI_LISTENER_DEBUG
- fprintf (stderr, "event hashes: %lx %lx %lx\n", ls->event_type_hash, etype.hash, minor_hash);
+#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);
#endif
- if ((ls->event_type_hash == etype.hash) || (ls->event_type_hash == minor_hash))
+ if ((ls->event_type_quark == etype.major) || (ls->event_type_quark == etype.minor))
{
#ifdef SPI_DEBUG
fprintf (stderr, "notifying listener %d\n", g_list_index (listeners, l->data));