discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: GSoC Roundup [DBusKit]


From: Niels Grewe
Subject: Re: GSoC Roundup [DBusKit]
Date: Mon, 23 Aug 2010 17:34:25 +0200
User-agent: Mutt/1.5.20 (2009-06-14)

On Fri, Aug 20, 2010 at 09:32:24PM +0100, David Chisnall wrote:
> I wonder if Eric and Niels could provide the list with a little summary of 
> what was done over the summer?

No problem: My project was creating D-Bus bindings for GNUstep and I
think that I've been pretty successful, though I didn't get around to
implement every bit of my original proposal. The result is a framework
called 'DBusKit'.

The purpose of DBusKit is to allow Objective-C code to use the D-Bus
IPC mechanism. D-Bus is rather widespread outside the GNUstep ecosystem,
so this allows us access a variety of services (e.g. NetworkManager,
Geoclue, HAL/uDisks/uPower).

The public facing API is rather lean and aims to mimic the Distributed
Objects API as closely as possible: You get connections to D-Bus
applications via a subclass of NSPort and request proxies from
NSConnection as usual. If you've ever used DO, this will probably be
quite familiar.

Under the hood, this involved quite some work to integrate the low-level
details of libdbus (the D-Bus client library) into NSRunLoop and lots of
code mapping the D-Bus concepts to their corresponding Objective-C
equivalents.

In the present state, DBusKit can already be used call methods on D-Bus
objects. It also handles conversions from the D-Bus type system to the
Objective-C type system in a very flexible way: You can choose whether
you want arguments and return values boxed to the corresponding
Foundation class (e.g. UTF8 strings on the D-Bus side as NSString) or as
their plain C equivalents (e.g. you'd probably want to return D-Bus
booleans as BOOL and not as NSNumber).

Another useful thing that works quite well already is support for
receiving 'signals' from a D-Bus service: DBusKit will ingest them and
spit out NSNotifications for use in your application. Using this, one
can (for example) let the HAL service notify an application about
devices being added or removed from the system.

But some loose ends remain: I didn't get around to implement proper
support for D-Bus properties. You can access them using the -Get:: and
-Set::: methods of the D-Bus object, but in the future I'd like to have
the proxy provide proper getters and setters for the properties. Also,
exporting objects from an Objective-C application to D-Bus is not yet
supported (most of the plumbing is there, though).

So if anybody has a favourite D-Bus service that could be useful in a
GNUstep application: Go ahead, check out DBusKit (it's in
modules/dev-libs in svn), play around with it, and report any bugs and
nuisances you might encounter along the way. I also spent some time
writing documentation and I hope that it will be helpful: If it's not,
I'd consider that a bug as well ;-).

Finally, I'd also like to say thanks to a few people. Especially to
Fred, who has been my very supportive mentor for the past months. He's
probably to modest to admit it, but I really feel that he went beyond
the call of duty with his code reviews and suggestions for improvements.
But also to David, who did not only nudge me into applying for GSoC in
the first place, but has also always been quick to answer my usual
libobjc-related-question-of-the-day.

Cheers,


Niels



reply via email to

[Prev in Thread] Current Thread [Next in Thread]