Connecting to a signal on processing the signal



Events module of W3C DOM Level 2 define interface EventTarget
and method ::addEventListener() to register an event listener
to an event source.

g_signal_connect() family may be the counterpart from glib.

http://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-EventTarget
says that; If an EventListener is added to an EventTarget
while it is processing an event, it will not be triggered
by the current actions but may be triggered during a later stage
of event flow, such as the bubbling phase.

What happen to GSignal mechanism for the case of text above?

I have coded EventTarget::addEventListener() as follow;

static void
impl_addEventListener (domEventTarget *self,
                       DOMString type,
                       domEventListener *listener,
                       boolean useCapture)
{
        /* EventListener::handleEvent() is called whenever an event occurs
         * of the type for which the EventListener interface was registered.
         */
        g_signal_connect (G_OBJECT (self), (gchar *)type,
                          G_CALLBACK (DOM_EVENTLISTENER_GET_CLASS (listener)->handleEvent),
                          NULL);
}

and I wanna get confirmation from glib-experienced developers.

You can find the dominigue project here; http://gybe.sf.net/dominigue/

Thanks in advance,
kz.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]