Am Mittwoch, 3. Januar 2007 17:51 schrieb Bo Peng:
> Let us think a bit more about this MIME approach:
> 1. it removes the need for internal clipboards.

At the cost of either performance or another serialization format.

> 2. it stops confusions about pasting under different contexts. I guess
> you agree with me that copy text, copy table cell and paste should
> only paste table cell.

Yes, I agree with that. But that is an issue of the separate table 
clipboard that will be removed eventually. Once that is removed this 
problem will not exist anymore.

> 3. it makes unification of paste a lot easier.

I don't think so. The patch I sent that did this unification was not very 
complicated, and the resulting code is not very complicated either. Of 
course the code would be simpler if we would only use the external 
clipboard, but that does not outweigh the cost IMHO.

> 4. it makes possible copy and pasting between lyx instances!!

You have a point here. Although this can also be done with the separate 
external clipboard it removes the performance argument on the copy side 
(but not the paste side which si more expensive).

> 5. it makes possible to accept formated texts from, for example, word
> or firefox. I mean, bold, underline etc.

Again this is independant of the internal/external clipboard separation. We 
are certainly not going to persuade Microsoft or OOo to store their 
contents in our self defined LyX keyboard format in the clipboard. 
Therefore we have to parse whatever they provide, and we can do that as 
well with an existing internal clipboard. The only thing we would need to 
to is to look at the formats that are available in the clipboard, and 
convert them accordiingly to LyX contents. This could be done in LyX 
itself for simple stuff, and in addition any format that is importable 
could be used here.

> The compliaction is, as you have said, parsing system clipboard
> content. The parse function might be long but it does a single task
> and can be perfected over the time.
> 
> As of internal formating, maybe we can put in MIME format some
> internal data structure, in addition to text presentation?

This is certainly possible. I only do not see the advantage in doing so, 
only a problem: This representation would directly reflect the internal 
data structure, therefore it could change quite often, even in the stable 
series. That means that this internal data structure should not be used by 
any other program. We would even need to make it versioned, because 
somebody could run two different versions of LyX at the same time e.g. for 
debugging. How would you guarantee that the version number changes every 
time the format changes?

I think that everybody agrees that we want to be able to exchange formatted 
text (from LyX or other applications) via the external clipboard in the 
future. IMO this exchange should only be done using well defined formats 
like HTML, LyX file format, ODT or whatever. For this we will need to 
extend the interface of the frontend::Clipboard class.

I don't think that we should use the external clipboard for copy/paste 
internal to LyX, because IMHO the advantages do not outweigh the costs.


Georg

Reply via email to