Hi Daniel,

On 09.02.2013, at 06:08, wagne...@seas.upenn.edu wrote:

> I am attempting (and failing) to build gtk3hs. Have you seen these errors? 
> There are several of them, but they are all very similar, so I've only 
> included the first one.
> 
> Graphics/UI/Gtk/Printing/PrintOperation.chs:409:6:
>    Couldn't match expected type `Ptr ()' with actual type `Window'
>    In the return type of a call of `toWindow'
>    In the third argument of `\ (PrintOperation arg1) arg2 arg3 arg4
>                                -> withForeignPtr arg1
>                                   $ \ argPtr1
>                                       -> gtk_print_operation_run argPtr1 arg2 
> arg3 arg4', namely
>      `(toWindow parent)'
>    In the expression:
>      (\ (PrintOperation arg1) arg2 arg3 arg4
>         -> withForeignPtr arg1
>            $ \ argPtr1 -> gtk_print_operation_run argPtr1 arg2 arg3 arg4)
>        (toPrintOperation self)
>        ((fromIntegral . fromEnum) action)
>        (toWindow parent)
>        errorPtr
> 
> This is especially puzzling because diff tells me that PrintOperation.chs 
> hasn't changed in these patches, and as far as I can tell from the GTK 
> documentation, the printing API hasn't changed between gtk-2 and gtk-3, 
> either.
> 
> Still exploring.
> 

I can tell you what is happening, if that helps.

I suspect that c2hs translates gtk_print_operation_run such that it expects a 
Ptr () instead of a GtkWindow. The reason is that c2hs has not seen the typedef 
of GtkWindow, probably due to not finding it in the big header file it parses 
or, more likely, it doesn't read in the .chi file that holds this mapping. So 
maybe there is a reason why the .chi file isn't generated or not read. I can't 
actually remember how it all works. I think .chs files are sorted topologically 
by their dependency and the first one will create the cache file that holds the 
parsed result of the big header file that is afterwards read by all other 
invocations of c2hs. Maybe there is a cycle in the dependencies?

I hope I'm helping more than I'm confusing. But it is likely a problem with 
c2hs and not with C files being incompatible. Many widgets used to incorrectly 
return a Widget* rather than a, say, PrintOption* . So there are a lot of casts 
in the Haskell code. These should be harmless though.

Cheers,
Axel

> ~d
> 
> Quoting Hamish Mackenzie <hamish.k.macken...@gmail.com>:
> 
>> Hi,
>> 
>> I want to do a release of Leksah to Hackage that uses Gtk3 and WebKit 
>> (preferably in the next week or two).
>> 
>> This will need the following patches:
>> https://patch-tag.com/r/hamish/gtk2hs
>> http://leksah.org/gtksourceview3.patches (repo still seems to be darcs1)
>> https://patch-tag.com/r/hamish/webkit
>> 
>> Although these packages default to gtk3 you can still use them with gtk2 
>> (cabal install -f-gtk3)
>> 
>> I think we have three options:
>> 1) Push the Gtk3 patches into the Gtk2Hs repo in preparation for a regular 
>> release (perhaps 0.13.0).
>> 2) Create a new repo for them and release it as gtk on Hackage (version 
>> 1.0.0 or 0.13.0) and continue merging 0.12 repo changes in.
>> 3) Add gtk-gtk3, gtksourceview-gtk3 and webkit-gtk3 to Hackage.
>> 
>> Please can we start the ball rolling on option 1 or can you let me know 
>> which of the other two options you would prefer?
>> 
>> Thanks,
>> Hamish
>> 
>> 
>> 
> 
> 


------------------------------------------------------------------------------
Free Next-Gen Firewall Hardware Offer
Buy your Sophos next-gen firewall before the end March 2013 
and get the hardware for free! Learn more.
http://p.sf.net/sfu/sophos-d2d-feb
_______________________________________________
Gtk2hs-devel mailing list
Gtk2hs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gtk2hs-devel

Reply via email to