Clipboard/Selection Target Types

Dom Lachowicz domlachowicz at yahoo.com
Wed Dec 31 02:38:50 EET 2003


Hi David,

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
developers.

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:

text/html
application/xhtml+xml
application/rtf
image/png
image/jpeg
image/svg

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,
stylesheets, etc...)
3) Do we allow document fragments or only valid
documents

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.

Best regards,
Dom

--- Dave Malcolm <david at davemalcolm.demon.co.uk>
wrote:
> Does Freedesktop.org maintain a list of "well-known"
> X selection target
> atoms?  Or can someone direct me to an up-to-date
> one?
> 
> The lists I've found so far are: 
> (i) in section 2.6.2 of the ICCCM here:
> http://tronche.com/gui/x/icccm/sec-2.html
> (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
> dumb?)
> 
> 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.
> 
> So:
> (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
> DTD?
> (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?
>
http://www.pps.jussieu.fr/~jch/software/UTF8_STRING/UTF8_STRING.text
> 
> Thoughts?  Links?  Flames?
> 
> -- 
> David Malcolm
> www.conglomerate.org
> 
> _______________________________________________
> Xdg-list mailing list
> Xdg-list at freedesktop.org
> https://www.redhat.com/mailman/listinfo/xdg-list


__________________________________
Do you Yahoo!?
Protect your identity with Yahoo! Mail AddressGuard
http://antispam.yahoo.com/whatsnewfree



More information about the xdg mailing list