DBUS Java MethodCall problem

Ben Itzstein eetzoo at gmail.com
Thu Dec 11 17:12:42 PST 2008


Hi all, I'm having some difficulty understanding the interface of the Java
MethodCall constructor, as the javadoc doesn't explain the arguments at all.

I want to be able to replicate the call:
dbus-send --type=method_call --dest=org.freedesktop.compiz
/org/freedesktop/compiz/firepaint/allscreens/add_particle
org.freedesktop.compiz.activate string:'root' int32:`xwininfo -root | grep
id: | awk '{ print $4 }'` string:'x' double:320 string:'y' double:240

I've replicated the low-level example in the java documentation, and am just
altering the MethodCall parameters to suit my case. My attempt is:

            Message addParticle = new MethodCall(
                    "org.freedesktop.compiz", //dest

"/org/freedesktop/compiz/firepaint/allscreens/add_particle", //path
                    "org.freedesktop.compiz", //iface
                    "activate", //member
                    (byte)0, //flags
                    null, //signature
                    "root", (int)0xC2, //args
                    "x", (double)320.0,
                    "y", (double)440.0);

However this doesn't appear to work, so any help in making the correct
constructor would be appreciated!

Second (off-topic) question:
0xC2 was the result of `xwininfo -root | grep id: | awk '{ print $4 }'` at
the time I was testing this program. Is there a way I can get this
information from java?

Cheers,
Ben
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freedesktop.org/archives/dbus/attachments/20081212/25fc8d8b/attachment.html 


More information about the dbus mailing list