[Portland] Plans for a c or c++ library to access the Xdg menu structure?

Hans Joseph Solbrig joesolbrig at yahoo.com
Sat May 15 14:58:10 PDT 2010


Hi, 

I've been attempting to write an open source application launcher. Among other things, I would like to read the Xdg menu structure used by Gnome panels and it's KDE equivalent. From this, I would like to extract a list of the menus, submenus and applications which the user sees in order to show an equivalent list in my application. 

So far the Portland project's web site shows some shell scripts suitable for installing applications. It seems there isn't any portable c/c++ library for accessing the menu structure as defined in the spec. Gnome and KDE each have their own routines for accessing the various file which together define this structure but for each library, the code seem to be buried deep within one or another daemons. The Gnome's lib menu interface has:
#ifndef GMENU_I_KNOW_THIS_IS_UNSTABLE
#error "libgnome-menu should only be used if you understand that it's subject to frequent change, and is not supported as a fixed API/ABI or as part of the platform"
#endif
Right in it's header, so it screams do not use (though it's used by lxlaunch).

KDE's interface is within KDEd (KDE daemon) so it's not inviting to use for any general purposes as is. However, I've experimented and it seems like one can rip the parsing code fairly cleanly except for reference to KGlobal::dirs, which is huge subsystem in its own right. 

BUT... if I could use the spec to determine how KGlobal::dirs does the fix-ups which it apperently does, I could create a library for my purposes. 

I suppose my question is whether you folks think this makes sense. I could make the library I'm constructing more general purpose if folks are interested. 

Or perhaps the Dbus library is going to written soon and I could use that?

Any feedback appreciated. And if this isn't the right place to ask this, pointers to where to ask this kind of question would be appreciated. 

Best, 
HJS




More information about the Portland mailing list