[TextShare] - proposal to make a desktop-wide format for text

François Revol revol at free.fr
Tue Jun 17 13:06:35 PDT 2008


> > And please have a setting to make one default desktop-side. 
> > Formatted
> > text cut & pasting is a major plague in OO.o, one is always wasting
> > time un-formatting the result to avoid style contamination.

You know Shift-Ctrl-v in OOo proposes you a list of formats before 
pasting, just select plain text there.

> Could the app copying the text set some sort of hint (maybe mime
> type?) about the format of the copied text or object? If we could 
> have

If I may explain how BeOS and Haiku do, that can surely give hints.

In BeOS, and Haiku, we already use mimetypes for the clipboard, see
http://lists.freedesktop.org/archives/xdg/2008-May/009637.html

For text there should always be a text/plain version, and applications 
supporting it add the BeOS-specific text formating data, and sometimes 
RTF.
DnD protocol in BeOS also propose a set of mimetypes for the data, 
either directly or via a file, which the target can accept or not.

I don't know much about X11 clipboard formats, but it should be 
possible to stuff several mime versions inside.

> a type hint of the copied object and a set of possible types that 
> each
> app accepts we might be able to write some converters to get from 
> Type
> A to Type B.

That's exactly what BeOS and Haiku do on drag-n-drop, mainly for 
images. They build a list of translators that supports the native 
format on input, and the target displays a list of formats (PNG, JPG, 
...), usually only on right-button drags, left drags selecting the 
default native format.

> For example, say you copy an email out of an email client. The type 
> of
> the object in the buffer would be an application/mbox, and the

Is application/mbox standardized at all ?
If not it should really use x- prefix, and to me the basetype should be 
text anyway.
BeOS uses "text/x-email" for mail files (that is, in a maildir-like 
format, but with xattrs).

> Each app would have to order their preferred mime types (i.e. say
> which is their first choice), and they may possibly have to ask the
> user which they want. I think OpenOffice asks the user, right? So
> you're really have your choice when pasting that text whether you
> wanted to turn it into plain text or keep the HTML formatting from
> that web page you just copied out of...

Yes, Ctrl-Shift-v does in OOo.

> If this seems like a good idea then the next step would be to specify
> which mime types can convert to which others. Might be good to use
> independent libraries to implement some of the conversions instead of
> writing a converter for everything. Does this seem like overkill?

I suppose Gnome and KDE have datatypes like engines already, are they 
mime-based ?

François.



More information about the xdg mailing list