[Portland] The Code

Bryce Harrington bryce at osdl.org
Thu Feb 16 00:55:16 EET 2006


On Wed, Feb 15, 2006 at 07:25:53PM +0100, Lubos Lunak wrote:
>  At http://ktown.kde.org/~seli/dapi/dapi.tar.bz2 is a tarball implementing 
> some basic desktop API. To build there's the usual "configure && make" combo, 
> don't bother with installing for just testing. You need KDE devel packages 
> for building it.

Okay cool, your latest version compiles and runs properly (gentoo/KDE).
It builds without issue using:

    ./configure && make -C lib && make

I tried out each of the test scripts.  The mailto and runasuser tests
failed, but the others seemed to give sensible output.

One comment on the screensaver code, though.  The API here includes
commands to turn it on and off, but I've been thinking perhaps a
delaying mechanism might be better?  I could imagine a situation where
my presentation program might crash or get locked up, so if we're
depending on it to restart the screensaver, that might not always
happen.  Instead, if when the program requests to turn off the
screensaver, if it could give a timeout period (i.e., "turn it off for 1
hour or until I send a turn on signal, whichever comes first") that may
better match what the user would expect.

>  There is:
> 
> - doc/ with a description of the implemented calls. There's only some basic 
> stuff like "open url", "send mail", "turn on/off screensaver", 
> "download/upload remote file" that came first to my mind, but it should be 
> enough for testing (well, and it's also probably the stuff that's needed the 
> most)

A README (perhaps with a copy of this email) would be helpful too.

> - lib/ is a library that should be everything apps need to care about (note 
> that some of the stuff is autogenerated in gen/ so that's where the .h file 
> with the C functions is). Just in case it's not absolutely obvious, the 
> library doesn't depend on KDE at all of course.
> - test/ has a couple of simple C apps that use the various calls, e.g. 
> test_mailto should be self-explaining.
> - daemon_generic/ and daemon_kde/ have implementations of the calls, generic 
> being unrelated to any desktop (and as such simple, stupid and not having 
> some functionality), kde implements the functionality using KDE

If I'm understanding correctly, the one dependent lib that an app would
need to add would be libdapi.a?

> - What more should be needed? As I've already mentioned before I find the 
> Portland pages at fd.o too vague. "Query the address book" doesn't mean much 
> from the developer's point of view and there are even worse. But note 
> the "certain order" thingy from the previous paragraph first.

Perhaps, but there's a number of items on that list that look fairly
clear, and that I imagine would be straightforward to add to your code,
assuming this approach is acceptable to Gnome/Xfce/Kde folks...

* Given a URL, open it in the preferred web browser
* Set the preferred web browser
* Lookup handler for a particular mimetype
  (Which program should I use for 'editing' a '*.doc' file?)
* Enable/disable power management for the display
  (This goes hand in hand with the screensaver, and should have a
  similar API).

I can't speak for anyone else of course, but this looks like a pretty
workable solution, and if the KDE/Gnome/Xfce/etc. folks think it's
something they might be willing to consider, I'd be open to experiment
with hooking it into Inkscape.

Bryce



More information about the Portland mailing list