Andreas Rottmann writes: > Andy Wingo writes: > >> Ariel! Do check out that url, >> http://ambient.2y.net/wingo/tmp/guile-gobject-0.5.0.tar.gz. >> > Wow! Excellent work! > > I played with it a bit, since I need good glib bindings for a project > of mine. I already have made a bit of progress wrapping GError, but > there is one thing that bit me: Wrapping enums that don't have a GType > ID (such as the ones found in GLib, e.g. GIOStatus). > > I think one route to wrap these would be to have h2def.py somehow > realize they don't have a GType ID (don't know if that is feasible) > and as a consequence generate a .def entry without (g-type-id > "foobar"). defs-support.scm could then use plain g-wrap gw:wrap-enum > instead of gobject:gwrap-enum. > I now have kind of implemented GError support; I have attached patches to g-wrap 1.3.4 (the patch includes the gw-standard-spec.scm mods from guile-gobject 0.5.0) and guile-gobject 0.5.0. ChangeLog entries are included. You can now call GError-producing functions like this: -------- (use-modules (gnome glib)) (let ((error '(#f #f #f))) (if (not (g-io-channel-new-file "/ENOENT" "r" error)) (if (= (g-file-error-quark) (car error)) (format #t "file error (~S) opening /ENOENT: ~S\n" (gw:enum-GFileError-val->sym (cadr error) #f) (caddr error))))) -------- Which yields (at least on my system ;-)): ----- file error (noent) opening /ENOENT: "No such file or directory" ----- Flags are also covered: ----- guile> (use-modules (gnome glib) (srfi srfi-1)) guile> (fold logior 0 (map gw:enum-GIOCondition-val->int '(in out))) 5 ----- I'm not quite sure what we could do to make the interface more convient, so please storm your brains... It would be nice if these patches could go upstream...