drag&drop fill file list functions -> lib
Danny Milosavljevic
danny.milo at gmx.net
Thu Aug 26 15:38:20 CEST 2004
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.
cheers,
Danny
--
NEU: Bis zu 10 GB Speicher für e-mails & Dateien!
1 GB bereits bei GMX FreeMail http://www.gmx.net/de/go/mail
More information about the Xfce4-dev
mailing list