Note: This website is archived. For up-to-date information about D projects and development, please visit wiki.dlang.org.

Welcome to DBus-D

This is a framework to connect D applications to the DBus or use a local DBus to connect to another application module, eg. written in Java.

This framework build on top of the C library libdbus-1.

Project Status

Development seems to have stalled with changeset 12:198c379caaa7 on 2007-11-18.

Project Information

Name DBus-D
Category Libraries-System
Status 3 - Alpha
Short Description Language Bindings for the DBus
Long Description
Home Page
Forum /forums/viewforum.php?f=151

What it is

DBus is an Inter Process Communication (IPC) that communicated over unix-pipes or local tcp/ip connections. DBus is mostly used to communicate over a dbus-demon as a system service. So different programs can cooperate or request information from the OS.

DBus can also be used to make an application local bus. For example if the application is partitioned into several executables. If one part is written in D and one part in another language, this application local DBus can make them communicate. DBus is efficient and also has an OOP-like interface.

An XML format is used to describe the interface of an object. Also this xml file can be used to generate stub code, for an application, on the caller and also on the callee side.

<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" 
  "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
<node>
  <interface name="MyReader">
    <method name="OpenFile">
      <annotation name="org.dsource.dbus.d.Returns" value="file"/>
      <arg name="filename" type="s" direction="in"/>
      <arg name="file" type="o" direction="out"/>
    </method>
  </interface>
</node>

The format specification can be found at introspection-format

This example xml describes an interface for a DBus object, that offers an OpenFile() method, that take one string argument, the file path. As an output argument, there is a reference to the open file returned in the file argument. The annotation makes this file argument to make to the methods return value in the D implementation.

You can read more about DBus in the FAQ and the specification

Project doc

The state of this project

Actually this dbus binding can be used to call D from another DBus application. The author (keinfarbton) uses the current code to implement a Java application that calls a D helper application to do performance IO.

This project does also have a Java module to make this scenario, Java uses a D helper app, easy.

Actually you cannot use dbus-d to make calls from D to the DBus and also the use of signals is not yet implemented.

Related Projects