[Mono-osx] [MonoMac] Adding WebKit DOM interfaces

Alexander Shulgin alexander.shulgin at yessoftware.com
Tue Nov 16 11:01:30 EST 2010

On 16.11.2010 7:30, Miguel de Icaza wrote:
>     Perhaps I didn't quite get how to employ the generator for this case.
>     Do you suggest that we simply stuff DomEventTarget methods under DomNode
>     interface in webkit.cs?
> You had it mostly there, but you had commented it out.

Yeah, because it'll be compiled into a class rather than an interface, 
so DomNode couldn't inherit from that.  So after more thought, I've come 
up with this patch which adds IDomEventTarget interface.

It was tricky to get it compiled, but after adding the new file 
`IDomEventTarget.cs' to both CORE_SOURCES and MONOMAC_SOURCES and 
stubbing DomEvent and DomEventListener names for COREBUILD with empty 
interfaces, it finally worked.

The pro of doing so is that now we can declare the `Target' property of 
`DomEvent' as `IDomEventTarget'.  This among other things greatly 
improves debugging experience.

Please push if there's no objections.

>     Me too.  But this can't map directly to the ObjC method, right?  We'll
>     need to add an overload which will transfer control from it's internal
>     DomEventListener instance to the delegate.
> If you use a model, users can inherit, I used that bit from your
> commented out code.
> I also added two convenience overloads that will do the mapping and let
> use use lambdas.

That's great, works like a charm! :)

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 0001-Added-IDomEventTarget-interface-for-DomNode.patch
Url: http://lists.ximian.com/pipermail/mono-osx/attachments/20101116/f3d80b1f/attachment.pl 

More information about the Mono-osx mailing list