[Gtk-sharp-list] Gapi2 question

Mike Kestner mkestner at gmail.com
Thu May 22 00:24:49 EDT 2008

On Wed, 2008-05-21 at 20:40 -0400, Andrew Pendleton wrote:

> that is to say, the wrapped C function needs to have an extra
> parameter, and rather than being exposed via the C# method, a null
> value always needs to be passed into the C function from the wrapping
> constructor.
> So, my question: this occurs in a whole bunch of classes in the
> library.  I know I can use the gapi2 fixer program to strip the
> constructors out of all of these classes, and use .custom files to
> hand-code new constructors for each one, but I'd rather not.  Is there
> some way I can make gapi2 generate code with this behavior?

Unfortunately, no.  The generator currently ignores all methods/ctors
with "ellipsis" parameters, reporting a warning to console.

It might be a nice generator feature to support an ellipsis="NULL"
attribute value that could be set with fixup so that the code you
describe would be produced, but I don't think it would be a good default
behavior.  Often such methods have binding-friendlier alternative
versions and many ellipsis methods would be useless without at least one
value provided on the parameter stack.

If you are interested in adding such a feature to the generator, you
could contact me and I'd be happy to help get you started.  Depending on
how many ctors you have to .custom though, it may be quicker to just go
that route.

Mike Kestner <mkestner at gmail.com>

More information about the Gtk-sharp-list mailing list