GNOME Bugzilla – Bug 647465
x11: Add XTest bindings
Last modified: 2012-01-22 22:01:46 UTC
I've attached bindings for the XTest extension (aka libxtst) and a small demonstration program which will start/pause your music player. This is how it should work: $ valac --pkg=x11 --pkg=xtst --vapidir=. Test.vala && ./Test sizeof(char) = 1, sizeof(int) = 4, sizeof(long) = 4 sizeof(X.KeyCode) = 1, sizeof(X.KeySym) = 4, sizeof(X.ID) = 4 Display :0.0 opened String XF86AudioPlay has keysym 0x1008FF14 Keysym 0x1008FF14 has keycode 172 Keycode 172 pressed Keycode 172 released Display :0.0 flushed $ Please note that this patch needs the patch I submitted in #647464. I'm looking forward to any comments/criticism/whatever! If everything is ok, I would be happy if you could merge this into master.
Created attachment 185711 [details] [review] xtst.vapi
Created attachment 185712 [details] [review] xtst.deps
Created attachment 185713 [details] Test.vala
I would love to see this implemented! It's excatly the feature I was looking for...
Comment on attachment 185711 [details] [review] xtst.vapi cheader_filename must be set on every method. Test must be a namespace not a class. Also I'm unsure whether to use XTest namespace or X.Test.
Created attachment 205834 [details] xtst.vapi
(In reply to comment #5) > (From update of attachment 185711 [details] [review]) > cheader_filename must be set on every method. Done. > Test must be a namespace not a class. Done. > Also I'm unsure whether to use XTest namespace or X.Test. I used X.Test so you can simply use "using X;" Now that #647464 has been fixed, do you think this can be included?
XTest would be more consistent with other bindings.
Created attachment 205839 [details] xtst.vapi
Created attachment 205840 [details] Test.vala
(In reply to comment #8) > XTest would be more consistent with other bindings. Here you go...
commit 3e0ae3c6fe53090c6a978383d436a8f1145bf739 Author: Alexander Kurtz <kurtz.alex@googlemail.com> Date: Sun Jan 22 14:01:03 2012 -0800 Add xtst bindings Fixes bug 647465.