From: Axel S. <Axe...@en...> - 2008-11-16 20:33:22
|
Darrin, On Nov 16, 2008, at 20:03, Jefferson Heard wrote: > I personally wouldn't extend gtk2hs to do it. I'd build it separately > and stick with a pure FFI interface. Let clutter's build system build > itself and let Cabal handle everything GHC related. That's me trying > to be expedient, though, and taking into account that at some point > they are going to switch to using Cabal for gtk2hs. > > I don't think you want to patch gtk2hs mainly because I doubt that > Duncan's going to want to add Clutter as part of the base gtk2hs > functionality, although you could ask him, and having to download and > build the gtk2hs sources in order to use Clutter seems clunky on the > face of it. Well, I would welcome another module within Gtk2Hs! And, yes, we will switch to Cabal as soon as we know how to. Since Clutter is using built on GObjects and render into Gtk windows (and Cairo surfaces?) it seems silly not to put it into the Gtk2Hs tree: you can benefit form the type generator that creates all the type declarations and the casting code for you. Furthermore, it make it easier for people to use Clutter and Gtk together, simply because you use the same type declarations. Obviously you get some essential core functions from Glib, functions for marshalling UTF-8 string etc, for free. The way to to start is to copy another module in Makefile.am (such as gconf or sourceview) and modify the definitions suitably. And then we face the following: > Not that this addresses the Clutter xsl problem. I would suspect, > just guessing that the XSLT file is generated as an intermediate and > you're missing a step somewhere toward the beginning. Can't confirm > right now, though. The apiGen program is some sort of black magic that reads some marshalling specification created in the context of the Mono project for Gtk, IIRC. Clutter is unlikely to be specified that way. Indeed, we (Duncan if he ever has time, me if I ever get the time and understand the issues involved) would like to move away from using these specifications since that also means we're stuck on generating code for older versions of Gtk. A better way it to create an instance of all possible widgets (or other derived objects) and use introspection to generate the Haskell stubs. Thus, in a nutshell: Using apiGen to generate most of the wrappers to Clutter is probably a no-go at the moment. Hence, if Clutter isn't too big, or if you only need a few functions, it's probably easier to just write the wrappers by hand. At least you get the types generated automatically for you (by adding them to tools/hierarchyGen/hierarchy.list) and the other helper functions. If you're interested in rewriting apiGen because Clutter is big, then you should talk to Duncan on IRC who's the expert. I hope that we soon get around to splitting Gtk2Hs into many Cabal modules. This seems to be more and more attractive for visibility (what's a library that's not on Hackage?) and because there's so many libraries that can be used without Gtk like Cairo, Cairo+Pango (creating PDFs), pixbuf (image manipulation) and a few more. My 2p, Axel. > -- Jeff > > > On Sun, Nov 16, 2008 at 12:43 PM, Darrin Thompson > <dar...@gm...> wrote: >> On Sat, Nov 15, 2008 at 9:33 PM, Jefferson Heard >> <jef...@gm...> wrote: >>> >>> Darrin, it's highly doable, and I was actually looking at it last >>> week. Work's not calming down at all right now, but once it >>> does, I'd >>> love to take a crack at it. If you want to start, I'll join you. >>> >> >> Ok. So I took a shot at starting. Got this far: >> >> diff -rN -u old-gtk2hs/tools/apiGen/Makefile >> new-gtk2hs/tools/apiGen/Makefile >> --- old-gtk2hs/tools/apiGen/Makefile 2008-11-16 >> 12:40:53.000000000 -0500 >> +++ new-gtk2hs/tools/apiGen/Makefile 2008-11-16 >> 12:40:53.000000000 -0500 >> @@ -28,10 +28,17 @@ >> # >> # source code >> # >> -packages = glib pango atk gtk glade gconf sourceview >> +packages = clutter glib pango atk gtk glade gconf sourceview >> >> gnome_platform_url = >> http://ftp.gnome.org/pub/gnome/platform/2.18/2.18.1/sources >> gnome_desktop_url = >> http://ftp.gnome.org/pub/gnome/desktop/2.18/2.18.1/sources >> +clutter_api_url = http://www.clutter-project.org/sources/ >> +clutter_series = 0.8 >> + >> +clutter_version = 0.8.2 >> +clutter_dir = clutter >> +clutter_tar = clutter-$(clutter_version).tar.bz2 >> +clutter_url = $(clutter_api_url)/clutter/$(clutter_series)/$ >> (clutter_tar) >> >> glib_version = 2.12.11 >> glib_dir = glib >> @@ -341,6 +348,21 @@ >> gdkglext-modules : gdkglext-docs.xml >> >> >> +######################## >> +# >> +# clutter modules >> +# >> + >> +clutter_docs_dirs = clutter/doc/reference/clutter >> clutter/doc/reference/cogl >> +clutter_docs_standalone = yes >> +#clutter_includeapi = gtk-api.xml gdk-api.xml pango-api.xml atk- >> api.xml \ >> +# gobject-api.xml glib-api.xml >> +#clutter_excludeapi = gtk.ignore >> +clutter_modprefix = Graphics.UI.Clutter >> +clutter_scanmodules = Graphics/UI/Clutter >> +clutter-modules : clutter-docs.xml >> + >> + >> ####################### >> # >> # Dock widget from libegg >> >> But then I got this: >> >> $ rm -f clutter-docs.xml ; make clutter-modules 2>&1 >> chmod ug+x mkdocxml.sh >> ./mkdocxml.sh --standalone clutter/doc/reference/clutter >> clutter/doc/reference/cogl \ >> | xsltproc --novalid format-docs.xsl - > clutter-docs.xml >> warning: failed to load external entity "extract-docs.xsl" >> cannot parse extract-docs.xsl >> >> I think I'm correct in picking the standalone doc style, but >> there's no sign >> of extract-docs.xsl any where in Google's memory. >> >> -- >> Darrin >> >> >> > > ---------------------------------------------------------------------- > --- > This SF.Net email is sponsored by the Moblin Your Move Developer's > challenge > Build the coolest Linux based applications with Moblin SDK & win > great prizes > Grand prize is a trip for two to an Open Source event anywhere in > the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > Gtk2hs-users mailing list > Gtk...@li... > https://lists.sourceforge.net/lists/listinfo/gtk2hs-users |