X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;ds=sidebyside;f=libspi%2Flistener.c;h=d6d6efc9a6568441a7690b005aa02493dff36146;hb=7f36a8614747ac4bdcd66a507fe28839e5533615;hp=5e6fb41c0097dcf7d7c6fa66d23b4ccf75008184;hpb=5d480319bfc6e106a9cfda9cd4509ec626e9f50d;p=platform%2Fcore%2Fuifw%2Fat-spi2-atk.git diff --git a/libspi/listener.c b/libspi/listener.c index 5e6fb41..d6d6efc 100644 --- a/libspi/listener.c +++ b/libspi/listener.c @@ -24,13 +24,14 @@ * listener.c: test for accessibility implementation * */ -#define DEBUG_PRINTSTUFF -#ifdef DEBUG_PRINTSTUFF + +#ifdef SPI_DEBUG #include #endif + #include #include -#include +#include /* * This pulls the definition for the BonoboObject (GType) @@ -40,7 +41,7 @@ /* * Our parent Gtk object type */ -#define PARENT_TYPE BONOBO_X_OBJECT_TYPE +#define PARENT_TYPE BONOBO_OBJECT_TYPE /* * A pointer to our parent object class @@ -55,8 +56,9 @@ listener_object_finalize (GObject *object) { /* Listener *listener = LISTENER (object); */ - printf("listener_object_finalize called\n"); - +#ifdef SPI_DEBUG + fprintf(stderr, "listener_object_finalize called\n"); +#endif listener_parent_class->finalize (object); } @@ -69,9 +71,25 @@ impl_notify_event (PortableServer_Servant servant, const Accessibility_Event *e, CORBA_Environment *ev) { - fprintf (stderr, "notify...\n"); +#ifdef SPI_DEBUG + fprintf (stderr, "notify %s...\n", e->type); fprintf (stderr, "source name: '%s'\n", Accessibility_Accessible__get_name(e->target, ev)); + if (ev->_major != CORBA_NO_EXCEPTION) { + fprintf(stderr, + ("Accessibility app error: exception during event notification: %s\n"), + CORBA_exception_id(ev)); + exit(-1); + } + fprintf (stderr, "source is component ? : %s\n", + Accessibility_Accessible_queryInterface (e->target, + "IDL:Accessibility/Component:1.0", + ev) + ? "yes" : "no"); + +#endif + bonobo_object_release_unref (e->target, ev); + } static void @@ -79,7 +97,7 @@ listener_class_init (ListenerClass *klass) { GObjectClass * object_class = (GObjectClass *) klass; POA_Accessibility_EventListener__epv *epv = &klass->epv; - listener_parent_class = g_type_class_ref (BONOBO_X_OBJECT_TYPE); + listener_parent_class = g_type_class_ref (BONOBO_OBJECT_TYPE); object_class->finalize = listener_object_finalize; @@ -110,12 +128,12 @@ listener_get_type (void) NULL /* value table */ }; /* - * Here we use bonobo_x_type_unique instead of + * Here we use bonobo_type_unique instead of * gtk_type_unique, this auto-generates a load of * CORBA structures for us. All derived types must - * use bonobo_x_type_unique. + * use bonobo_type_unique. */ - type = bonobo_x_type_unique ( + type = bonobo_type_unique ( PARENT_TYPE, POA_Accessibility_EventListener__init, NULL,