From: Michal Suchanek Date: 2006-08-29T00:32:55+09:00 Subject: Re: XLib (specifically, the swig xlib wrapper) On 8/24/06, Axis Sivitz wrote: > I want to write a window manager in Ruby (or at least, write some sort > of prototype to learn how they are made) but all the Xlib bindings > available are years old and/or incomplete. > > One project, however, uses SWIG and is fairly complete (though it is a > direct translation of the function calls). I could use it, or at least > turn it into something more ruby-like, but it's pretty out of date. > That is, it won't compile on my machine. I spent a while looking into > the errors, but I've never used SWIG before, so I didn't get very far. > > Would anyone with SWIG experience be willing to bring it up to speed to > some current-ish version of SWIG? As a head start, there's a patch that > does some of the work, though it just gives me different errors. > > project page: http://sourceforge.net/projects/ruby-xlib-wrap/ > > patch: > http://sourceforge.net/tracker/index.php?func=detail&aid=756724&group_id=36722&atid=417702 > Hello Last time I looked at ruby-xlib-wrap it was far from ideal. The problem I found was that some Xlib functions often return repeatedly the same pointer/value (ie the value of screen or display normally does not change) but swing would wrap it in new objects. This is both inefficient and obscures the fact that the value is identical. I intended to update some of the wrappers that I would need for my program but then I found a working solution that was already written in C. So I got no swig experience either. Assuming the state of the library did not change much you would have to add some hand-crafted code anyway, so you could as well start looking into swig. I'm looking forward to the ruby wm :) Thanks Michal