Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Announce: D_Bus/Ada, talk with your desktop in Ada

23 views
Skip to first unread message

Reto Buerki

unread,
Dec 5, 2011, 6:17:30 AM12/5/11
to
I'm proud to announce the first release of D_Bus/Ada.

The D_Bus/Ada library provides an Ada binding to the D-Bus message bus
used for inter-process communication on most modern Linux desktop
systems.

D_Bus/Ada supports all but two basic D-Bus types (file descriptor and
signature types are not yet implemented) and all container types [1].

The current release focuses on the client side of the D-Bus API but it
is also possible to provide D-Bus services written in Ada using the
service object interface of D_Bus/Ada.

For further information visit the D_Bus/Ada project page at [2].

Kind regards,
- reto

[1] - http://dbus.freedesktop.org/doc/dbus-specification.html#type-system
[2] - http://www.codelabs.ch/dbus-ada

Yannick Duchêne (Hibou57)

unread,
Dec 5, 2011, 6:40:19 AM12/5/11
to
Le Mon, 05 Dec 2011 12:17:30 +0100, Reto Buerki <re...@codelabs.ch> a écrit:
> [2] - http://www.codelabs.ch/dbus-ada
At the bottom of the above page, in section “Examples”, there's a


with D_Bus.Arguments.Basic;
with D_Bus.Arguments.Containers;

Then later

pragma Unreferenced (D_Bus.Arguments.Basic);
pragma Unreferenced (D_Bus.Arguments.Containers);


Do you withed both for initialization side effects ?

--
“Syntactic sugar causes cancer of the semi-colons.” [1]
“Structured Programming supports the law of the excluded muddle.” [1]
[1]: Epigrams on Programming — Alan J. — P. Yale University

Yannick Duchêne (Hibou57)

unread,
Dec 5, 2011, 6:45:09 AM12/5/11
to
Le Mon, 05 Dec 2011 12:17:30 +0100, Reto Buerki <re...@codelabs.ch> a écrit:
> [2] - http://www.codelabs.ch/dbus-ada
Also, please, it's always better to show license terms on-page too, not
only in sources. License is often the first thing one may which to check
for. When license terms are exposed on-page (at least by reference), this
avoid the need to download all the source just to check for the license.

Actually, the license for this one seems to be GPL, but the above page
does not say anything about it.

Reto Buerki

unread,
Dec 5, 2011, 7:12:54 AM12/5/11
to
On 2011-12-05, Yannick Duchêne <yannick...@yahoo.fr> wrote:
> Le Mon, 05 Dec 2011 12:17:30 +0100, Reto Buerki <re...@codelabs.ch> a écrit:
>> [2] - http://www.codelabs.ch/dbus-ada
> At the bottom of the above page, in section “Examples”, there's a
>
>
> with D_Bus.Arguments.Basic;
> with D_Bus.Arguments.Containers;
>
> Then later
>
> pragma Unreferenced (D_Bus.Arguments.Basic);
> pragma Unreferenced (D_Bus.Arguments.Containers);
>
>
> Do you withed both for initialization side effects ?

No. This is needed to make the basic and container types known to the
D_Bus/Ada type system. D_Bus/Ada uses generic dispatching to create
Arguments from low-level D-Bus message arguments.

The example does not use specific argument extensions, that's why both
packages are Unreferenced.

E.g. if you remove 'with D_Bus.Arguments.Containers' in this example
you'll get:

raised D_BUS.D_BUS_ERROR : Unknown type code 'a' in message

The type system does not know how to deserialize the D-Bus ARRAY(97)
type.

- reto

Reto Buerki

unread,
Dec 5, 2011, 7:27:53 AM12/5/11
to
On 2011-12-05, Yannick Duchêne <yannick...@yahoo.fr> wrote:
> Le Mon, 05 Dec 2011 12:17:30 +0100, Reto Buerki <re...@codelabs.ch> a écrit:
>> [2] - http://www.codelabs.ch/dbus-ada
> Also, please, it's always better to show license terms on-page too, not
> only in sources. License is often the first thing one may which to check
> for. When license terms are exposed on-page (at least by reference), this
> avoid the need to download all the source just to check for the license.

You are certainly right. Thanks for your feedback! The D_Bus/Ada project
page now contains a 'Licence' section.

> Actually, the license for this one seems to be GPL, but the above page
> does not say anything about it.

The licence of D_Bus/Ada is GMGPL.

- reto

Tero Koskinen

unread,
Dec 5, 2011, 2:43:30 PM12/5/11
to
Hi,

On Mon, 5 Dec 2011 11:17:30 +0000 (UTC)
Reto Buerki <re...@codelabs.ch> wrote:

> I'm proud to announce the first release of D_Bus/Ada.
>
> The D_Bus/Ada library provides an Ada binding to the D-Bus message bus
> used for inter-process communication on most modern Linux desktop
> systems.

For those who are wondering what to do with this, here is an example:
http://iki.fi/tero.koskinen/dbus-ada/notify/

In summary:

Name_A : Arguments.Basic.String_Type := +"ada.notify";
Replaces_ID_A : Arguments.Basic.U_Int32_Type := +33;
App_Icon_A : Arguments.Basic.String_Type := +"";
Summary_A : Arguments.Basic.String_Type := +"Hello";
Body_A : Arguments.Basic.String_Type := +"Hello, World from Ada!";
...
begin

-- Arguments
Args.Append (Name_A);
...

Result := Connection.Call_Blocking
(Connection => Conn,
Destination => "org.freedesktop.Notifications",
Path => "/org/freedesktop/Notifications",
Iface => "org.freedesktop.Notifications",
Method => "Notify",
Args => Args);


After running the program, you should see a notification
with text "Hello, World from Ada!" on your GNOME/KDE desktop.

--
Tero Koskinen - http://iki.fi/tero.koskinen/

PS. For some reason dbus-ada does not allow me to use/serialize
empty arrays, so I fill the arrays with dummy data in my code.

Reto Buerki

unread,
Dec 6, 2011, 3:02:56 AM12/6/11
to
On 2011-12-05, Tero Koskinen <tero.k...@iki.fi> wrote:
> For those who are wondering what to do with this, here is an example:
> http://iki.fi/tero.koskinen/dbus-ada/notify/
[snip]
> After running the program, you should see a notification
> with text "Hello, World from Ada!" on your GNOME/KDE desktop.

Thanks for this example Tero. With your permission it is now included in
D_Bus/Ada. I slightly simplified it, see [1].

> PS. For some reason dbus-ada does not allow me to use/serialize
> empty arrays, so I fill the arrays with dummy data in my code.

I have to look into this. I'll try to add support for empty containers
in the next release.

- reto

[1] - http://git.codelabs.ch/?p=dbus-ada.git;a=blob;f=examples/notify/notify.adb
0 new messages