+2001-08-16 Bill Haneman <bill.haneman@sun.com>
+
+ * libspi/accessible.c : accessible_new() :
+ Now we add the Component interface via bonobo_object_add_interface,
+ if the contained AtkObject implements AtkComponent.
+ * libspi/accessible.h : now include "component.h"
+ * libspi/component.h :
+ * libspi/component.c : added files - implementation of
+ bonobo wrapper object for Accessibility/Component
+ * libspi/listener.c :
+ Added test code to check for Accessibility/Component:1.0
+ interface and report whether it is implemented by the
+ event source.
+ * libspi/registry.c :
+ Now we check for not only the hash of the whole event
+ string before relaying the event, we also check the
+ "minor" event string (without the detail string).
+ This allows event listeners to be registered against
+ all events of a certain major+minor type, or just
+ against a specific major+minor+detail type.
+ * libspi/accessible.c :
+ Added implementations for Accessible:get_parent(),
+ Accessible:getChildCount(), and Accessible:getChildAtIndex().
+
2001-08-15 Mark McLoughlin <mark@skynet.ie>
* libspi/Makefile.am,
2001-08-15 Mark McLoughlin <mark@skynet.ie>
- * test/app.c: use atgv[0] instead of
+ * test/app.c: use argv[0] instead of
g_type_prgname.
2001-08-15 Mark McLoughlin <mark@skynet.ie>
printf ("Accessible set_description called: %s\n", name);
}
+/*
+ * CORBA Accessibility::Accessible::get_parent method implementation
+ */
+static Accessibility_Accessible
+impl_accessibility_accessible_get_parent (PortableServer_Servant servant,
+ CORBA_Environment *ev)
+{
+ Accessibility_Accessible retval;
+ Accessible *accessible = ACCESSIBLE (bonobo_object_from_servant (servant));
+ AtkObject *parent;
+ parent = atk_object_get_parent (accessible->atko);
+ retval = bonobo_object_corba_objref (bonobo_object (accessible_new (parent)));
+ printf ("Accessible get_parent called\n");
+ return retval;
+}
+
+/*
+ * CORBA Accessibility::Accessible::get_childCount method implementation
+ */
+static CORBA_long
+impl_accessibility_accessible_get_child_count (PortableServer_Servant servant,
+ CORBA_Environment *ev)
+{
+ CORBA_long retval;
+ Accessible *accessible = ACCESSIBLE (bonobo_object_from_servant (servant));
+ retval = (CORBA_long) atk_object_get_n_accessible_children (accessible->atko);
+ printf ("Accessible get_childCount called: %d\n", (int) retval);
+ return retval;
+}
+
+/*
+ * CORBA Accessibility::Accessible::getChildAtIndex method implementation
+ */
+static Accessibility_Accessible
+impl_accessibility_accessible_get_child_at_index (PortableServer_Servant servant,
+ const CORBA_long index,
+ CORBA_Environment *ev)
+{
+ Accessibility_Accessible retval;
+ Accessible *accessible = ACCESSIBLE (bonobo_object_from_servant (servant));
+ AtkObject *child = atk_object_ref_accessible_child (accessible->atko, (gint) index);
+ retval = bonobo_object_corba_objref ( bonobo_object (accessible_new (child)));
+ printf ("Accessible get_child_at_index called.\n");
+ return retval;
+}
+
static void
accessible_class_init (AccessibleClass *klass)
{
epv->_get_description = impl_accessibility_accessible_get_description;
epv->_set_description = impl_accessibility_accessible_set_description;
- /* epv->_get_parent = impl_accessibility_accessible_get_parent; */
- /* epv->_get_childCount = impl_accessibility_accessible_get_child_count; */
- /* epv->getChildAtIndex = impl_accessibility_accessible_get_child_at_index; */
+ epv->_get_parent = impl_accessibility_accessible_get_parent;
+ epv->_get_childCount = impl_accessibility_accessible_get_child_count;
+ epv->getChildAtIndex = impl_accessibility_accessible_get_child_at_index;
+
/* epv->getIndexInParent = impl_accessibility_accessible_get_index_in_parent; */
/* epv->getRelationSet = impl_accessibility_accessible_get_relation_set; */
/* epv->getState = impl_accessibility_accessible_get_state; */
ACCESSIBLE (g_object_new (accessible_get_type (), NULL));
g_object_ref (o);
retval->atko = ATK_OBJECT (o);
+
+ /*
+ * TODO: add interface containers/constructors for ACTION, EDITABLE_TEXT, HYPERTEXT,
+ * IMAGE, SELECTION, TABLE, TEXT, VALUE.
+ */
+
+ /* add appropriate ATK interfaces */
+
+ /* Action: not yet implemented
+ if (ATK_IS_ACTION (o))
+ {
+ bonobo_object_add_interface (bonobo_object (retval),
+ bonobo_object (action_interface_new (o)));
+ }
+ */
+
+ if (ATK_IS_COMPONENT (o))
+ {
+ bonobo_object_add_interface (bonobo_object (retval),
+ bonobo_object (component_interface_new (o)));
+ }
+
+ /* Others: not yet implemented
+ if (ATK_IS_EDITABLE_TEXT (o))
+ {
+ bonobo_object_add_interface (bonobo_object (retval),
+ bonobo_object (editable_text_interface_new (o)));
+ }
+ else if (ATK_IS_HYPERTEXT (o))
+ {
+ bonobo_object_add_interface (bonobo_object (retval),
+ bonobo_object (hypertext_interface_new (o)));
+ }
+ else if (ATK_IS_TEXT (o))
+ {
+ bonobo_object_add_interface (bonobo_object (retval),
+ bonobo_object (text_interface_new (o)));
+ }
+ if (ATK_IS_IMAGE (o))
+ {
+ bonobo_object_add_interface (bonobo_object (retval),
+ bonobo_object (image_interface_new (o)));
+ }
+ if (ATK_IS_SELECTION (o))
+ {
+ bonobo_object_add_interface (bonobo_object (retval),
+ bonobo_object (selection_interface_new (o)));
+ }
+ if (ATK_IS_TABLE (o))
+ {
+ bonobo_object_add_interface (bonobo_object (retval),
+ bonobo_object (table_interface_new (o)));
+ }
+ if (ATK_IS_VALUE (o))
+ {
+ bonobo_object_add_interface (bonobo_object (retval),
+ bonobo_object (value_interface_new (o)));
+ }
+
+ */
+
return retval;
}
{
delimiter = g_utf8_get_char (":");
}
+
major_delim_char = g_utf8_strchr (event_name, (gssize) 32, delimiter);
minor_delim_char = g_utf8_strrchr (event_name, (gssize) 255, delimiter);
nbytes = (guint)((gint64) minor_delim_char -
(gint64) major_delim_char);
- fprintf ("nbytes = %ld", (long) nbytes);
-
+ fprintf (stderr, "nbytes = %ld\n", (long) nbytes);
if (!g_ascii_strncasecmp (event_name, "focus:", 6))
{
etype->major = ETYPE_FOCUS;
int len;
ListenerStruct *ls;
EventTypeStruct etype;
+ guint minor_hash;
parse_event_type (&etype, e->type);
+ minor_hash = g_str_hash (etype.minor);
len = g_list_length (listeners);
for (n=0; n<len; ++n)
#ifdef SPI_DEBUG
fprintf(stderr, "event hashes: %lx %lx\n", ls->event_type_hash, etype.hash);
#endif
- if ((ls->event_type_hash == etype.hash) || (TRUE))
+ if ((ls->event_type_hash == etype.hash) || (ls->event_type_hash == minor_hash))
{
#ifdef SPI_DEBUG
fprintf(stderr, "notifying listener #%d\n", n);
{
delimiter = g_utf8_get_char (":");
}
+
major_delim_char = g_utf8_strchr (event_name, (gssize) 32, delimiter);
minor_delim_char = g_utf8_strrchr (event_name, (gssize) 255, delimiter);
nbytes = (guint)((gint64) minor_delim_char -
(gint64) major_delim_char);
- fprintf ("nbytes = %ld", (long) nbytes);
-
+ fprintf (stderr, "nbytes = %ld\n", (long) nbytes);
if (!g_ascii_strncasecmp (event_name, "focus:", 6))
{
etype->major = ETYPE_FOCUS;
int len;
ListenerStruct *ls;
EventTypeStruct etype;
+ guint minor_hash;
parse_event_type (&etype, e->type);
+ minor_hash = g_str_hash (etype.minor);
len = g_list_length (listeners);
for (n=0; n<len; ++n)
#ifdef SPI_DEBUG
fprintf(stderr, "event hashes: %lx %lx\n", ls->event_type_hash, etype.hash);
#endif
- if ((ls->event_type_hash == etype.hash) || (TRUE))
+ if ((ls->event_type_hash == etype.hash) || (ls->event_type_hash == minor_hash))
{
#ifdef SPI_DEBUG
fprintf(stderr, "notifying listener #%d\n", n);