[Mono-list] Re: Status of the Qt c# bindings

Adam Treat manyoso@yahoo.com
Tue, 5 Mar 2002 12:36:38 -0800


> Have you got C to C# callbacks working yet? I've seen the P/Invoke code
> which calls C from C#, and then in turn calls C++. But can you call C from
> C#? For example, is it possible to do this?
 ....
> Event handlers can be nested too with drag and drop, and slots/signals can
> also be nested. There are event handling and slot/signal callbacks in the
> QtC bindings that it should be possible to use for this - I don't know how
> far you've got..

Haven't looked at this.  I don't think Mono contains the ability for native 
code to call managed code at this point.  It is rather, a one way 
relationship ;-)

> More virtual method callbacks in the QtC bindings are needed if you want to
> do more than just customize event handling though.

This is not on the horizon yet.  I am going to try and fix all the kinks in 
the bindings first and then worry about more advanced aspects like this a 
little later.

> > 2.  Several Qt classes are missing methods and constructors because...
> > 3.  The type mappings are not completely fleshed out
>
> Do you mean you need to complete the runtime conversion functions to
> convert between C# and Qt types?

No, I just need to complete the mappings and deal with things like multiple 
methods with C parameter types that map to singular C# parameter 
types.  For instance QString has duplicate methods 'contains' and 'section'. 
I say they are duplicate because one takes 'const char' and other 'char' for 
C parameters but currently these _both_ map to the C# type 'string'.  This is 
probably an incorrect mapping, but that was what I was referring to.  We also 
have the issue of using QString at all or engineering the bindings in such a 
way that you would just use the C# 'string' type and then map that to QString 
behind the scenes and use that to call the C function.  These are issues I'll 
be dealing with now that the bindings compile.

> If you can do it for 300+ Qt classes, then it's just more of the same for
> KDE.. You can convert KDE kdoc comments to C# style xml, which should be
> fun though.

Yah, the KDE classes are next.  I am going to refine the qt bindings first 
though.

> > Congratulations!  Would you like to put this on CVS?
>
> Yes, agreed! And the code is also most welcome in the kdebindings CVS too.
> Maybe it wouldn't do any harm to have it in both places. But if you check
> in the kalyptus C# + P/Invoke bindings code generation option into
> kdebindings, I would be happy to help tweak it.
>
> Please add the QtC bindings to the Mono cvs too, if people want them
> together, that's fine with me.

I will be happy to put this in cvs.  The qtc# bindings will require the qtc 
bindings so... to go in mono's cvs would probably require those qtc bindings. 
 Either way, let me polish up the bindings and I'll have something to put in 
there very soon.

Cheers,

Adam