X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=libspi%2Fkeystrokelistener.c;h=f59b00b0e2aaa21a95544dc6399e541b1f7dbaea;hb=66c4375c7cd9a0a01e79f562e1bb0326fc4dcd21;hp=68736c9f3553c87312e1cb39e0580f5775012116;hpb=e5a9e644107d0a366d8f4036fc8d363a4ff82255;p=platform%2Fcore%2Fuifw%2Fat-spi2-atk.git diff --git a/libspi/keystrokelistener.c b/libspi/keystrokelistener.c index 68736c9..f59b00b 100644 --- a/libspi/keystrokelistener.c +++ b/libspi/keystrokelistener.c @@ -54,7 +54,7 @@ static GObjectClass *keystroke_listener_parent_class; static void keystroke_listener_object_finalize (GObject *object) { -/* KeystrokeListener *keystroke_listener = KEYSTROKE_LISTENER (object); */ +/* KeystrokeListener *keystroke_listener = KEYSTROKE_SPI_LISTENER (object); */ #ifdef SPI_DEBUG fprintf(stderr, "keystroke_listener_object_finalize called\n"); @@ -81,13 +81,15 @@ void keystroke_listener_remove_callback (KeystrokeListener *listener, /* * CORBA Accessibility::KeystrokeListener::keyEvent method implementation */ - static CORBA_boolean impl_key_event (PortableServer_Servant servant, const Accessibility_KeyStroke *key, CORBA_Environment *ev) { -#ifdef SPI_DEBUG + KeystrokeListener *listener = KEYSTROKE_SPI_LISTENER (bonobo_object_from_servant (servant)); + GList *callbacks = listener->callbacks; + gboolean was_consumed = FALSE; +#ifdef SPI_KEYEVENT_DEBUG if (ev->_major != CORBA_NO_EXCEPTION) { fprintf(stderr, ("Accessibility app error: exception during keystroke notification: %s\n"), @@ -101,6 +103,13 @@ impl_key_event (PortableServer_Servant servant, (char) toupper((int) key->keyID) : (char) tolower((int) key->keyID)); } #endif + while (callbacks) + { + BooleanKeystrokeListenerCB cb = (BooleanKeystrokeListenerCB) callbacks->data; + was_consumed = (*cb) (key) || was_consumed; + callbacks = g_list_next (callbacks); + } + return was_consumed; } static void @@ -161,6 +170,6 @@ KeystrokeListener * keystroke_listener_new (void) { KeystrokeListener *retval = - KEYSTROKE_LISTENER (g_object_new (keystroke_listener_get_type (), NULL)); + KEYSTROKE_SPI_LISTENER (g_object_new (keystroke_listener_get_type (), NULL)); return retval; }