[Vala] Xlib bindings?



I didn't see any packaged with Vala, and searching around on Google
hasn't yet yielded me an answer, so I am hoping that someone can say
definitively whether or not there are bindings to Xlib (or a work in
progress to that effect).

Any idea?  It would be nice to have.  I'm trying to learn how to create
bindings for it at the moment as I am considering Vala for a project of
mine, but it requires working with Xlib or otherwise using the X11
protocol.

Also, a question regarding bindings:  Do they *have* to be in .vapi
files, or is it possible to create a class that does something like
C#/Mono/.NET's P/Invoke?  For example, if I wanted to create an X11
class, in C# I could do:

namespace Foo {
  public class X11 {
    [DllImport(libx11)]
    private static extern IntPtr XOpenDisplay(string dispName);

    IntPtr x11_display;

    public X11() {
      x11_display = X11.XOpenDisplay(null);
    }
  }
}

The idea being that you would import the raw API entrypoint into the
class as a private static method, and then it would be wrapped by the
implementing class in some way.  In this way, you can quickly integrate
code that exists without having to write full bindings for it, just
using the functionality that you need from it.  This would likely be
ideal for what I'm working on.

        --- Mike

-- 
My sigfile ran away and is on hiatus.
http://www.trausch.us/





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]