After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 647465 - x11: Add XTest bindings
x11: Add XTest bindings
Status: RESOLVED FIXED
Product: vala
Classification: Core
Component: Bindings
0.12.x
Other Linux
: Normal enhancement
: ---
Assigned To: Vala maintainers
Vala maintainers
Depends on: 647464
Blocks:
 
 
Reported: 2011-04-11 15:23 UTC by Alexander Kurtz
Modified: 2012-01-22 22:01 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
xtst.vapi (2.46 KB, patch)
2011-04-11 15:24 UTC, Alexander Kurtz
needs-work Details | Review
xtst.deps (4 bytes, patch)
2011-04-11 15:25 UTC, Alexander Kurtz
none Details | Review
Test.vala (1017 bytes, text/plain)
2011-04-11 15:25 UTC, Alexander Kurtz
  Details
xtst.vapi (2.85 KB, text/plain)
2012-01-22 20:48 UTC, Alexander Kurtz
  Details
xtst.vapi (2.82 KB, text/plain)
2012-01-22 21:26 UTC, Alexander Kurtz
  Details
Test.vala (1014 bytes, text/plain)
2012-01-22 21:27 UTC, Alexander Kurtz
  Details

Description Alexander Kurtz 2011-04-11 15:23:18 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.
Comment 1 Alexander Kurtz 2011-04-11 15:24:41 UTC
Created attachment 185711 [details] [review]
xtst.vapi
Comment 2 Alexander Kurtz 2011-04-11 15:25:12 UTC
Created attachment 185712 [details] [review]
xtst.deps
Comment 3 Alexander Kurtz 2011-04-11 15:25:45 UTC
Created attachment 185713 [details]
Test.vala
Comment 4 Simon 2011-06-16 18:04:27 UTC
I would love to see this implemented! It's excatly the feature I was looking for...
Comment 5 Luca Bruno 2011-07-13 07:25:45 UTC
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.
Comment 6 Alexander Kurtz 2012-01-22 20:48:09 UTC
Created attachment 205834 [details]
xtst.vapi
Comment 7 Alexander Kurtz 2012-01-22 20:53:57 UTC
(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?
Comment 8 Evan Nemerson 2012-01-22 21:14:16 UTC
XTest would be more consistent with other bindings.
Comment 9 Alexander Kurtz 2012-01-22 21:26:53 UTC
Created attachment 205839 [details]
xtst.vapi
Comment 10 Alexander Kurtz 2012-01-22 21:27:54 UTC
Created attachment 205840 [details]
Test.vala
Comment 11 Alexander Kurtz 2012-01-22 21:30:20 UTC
(In reply to comment #8)
> XTest would be more consistent with other bindings.

Here you go...
Comment 12 Evan Nemerson 2012-01-22 22:01:46 UTC
commit 3e0ae3c6fe53090c6a978383d436a8f1145bf739
Author: Alexander Kurtz <kurtz.alex@googlemail.com>
Date:   Sun Jan 22 14:01:03 2012 -0800

    Add xtst bindings
    
    Fixes bug 647465.