drag&drop fill file list functions -> lib

Benedikt Meurer benedikt.meurer at unix-ag.uni-siegen.de
Thu Aug 26 16:43:57 CEST 2004


Danny Milosavljevic wrote:
> Hi,
> 
> I wonder if we can add generic drag and drop handler functions to libxfce*
> to handle the usual case of drag-get for a file list and drag-received to a
> file list.
> 
> (Or we already have them and I'm just blind, don't know :))
> 
> I wrote some small functions for this that seem to do the job.
> But it would be better to add them to a central place since many xfce apps
> need dnd anyways.
> And there seem to be a lot of whacko programs out there that do send drag
> and drop data just a tad different than others. And many eyes see more than
> two :)
> 
> Of course this would be after 4.2 since it would require rewriting of some
> parts in apps and of course it would be new api and involve dozens of
> translations for error messages etc ;).
> 
> Anyways.
> 
> I intend the interface to be like this:
>   GList *xfce_drag_get_file_list(dragcontext,  ...);
>   void xfce_drag_set_file_list(dragcontext, ..., const GList *file_list);
> 
> (Non-filename-arguments would be skipped in the drag data, of course)
> 
> The functions would do the dirt work, which involves 
>    - identifying different target types
>        text/plain
>        UTF8_STRING
>        (...whatevertargetoftheday)
>    - identifying different dnd filename uri/whacko encodings
>        file:/path/to/file with spaces
>        file:///path/to/file%20with%20spaces
>        file://myhostname/path/to/file%20with%20spaces <-- only this is
> supposed to be used but many apps dont.
>        (checking the hostname and only matching when the hostname = local
> host name would be the sanest to do at first, I'd guess)
>    - handle different filename encodings than utf8
>        (since I have an utf-8 only system, someone else has to do / test
> this)
> 
> Tell me what you think.

I'm working on functions for uri and uri list handling already, they'll 
be ready for 4.4. Until then, do as the session manager and the panel do 
and use the gnome-uri functions.

> cheers,
>    Danny

regards,
Benedikt



More information about the Xfce4-dev mailing list