On Fri, 2008-06-20 at 10:26 +0200, Axel Simon wrote:
> As you can imagine, I am not happy about this at all. The thing is that
> we have the new signal mechanism lying around for over a year and we
> still haven't found time to incorporate the new signals.
Though that's partly because we've not actually worked out whether to
prefix their names with the object/type names or to try using type
classes to let them be overloaded.
> I had a go at about 10 files or so (maybe 20) which I admit wasn't too
> bad, but there is always the odd one that isn't automatic and that
> takes a lot of time. It took a whole evening. (These changes are in my
> broken darcs repository, I should really try to recover them.)
You're right though. It is time consuming. I also have a half completed
repo somewhere :-)
> I see two other options:
> - stick with the home-grown c2hs for all time being
> - convince Manuel to incorporate Gtk2Hs-specific stuff into mainstream
> c2hs
>
> Both solutions aren't the Right Thing, but it's pragmatic and will save
> us about 50 hours of mundane work that does not improve Gtk2Hs itself.
>
> What do you think?
I don't think convincing Manuel is the hard part if we do it properly.
The "Right Thing"tm to do, it would appear to me, is to extend the {#
call #} hooks with the same marshaling support as the {# fun #} hooks.
It'd need an extra tag to indicate that one wants it. eg:
{# call marshal gtk_foo_bar #}
But it should use all the same marshaling support as the {# fun #} hooks
already provide but as an inline call/expression rather than as a top
level declaration like {# fun #}.
The marshaling that {# fun #} provides includes helpful defaults like
Int -> CInt etc etc. If at the same time we improved the marshaling
support in c2hs generally then I'm sure Manuel would be happy.
For example at the moment there is no way to extend the default
marshalers. There is only the fixed set of them. But obviously if you
define {#pointer *GObject foreign newtype #} then you want withGObject
to be the default marshaler.
Or more generally perhaps there should be a way to define them. For
example we might prefer withGObject (toGObject obj) as our default
marshaler (ie including the safe up-cast).
Duncan
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Gtk2hs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gtk2hs-devel