[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

XLib (specifically, the swig xlib wrapper

Axis Sivitz

8/24/2006 6:50:00 PM

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-...

patch:
http://sourceforge.net/tracker/index.php?func=detail&aid=756724&group_id=36722&a...

Thanks

2 Answers

Michal Suchanek

8/28/2006 3:33:00 PM

0

On 8/24/06, Axis Sivitz <asivitz@oberlin.edu> 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-...
>
> patch:
> http://sourceforge.net/tracker/index.php?func=detail&aid=756724&group_id=36722&a...
>

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

Kero van Gelder

8/28/2006 8:57:00 PM

0

>> 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.

My Ruby/Wise is indeed incomplete.
I have no SWIG experience.

Maybe matju's binding (not Xlib, talks directly to the Xserver) is of use:
http://artengine.ca/matj...

> I'm looking forward to the ruby wm :)

I found out today that wmii plugins are mostly written in Ruby :)

and I learned of wmii from dutch.rb (which needs a successor).