Annotations in Java binding

Tim Moloney t.moloney at verizon.net
Mon Apr 17 19:19:35 PDT 2006


I'm trying to learn D-BUS and I thought it would be fun to control 
Rhythmbox via Java.

I've generated a RhythmboxPlayer class by running CreateInterface on 
rb-shell-player.xml (which came with Rhythmbox).  The resulting Java 
code has undefined annotations of org.freedesktop.DBus.GLib.CSymbol.
Both rb-shell-player.xml and RhythmboxPlayer.java are attached.

I see that org.freedesktop.DBus.GLib.CSymbol is defined for C in 
dbus-binding-tool-glib.h.  Is it available to the Java binding anywhere?

Tim Moloney

-------------- next part --------------
A non-text attachment was scrubbed...
Name: rb-shell-player.xml
Type: text/xml
Size: 2862 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/dbus/attachments/20060417/3491996d/rb-shell-player.bin
-------------- next part --------------

import org.freedesktop.dbus.DBusException;
import org.freedesktop.dbus.DBusInterface;
import org.freedesktop.dbus.DBusSignal;
import org.freedesktop.dbus.UInt32;

public interface RhythmboxPlayer extends DBusInterface {

  public static class playingChanged extends DBusSignal {
    public playingChanged(String path) throws DBusException {
      super(path);
    }
  }

  public static class playingUriChanged extends DBusSignal {
    public playingUriChanged(String path) throws DBusException {
      super(path);
    }
  }

  public static class elapsedChanged extends DBusSignal {
    public elapsedChanged(String path) throws DBusException {
      super(path);
    }
  }

  @org.freedesktop.DBus.GLib.CSymbol("rb_shell_player_playpause")
  public void playPause(boolean a);

  @org.freedesktop.DBus.GLib.CSymbol("rb_shell_player_do_previous")
  public void previous();

  @org.freedesktop.DBus.GLib.CSymbol("rb_shell_player_do_next")
  public void next();

  @org.freedesktop.DBus.GLib.CSymbol("rb_shell_player_get_playing")
  public boolean getPlaying();

  @org.freedesktop.DBus.GLib.CSymbol("rb_shell_player_get_playing_path")
  public String getPlayingUri();

  @org.freedesktop.DBus.GLib.CSymbol("rb_shell_player_get_playing_time")
  public UInt32 getElapsed();

  @org.freedesktop.DBus.GLib.CSymbol("rb_shell_player_set_playing_time")
  public void setElapsed(UInt32 elapsed);

  @org.freedesktop.DBus.GLib.CSymbol("rb_shell_player_get_volume")
  public double getVolume();

  @org.freedesktop.DBus.GLib.CSymbol("rb_shell_player_set_volume")
  public void setVolume(double volume);

  @org.freedesktop.DBus.GLib.CSymbol("rb_shell_player_set_volume_relative")
  public void setVolumeRelative(double volume);

  @org.freedesktop.DBus.GLib.CSymbol("rb_shell_player_set_mute")
  public void setMute(boolean mute);

  @org.freedesktop.DBus.GLib.CSymbol("rb_shell_player_get_mute")
  public boolean getMute();

}


More information about the dbus mailing list