Ikke's Blog

Post details: First CDIS "proof of concept"

Apr 12
First CDIS "proof of concept"

Well, proof of concept, it's not that much actually :-)
Been fighting with DBus today to get something as I described yesterday working. Thanks to the people on the mailing list and IRC (#dbus@freenode) for all help, hints and pointers!

I hacked together a very small sample in Python (yes, I hardly know Python, so the code might be very very bad, I just wanted to test whether what I want to do is possible using DBus).

The setup uses a central daemon (don't shoot! It looks like it's the only usable way to cut the job) which keeps track of all objects that want to implement some CDIS interface. Objects subscribe to the concentrator (thats how I called it anyway), and clients talk to it too.
See this screenshot to get an overview how it works. First the concentrator is started. Then the user starts Gaim and Kopete (this is just a sample, obviously). They both register to the concentrator, which keeps track of them. Now some user app (think "a screensaver") connects to the concentrator, and asks it to set the status of all IM clients to "idle".
The concentrator receives this request, checks his list of connected objects, and runs the "SetState(s)" method on all objects implementing org.freedesktop.CDIS.InstantMessenger.

All of this is completely transparant to the actual application: it doesn't know about DBus, it shouldn't care about subscribing to the concentrator (unsubscribing can be done using NameOwnerChanged etc, not implemented yet) etc. Just provide all functions to implement the inteface.

The best way to tackle this, I think, is to write the specs using some XML format (we might want to look at the dbus-glib-bindings format), then generating code using that (plain C using function pointers, GObjects and their signals, QObjects and their in-process signal mechanism, dunno about the best way to do this in Python and others). It should be fairly painless to get this working.

Other TODO's:

  • Write a *decent* concentrator (this one can be started using DBus activation on the first subscription call, jay!) that's error-savvy, handles killed applications, can scan the bus on startup for existing objects it should handle,...
  • Write a spec XML format
  • Write specs (this one will be the hardest part I guess)
  • Get desktop apps to use this beast!
  • Tons of other things

[edit] Per RealNitro's request, code is online. Beware, it's ugly.
I've been thinking: for the Python "bindings", function decorators could be very well suited...
Tomorrow I'll send something about this to XDG, I hope something useful can come out of this.


Comment from: Ross [Visitor]
Isn't this the same problem that Galago solves (although Galago also solved more).
PermalinkPermalink 04/12/06 @ 19:39
Comment from: Snark [Visitor]
I already had:
and after your last blog entry, posted:

It may interest you ;-)
PermalinkPermalink 04/12/06 @ 20:01
Comment from: Ikke [Member] · http://www.eikke.com
@Ross: actually, it's not. Galago is about presence of you and others, indeed. CDIS is, as you could have read yesterday, much more. The sample I use here is about presence too, but things like NetworkManager's interface, GPM's interface, a screensaver application,... could also become a spec.

@Snark: thanks for the pointers, I'll CC to the bugs in a minute.

I guess I'll write down a lengthy email about this for XDG tomorrow...
PermalinkPermalink 04/12/06 @ 20:04

This post has 1 feedback awaiting moderation...

Leave a comment:

Your email address will not be displayed on this site.
Your URL will be displayed.

Allowed XHTML tags: <p, ul, ol, li, dl, dt, dd, address, blockquote, ins, del, span, bdo, br, em, strong, dfn, code, samp, kdb, var, cite, abbr, acronym, q, sub, sup, tt, i, b, big, small>
(Line breaks become <br />)
(Set cookies for name, email and url)
(Allow users to contact you through a message form (your email will NOT be displayed.))


Who's Online?

  • Guest Users: 469


XML Feeds

What is RSS?