[Gtk-sharp-list] Tinymail's .NET bindings

Philip Van Hoof spam at pvanhoof.be
Thu Oct 26 06:38:54 EDT 2006


On Mon, 2006-10-16 at 11:17 +0200, Philip Van Hoof wrote:

> For people interested in working on the .NET bindings for tinymail:

I have attached a manual version of what I have in mind. A binding
generator should create something like this (which doesn't look
impossible), maybe make xslts of this manual stuff and feed those xslts
the different types, methods, properties and etcetera parsed from the .h
files?

It doesn't look like GAPI generates something that already looks like
this. An open question is whether the interested people are rather
interested in creating a new generator or whether they prefer adapting
gapi?

I prefer generated language bindings. But the quality of the binding
itself is by far more important than its 'generatability'.

I named the files the same as the namespace would be. Per two such
namespaces, a .dll will be created. For example:

Tny and Tny.Proxy will be libtinymail-sharp-1.0.dll
Tny.Ui and Tny.Ui.Proxy will be libtinymailui-sharp-1.0.dll
Tny.Ui.Gtk and Tny.Ui.Gtk.Proxy will be libtinymailui-gtk-sharp-1.0.dll
Tny.Camel and Tny.Camel.Proxy will be libtinymail-camel-sharp-1.0.dll
Tny.Platform and Tny.Platform.Proxy will be libtinymail-platform-sharp-1.0.dll

The types in the Proxy namespaces implement P/Invoke-ing to the GObject
library. The other types, using the Proxy types as the real in a proxy,
implement converting the proxy-calls to whatever is cool in the higher
level programming language. I think those types cannot be 100% generated
whereas the proxy types can (even without any customisation). I would
prefer the generated proxy types to be left untouched (maybe let GAPI
generate them after enhancing GAPI?)

Almost none of the tinymail API isn't suitable for parsing/generating a
language binding for. I have specifically put a lot time in making sure
it's all easy (no typical C types like doubly linked lists, pointers or
other such things are being returned or accepted as a parameter, all
such are converted to full GObject types, except things like "gchar*"
and "gint" of course).

That way it will be possible to have a Tny.List type that implements
IList and IEnumeratable, and a Tny.Iterator that implements IEnumerator
etc etc (or however they are called on .NET today). Those will wrap the
GObject types TnyList and TnyIterator (just examples).

ps. I know at least Bart is working on .NET bindings for tinymail.

-- 
Philip Van Hoof, software developer
home: me at pvanhoof dot be
gnome: pvanhoof at gnome dot org
work: vanhoof at x-tend dot be
blog: http://pvanhoof.be/blog
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Tny.Camel.cs
Type: text/x-csharp
Size: 350 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/gtk-sharp-list/attachments/20061026/f6abad04/attachment.bin 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Tny.Camel.Proxy.cs
Type: text/x-csharp
Size: 597 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/gtk-sharp-list/attachments/20061026/f6abad04/attachment-0001.bin 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Tny.cs
Type: text/x-csharp
Size: 701 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/gtk-sharp-list/attachments/20061026/f6abad04/attachment-0002.bin 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Tny.Proxy.cs
Type: text/x-csharp
Size: 1290 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/gtk-sharp-list/attachments/20061026/f6abad04/attachment-0003.bin 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Tny.Ui.cs
Type: text/x-csharp
Size: 499 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/gtk-sharp-list/attachments/20061026/f6abad04/attachment-0004.bin 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Tny.Ui.Gtk.cs
Type: text/x-csharp
Size: 212 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/gtk-sharp-list/attachments/20061026/f6abad04/attachment-0005.bin 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Tny.Ui.Gtk.Proxy.cs
Type: text/x-csharp
Size: 331 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/gtk-sharp-list/attachments/20061026/f6abad04/attachment-0006.bin 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Tny.Ui.Proxy.cs
Type: text/x-csharp
Size: 957 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/gtk-sharp-list/attachments/20061026/f6abad04/attachment-0007.bin 


More information about the Gtk-sharp-list mailing list