Am Mittwoch, 3. Januar 2007 16:46 schrieb Bo Peng: > I do not quite get it. Why do we need the concept of internal > clipboard(s)? Why can not we send everything to system clipboard?
We should send everything to the system clipboard (and AFAIK we do this already). > After all, system clipboard accepts contents of different formats. > > Lyx currently keeps clipboard buffers for text, math and table. The math clipboard has disappeared in 1.4. I am still not sure whether I like that or not. > So the > sequence of copy text, copy table cells and paste can paste text or > table cells under different contexts. This is against the idea of a > single system clipboard and is in my opinion very wrong. The second > copy operation should replace the copied text, and paste table cells > in normal text should be handled (converted) properly. Everybody agrees that the table clipboard should be merged with the normal internal clipboard. I just don't think that we should do this now, since it is too risky. That leaves two different clipboars: An internal one and an external one. I know of two reasons why we need both an internal and an external clipboard. I did not want to discuss this now, since this is definitely something for later, but it seems I need to. First reason: Performance. If we want to store LyX contents on the external clipboard using the Qt interface we have to serialize it to a string, and choose a suitable format (mime type). The natural format choice is of course the LyX file format, and I would even go as far and accept not only the current format, but everything that lyx2lyx can handle. That would open the door for cooperation with other programs that can generate LyX format, and the would not need to be adjusted for every format change. That means that we have to pipe the external clipboard through lyx2lyx. But even if we don't do that, reading and writing .lyx is not very fast. That means that we would need to invent another serialization format for the clipboard, and I really don't see the advantage in doing so if we can as well just use an internal clipboard. Next reason: We do have a stack of 10 clipboards. I personally don't use that, but the last time I proposed to get rid of that I got several complaints (and good use cases which I forgot), so removing the internal clipboard is not an option. > What we need to do is first unify all copy operations and set > clipboard format properly. Then, unify all paste operations that paste > properly for different formats. I am not talking about selection here, > only system clipboard operations. I don't think that we should change too much now. I see the need for merging the internal with the external clipboard, since the nUI change for windows users would be bad otherwise, and I am also OK with the implementation of a fake selection on windows, but IMHO everytthing else should wait. Georg