* test/Makefile.am :
* test/simple-at.c :
Added new test that uses the C bindings API.
+ * idl/Event.idl :
+ * libspi/listener.c :
+ * libspi/registry.c :
+ * libspi/accessibleeventlistener.c :
+ * at-bridge/bridge.c :
+ Renamed member "target" of Accessibility_Event to "source",
+ which is more descriptive.
+
2001-08-18 Bill Haneman <bill.haneman@sun.com>
{
Accessibility_Event *e = g_new0(Accessibility_Event, 1);
e->type = CORBA_string_dup ("focus:");
- e->target = bonobo_object_corba_objref (bonobo_object (accessible_new (object)));
+ e->source = bonobo_object_corba_objref (bonobo_object (accessible_new (object)));
e->detail1 = 0;
e->detail2 = 0;
Accessibility_Registry_notifyEvent (registry, e, &ev);
{
Accessibility_Event *e = g_new0(Accessibility_Event, 1);
e->type = CORBA_string_dup ("focus:");
- e->target = bonobo_object_corba_objref (bonobo_object (accessible_new (object)));
+ e->source = bonobo_object_corba_objref (bonobo_object (accessible_new (object)));
e->detail1 = 0;
e->detail2 = 0;
Accessibility_Registry_notifyEvent (registry, e, &ev);
*
*/
-typedef struct _AccessibleEvent {
- Accessible *source;
- char *type;
- char *detail1;
- char *detail2;
-} AccessibleEvent;
+typedef Accessibility_Event AccessibleEvent;
/*
*
struct Event {
string type;
- Accessible target;
+ Accessible source;
long detail1;
long detail2;
};
struct Event {
string type;
- Accessible target;
+ Accessible source;
long detail1;
long detail2;
};
const Accessibility_Event *e,
CORBA_Environment *ev)
{
-
int n;
int len;
VoidEventListenerCB cb;
cb = (VoidEventListenerCB) g_list_nth_data (listener->callbacks, n);
if (cb)
{
- (*cb) (NULL);
+ (*cb) (e);
}
}
- bonobo_object_release_unref (e->target, ev);
+ bonobo_object_release_unref (e->source, ev);
}
static void
accessible_event_listener_new ()
{
AccessibleEventListener *retval =
- LISTENER (g_object_new (accessible_event_listener_get_type (), NULL));
+ ACCESSIBLE_EVENT_LISTENER (g_object_new (accessible_event_listener_get_type (), NULL));
return retval;
}
{
aobject = atk_implementor_ref_accessible (ATK_IMPLEMENTOR (gobject));
e->type = CORBA_string_dup (sbuf);
- e->target = bonobo_object_corba_objref (bonobo_object (accessible_new (aobject)));
+ e->source = bonobo_object_corba_objref (bonobo_object (accessible_new (aobject)));
e->detail1 = 0;
e->detail2 = 0;
Accessibility_EventListener_notifyEvent (the_toolkit_listener, e, &ev);
const Accessibility_Event *e,
CORBA_Environment *ev)
{
-
int n;
int len;
VoidEventListenerCB cb;
cb = (VoidEventListenerCB) g_list_nth_data (listener->callbacks, n);
if (cb)
{
- (*cb) (NULL);
+ (*cb) (e);
}
}
- bonobo_object_release_unref (e->target, ev);
+ bonobo_object_release_unref (e->source, ev);
}
static void
accessible_event_listener_new ()
{
AccessibleEventListener *retval =
- LISTENER (g_object_new (accessible_event_listener_get_type (), NULL));
+ ACCESSIBLE_EVENT_LISTENER (g_object_new (accessible_event_listener_get_type (), NULL));
return retval;
}
#ifdef SPI_DEBUG
fprintf (stderr, "notify %s...\n", e->type);
fprintf (stderr, "source name: '%s'\n",
- Accessibility_Accessible__get_name(e->target, ev));
+ Accessibility_Accessible__get_name(e->source, ev));
if (ev->_major != CORBA_NO_EXCEPTION) {
fprintf(stderr,
("Accessibility app error: exception during event notification: %s\n"),
exit(-1);
}
fprintf (stderr, "source is component ? : %s\n",
- Accessibility_Accessible_queryInterface (e->target,
+ Accessibility_Accessible_queryInterface (e->source,
"IDL:Accessibility/Component:1.0",
ev)
? "yes" : "no");
#endif
- bonobo_object_release_unref (e->target, ev);
+ bonobo_object_release_unref (e->source, ev);
}
default:
break;
}
- bonobo_object_release_unref (e->target, ev);
+ bonobo_object_release_unref (e->source, ev);
}
static void
{
#ifdef SPI_DEBUG
fprintf(stderr, "notifying listener #%d\n", n);
- fprintf(stderr, "event name %s\n", Accessibility_Accessible__get_name(e->target, ev));
+ fprintf(stderr, "event name %s\n", Accessibility_Accessible__get_name(e->source, ev));
#endif
- bonobo_object_dup_ref ( e->target, ev);
+ bonobo_object_dup_ref ( e->source, ev);
Accessibility_EventListener_notifyEvent ((Accessibility_EventListener) ls->listener,
e,
ev);
default:
break;
}
- bonobo_object_release_unref (e->target, ev);
+ bonobo_object_release_unref (e->source, ev);
}
static void
{
#ifdef SPI_DEBUG
fprintf(stderr, "notifying listener #%d\n", n);
- fprintf(stderr, "event name %s\n", Accessibility_Accessible__get_name(e->target, ev));
+ fprintf(stderr, "event name %s\n", Accessibility_Accessible__get_name(e->source, ev));
#endif
- bonobo_object_dup_ref ( e->target, ev);
+ bonobo_object_dup_ref ( e->source, ev);
Accessibility_EventListener_notifyEvent ((Accessibility_EventListener) ls->listener,
e,
ev);
accessible = accessible_new (atko);
fprintf(stderr, "accessible created.\n");
- e.target = bonobo_object_corba_objref ( bonobo_object (accessible));
+ e.source = bonobo_object_corba_objref ( bonobo_object (accessible));
e.type = CORBA_string_dup ("focus:");
obj_id = "OAFIID:Accessibility_Registry:proto0.1";
}
void
-report_focus_event (void *fp)
+report_focus_event (void *p)
{
- fprintf (stderr, "focus\n");
+ AccessibleEvent *ev = (AccessibleEvent *) p;
+ fprintf (stderr, "%s event from %s\n", ev->type,
+ Accessible_getName (&ev->source));
}
void
-report_button_press (void *fp)
+report_button_press (void *p)
{
- fprintf (stderr, "button press\n");
+ AccessibleEvent *ev = (AccessibleEvent *) p;
+ fprintf (stderr, "%s event from %s\n", ev->type,
+ Accessible_getName (&ev->source));
}