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

Alexander Shulgin alexander.shulgin at yessoftware.com
Thu Nov 18 12:34:25 EST 2010

On 16.11.2010 23:46, Miguel de Icaza wrote:
> Hello,
>     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.
> What I did was to add the events directly to the DomNode, so it is
> possible to add the event listeners directly into the DomNode:
> myNode.AddEventListener (...)
> The problem with introducing C# interfaces into the mix is that it would
> be half a solution, they are not universally supported for
> incoming/outgoing arguments nor marshalling.


it's me again. :-)

I'd like to get some help about binding Private interfaces and protocols.

I need to get the current selection rectangle for a WebFrame.  From what 
I could gather in WebKit.framework/Headers and PrivateHeaders, I need to 
access through WebDocumentSelection protocol (defined in 
WebDocumentPrivate.h) the `selectionRect' method:

@protocol WebDocumentSelection <WebDocumentText>
- (NSRect)selectionRect;

Grepping further I've found that WebDocumentText is an optional protocol 
for WebDocumentView objects (not sure here):


@protocol WebDocumentText <NSObject>

What missing here is `WebView.MainFrame.FrameView.DocumentView' which 
should be of type `WebDocumentView'.  Unfortunately, it throws an 
InvalidCastException at me when I try to evaluate the last property 
accessor: `FrameView.DocumentView'.  So I'm puzzled.

`WebDocumentView' is declared [Model] and stuffed with [Abstract] 
methods in webkit.cs

How should I go about debugging this?


More information about the Mono-osx mailing list