Re: Implementing XDS at GTK+ level?

On Fri, 04 Nov 2005 16:34:03 -0500, Matthias Clasen wrote:

> On Fri, 2005-11-04 at 12:26 +0100, Christian Neumair wrote:
>> I wonder whether implementing the XDS dnd protocol [1] at GTK+ level is
>> viable. The drag source implementation is in GIMP, the drag target
>> implementation (rather the rarely tested beginning of it) in bugzilla
>> [2,3,4]. I'm asking because it would be handy for Nautilus/panel
>> interaction (launcher copying), where both would be drag source and
>> destination, and I'm sure that many applications want this as well.
>> [1]
>> [2]
>> [3]
>> [4]
> Do you have an API proposal ?

Here's the one that ROX-Lib provides:

When the text/uri-list arrives, the application is offered the list

If it doesn't handle this, ROX-Lib checks whether all the URIs refer to
local files. If so, it calls xds_load_from_file() on each one. If not, and
there is one remote file, ROX-Lib fetches it via the X server and passes
it to the application with xds_load_from_stream().

So, if an application just wants data, it only overrides load_from_stream,
whereas if it wants files it overrides load_from_file. Of course, you
might implement this with signals rather than by sub-classing in a GTK

Probably the most useful function is having GTK extract the local file
names from the uri-list, as this is rather error-prone (some apps don't
cope well with hostnames currently, for example). Likewise, we could do
with a GTK function to create a text/uri-list from a list of local files
(many apps get the line endings wrong).

Dr Thomas Leonard
GPG: 9242 9807 C985 3C07 44A6  8B9A AE07 8280 59A5 3CC1

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]