Clipboard/Selection Target Types
domlachowicz at yahoo.com
Wed Dec 31 02:38:50 EET 2003
Though what we've been doing to-date might be out of
standard or even wrong, there is some precedent and
agreement in this area amongst various application
AbiWord, Gnumeric, Evolution, OpenOffice, Mozilla, et.
al. have been using mime-type based atoms to
interchange data. Specifically, some of the mime-type
atoms we've been using include:
IIRC, Mozilla posts UCS2 HTML fragments under the
"text/html" atom. AbiWord (and, iirc, Gnumeric and
Evolution) has been posting UTF8 HTML 4.0 there, and
XHTML+UTF8 1.0 under "application/xhtml+xml". I know
that OpenOffice pays attention the text/html HTML
atoms, as rich-text cut+paste between Abi, Mozilla,
and OO is possible.
It would probably be beneficial to codify these
techniques and put them into a freedesktop standard -
especially for a format like HTML. Using HTML on the
clipboard is a little odd, in that we'd probably have
to discuss at least:
1) An standard encoding
2) What to do wrt embedded entities (images,
3) Do we allow document fragments or only valid
I'm willing to help out here as much as is needed.
Something like "COMPOUND_TEXT" isn't flexible enough
to describe the large variety of formats these complex
applications can support, and sniffing clipboard
contents is both prohibitive and restrictive.
--- Dave Malcolm <david at davemalcolm.demon.co.uk>
> Does Freedesktop.org maintain a list of "well-known"
> X selection target
> atoms? Or can someone direct me to an up-to-date
> The lists I've found so far are:
> (i) in section 2.6.2 of the ICCCM here:
> (ii) ftp://ftp.x.org/pub/R6.6/xc/registry
> These don't seem particularly up-to-date or
> comprehensive, for instance,
> what target should I use for fragments of HTML? (or
> am I just being
> In particular, I'm writing an XML editor
> (www.conglomerate.org) which
> can support multiple XML formats, although it's
> primarily aimed at
> DocBook editing.
> I want to interoperate with other XML editors, and
> with web browsers.
> I'd like to be able to distinguish between different
> XML types when
> copying/pasting fragments of XML source. For
> example if a user pastes a
> fragment of Kernel Cousin XML Source into a DocBook
> document, I'd like
> the program to be able to convert all the <li> tags
> into <listitem> tags
> automatically. Also, when the user copies a
> fragment of DocBook source
> to the clipboard, it would be nice to be able to
> offer it as HTML in
> case they want to paste it into an email client.
> (i) Is there an atom for "fragment of XML source",
> with some agreed-upon
> encoding (probably UTF-8)?
> (ii) Is there a smart target atom that's more that
> just "XML Source" and
> that carries some kind of DTD information - perhaps
> the Public ID of the
> (iii) Is there an agreed-upon atom for fragments of
> HTML source?
> Should I write some kind of proposal for (ii) above,
> similar to the one
> for UTF8_STRING?
> Thoughts? Links? Flames?
> David Malcolm
> Xdg-list mailing list
> Xdg-list at freedesktop.org
Do you Yahoo!?
Protect your identity with Yahoo! Mail AddressGuard
More information about the xdg