[Vala] Compilation error using XClientMessageEvent



Hi,

then I try to compile the following code with vala 0.14, I get a compilation error from gcc :

using Gtk;
using Gdk;
using X;


public class Test : Object {

    enum Message {
        REQUEST_DOCK,
        BEGIN,
        CANCEL
    }

    private void add_client (long xid) {
    }

    private void event_filter (Gdk.XEvent xev) {
        void* pointer = &xev;
        X.Event* xevent = (X.Event*) pointer;

        if (xevent->xclient.data.l [1] == Message.REQUEST_DOCK)
            add_client (xevent->xclient.data.l [2]);
        return;
    }

    static int main (string[] args) {
        Gtk.init (ref args);
        Gtk.main ();
        return 0;
    }
}


valac --pkg x11 --pkg gtk+-3.0 --pkg gdk-x11-3.0 xlib.vala
xlib.vala:17.5-17.29: warning: method `Test.event_filter' never used
    private void event_filter (Gdk.XEvent xev) {
    ^^^^^^^^^^^^^^^^^^^^^^^^^
/home/hotnuma/Bureau/Projets/samples/x11/xlib.vala.c: In function 'test_event_filter': /home/hotnuma/Bureau/Projets/samples/x11/xlib.vala.c:83:2: erreur: unknown type name 'ClientMessageEventData' /home/hotnuma/Bureau/Projets/samples/x11/xlib.vala.c:94:9: erreur: incompatible types when assigning to type 'int' from type 'union <anonymous>' /home/hotnuma/Bureau/Projets/samples/x11/xlib.vala.c:95:17: erreur: request for member 'l' in something not a structure or union /home/hotnuma/Bureau/Projets/samples/x11/xlib.vala.c:96:25: erreur: request for member 'l_length1' in something not a structure or union /home/hotnuma/Bureau/Projets/samples/x11/xlib.vala.c:101:3: erreur: unknown type name 'ClientMessageEventData' /home/hotnuma/Bureau/Projets/samples/x11/xlib.vala.c:107:10: erreur: incompatible types when assigning to type 'int' from type 'union <anonymous>' /home/hotnuma/Bureau/Projets/samples/x11/xlib.vala.c:108:18: erreur: request for member 'l' in something not a structure or union /home/hotnuma/Bureau/Projets/samples/x11/xlib.vala.c:109:26: erreur: request for member 'l_length1' in something not a structure or union
error: cc exited with status 256
Compilation failed: 1 error(s), 1 warning(s)

ClientMessageEventData is an union to ClientMessageEvent (x11.vapi)  :

    public struct ClientMessageEvent {
        public int type;
        public ulong serial;    /* # of last request processed by server */
public bool send_event; /* true if this came from a SendEvent request */ public unowned Display display; /* Display the event was read from */
        public Window window;
        public Atom message_type;
        public int format;
        public ClientMessageEventData data;
    }


I'm missing something, any help would be appreciated.

Thanks.





-- Axel FILMORE


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