FWD: Re: Thanks for KDE/Gnome article, and new info request

Waldo Bastian bastian at kde.org
Sun Jan 12 15:42:29 GMT 2003

On Saturday 11 January 2003 22:37, M. Fioretti wrote:
> On Fri, Jan 10, 2003 14:02:43 at 02:02:43PM +0100, Waldo Bastian 
(bastian at kde.org) wrote:
> > Very well said. It should be mentioned that the Qt DND API (And I assume
> > that also applies to the GTK DND API) is rather simple to use, it's just
> > that the underlying magic is complicated, but as an application developer
> > you don't need to know anything about that. The idea of XDND is that an
> > application can present data in several different formats, and the
> > receiving application can choose from that list the format it would like
> > to receive.
> So:
> 	The toolkit, whatever it is, intercepts/loads what must be
> 	drag and dropped, and passes it to the receiving toolkit
> 	(which in turn will hand it to the application core)
> 	via XDND, nobody else involved. Correct?

Yes. It's not so much a matter of intercepting as well that the application 
just makes the appropriate calls into its (own) toolkit.

> 	XDND is not a piece of software, but a *protocol* which, among
> 	other things I guess, defines this list of formats, right?

XDND is a protocol yes. It does not define formats. It refers to the formats 
by their mimetype (e.g. text/plain, text/html) 

> 	How does this list looks like? How does it discriminate
> 	between text and objects like whole files?

That's up to the application. An application can decide to the offer e.g. a 
text-file as both text/plain (in which case it would offer the text inside 
the file) and text/uri-list (in which case it would merily pass the name of 
the file)

> 	From what you tell me, I assume that there is more than one
> 	way to pass the same kind of data, text for example. Is this
> 	true? If yes, why is it so?

If you select a text in KWord you have selected text together with its 
formatting, e.g. the font used, the color, etc. When you drag and drop such a 
text fragment, you would like to preserve this formatting when possible, but 
if that isn't possible, e.g. because the receiving application only supports 
text and no formatting you still want to be able to drop just the text 
itself. By being able to offer the same text in different formats (e.g. 
richtext and plaintext) you allow another KWord-like application to keep the 
formatting while "dumb" applications (such as KEdit) could still just 
accept the text itself without having to know anything about richtext.

This also allows to extend standards while keeping compatibility with others. 
E.g. when dragging a URL from konqueror it will offer it in the form of 
text/urilist which is a standard understood by many others. At the same time 
it offers it in the form of application/x-kio-metadata which is a KDE 
specific form and which includes additional information such as the 

bastian at kde.org -=|[ SuSE, The Linux Desktop Experts ]|=- bastian at suse.com

More information about the kde-core-devel mailing list