/*
 * gcc leaktest1.c -o leaktest1 $(pkg-config --cflags --libs gobject-2.0 glib-2.0 atspi-2)
 * */

#include "atspi/atspi.h"
#include <stdio.h>


void on_event (AtspiEvent *event, void *data)
{
    printf("%s %d %d\n", event->type, event->detail1, event->detail2);
    g_boxed_free (ATSPI_TYPE_EVENT, event);
}

int main()
{
    AtspiEventListener *listener;

    atspi_init ();

    listener = atspi_event_listener_new ((AtspiEventListenerCB)on_event, NULL, NULL);
    atspi_event_listener_register (listener, "object:text-changed", NULL);

    atspi_event_main ();

    atspi_exit ();
    return 0;
}
