Re: Webkit2 porting



On Wed, Oct 15, 2014 at 2:36 PM, Evan Nemerson <evan coeus-group com> wrote:
Vala is strongly (and statically) typed, so it needs to know what the
delegate you pass to the closure argument should look like.  GObject
Introspection doesn't include that information for for GClosures (bug
#636812) so we have to set the type for GClosure arguments in metadata.
It's not difficult to do, but someone who actually knows the API needs
to tell us what that type should be (or it needs to be documented).

The VAPI just needs to change from

public bool add_event_listener_with_closure (string event_name,
        GLib.Closure handler, bool use_capture);

to something like

public bool add_event_listener_with_closure (string event_name,
        [CCode (type = "GClosure*")] owned WebKit.DOM.FooFunc handler,
        bool use_capture);

I just need to know what to put for instead of WebKit.DOM.FooFunc and I
can push a change to the VAPI.  Preferably a typedef in C, but if need
be we can also create a delegate type from scratch in the VAPI.

Thanks for setting me straight on this. I tried to create my own delegate in the VAPI and managed to get it to compile. But it crashed the web process on execution. (As promised, the UI process continued!) So I'm hoping that a WebKitGTK guru can enlighten us on the signature of the delegate.

Thanks again,
Robert



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