Generic desktop adapter library: libdadapt prototype

nf2 nf2 at scheinwelt.at
Tue Nov 22 15:39:55 PST 2005


Hi!

I have just finished a prototype of "libdadapt". The purpose of the 
"Generic desktop adapter library" is described here:
http://www.scheinwelt.at/~norbertf/common_main_loop/

the prototype consists of three parts:

* libdadapt: client library and interface definitions
* libdadapt_file_gnome.so: very basic implementation of the module for 
file-dialogs and VFS functions (using GTK File Chooser and GnomeVFS in 
this case)
* liblvariant: Variant data type library, which is used in dadapt quite 
a lot, to make the interface as simple and extensible as possible. At 
the moment LVariants can be INT, STRING, BOOL, ARRAY, MAP. LVariant 
containers like ARRAY and MAP wrap around other LVariants and there is 
no limit on nesting LVariants. Furthermore LVariants have reference 
counters and containers are cleaned up recursively.

Download:
http://www.scheinwelt.at/~norbertf/dadapt/files/

The design of libdadapt is quite simple:

The client calls mod = daModuleOpen(name), which will dlopen the 
appropriate so-module for the current desktop.
Then it retrieves the interfaces it wants to use: For instance: i = 
daModuleGetInterface(mod, "DaFiledialogInterface_R1");
The interfaces are simple structs of function pointers, which have a 
version number in their name. Therefore multiple versions of an 
interface can be served by the same module. I thought this might be an 
important feature, because client apps don't have to be rewritten every 
time libdadapt improves.

Functions for file-dialogs and vfs are pseudo-synchronous, which means 
they are internally asynchronous and keep the main-loop iterating.

I have attached the source of a little client-demo, which opens a 
file-dialog and then downloads a file with the VFS.

Of course there are a lot of open questions:

* How to detect the current desktop?
* Do you think it makes sense to continue this project? One prerequisite 
of libdadapt is the "common main loop", of course. ;-)
* Other features libdadapt should provide...
* ...

Waiting for your your comments, suggestions, help,...

regards,

Norbert

-------------- next part --------------
A non-text attachment was scrubbed...
Name: dadapt_test.c
Type: text/x-csrc
Size: 1845 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/xdg/attachments/20051123/a6cb23ab/attachment.c 


More information about the xdg mailing list